本文整理汇总了C++中BView::SetViewColor方法的典型用法代码示例。如果您正苦于以下问题:C++ BView::SetViewColor方法的具体用法?C++ BView::SetViewColor怎么用?C++ BView::SetViewColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BView
的用法示例。
在下文中一共展示了BView::SetViewColor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NewGeneralView
BView* SeqEditMultiFilterWindow::NewGeneralView(BRect frame)
{
BView* v = new BView(frame, GENERAL_STR, B_FOLLOW_ALL, 0);
if (!v) return NULL;
v->SetViewColor( Prefs().Color(AM_AUX_WINDOW_BG_C) );
float fh = arp_get_font_height(v);
float spaceX = 5, spaceY = 5;
float divider = v->StringWidth("Author:") + 10;
BRect f(spaceX, 0, frame.Width() - spaceX, fh);
/* The Name field.
*/
mNameCtrl = new BTextControl(f, "name_ctrl", "Name:", NULL, new BMessage(NAME_MSG), B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP);
if (mNameCtrl) {
f.top = mNameCtrl->Frame().bottom;
mNameCtrl->SetDivider(divider);
mNameCtrl->MakeFocus(true);
v->AddChild(mNameCtrl);
}
/* The Key field.
*/
f.top += spaceY;
f.bottom = f.top + fh;
mKeyCtrl = new BTextControl(f, "key_ctrl", "Key:", NULL, new BMessage(KEY_MSG), B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP);
if (mKeyCtrl) {
f.top = mKeyCtrl->Frame().bottom;
mKeyCtrl->SetDivider(divider);
v->AddChild(mKeyCtrl);
}
/* The Author field.
*/
f.top += spaceY;
f.bottom = f.top + fh;
mAuthorCtrl = new BTextControl(f, "author_ctrl", "Author:", NULL, new BMessage(AUTHOR_MSG), B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP);
if (mAuthorCtrl) {
f.top = mAuthorCtrl->Frame().bottom;
mAuthorCtrl->SetDivider(divider);
v->AddChild(mAuthorCtrl);
}
/* The Email field.
*/
f.top += spaceY;
f.bottom = f.top + fh;
mEmailCtrl = new BTextControl(f, "email_ctrl", "Email:", NULL, new BMessage(EMAIL_MSG), B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP);
if (mEmailCtrl) {
f.top = mEmailCtrl->Frame().bottom;
mEmailCtrl->SetDivider(divider);
v->AddChild(mEmailCtrl);
}
return v;
}
示例2: BView
MusicCollectionWindow::MusicCollectionWindow(BRect frame, const char* title)
:
BWindow(frame, title, B_DOCUMENT_WINDOW, B_AVOID_FRONT)
{
BView* rootView = new BView(Bounds(), NULL, B_FOLLOW_ALL, B_WILL_DRAW);
AddChild(rootView);
rootView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
fQueryField = new BTextControl("Search: ", "", NULL);
fQueryField->SetExplicitAlignment(BAlignment(B_ALIGN_HORIZONTAL_CENTER,
B_ALIGN_USE_FULL_HEIGHT));
fQueryField->SetModificationMessage(new BMessage(kMsgQueryInput));
fCountView = new BStringView("Count View", "Count:");
fFileListView = new MusicFileListView("File List View");
fFileListView->SetInvocationMessage(new BMessage(kMsgItemInvoked));
BScrollView* scrollView = new BScrollView("list scroll", fFileListView, 0,
true, true, B_PLAIN_BORDER);
float spacing = be_control_look->DefaultItemSpacing() / 2;
BALMLayout* layout = new BALMLayout(spacing);
layout->SetInset(spacing);
rootView->SetLayout(layout);
layout->AddView(fQueryField, layout->Left(), layout->Top());
layout->AddViewToRight(fCountView, layout->Right());
layout->AddView(scrollView, layout->Left(),
layout->AreaFor(fQueryField)->Bottom(), layout->Right(),
layout->Bottom());
Area* area = layout->AreaFor(scrollView);
area->SetLeftInset(0);
area->SetRightInset(0);
area->SetBottomInset(0);
BSize min = layout->MinSize();
BSize max = layout->MaxSize();
SetSizeLimits(min.Width(), max.Width(), min.Height(), max.Height());
fEntryViewInterface = new ListViewListener<FileListItem>(fFileListView,
fCountView);
fQueryHandler = new QueryHandler(fEntryViewInterface);
AddHandler(fQueryHandler);
fQueryReader = new QueryReader(fQueryHandler);
fQueryHandler->SetReadThread(fQueryReader);
// start initial query
PostMessage(kMsgQueryInput);
}
示例3: BStringView
TeamDescriptionView::TeamDescriptionView()
:
BView("description view", B_WILL_DRAW),
fItem(NULL),
fSeconds(4),
fRebootRunner(NULL)
{
fInfoString = B_TRANSLATE(
"Select an application from the list above and click one of "
"the buttons 'Kill application' and 'Quit application' "
"in order to close it.\n\n"
"Hold CONTROL+ALT+DELETE for %ld seconds to reboot.");
fTeamName = new BStringView("team name", "team name");
fSysComponent = new BStringView("system component", B_TRANSLATE(
"(This team is a system component)"));
fQuitOverdue = new BStringView("quit overdue", B_TRANSLATE(
"If the application will not quit you may have to kill it."));
fQuitOverdue->SetFont(be_bold_font);
fInfoTextView = new AllShowingTextView("info text");
BGroupView* group = new BGroupView(B_VERTICAL);
BGroupLayoutBuilder(group)
.Add(fInfoTextView)
.AddGlue();
fIconView = new IconView();
fIconView->SetExplicitAlignment(
BAlignment(B_ALIGN_HORIZONTAL_UNSET, B_ALIGN_VERTICAL_CENTER));
BView* teamPropertiesView = new BView("team properties", B_WILL_DRAW);
teamPropertiesView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
BGroupLayout* layout = new BGroupLayout(B_HORIZONTAL);
teamPropertiesView->SetLayout(layout);
BGroupLayoutBuilder(layout)
.Add(fIconView)
.AddGroup(B_VERTICAL)
.Add(fTeamName)
.Add(fSysComponent)
.Add(fQuitOverdue)
.End()
.AddGlue();
fLayout = new BCardLayout();
SetLayout(fLayout);
fLayout->AddView(group);
fLayout->AddView(teamPropertiesView);
SetItem(NULL);
}
示例4: BWindow
BFIV_PrefWin::BFIV_PrefWin(BRect frame)
: BWindow(frame, "Preferences", B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, B_NOT_RESIZABLE|B_NOT_ZOOMABLE)
{
BRect rect = Bounds();
BView *back;
BTextControl *scratchPath;
BButton *cancelButton, *okButton, *selectButton;
font_height fontHeight;
float fontSize, tmp;
// private data
filePanel = NULL;
// some font voodoo
be_plain_font->GetHeight(&fontHeight);
fontSize = fontHeight.ascent + fontHeight.descent;
// the background
back = new BView(rect, "background", B_FOLLOW_ALL, 0);
back->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
AddChild(back);
// the select button
tmp = be_plain_font->StringWidth("Select");
rect.Set(frame.Width() - tmp - 20., 5., frame.Width() - 5., 5. + fontSize + 10.);
selectButton = new BButton(rect, "select", "Select", new BMessage(SELECT_SCRATCH_PATH));
back->AddChild(selectButton);
// the path
rect.Set(5.,5., selectButton->Frame().left - 5., 5. + fontSize + 10.);
scratchPath = new BTextControl(rect, "path", "Scratch Location", NULL, NULL, B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW);
back->AddChild(scratchPath);
scratchPath->SetText(((BFIV_App *)be_app)->ScratchDirectory()); // current dir
scratchPath->TextView()->MakeEditable(false); // only works after AddChild() (!!)
// the ok button
tmp = be_plain_font->StringWidth("OK");
rect.Set(frame.Width() - tmp - 35., Frame().Height() - fontSize - 20., frame.Width() - 10., Frame().Height() - 10.);
okButton = new BButton(rect, "ok", "OK", new BMessage(APPLY_PREFS_CHANGE));
back->AddChild(okButton);
okButton->MakeDefault(true);
// the cancel button
tmp = be_plain_font->StringWidth("Cancel");
rect.Set(okButton->Frame().left - tmp - 20., okButton->Frame().top, okButton->Frame().left - 5., okButton->Frame().bottom);
cancelButton = new BButton(rect, "cancel", "Cancel", new BMessage(B_QUIT_REQUESTED));
back->AddChild(cancelButton);
}
示例5: BWindow
StickItWindow::StickItWindow(BRect frame)
: BWindow(frame, "StickIt", B_TITLED_WINDOW, NULL)
{
frame = Bounds();
frame.InsetBy(5, 5);
BBox* box = new BBox(frame, NULL, B_FOLLOW_ALL_SIDES);
// Allocate object
BView* view = new BView(Bounds(), "", B_FOLLOW_ALL_SIDES, NULL);
view->SetViewColor(216, 216, 216);
view->SetLowColor(216, 216, 216);
BRect rectString = BRect(frame.left, frame.top-10, frame.right -30, 30);
BStringView* stringview1 = new BStringView(rectString,"StringView1",
"This list, lists action that StickIt makes.");
BRect rect = BRect(rectString.left, rectString.bottom + SPACE,
rectString.right, rectString.bottom + SPACE + 200);
fListView1 = new BListView(rect,"ListView1");
rectString = BRect(rect.left, rect.bottom + SPACE, rect.right,
rect.bottom + SPACE + 15);
BStringView* stringview2 = new BStringView(rectString,"StringView2",
"Choose Joystick below if any exists");
rect = BRect(rectString.left, rectString.bottom + SPACE, rectString.right,
Bounds().bottom -20);
fListView2 = new BListView(rect,"ListView2");
fListView2->SetSelectionMessage(new BMessage(SELECTED));
fListView2->SetInvocationMessage(new BMessage(INVOKE));
// Adding object
box->AddChild(new BScrollView("fListView1", fListView1,
B_FOLLOW_LEFT_RIGHT, NULL, false, true));
box->AddChild(new BScrollView("fListView2", fListView2,
B_FOLLOW_ALL_SIDES, NULL, false, true));
box->AddChild(stringview1);
box->AddChild(stringview2);
view->AddChild(box);
AddChild(view);
fJoystick = new BJoystick;
PickJoystick(fJoystick);
}
示例6: Bounds
AboutWindow::AboutWindow()
:
BWindow(BRect(250, 200, 650, 500), "AboutWindow", B_MODAL_WINDOW_LOOK, B_MODAL_APP_WINDOW_FEEL, B_NOT_ZOOMABLE | B_NOT_RESIZABLE | B_NOT_CLOSABLE)
{
BRect r;
SetTitle("About");
r = Bounds();
BView* aroundView = new BView(r, "AroundView", B_FOLLOW_ALL_SIDES, B_WILL_DRAW);
aroundView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
AddChild(aroundView);
r = aroundView->Bounds();
r.InsetBy(5.0, 5.0);
aroundView->AddChild(new BButton(r, "close", "Close", new BMessage('ClWi')));
aroundView->AddChild(new AboutView(r, "AboutView"));
}
示例7: AddViews
void SeqPrefWin::AddViews(const BMessage& prefs)
{
BRect b = Bounds();
/* Add the bottom panel with the Cancel OK buttons. When this
* block is done, it will adjust the bounds accordingly (i.e.,
* without the space used by this view).
*/
{
float buttonW = 60, buttonH = 24;
float edgeR = 8, edgeB = 8, edgeT = 8;
BRect f(b);
f.top = f.bottom - edgeB - buttonH - edgeT;
BView* v = new BView( f, "button_panel", B_FOLLOW_LEFT_RIGHT | B_FOLLOW_BOTTOM, 0 );
if( v ) {
BRect f( b.right - edgeR - buttonW, edgeT, b.right - edgeR, edgeT + buttonH );
BButton* button = new BButton( f, "ok_button", "OK", new BMessage( OK_MSG ), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM );
if( button ) {
v->AddChild( button );
button->MakeDefault( true );
}
f.OffsetBy( 0-(buttonW + 10), 0 );
button = new BButton( f, "cancel_button", "Cancel", new BMessage( CANCEL_MSG ), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM );
if( button ) v->AddChild( button );
v->SetViewColor( Prefs().Color(AM_AUX_WINDOW_BG_C) );
AddChild( v );
b.bottom = b.bottom - edgeB - buttonH - edgeT - 1;
}
}
BTabView* tv = new BTabView(b, TABVIEW_STR);
if (!tv) return;
BView* fileView = NewFileView(b, prefs);
if (fileView) tv->AddTab(fileView);
BView* editView = NewEditView(b, prefs);
if (editView) tv->AddTab(editView);
BView* playbackView = NewTrackView(b, prefs);
if (playbackView) tv->AddTab(playbackView);
mFactoryView = NewFactoriesView(b, prefs);
if (mFactoryView) tv->AddTab(mFactoryView);
AddChild(tv);
/* NOTE: Have to do this after the tab view's been added to the window or else
* you get a crash. It's a bug in the tab view, nothing to be done about it.
*/
tv->SetTabWidth(B_WIDTH_FROM_WIDEST);
}
示例8: BView
BView *PrefsWindow::create_volumes_pane(void)
{
BView *pane = new BView(BRect(0, 0, top_frame.right-20, top_frame.bottom-80), GetString(STR_VOLUMES_PANE_TITLE), B_FOLLOW_NONE, B_WILL_DRAW);
pane->SetViewColor(fill_color);
float right = pane->Bounds().right-10;
const char *str;
int32 index = 0;
volume_list = new VolumeListView(BRect(15, 10, pane->Bounds().right-30, 113), "volumes");
while ((str = PrefsFindString("disk", index++)) != NULL)
volume_list->AddItem(new BStringItem(str));
volume_list->SetSelectionMessage(new BMessage(MSG_VOLUME_SELECTED));
volume_list->SetInvocationMessage(new BMessage(MSG_VOLUME_INVOKED));
pane->AddChild(new BScrollView("volumes_border", volume_list, B_FOLLOW_LEFT | B_FOLLOW_TOP, 0, false, true));
pane->AddChild(new BButton(BRect(10, 118, pane->Bounds().right/3, 138), "add_volume", GetString(STR_ADD_VOLUME_BUTTON), new BMessage(MSG_ADD_VOLUME)));
pane->AddChild(new BButton(BRect(pane->Bounds().right/3, 118, pane->Bounds().right*2/3, 138), "create_volume", GetString(STR_CREATE_VOLUME_BUTTON), new BMessage(MSG_CREATE_VOLUME)));
pane->AddChild(new BButton(BRect(pane->Bounds().right*2/3, 118, pane->Bounds().right-11, 138), "remove_volume", GetString(STR_REMOVE_VOLUME_BUTTON), new BMessage(MSG_REMOVE_VOLUME)));
extfs_control = new PathControl(true, BRect(10, 145, right, 160), "extfs", GetString(STR_EXTFS_CTRL), PrefsFindString("extfs"), NULL);
extfs_control->SetDivider(90);
pane->AddChild(extfs_control);
BMenuField *menu_field;
BPopUpMenu *menu = new BPopUpMenu("");
menu_field = new BMenuField(BRect(10, 165, right, 180), "bootdriver", GetString(STR_BOOTDRIVER_CTRL), menu);
menu_field->SetDivider(90);
menu->AddItem(new BMenuItem(GetString(STR_BOOT_ANY_LAB), new BMessage(MSG_BOOT_ANY)));
menu->AddItem(new BMenuItem(GetString(STR_BOOT_CDROM_LAB), new BMessage(MSG_BOOT_CDROM)));
pane->AddChild(menu_field);
int32 i32 = PrefsFindInt32("bootdriver");
BMenuItem *item;
if (i32 == 0) {
if ((item = menu->FindItem(GetString(STR_BOOT_ANY_LAB))) != NULL)
item->SetMarked(true);
} else if (i32 == CDROMRefNum) {
if ((item = menu->FindItem(GetString(STR_BOOT_CDROM_LAB))) != NULL)
item->SetMarked(true);
}
nocdrom_checkbox = new BCheckBox(BRect(10, 185, right, 200), "nocdrom", GetString(STR_NOCDROM_CTRL), new BMessage(MSG_NOCDROM));
pane->AddChild(nocdrom_checkbox);
nocdrom_checkbox->SetValue(PrefsFindBool("nocdrom") ? B_CONTROL_ON : B_CONTROL_OFF);
return pane;
}
示例9: bounds
PasswordWindow::PasswordWindow()
: BWindow(BRect(100, 100, 400, 230), "Enter password",
B_NO_BORDER_WINDOW_LOOK, kPasswordWindowFeel
/* TODO: B_MODAL_APP_WINDOW_FEEL should also behave correctly */,
B_NOT_MOVABLE | B_NOT_CLOSABLE | B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE
| B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS, B_ALL_WORKSPACES)
{
BView* topView = new BView(Bounds(), "topView", B_FOLLOW_ALL, B_WILL_DRAW);
topView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
AddChild(topView);
BRect bounds(Bounds());
bounds.InsetBy(10.0, 10.0);
BBox *customBox = new BBox(bounds, "customBox", B_FOLLOW_NONE);
topView->AddChild(customBox);
customBox->SetLabel("Unlock screen saver");
bounds.top += 10.0;
fPassword = new BTextControl(bounds, "password", "Enter password:",
"VeryLongPasswordPossible", B_FOLLOW_NONE);
customBox->AddChild(fPassword);
fPassword->MakeFocus(true);
fPassword->ResizeToPreferred();
fPassword->TextView()->HideTyping(true);
fPassword->SetDivider(be_plain_font->StringWidth("Enter password:") + 5.0);
BButton* button = new BButton(BRect(), "unlock", "Unlock",
new BMessage(kMsgUnlock), B_FOLLOW_NONE);
customBox->AddChild(button);
button->MakeDefault(true);
button->ResizeToPreferred();
button->SetTarget(NULL, be_app);
BRect frame = fPassword->Frame();
button->MoveTo(frame.right - button->Bounds().Width(), frame.bottom + 10.0);
customBox->ResizeTo(frame.right + 10.0, button->Frame().bottom + 10.0);
frame = customBox->Frame();
ResizeTo(frame.right + 10.0, frame.bottom + 10.0);
BScreen screen(this);
MoveTo(screen.Frame().left + (screen.Frame().Width() - Bounds().Width()) / 2,
screen.Frame().top + (screen.Frame().Height() - Bounds().Height()) / 2);
}
示例10: NewFactoriesView
BView* SeqPrefWin::NewFactoriesView(BRect bounds, const BMessage& prefs)
{
BView* v = new BView(bounds, VIEWS_STR, B_FOLLOW_ALL, 0);
if (!v) return v;
v->SetViewColor( Prefs().Color(AM_AUX_WINDOW_BG_C) );
float sx = Prefs().Size(SPACE_X), sy = Prefs().Size(SPACE_Y);
float iH = Prefs().Size(INT_CTRL_Y);
float listB = (bounds.Height() * 0.5) - (sy * 2) - (iH * 3);
/* The factory list.
*/
BRect f(sx, sy, bounds.Width() - sx, sy + listB);
mFactoryList = new SeqFactoryListView(f, VIEWS_STR);
if (!mFactoryList) return v;
mFactoryList->SetSelectionMessage(new BMessage(VIEW_ROW_SELECTED_MSG));
v->AddChild(mFactoryList);
return v;
}
示例11: NewIconView
BView* SeqEditMultiFilterWindow::NewIconView(BRect frame)
{
BView* v = new BView(frame, ICON_STR, B_FOLLOW_ALL, 0);
if (!v) return NULL;
v->SetViewColor( Prefs().Color(AM_AUX_WINDOW_BG_C) );
/* The icon editor.
*/
BRect f(5, 0, frame.Width(), frame.Height() );
mIconEditor = new SeqBitmapEditor(f, ICON_STR, NULL, B_FOLLOW_ALL, new_icon_editor_menu() );
if (mIconEditor) {
mIconEditor->SetBitmapChangeMessage( new BMessage(BITMAP_CHANGE_MSG) );
mIconEditor->SetViewColor( Prefs().Color(AM_AUX_WINDOW_BG_C) );
v->AddChild(mIconEditor);
}
return v;
}
示例12: r
CColorPicker::CColorPicker(BRect frame, const char *name, bool stayOpen)
: BWindow(frame, name, stayOpen ? B_TITLED_WINDOW : B_MODAL_WINDOW,
B_NOT_RESIZABLE | B_NOT_ZOOMABLE)
{
fStayOpen = stayOpen;
fCaller = NULL;
BView *main = new BView(Bounds(), "main", 0, B_WILL_DRAW);
AddChild(main);
main->SetViewColor(kGray);
BRect r(10, 10, 145, 130);
fHSV = new CHSVView(r, "hsvview");
main->AddChild(fHSV);
r.Set(155, 10, 205, 130);
fON = new CONView(r, "o&n");
main->AddChild(fON);
r.Set(215, 10, 380, 130);
fRGB = new CRGBView(r, "rgbview");
main->AddChild(fRGB);
if (fStayOpen)
{
BRect b(Bounds());
ResizeTo(b.Width(), b.Height() - 30);
}
else
{
r.Set(320, 140, 380, 160);
BButton * ok = new BButton(r, "ok", "OK", new BMessage(msg_OK));
main->AddChild(ok);
ok->MakeDefault(true);
r.Set(250, 140, 310, 160);
main->AddChild(new BButton(r, "cancel", "Cancel", new BMessage(msg_Cancel)));
// TPV 00-02-27
KeyFilter * kf = new KeyFilter(B_ESCAPE, msg_Cancel) ;
AddCommonFilter( kf ) ;
}
} /* CColorPicker::CColorPicker */
示例13: BMessage
FolderConfigWindow::FolderConfigWindow(BRect parent, const BMessage& settings)
:
BWindow(BRect(0, 0, 300, 300), B_TRANSLATE("IMAP Folders"),
B_TITLED_WINDOW_LOOK, B_MODAL_APP_WINDOW_FEEL,
B_NO_WORKSPACE_ACTIVATION | B_NOT_ZOOMABLE | B_AVOID_FRONT),
fSettings(settings)
{
BView* rootView = new BView(Bounds(), "root", B_FOLLOW_ALL, B_WILL_DRAW);
AddChild(rootView);
rootView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
float spacing = be_control_look->DefaultItemSpacing();
BALMLayout* layout = new BALMLayout(spacing);
rootView->SetLayout(layout);
layout->SetInset(spacing);
fFolderListView = new EditListView(B_TRANSLATE("IMAP Folders"));
fFolderListView->SetExplicitPreferredSize(BSize(B_SIZE_UNLIMITED,
B_SIZE_UNLIMITED));
fApplyButton = new BButton("Apply", B_TRANSLATE("Apply"),
new BMessage(kMsgApplyButton));
fQuotaView = new BStringView("quota view",
B_TRANSLATE("Failed to fetch available storage."));
fQuotaView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
B_ALIGN_VERTICAL_CENTER));
layout->AddView(fFolderListView, layout->Left(), layout->Top(),
layout->Right(), layout->Bottom());
GroupItem item = GroupItem(fQuotaView) / GroupItem(fFolderListView)
/ (GroupItem(BSpaceLayoutItem::CreateGlue())
| GroupItem(fApplyButton));
layout->BuildLayout(item);
PostMessage(kMsgInit);
BSize min = layout->MinSize();
BSize max = layout->MaxSize();
SetSizeLimits(min.Width(), max.Width(), min.Height(), max.Height());
CenterIn(parent);
}
示例14: r
BView*
NormalizeFilter::ConfigView()
{
BRect r(0,0,180,80);
BView *view = new BView(r, NULL, B_FOLLOW_ALL, B_WILL_DRAW);
view->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
value = new SpinControl(NULL, B_TRANSLATE("Normalize Level (%)"),
NULL, 1, 100, Prefs.filter_normalize, 1);
value->SetDivider(120);
BLayoutBuilder::Group<>(view, B_HORIZONTAL)
.Add(value)
.End();
return view;
}
示例15: BView
TChmodWindow::TChmodWindow(float ix, float iy, const char *title)
: BWindow(BRect(ix, iy, ix + 275, iy + 170), title,
B_FLOATING_WINDOW_LOOK, B_MODAL_APP_WINDOW_FEEL,
B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE | B_NOT_RESIZABLE)
{
BView *bgView = new BView(Bounds(), "", 0, 0);
bgView->SetViewColor(217,217,217);
AddChild(bgView);
float r = 40, w = 70, x = 100, ow = 80, gr = 140, ot = 200, xd = 15, yd = 15;
bgView->AddChild(new BStringView(BRect(10, r, ow - 2, r + yd + 3), "", "Read:"));
bgView->AddChild(new BStringView(BRect(10, w, ow - 2, w + yd + 3), "", "Write:"));
bgView->AddChild(new BStringView(BRect(10, x, ow - 2, x + yd + 3), "", "Execute:"));
bgView->AddChild(new BStringView(BRect(ow - 10, r - 20, ow + 30, r - 3), "", "Owner"));
bgView->AddChild(new BStringView(BRect(gr - 10, r - 20, gr + 30, r - 3), "", "Group"));
bgView->AddChild(new BStringView(BRect(ot - 10, r - 20, ot + 30, r - 3), "", "Other"));
fOwnerRead = new BCheckBox(BRect(ow, r, ow + xd, r + yd), "OwnerRead", "", NULL);
fOwnerWrite = new BCheckBox(BRect(ow, w, ow + xd, w + yd), "OwnerWrite", "", NULL);
fOwnerExec = new BCheckBox(BRect(ow, x, ow + xd, x + yd), "OwnerExec", "", NULL);
fGroupRead = new BCheckBox(BRect(gr, r, gr + xd, r + yd), "GroupRead", "", NULL);
fGroupWrite = new BCheckBox(BRect(gr, w, gr + xd, w + yd), "GroupWrite", "", NULL);
fGroupExec = new BCheckBox(BRect(gr, x, gr + xd, x + yd), "GroupROwner", "", NULL);
fOtherRead = new BCheckBox(BRect(ot, r, ot + xd, r + yd), "OtherRead", "", NULL);
fOtherWrite = new BCheckBox(BRect(ot, w, ot + xd, w + yd), "OtherWrite", "", NULL);
fOtherExec = new BCheckBox(BRect(ot, x, ot + xd, x + yd), "OtherExec", "", NULL);
bgView->AddChild(fOwnerRead);
bgView->AddChild(fOwnerWrite);
bgView->AddChild(fOwnerExec);
bgView->AddChild(fGroupRead);
bgView->AddChild(fGroupWrite);
bgView->AddChild(fGroupExec);
bgView->AddChild(fOtherRead);
bgView->AddChild(fOtherWrite);
bgView->AddChild(fOtherExec);
fOKButton = new BButton(BRect(10, 140, 100, 160), "", "Change", new BMessage(OK_CLICKED));
bgView->AddChild(fOKButton);
fCancelButton = new BButton(BRect(170, 140, 260, 160), "", "Cancel", new BMessage(B_QUIT_REQUESTED));
bgView->AddChild(fCancelButton);
AddShortcut('W', 0, new BMessage(B_QUIT_REQUESTED));
fStatus = B_BUSY;
}