这篇教程C++ BAlignment函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中BAlignment函数的典型用法代码示例。如果您正苦于以下问题:C++ BAlignment函数的具体用法?C++ BAlignment怎么用?C++ BAlignment使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了BAlignment函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: TableDemoWindow TableDemoWindow(BRect frame) : BWindow(frame, "ALM Table Demo", B_TITLED_WINDOW, B_QUIT_ON_WINDOW_CLOSE) { // create a new BALMLayout and use it for this window BALMLayout* layout = new BALMLayout(); SetLayout(layout); Column* c1 = layout->AddColumn(layout->Left(), layout->Right()); Row* r1 = layout->AddRow(layout->Top(), NULL); Row* r2 = layout->AddRow(r1->Bottom(), NULL); Row* r3 = layout->AddRow(r2->Bottom(), layout->Bottom()); BButton* b1 = new BButton("A1"); layout->AddView(b1, r1, c1); b1->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_TOP)); BButton* b2 = new BButton("A2"); layout->AddView(b2, r2, c1); b2->SetExplicitAlignment(BAlignment( B_ALIGN_HORIZONTAL_CENTER, B_ALIGN_VERTICAL_CENTER)); BButton* b3 = new BButton("A3"); layout->AddView(b3, r3, c1); b3->SetExplicitAlignment(BAlignment(B_ALIGN_RIGHT, B_ALIGN_BOTTOM)); // test size limits BSize min = layout->MinSize(); BSize max = layout->MaxSize(); SetSizeLimits(min.Width(), max.Width(), min.Height(), max.Height()); }
开发者ID:yunxiaoxiao110,项目名称:haiku,代码行数:30,
示例2: ThreeButtonsWindow ThreeButtonsWindow(BRect frame) : BWindow(frame, "ALM Three Buttons", B_TITLED_WINDOW, B_QUIT_ON_WINDOW_CLOSE) { BButton* button1 = new BButton("A"); BButton* button2 = new BButton("B"); BButton* button3 = new BButton("C"); button1->SetExplicitAlignment(BAlignment(B_ALIGN_USE_FULL_WIDTH, B_ALIGN_USE_FULL_HEIGHT)); button1->SetExplicitMaxSize(BSize(500, 50)); button2->SetExplicitAlignment(BAlignment(B_ALIGN_USE_FULL_WIDTH, B_ALIGN_USE_FULL_HEIGHT)); button2->SetExplicitMaxSize(BSize(500, 500)); button3->SetExplicitAlignment(BAlignment(B_ALIGN_USE_FULL_WIDTH, B_ALIGN_USE_FULL_HEIGHT)); button3->SetExplicitMaxSize(BSize(500, 500)); // create a new BALMLayout and use it for this window fLayout = new BALMLayout(); SetLayout(fLayout); fLayout->AddView(button1, fLayout->Left(), fLayout->Top(), fLayout->Right(), NULL); fLayout->AddViewToBottom(button2); fLayout->AddViewToBottom(button3, fLayout->Bottom()); // test size limits BSize min = fLayout->MinSize(); BSize max = fLayout->MaxSize(); SetSizeLimits(min.Width(), max.Width(), min.Height(), max.Height()); }
开发者ID:veer77,项目名称:Haiku-services-branch,代码行数:35,
示例3: BViewLookAndFeelSettingsView::LookAndFeelSettingsView(const char* name) : BView(name, 0), fDecorInfoButton(NULL), fDecorMenuField(NULL), fDecorMenu(NULL){ // Decorator menu _BuildDecorMenu(); fDecorMenuField = new BMenuField("decorator", B_TRANSLATE("Decorator:"), fDecorMenu); fDecorInfoButton = new BButton(B_TRANSLATE("About"), new BMessage(kMsgDecorInfo)); // scroll bar arrow style BBox* arrowStyleBox = new BBox("arrow style"); arrowStyleBox->SetLabel(B_TRANSLATE("Arrow style")); fSavedDoubleArrowsValue = _DoubleScrollBarArrows(); fArrowStyleSingle = new FakeScrollBar(true, false, new BMessage(kMsgArrowStyleSingle)); fArrowStyleDouble = new FakeScrollBar(true, true, new BMessage(kMsgArrowStyleDouble)); BView* arrowStyleView; arrowStyleView = BLayoutBuilder::Group<>() .AddGroup(B_VERTICAL, 1) .Add(new BStringView("single", B_TRANSLATE("Single:"))) .Add(fArrowStyleSingle) .AddStrut(B_USE_DEFAULT_SPACING) .Add(new BStringView("double", B_TRANSLATE("Double:"))) .Add(fArrowStyleDouble) .SetInsets(B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING) .End() .View(); arrowStyleBox->AddChild(arrowStyleView); arrowStyleBox->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_VERTICAL_CENTER)); arrowStyleBox->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET)); BStringView* scrollBarLabel = new BStringView("scroll bar", B_TRANSLATE("Scroll bar:")); scrollBarLabel->SetExplicitAlignment( BAlignment(B_ALIGN_LEFT, B_ALIGN_TOP)); // control layout BLayoutBuilder::Grid<>(this, B_USE_DEFAULT_SPACING, B_USE_DEFAULT_SPACING) .Add(fDecorMenuField->CreateLabelLayoutItem(), 0, 0) .Add(fDecorMenuField->CreateMenuBarLayoutItem(), 1, 0) .Add(fDecorInfoButton, 2, 0) .Add(scrollBarLabel, 0, 1) .Add(arrowStyleBox, 1, 1) .AddGlue(0, 2) .SetInsets(B_USE_WINDOW_SPACING); // TODO : Decorator Preview Image?}
开发者ID:looncraz,项目名称:haiku,代码行数:60,
示例4: ThreeButtonsWindow ThreeButtonsWindow(BRect frame) : BWindow(frame, "ALM Three Buttons", B_TITLED_WINDOW, B_QUIT_ON_WINDOW_CLOSE) { BButton* button1 = new BButton("A"); BButton* button2 = new BButton("B"); BButton* button3 = new BButton("C"); button1->SetExplicitAlignment(BAlignment(B_ALIGN_USE_FULL_WIDTH, B_ALIGN_USE_FULL_HEIGHT)); button1->SetExplicitMaxSize(BSize(500, 50)); button2->SetExplicitAlignment(BAlignment(B_ALIGN_USE_FULL_WIDTH, B_ALIGN_USE_FULL_HEIGHT)); button2->SetExplicitMaxSize(BSize(500, 500)); button3->SetExplicitAlignment(BAlignment(B_ALIGN_USE_FULL_WIDTH, B_ALIGN_USE_FULL_HEIGHT)); button3->SetExplicitMaxSize(BSize(500, 500)); fLayout = new BALMLayout(0, 0); BALM::BALMLayoutBuilder(this, fLayout) .Add(button1, fLayout->Left(), fLayout->Top(), fLayout->Right()) .StartingAt(button1) .AddBelow(button2) .AddBelow(button3, fLayout->Bottom()); // test size limits BSize min = fLayout->MinSize(); BSize max = fLayout->MaxSize(); SetSizeLimits(min.Width(), max.Width(), min.Height(), max.Height()); }
开发者ID:SummerSnail2014,项目名称:haiku,代码行数:33,
示例5: BViewCamStatusView::CamStatusView(Controller* controller) : BView("CamStatusView", B_WILL_DRAW|B_PULSE_NEEDED), fController(controller), fStringView(NULL), fBitmapView(NULL), fEncodingStringView(NULL), fStatusBar(NULL), fNumFrames(0), fRecording(false), fPaused(false), fRecordingBitmap(NULL), fPauseBitmap(NULL){ BCardLayout* cardLayout = new BCardLayout(); SetLayout(cardLayout); BRect bitmapRect(0, 0, kBitmapSize, kBitmapSize); fRecordingBitmap = new BBitmap(bitmapRect, B_RGBA32); fPauseBitmap = new BBitmap(bitmapRect, B_RGBA32); BView* statusView = BLayoutBuilder::Group<>() .SetInsets(0) .Add(fEncodingStringView = new BStringView("stringview", kEncodingString)) .Add(fStatusBar = new BStatusBar("", "")) .View(); fStatusBar->SetExplicitMinSize(BSize(100, 20)); BView* layoutView = BLayoutBuilder::Group<>() .SetInsets(0) .Add(fBitmapView = new SquareBitmapView("bitmap view")) .Add(fStringView = new BStringView("cam string view", "")) .View(); cardLayout->AddView(layoutView); cardLayout->AddView(statusView); fBitmapView->SetBitmap(NULL); BFont font; GetFont(&font); float scaledSize = kBitmapSize * (capped_size(font.Size()) / 12); fBitmapView->SetExplicitMinSize(BSize(scaledSize, scaledSize)); fBitmapView->SetExplicitMaxSize(BSize(scaledSize, scaledSize)); fBitmapView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_TOP)); fStringView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_MIDDLE)); cardLayout->SetVisibleItem(int32(0));}
开发者ID:jackburton79,项目名称:bescreencapture,代码行数:50,
示例6: rectvoidBButton::Draw(BRect updateRect){ BRect rect(Bounds()); rgb_color background = LowColor(); rgb_color base = background; uint32 flags = be_control_look->Flags(this); if (_Flag(FLAG_DEFAULT)) flags |= BControlLook::B_DEFAULT_BUTTON; if (_Flag(FLAG_FLAT) && !IsTracking()) flags |= BControlLook::B_FLAT; if (_Flag(FLAG_INSIDE)) flags |= BControlLook::B_HOVER; be_control_look->DrawButtonFrame(this, rect, updateRect, base, background, flags); if (fBehavior == B_POP_UP_BEHAVIOR) { be_control_look->DrawButtonWithPopUpBackground(this, rect, updateRect, base, flags); } else { be_control_look->DrawButtonBackground(this, rect, updateRect, base, flags); } // always leave some room around the label rect.InsetBy(kLabelMargin, kLabelMargin); const BBitmap* icon = IconBitmap( (Value() == B_CONTROL_OFF ? B_INACTIVE_ICON_BITMAP : B_ACTIVE_ICON_BITMAP) | (IsEnabled() ? 0 : B_DISABLED_ICON_BITMAP)); be_control_look->DrawLabel(this, Label(), icon, rect, updateRect, base, flags, BAlignment(B_ALIGN_CENTER, B_ALIGN_MIDDLE));}
开发者ID:SummerSnail2014,项目名称:haiku,代码行数:35,
示例7: SetPulseRatevoidTTimeWindow::_InitWindow(){ SetPulseRate(500000); fDateTimeView = new DateTimeView(B_TRANSLATE("Date and time")); fTimeZoneView = new TimeZoneView(B_TRANSLATE("Time zone")); fNetworkTimeView = new NetworkTimeView(B_TRANSLATE("Network time")); fClockView = new ClockView(B_TRANSLATE("Clock")); fBaseView = new TTimeBaseView("baseView"); fBaseView->StartWatchingAll(fDateTimeView); fBaseView->StartWatchingAll(fTimeZoneView); fTabView = new BTabView("tabView", B_WIDTH_FROM_WIDEST); fTabView->AddTab(fDateTimeView); fTabView->AddTab(fTimeZoneView); fTabView->AddTab(fNetworkTimeView); fTabView->AddTab(fClockView); fBaseView->AddChild(fTabView); fRevertButton = new BButton("revert", B_TRANSLATE("Revert"), new BMessage(kMsgRevert)); fRevertButton->SetEnabled(false); fRevertButton->SetTarget(this); fRevertButton->SetExplicitAlignment( BAlignment(B_ALIGN_LEFT, B_ALIGN_MIDDLE)); BLayoutBuilder::Group<>(this, B_VERTICAL) .SetInsets(B_USE_DEFAULT_SPACING) .Add(fBaseView) .Add(fRevertButton);}
开发者ID:orangejua,项目名称:haiku,代码行数:34,
示例8: PictureViewvoidPersonView::UpdatePicture(BBitmap* bitmap){ if (fPictureView == NULL) { fPictureView = new PictureView(70, 90, bitmap); GridLayout()->AddView(fPictureView, 0, 0, 1, 5); GridLayout()->ItemAt(0, 0)->SetExplicitAlignment( BAlignment(B_ALIGN_CENTER, B_ALIGN_TOP)); return; } if (fSaving) return;/* time_t modificationTime = 0; BEntry entry(ref); entry.GetModificationTime(&modificationTime); if (entry.InitCheck() == B_OK && modificationTime <= fLastModificationTime) { return; }*/ fPictureView->Update(bitmap);}
开发者ID:veer77,项目名称:Haiku-services-branch,代码行数:27,
示例9: BGridViewPersonView::PersonView(const char* name, const char* categoryAttribute, const entry_ref *ref) : BGridView(), fLastModificationTime(0), fGroups(NULL), fControls(20, false), fCategoryAttribute(categoryAttribute), fPictureView(NULL), fSaving(false){ SetName(name); SetFlags(Flags() | B_WILL_DRAW); fRef = ref; BFile* file = NULL; if (fRef != NULL) file = new BFile(fRef, B_READ_ONLY); // Add picture "field", using ID photo 35mm x 45mm ratio fPictureView = new PictureView(70, 90, ref); BGridLayout* layout = GridLayout(); float spacing = be_control_look->DefaultItemSpacing(); layout->SetInsets(spacing, spacing, spacing, spacing); layout->AddView(fPictureView, 0, 0, 1, 5); layout->ItemAt(0, 0)->SetExplicitAlignment( BAlignment(B_ALIGN_CENTER, B_ALIGN_TOP)); if (file != NULL) file->GetModificationTime(&fLastModificationTime); delete file;}
开发者ID:looncraz,项目名称:haiku,代码行数:35,
示例10: _ValidateLayoutDataBAlignmentBAbstractSpinner::LayoutAlignment(){ _ValidateLayoutData(); return BLayoutUtils::ComposeAlignment(ExplicitAlignment(), BAlignment(B_ALIGN_LEFT, B_ALIGN_VERTICAL_CENTER));}
开发者ID:simonsouth,项目名称:haiku,代码行数:7,
示例11: BPointvoidBToolTip::_InitData(){ fIsSticky = false; fRelativeLocation = BPoint(20, 20); fAlignment = BAlignment(B_ALIGN_RIGHT, B_ALIGN_BOTTOM);}
开发者ID:mariuz,项目名称:haiku,代码行数:7,
示例12: BPopUpMenuBMenuField*ModifierKeysWindow::_CreateCommandMenuField(){ fCommandMenu = new BPopUpMenu( B_TRANSLATE_NOCOLLECT(_KeyToString(MENU_ITEM_COMMAND)), true, true); for (int32 key = MENU_ITEM_SHIFT; key <= MENU_ITEM_DISABLED; key++) { if (key == MENU_ITEM_SEPERATOR) { // add separator item BSeparatorItem* separator = new BSeparatorItem; fCommandMenu->AddItem(separator, MENU_ITEM_SEPERATOR); continue; } BMessage* message = new BMessage(kMsgUpdateModifier); message->AddInt32(_KeyToString(MENU_ITEM_COMMAND), key); BMenuItem* item = new BMenuItem( B_TRANSLATE_NOCOLLECT(_KeyToString(key)), message); fCommandMenu->AddItem(item, key); } fCommandMenu->SetExplicitAlignment(BAlignment(B_ALIGN_USE_FULL_WIDTH, B_ALIGN_VERTICAL_UNSET)); return new BMenuField(B_TRANSLATE_COMMENT("Command:", "Command key role name"), fCommandMenu);}
开发者ID:tqh,项目名称:haiku_efi_old,代码行数:27,
示例13: BViewPreviewView::PreviewView() : BView("Rect View", B_WILL_DRAW), fBitmapView(NULL), fTop(NULL), fLeft(NULL), fRight(NULL), fBottom(NULL){ fCoordRect = BRect(10, 10, 20, 20); fChanged = true; SetLayout(new BGroupLayout(B_HORIZONTAL)); SetExplicitAlignment(BAlignment(B_ALIGN_HORIZONTAL_CENTER, B_ALIGN_VERTICAL_CENTER)); AddChild(BGroupLayoutBuilder(B_VERTICAL) .AddGroup(B_HORIZONTAL) .Add(new BStringView("spacer", "")) .Add(fTop = new BStringView("top", "top")) .Add(new BStringView("spacer", "")) .End() .AddGroup(B_HORIZONTAL) .Add(fLeft = new BStringView("left", "left")) .Add(fBitmapView = new BitmapView()) .Add(fRight = new BStringView("right", "right")) .End() .AddGroup(B_HORIZONTAL) .Add(new BStringView("spacer", "")) .Add(fBottom = new BStringView("bottom", "bottom")) .Add(new BStringView("spacer", "")) .End() );}
开发者ID:jscipione,项目名称:BeScreenCapture,代码行数:33,
示例14: BWindowScreenSaverWindow::ScreenSaverWindow() : BWindow(BRect(50.0f, 50.0f, 50.0f + kWindowWidth, 50.0f + kWindowHeight), B_TRANSLATE_SYSTEM_NAME("ScreenSaver"), B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS){ fSettings.Load(); fMinWidth = floorf(be_control_look->DefaultItemSpacing() * (kWindowWidth / kDefaultItemSpacingAt12pt)); font_height fontHeight; be_plain_font->GetHeight(&fontHeight); float textHeight = ceilf(fontHeight.ascent + fontHeight.descent); fMinHeight = ceilf(std::max(kWindowHeight, textHeight * 28)); // Create the password editing window fPasswordWindow = new PasswordWindow(fSettings); fPasswordWindow->Run(); // Create the tab view fTabView = new TabView(); fTabView->SetBorder(B_NO_BORDER); // Create the controls inside the tabs fFadeView = new FadeView(B_TRANSLATE("General"), fSettings); fModulesView = new ModulesView(B_TRANSLATE("Screensavers"), fSettings); fTabView->AddTab(fFadeView); fTabView->AddTab(fModulesView); // Create the topmost background view BView* topView = new BView("topView", B_WILL_DRAW); topView->SetViewUIColor(B_PANEL_BACKGROUND_COLOR); topView->SetExplicitAlignment(BAlignment(B_ALIGN_USE_FULL_WIDTH, B_ALIGN_USE_FULL_HEIGHT)); topView->SetExplicitMinSize(BSize(fMinWidth, fMinHeight)); BLayoutBuilder::Group<>(topView, B_VERTICAL) .SetInsets(0, B_USE_DEFAULT_SPACING, 0, B_USE_WINDOW_SPACING) .Add(fTabView) .End(); SetLayout(new BGroupLayout(B_VERTICAL)); GetLayout()->AddView(topView); fTabView->Select(fSettings.WindowTab()); if (fSettings.WindowFrame().left > 0 && fSettings.WindowFrame().top > 0) MoveTo(fSettings.WindowFrame().left, fSettings.WindowFrame().top); if (fSettings.WindowFrame().Width() > 0 && fSettings.WindowFrame().Height() > 0) { ResizeTo(fSettings.WindowFrame().Width(), fSettings.WindowFrame().Height()); } CenterOnScreen();}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:59,
示例15: fMessageSettings::Settings() : fMessage(kMsgDiskProbeSettings), fUpdated(false){ float fontSize = be_plain_font->Size(); int32 windowWidth = DataView::WidthForFontSize(fontSize) + 20; // TODO: make scrollbar width variable BScreen screen; fMessage.AddRect("window_frame", BLayoutUtils::AlignInFrame(screen.Frame(), BSize(windowWidth, windowWidth), BAlignment(B_ALIGN_HORIZONTAL_CENTER, B_ALIGN_VERTICAL_CENTER))); fMessage.AddInt32("base_type", kHexBase); fMessage.AddFloat("font_size", fontSize); fMessage.AddBool("case_sensitive", true); fMessage.AddInt8("find_mode", kAsciiMode); BFile file; if (Open(&file, B_READ_ONLY) != B_OK) return; // TODO: load/save settings as flattened BMessage - but not yet, // since that will break compatibility with R5's DiskProbe disk_probe_settings settings; if (file.Read(&settings, sizeof(settings)) == sizeof(settings)) {#if B_HOST_IS_BENDIAN // settings are saved in little endian settings.window_frame.left = B_LENDIAN_TO_HOST_FLOAT( settings.window_frame.left); settings.window_frame.top = B_LENDIAN_TO_HOST_FLOAT( settings.window_frame.top); settings.window_frame.right = B_LENDIAN_TO_HOST_FLOAT( settings.window_frame.right); settings.window_frame.bottom = B_LENDIAN_TO_HOST_FLOAT( settings.window_frame.bottom);#endif // check if the window frame is on screen at all BScreen screen; if (screen.Frame().Contains(settings.window_frame.LeftTop()) && settings.window_frame.Width() < screen.Frame().Width() && settings.window_frame.Height() < screen.Frame().Height()) fMessage.ReplaceRect("window_frame", settings.window_frame); if (settings.base_type == kHexBase || settings.base_type == kDecimalBase) fMessage.ReplaceInt32("base_type", B_LENDIAN_TO_HOST_INT32(settings.base_type)); if (settings.font_size >= 0 && settings.font_size <= 72) fMessage.ReplaceFloat("font_size", float(B_LENDIAN_TO_HOST_INT32(settings.font_size))); fMessage.ReplaceBool("case_sensitive", settings.flags & kCaseSensitive); fMessage.ReplaceInt8("find_mode", settings.flags & kHexFindMode ? kHexMode : kAsciiMode); }}
开发者ID:looncraz,项目名称:haiku,代码行数:59,
示例16: ui_colorvoidTabView::DrawContents(BView* owner, BRect frame, const BRect& updateRect, bool isFirst, bool isLast, bool isFront){ rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR); be_control_look->DrawLabel(owner, fLabel.String(), frame, updateRect, base, 0, BAlignment(B_ALIGN_LEFT, B_ALIGN_MIDDLE));}
开发者ID:DonCN,项目名称:haiku,代码行数:8,
示例17: BSpaceLayoutItem// CreateVerticalStrutBSpaceLayoutItem*BSpaceLayoutItem::CreateVerticalStrut(float height) { return new BSpaceLayoutItem( BSize(-1, height), BSize(B_SIZE_UNLIMITED, height), BSize(-1, height), BAlignment(B_ALIGN_HORIZONTAL_CENTER, B_ALIGN_VERTICAL_CENTER));}
开发者ID:mariuz,项目名称:haiku,代码行数:9,
示例18: BStringViewBView*AboutView::_CreateLabel(const char* name, const char* label){ BStringView* labelView = new BStringView(name, label); labelView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_VERTICAL_UNSET)); labelView->SetFont(be_bold_font); return labelView;}
开发者ID:mariuz,项目名称:haiku,代码行数:9,
示例19: _MakeButton BButton* _MakeButton(const char* label) { BButton* button = new BButton(label, new BMessage('BOOM')); button->SetExplicitMinSize(BSize(10, 50)); button->SetExplicitMaxSize(BSize(500, 500)); button->SetExplicitAlignment(BAlignment(B_ALIGN_USE_FULL_WIDTH, B_ALIGN_USE_FULL_HEIGHT)); return button; }
开发者ID:SummerSnail2014,项目名称:haiku,代码行数:9,
示例20: B_TRANSLATEvoidPackagesView::Draw(BRect updateRect){ if (CountChildren() > 0) return; be_control_look->DrawLabel(this, B_TRANSLATE("No optional packages available."), Bounds(), updateRect, ViewColor(), BControlLook::B_DISABLED, BAlignment(B_ALIGN_CENTER, B_ALIGN_MIDDLE));}
开发者ID:nielx,项目名称:haiku-serviceskit,代码行数:11,
示例21: MenuBarLayoutItemBLayoutItem*BMenuField::CreateMenuBarLayoutItem(){ if (!fLayoutData->menu_bar_layout_item) { // align the menu bar in the full available space fMenuBar->SetExplicitAlignment(BAlignment(B_ALIGN_USE_FULL_WIDTH, B_ALIGN_VERTICAL_UNSET)); fLayoutData->menu_bar_layout_item = new MenuBarLayoutItem(this); } return fLayoutData->menu_bar_layout_item;}
开发者ID:michael-manley,项目名称:haiku,代码行数:11,
示例22: BView//// StatusDock::Constructor of the viewStatusDock::StatusDock(const char* name) : BView(name, B_WILL_DRAW | B_FRAME_EVENTS), modus(MODE_INIT){ SetExplicitMaxSize(BSize(B_SIZE_UNSET, 75)); SetViewUIColor(B_PANEL_BACKGROUND_COLOR); BLayoutBuilder::Grid<>(this, B_USE_ITEM_SPACING, 0) .SetExplicitAlignment(BAlignment(B_ALIGN_USE_FULL_WIDTH, B_ALIGN_BOTTOM)) .SetInsets(B_USE_WINDOW_INSETS) .Add(statusIcon = new IconView("statusicon"), 0, 0, 1, 4) .AddGlue(1, 0, 2) .Add(statusMessage = new BStringView("statusmsg", NULL), 1, 1) .AddGlue(2,1) .Add(statusBar = new BStatusBar("statusbar"), 1, 2, 2) .End(); statusIcon->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_VERTICAL_CENTER)); statusMessage->SetExplicitAlignment(BAlignment(B_ALIGN_USE_FULL_WIDTH, B_ALIGN_VERTICAL_CENTER)); statusMessage->SetExplicitPreferredSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET)); statusBar->SetExplicitAlignment(BAlignment(B_ALIGN_USE_FULL_WIDTH, B_ALIGN_VERTICAL_CENTER)); statusIcon->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_VERTICAL_CENTER));}
开发者ID:HaikuArchives,项目名称:PhotoGrabber,代码行数:23,
示例23: TranslatorListViewvoidDataTranslationsWindow::_SetupViews(){ fInfoText = NULL; fConfigView = NULL; // This is NULL until a translator is // selected from the listview // Add the translators list view fTranslatorListView = new TranslatorListView("TransList"); fTranslatorListView->SetSelectionMessage( new BMessage(kMsgSelectedTranslator)); BScrollView* scrollView = new BScrollView("scroll_trans", fTranslatorListView, B_WILL_DRAW | B_FRAME_EVENTS, false, true, B_FANCY_BORDER); // Box around the config and info panels fRightBox = new BBox("Right_Side"); fRightBox->SetExplicitAlignment(BAlignment(B_ALIGN_USE_FULL_WIDTH, B_ALIGN_USE_FULL_HEIGHT)); // Add the translator icon view fIconView = new IconView(); // Add the translator info button fButton = new BButton("info", B_TRANSLATE("Info"), new BMessage(kMsgTranslatorInfo), B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE); fButton->SetEnabled(false); // Populate the translators list view _PopulateListView(); // Build the layout BLayoutBuilder::Group<>(this, B_HORIZONTAL) .SetInsets(B_USE_WINDOW_SPACING) .Add(scrollView, 3) .AddGroup(B_VERTICAL) .Add(fRightBox) .AddGroup(B_HORIZONTAL) .Add(fIconView) .AddGlue() .Add(fButton) .End() .End() .End(); fTranslatorListView->MakeFocus(); _ShowInfoView();}
开发者ID:AmirAbrams,项目名称:haiku,代码行数:51,
示例24: CALLEDvoidBMenuField::_InitMenuBar(BMenu* menu, BRect frame, bool fixedSize){ CALLED(); fMenu = menu; InitMenu(menu); if ((Flags() & B_SUPPORTS_LAYOUT)) { fMenuBar = new _BMCMenuBar_(fixedSize, this); } else { frame.left = _MenuBarOffset(); frame.top = kVMargin; frame.right -= kVMargin; frame.bottom -= kVMargin; TRACE("frame(%.1f, %.1f, %.1f, %.1f) (%.2f, %.2f)/n", frame.left, frame.top, frame.right, frame.bottom, frame.Width(), frame.Height()); fMenuBar = new _BMCMenuBar_(frame, fixedSize, this); } if (fixedSize) { // align the menu bar in the full available space fMenuBar->SetExplicitAlignment(BAlignment(B_ALIGN_USE_FULL_WIDTH, B_ALIGN_VERTICAL_UNSET)); } else { // align the menu bar left in the available space fMenuBar->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT, B_ALIGN_VERTICAL_UNSET)); } AddChild(fMenuBar); fMenuBar->AddItem(menu); fMenuBar->SetFont(be_plain_font);}
开发者ID:michael-manley,项目名称:haiku,代码行数:38,
注:本文中的BAlignment函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ BBL_InsHead函数代码示例 C++ BATdescriptor函数代码示例 |