本文整理汇总了C++中BMenuField::MoveTo方法的典型用法代码示例。如果您正苦于以下问题:C++ BMenuField::MoveTo方法的具体用法?C++ BMenuField::MoveTo怎么用?C++ BMenuField::MoveTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BMenuField
的用法示例。
在下文中一共展示了BMenuField::MoveTo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Minimize
void CharismaWindow::Minimize(bool minimize)
{
const float margin=4.0f;
BRect r;
// en réalité, minimize est ignoré
if(!isminim){
menubar->Hide();
setupview->MoveTo(B_ORIGIN);
modemenu->MoveTo(margin,margin);
r=modemenu->Frame();
ResizeTo(r.right+margin,r.bottom+margin);
SetLook(B_MODAL_WINDOW_LOOK);
isminim=1;
}else{
menubar->Show();
setupview->MoveTo(0,menubar->Frame().bottom);
modemenu->MoveTo(10.0f,10.0f);
r=setupview->Frame();
ResizeTo(r.right,r.bottom);
SetLook(B_TITLED_WINDOW_LOOK);
isminim=0;
}
}
示例2: bounds
void
DocInfoWindow::_SetupDocInfoView(BBox* panel)
{
BRect bounds(panel->Bounds());
#if HAVE_FULLVERSION_PDF_LIB
bounds.InsetBy(10.0, 10.0);
#endif
// add list of keys
fKeyList = new BMenu("Delete Key");
BMenuField *menu = new BMenuField(bounds, "delete", "", fKeyList,
B_FOLLOW_BOTTOM);
panel->AddChild(menu);
menu->SetDivider(0);
#ifdef __HAIKU__
menu->ResizeToPreferred();
menu->MoveTo(bounds.left, bounds.bottom - menu->Bounds().Height());
#else
menu->ResizeTo(menu->StringWidth("Delete Key") + 15.0, 25.0);
menu->MoveTo(bounds.left, bounds.bottom - 25.0);
#endif
const char* title[6] = { "Title", "Author", "Subject", "Keywords", "Creator",
NULL }; // PDFlib sets these: "Producer", "CreationDate", not "ModDate"
BMenu* defaultKeys = new BMenu("Default Keys");
for (int32 i = 0; title[i] != NULL; ++i)
defaultKeys->AddItem(new BMenuItem(title[i], new BMessage(DEFAULT_KEY_MSG)));
BRect frame(menu->Frame());
menu = new BMenuField(frame, "add", "", defaultKeys, B_FOLLOW_BOTTOM);
panel->AddChild(menu);
menu->SetDivider(0);
#ifdef __HAIKU__
menu->ResizeToPreferred();
menu->MoveBy(frame.Width() + 10.0, 0.0);
#else
menu->ResizeTo(menu->StringWidth("Default Keys") + 15.0, 25.0);
menu->MoveBy(menu->Bounds().Width() + 10.0, 0.0);
#endif
frame = menu->Frame();
frame.left = frame.right + 10.0;
frame.right = bounds.right;
BTextControl *add = new BTextControl(frame, "add", "Add Key:", "",
new BMessage(ADD_KEY_MSG), B_FOLLOW_LEFT_RIGHT | B_FOLLOW_BOTTOM);
panel->AddChild(add);
float width, height;
add->GetPreferredSize(&width, &height);
add->ResizeTo(bounds.right - frame.left, height);
add->SetDivider(be_plain_font->StringWidth("Add Key: "));
bounds.bottom = frame.top - 10.0;
bounds.right -= B_V_SCROLL_BAR_WIDTH;
bounds.InsetBy(2.0, 2.0);
fTable = new BView(bounds, "table", B_FOLLOW_ALL, B_WILL_DRAW);
fTable->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
fTableScrollView = new BScrollView("scroll_table", fTable, B_FOLLOW_ALL, 0,
false, true);
panel->AddChild(fTableScrollView);
BMessage docInfo;
fDocInfo->FindMessage("doc_info", &docInfo);
// fill table
_BuildTable(docInfo);
}