本文整理汇总了C++中BGroupView::SetViewColor方法的典型用法代码示例。如果您正苦于以下问题:C++ BGroupView::SetViewColor方法的具体用法?C++ BGroupView::SetViewColor怎么用?C++ BGroupView::SetViewColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BGroupView
的用法示例。
在下文中一共展示了BGroupView::SetViewColor方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BTextView
void
DataTranslationsWindow::_ShowInfoView()
{
if (fConfigView) {
fRightBox->RemoveChild(fConfigView);
delete fConfigView;
fConfigView = NULL;
}
BTextView* view = new BTextView("info text");
view->MakeEditable(false);
view->MakeSelectable(false);
view->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
view->SetText(B_TRANSLATE(
"Use this control panel to set default values for translators, "
"to be used when no other settings are specified by an application."));
BGroupView* group = new BGroupView(B_VERTICAL);
group->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
group->AddChild(view);
float spacing = be_control_look->DefaultItemSpacing();
group->GroupLayout()->SetInsets(spacing, spacing, spacing, spacing);
fRightBox->AddChild(group);
fConfigView = group;
}
示例2: BitmapView
ScreenshotWindow::ScreenshotWindow(BWindow* parent, BRect frame)
:
BWindow(frame, B_TRANSLATE("Screenshot"),
B_FLOATING_WINDOW_LOOK, B_FLOATING_SUBSET_WINDOW_FEEL,
B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS),
fDownloadPending(false),
fWorkerThread(-1)
{
AddToSubset(parent);
fScreenshotView = new BitmapView("screenshot view");
fScreenshotView->SetExplicitMaxSize(
BSize(B_SIZE_UNLIMITED, B_SIZE_UNLIMITED));
BGroupView* groupView = new BGroupView(B_VERTICAL);
groupView->SetViewColor(0, 0, 0);
fScreenshotView->SetLowColor(0, 0, 0);
// Build layout
BLayoutBuilder::Group<>(this, B_VERTICAL)
.AddGroup(groupView)
.Add(fScreenshotView)
.SetInsets(B_USE_WINDOW_INSETS)
.End()
;
CenterOnScreen();
}
示例3: BarberPole
ScreenshotWindow::ScreenshotWindow(BWindow* parent, BRect frame)
:
BWindow(frame, B_TRANSLATE("Screenshot"),
B_FLOATING_WINDOW_LOOK, B_FLOATING_SUBSET_WINDOW_FEEL,
B_ASYNCHRONOUS_CONTROLS | B_AUTO_UPDATE_SIZE_LIMITS),
fBarberPoleShown(false),
fDownloadPending(false),
fWorkerThread(-1)
{
AddToSubset(parent);
atomic_set(&fCurrentScreenshotIndex, 0);
fBarberPole = new BarberPole("barber pole");
fBarberPole->SetExplicitMaxSize(BSize(100, B_SIZE_UNLIMITED));
fBarberPole->Hide();
fIndexView = new BStringView("screenshot index", NULL);
fToolBar = new BToolBar();
fToolBar->AddAction(MSG_PREVIOUS_SCREENSHOT, this,
sNextButtonIcon->Bitmap(SharedBitmap::SIZE_22),
NULL, NULL);
fToolBar->AddAction(MSG_NEXT_SCREENSHOT, this,
sPreviousButtonIcon->Bitmap(SharedBitmap::SIZE_22),
NULL, NULL);
fToolBar->AddView(fIndexView);
fToolBar->AddGlue();
fToolBar->AddView(fBarberPole);
fScreenshotView = new BitmapView("screenshot view");
fScreenshotView->SetExplicitMaxSize(
BSize(B_SIZE_UNLIMITED, B_SIZE_UNLIMITED));
fScreenshotView->SetScaleBitmap(false);
BGroupView* groupView = new BGroupView(B_VERTICAL);
groupView->SetViewColor(kBackgroundColor);
// Build layout
BLayoutBuilder::Group<>(this, B_VERTICAL, 0)
.SetInsets(0, 3, 0, 0)
.Add(fToolBar)
.AddStrut(3)
.AddGroup(groupView)
.Add(fScreenshotView)
.SetInsets(B_USE_WINDOW_INSETS)
.End()
;
fScreenshotView->SetLowColor(kBackgroundColor);
// Set after attaching all views to prevent it from being overriden
// again by BitmapView::AllAttached()
CenterOnScreen();
}
示例4: BStringView
Window::Window()
:
BWindow(BRect(100, 100, 520, 430), "ToolTip-Test",
B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS)
{
BView* simple = new BStringView("1", "Simple Tool Tip");
simple->SetToolTip("This is a really\nsimple tool tip!");
BView* custom = new BStringView("2", "Custom Tool Tip");
custom->SetToolTip(new CustomToolTip("Custom tool tip!"));
BView* changing = new BStringView("3", "Changing Tool Tip");
changing->SetToolTip(new ChangingToolTip());
BView* mouse = new BStringView("4", "Mouse Tool Tip (sticky)");
mouse->SetToolTip(new MouseToolTip());
BView* immediate = new ImmediateView("5", "Immediate Tool Tip (sticky)");
BView* pulseString = new PulseStringView("pulseString",
"Periodically changing tool tip text");
BView* pulseToolTip = new PulseToolTipView("pulseToolTip",
"Periodically changing tool tip");
BGroupView* nested = new BGroupView();
nested->SetViewColor(50, 50, 90);
nested->GroupLayout()->SetInsets(30);
nested->SetToolTip("The outer view has a tool tip,\n"
"the inner one doesn't.");
nested->AddChild(new BGroupView("inner"));
BLayoutBuilder::Group<>(this, B_HORIZONTAL)
.SetInsets(B_USE_DEFAULT_SPACING)
.AddGroup(B_VERTICAL)
.Add(simple)
.Add(custom)
.Add(changing)
.Add(mouse)
.Add(immediate)
.End()
.AddGroup(B_VERTICAL)
.Add(pulseString)
.Add(pulseToolTip)
.Add(nested);
SetPulseRate(1000000LL);
}
示例5: BGroupView
bool
ResultWindow::AddLocationChanges(const char* location,
const PackageList& packagesToInstall,
const PackageSet& packagesAlreadyAdded,
const PackageList& packagesToUninstall,
const PackageSet& packagesAlreadyRemoved)
{
BGroupView* locationGroup = new BGroupView(B_VERTICAL);
ObjectDeleter<BGroupView> locationGroupDeleter(locationGroup);
locationGroup->GroupLayout()->SetInsets(B_USE_SMALL_INSETS);
rgb_color background = ui_color(B_LIST_BACKGROUND_COLOR);
if ((fContainerView->CountChildren() & 1) != 0)
background = tint_color(background, 1.04);
locationGroup->SetViewColor(background);
BStringView* locationView = new BStringView(NULL,
BString().SetToFormat("in %s:", location));
locationGroup->AddChild(locationView);
locationView->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET));
BFont locationFont;
locationView->GetFont(&locationFont);
locationFont.SetFace(B_BOLD_FACE);
locationView->SetFont(&locationFont);
BGroupLayout* packagesGroup = new BGroupLayout(B_VERTICAL);
locationGroup->GroupLayout()->AddItem(packagesGroup);
packagesGroup->SetInsets(20, 0, 0, 0);
bool packagesAdded = _AddPackages(packagesGroup, packagesToInstall,
packagesAlreadyAdded, true);
packagesAdded |= _AddPackages(packagesGroup, packagesToUninstall,
packagesAlreadyRemoved, false);
if (!packagesAdded)
return false;
fContainerView->AddChild(locationGroup);
locationGroupDeleter.Detach();
return true;
}
示例6: BWindow
BrowserWindow::BrowserWindow()
: BWindow(BRect(100, 100, 400, 400), "Tranquility", B_DOCUMENT_WINDOW, 0)
{
fToolbar = new BrowserToolbar();
fProxyView = new ProxyView(Bounds(), "Proxy");
BGroupView *view = new BGroupView(B_VERTICAL, 10);
view->SetViewColor(255, 255, 255);
// Set the layout
SetLayout(new BGroupLayout(B_HORIZONTAL));
AddChild(BGroupLayoutBuilder(view)
.Add(fToolbar)
.Add(fProxyView)
);
ResizeTo(500, 500);
AddShortcut('N', B_COMMAND_KEY, new BMessage(kMsgNewTab), this);
AddShortcut('W', B_COMMAND_KEY, new BMessage(kMsgCloseTab), this);
}
示例7: SetLayout
void
MainWindow::_CreateGUI()
{
SetLayout(new BGroupLayout(B_HORIZONTAL));
BGridLayout* layout = new BGridLayout();
layout->SetSpacing(0, 0);
BView* rootView = new BView("root view", 0, layout);
AddChild(rootView);
rootView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
BGroupView* leftTopView = new BGroupView(B_VERTICAL, 0);
layout->AddView(leftTopView, 0, 0);
// views along the left side
leftTopView->AddChild(_CreateMenuBar());
float splitWidth = 13 * be_plain_font->Size();
BSize minSize = leftTopView->MinSize();
splitWidth = std::max(splitWidth, minSize.width);
leftTopView->SetExplicitMaxSize(BSize(splitWidth, B_SIZE_UNSET));
leftTopView->SetExplicitMinSize(BSize(splitWidth, B_SIZE_UNSET));
BGroupView* iconPreviews = new BGroupView(B_HORIZONTAL);
iconPreviews->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
iconPreviews->GroupLayout()->SetSpacing(5);
// icon previews
fIconPreview16Folder = new IconView(BRect(0, 0, 15, 15),
"icon preview 16 folder");
fIconPreview16Menu = new IconView(BRect(0, 0, 15, 15),
"icon preview 16 menu");
fIconPreview16Menu->SetLowColor(ui_color(B_MENU_BACKGROUND_COLOR));
fIconPreview32Folder = new IconView(BRect(0, 0, 31, 31),
"icon preview 32 folder");
fIconPreview32Desktop = new IconView(BRect(0, 0, 31, 31),
"icon preview 32 desktop");
fIconPreview32Desktop->SetLowColor(ui_color(B_DESKTOP_COLOR));
fIconPreview64 = new IconView(BRect(0, 0, 63, 63), "icon preview 64");
fIconPreview64->SetLowColor(ui_color(B_DESKTOP_COLOR));
BGroupView* smallPreviews = new BGroupView(B_VERTICAL);
smallPreviews->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
smallPreviews->GroupLayout()->SetSpacing(5);
smallPreviews->AddChild(fIconPreview16Folder);
smallPreviews->AddChild(fIconPreview16Menu);
BGroupView* mediumPreviews = new BGroupView(B_VERTICAL);
mediumPreviews->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
mediumPreviews->GroupLayout()->SetSpacing(5);
mediumPreviews->AddChild(fIconPreview32Folder);
mediumPreviews->AddChild(fIconPreview32Desktop);
// iconPreviews->AddChild(fIconPreview48);
iconPreviews->AddChild(smallPreviews);
iconPreviews->AddChild(mediumPreviews);
iconPreviews->AddChild(fIconPreview64);
iconPreviews->SetExplicitMaxSize(BSize(B_SIZE_UNSET, B_SIZE_UNLIMITED));
leftTopView->AddChild(iconPreviews);
BGroupView* leftSideView = new BGroupView(B_VERTICAL, 0);
layout->AddView(leftSideView, 0, 1);
leftSideView->SetExplicitMaxSize(BSize(splitWidth, B_SIZE_UNSET));
// path menu and list view
BMenuBar* menuBar = new BMenuBar("path menu bar");
menuBar->AddItem(fPathMenu);
leftSideView->AddChild(menuBar);
fPathListView = new PathListView(BRect(0, 0, splitWidth, 100),
"path list view", new BMessage(MSG_PATH_SELECTED), this);
BView* scrollView = new BScrollView("path list scroll view",
fPathListView, B_FOLLOW_NONE, 0, false, true, B_NO_BORDER);
leftSideView->AddChild(scrollView);
// shape list view
menuBar = new BMenuBar("shape menu bar");
menuBar->AddItem(fShapeMenu);
leftSideView->AddChild(menuBar);
fShapeListView = new ShapeListView(BRect(0, 0, splitWidth, 100),
"shape list view", new BMessage(MSG_SHAPE_SELECTED), this);
scrollView = new BScrollView("shape list scroll view",
fShapeListView, B_FOLLOW_NONE, 0, false, true, B_NO_BORDER);
leftSideView->AddChild(scrollView);
// transformer list view
menuBar = new BMenuBar("transformer menu bar");
menuBar->AddItem(fTransformerMenu);
leftSideView->AddChild(menuBar);
//.........这里部分代码省略.........