本文整理汇总了C++中Area::SetTopInset方法的典型用法代码示例。如果您正苦于以下问题:C++ Area::SetTopInset方法的具体用法?C++ Area::SetTopInset怎么用?C++ Area::SetTopInset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Area
的用法示例。
在下文中一共展示了Area::SetTopInset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BMessage
void
DataTranslationsWindow::_SetupViews()
{
fConfigView = NULL;
// This is NULL until a translator is
// selected from the listview
// Window box
BView* mainView = new BView(Bounds(), "", B_FOLLOW_ALL, B_WILL_DRAW | B_FRAME_EVENTS);
mainView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
AddChild(mainView);
// Add the translators list view
fTranslatorListView = new TranslatorListView(BRect(0, 0, 1, 1), "TransList",
B_SINGLE_SELECTION_LIST);
fTranslatorListView->SetSelectionMessage(new BMessage(kMsgSelectedTranslator));
BScrollView *scrollView = new BScrollView("scroll_trans", fTranslatorListView,
B_FOLLOW_LEFT | B_FOLLOW_TOP_BOTTOM, B_WILL_DRAW | B_FRAME_EVENTS,
false, true, B_FANCY_BORDER);
// Box around the config and info panels
fRightBox = new BBox("Right_Side");
// Add the translator icon view
fIconView = new IconView(BRect(0, 0, 31, 31), "Icon",
B_FOLLOW_LEFT | B_FOLLOW_BOTTOM, B_WILL_DRAW | B_FRAME_EVENTS);
// Add the translator info button
BButton *button = new BButton("STD", "Info" B_UTF8_ELLIPSIS,
new BMessage(kMsgTranslatorInfo), B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE);
// Add the translator name view
fTranslatorNameView = new BStringView("TranName", "None");
// Populate the translators list view
_PopulateListView();
// Build the layout
BALMLayout *layout = new BALMLayout();
mainView->SetLayout(layout);
XTab *x1 = layout->AddXTab();
XTab *x2 = layout->AddXTab();
XTab *x3 = layout->AddXTab();
YTab *y1 = layout->AddYTab();
Area *leftArea = layout->AddArea(layout->Left(), layout->Top(),
x1, layout->Bottom(), scrollView);
leftArea->SetLeftInset(10);
leftArea->SetTopInset(10);
leftArea->SetBottomInset(10);
Area *rightArea = layout->AddArea(x1, layout->Top(), layout->Right(), y1, fRightBox);
rightArea->SetLeftInset(10);
rightArea->SetTopInset(10);
rightArea->SetRightInset(10);
rightArea->SetBottomInset(10);
Area *iconArea = layout->AddArea(x1, y1, x2, layout->Bottom(), fIconView);
iconArea->SetLeftInset(10);
iconArea->SetBottomInset(10);
Area *infoButtonArea = layout->AddArea(x3, y1, layout->Right(), layout->Bottom(), button);
infoButtonArea->SetRightInset(10);
infoButtonArea->SetBottomInset(10);
layout->AddConstraint(3.0, x1, -1.0, layout->Right(), OperatorType(EQ), 0.0);
fTranslatorListView->MakeFocus();
fTranslatorListView->Select(0);
}