本文整理汇总了C++中BBox::MoveTo方法的典型用法代码示例。如果您正苦于以下问题:C++ BBox::MoveTo方法的具体用法?C++ BBox::MoveTo怎么用?C++ BBox::MoveTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BBox
的用法示例。
在下文中一共展示了BBox::MoveTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BMessage
// constructor
ColorPickerPanel::ColorPickerPanel(BRect frame, rgb_color color,
selected_color_mode mode,
BWindow* window,
BMessage* message, BHandler* target)
: Panel(frame, "Pick Color",
B_FLOATING_WINDOW_LOOK, B_FLOATING_SUBSET_WINDOW_FEEL,
B_ASYNCHRONOUS_CONTROLS |
B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_NOT_CLOSABLE),
fWindow(window),
fMessage(message),
fTarget(target)
{
SetTitle(B_TRANSLATE("Pick a color"));
fColorPickerView = new ColorPickerView("color picker", color, mode);
#if LIB_LAYOUT
MButton* defaultButton = new MButton(B_TRANSLATE("OK"),
new BMessage(MSG_DONE), this);
// interface layout
BView* topView = new VGroup (
fColorPickerView,
new MBorder (
M_RAISED_BORDER, 5, "buttons",
new HGroup (
new Space(minimax(0.0, 0.0, 10000.0, 10000.0, 5.0)),
new MButton(B_TRANSLATE("Cancel"), new BMessage(MSG_CANCEL),
this),
new Space(minimax(5.0, 0.0, 10.0, 10000.0, 1.0)),
defaultButton,
new Space(minimax(2.0, 0.0, 2.0, 10000.0, 0.0)),
0
)
),
0
);
#else // LIB_LAYOUT
frame = BRect(0, 0, 40, 15);
BButton* defaultButton = new BButton(frame, "ok button",
B_TRANSLATE("OK"), new BMessage(MSG_DONE),
B_FOLLOW_RIGHT | B_FOLLOW_TOP);
defaultButton->ResizeToPreferred();
BButton* cancelButton = new BButton(frame, "cancel button",
B_TRANSLATE("Cancel"), new BMessage(MSG_CANCEL),
B_FOLLOW_RIGHT | B_FOLLOW_TOP);
cancelButton->ResizeToPreferred();
frame.bottom = frame.top + (defaultButton->Frame().Height() + 16);
frame.right = frame.left + fColorPickerView->Frame().Width();
BBox* buttonBox = new BBox(frame, "button group",
B_FOLLOW_LEFT_RIGHT | B_FOLLOW_BOTTOM,
B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE_JUMP,
B_PLAIN_BORDER);
ResizeTo(frame.Width(),
fColorPickerView->Frame().Height() + frame.Height() + 1);
frame = Bounds();
BView* topView = new BView(frame, "bg", B_FOLLOW_ALL, 0);
topView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
buttonBox->MoveTo(frame.left, frame.bottom - buttonBox->Frame().Height());
defaultButton->MoveTo(frame.right - defaultButton->Frame().Width() - 10,
frame.top + 8);
buttonBox->AddChild(defaultButton);
cancelButton->MoveTo(defaultButton->Frame().left - 10
- cancelButton->Frame().Width(),
frame.top + 8);
buttonBox->AddChild(cancelButton);
topView->AddChild(fColorPickerView);
topView->AddChild(buttonBox);
#endif // LIB_LAYOUT
SetDefaultButton(defaultButton);
if (fWindow)
AddToSubset(fWindow);
else
SetFeel(B_FLOATING_APP_WINDOW_FEEL);
AddChild(topView);
}