本文整理汇总了C++中BStringView::LowColor方法的典型用法代码示例。如果您正苦于以下问题:C++ BStringView::LowColor方法的具体用法?C++ BStringView::LowColor怎么用?C++ BStringView::LowColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BStringView
的用法示例。
在下文中一共展示了BStringView::LowColor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: unlimited
void
MediaWindow::_MakeEmptyParamView()
{
fParamWeb = NULL;
BStringView* stringView = new BStringView("noControls",
B_TRANSLATE("This hardware has no controls."));
BSize unlimited(B_SIZE_UNLIMITED, B_SIZE_UNLIMITED);
stringView->SetExplicitMaxSize(unlimited);
BAlignment centered(B_ALIGN_HORIZONTAL_CENTER,
B_ALIGN_VERTICAL_CENTER);
stringView->SetExplicitAlignment(centered);
stringView->SetAlignment(B_ALIGN_CENTER);
fContentLayout->AddView(stringView);
fContentLayout->SetVisibleItem(fContentLayout->CountItems() - 1);
rgb_color panel = stringView->LowColor();
stringView->SetHighColor(tint_color(panel,
B_DISABLED_LABEL_TINT));
}
示例2: _
// constructor
NavigationInfoPanel::NavigationInfoPanel(BWindow* parent,
const BMessage& message, const BMessenger& target)
: BWindow(BRect(0, 0, 200, 30), "Navigation Info", B_FLOATING_WINDOW_LOOK,
B_FLOATING_SUBSET_WINDOW_FEEL,
B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE | B_NOT_V_RESIZABLE)
, fMessage(message)
, fTarget(target)
{
// create the interface and resize to fit
BRect frame = Bounds();
frame.InsetBy(5, 5);
frame.bottom = frame.top + 15;
// label string view
fLabelView = new BStringView(frame, "label", kLabel,
B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP);
fLabelView->ResizeToPreferred();
frame = fLabelView->Frame();
// target clip text control
frame.OffsetBy(0, frame.Height() + 5);
fTargetClipTC = new BTextControl(frame, "clip id",
"Target Playlist ID", "", new BMessage(MSG_INVOKE),
B_FOLLOW_TOP | B_FOLLOW_LEFT_RIGHT);
fTargetClipTC->ResizeToPreferred();
frame = fTargetClipTC->Frame();
// help string view
frame.OffsetBy(0, frame.Height() + 5);
BStringView* helpView = new BStringView(frame, "help",
"Drag and drop a playlist clip here.",
B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP);
BFont font;
helpView->GetFont(&font);
font.SetFace(B_ITALIC_FACE);
font.SetSize(font.Size() * 0.9);
helpView->SetFont(&font);
helpView->SetAlignment(B_ALIGN_CENTER);
helpView->ResizeToPreferred();
// parent view
frame = fLabelView->Frame() | fTargetClipTC->Frame() | helpView->Frame();
frame.InsetBy(-5, -5);
fInfoView = new InfoView(frame, this);
fInfoView->AddChild(fLabelView);
fInfoView->AddChild(fTargetClipTC);
fInfoView->AddChild(helpView);
// resize to fit and adjust size limits
ResizeTo(fInfoView->Frame().Width(), fInfoView->Frame().Height());
AddChild(fInfoView);
float minWidth, maxWidth, minHeight, maxHeight;
GetSizeLimits(&minWidth, &maxWidth, &minHeight, &maxHeight);
minWidth = Frame().Width();
minHeight = maxHeight = Frame().Height();
SetSizeLimits(minWidth, maxWidth, minHeight, maxHeight);
// modify the high color after the help view is attached to a window
helpView->SetHighColor(tint_color(helpView->LowColor(),
B_DISABLED_LABEL_TINT));
helpView->SetFlags(helpView->Flags() | B_FULL_UPDATE_ON_RESIZE);
// help the buggy BeOS BStringView (when text alignment != left...)
fInfoView->SetEventMask(B_POINTER_EVENTS);
// resize controls to the same (maximum) width
float maxControlWidth = fLabelView->Frame().Width();
maxControlWidth = max_c(maxControlWidth, fTargetClipTC->Frame().Width());
maxControlWidth = max_c(maxControlWidth, helpView->Frame().Width());
fLabelView->ResizeTo(maxControlWidth, fLabelView->Frame().Height());
fTargetClipTC->ResizeTo(maxControlWidth, fTargetClipTC->Frame().Height());
helpView->ResizeTo(maxControlWidth, helpView->Frame().Height());
// center above parent window
BAutolock _(parent);
frame = Frame();
BRect parentFrame = parent->Frame();
MoveTo((parentFrame.left + parentFrame.right - frame.Width()) / 2,
(parentFrame.top + parentFrame.bottom - frame.Height()) / 2);
AddToSubset(parent);
}