本文整理汇总了C++中BGridLayout::View方法的典型用法代码示例。如果您正苦于以下问题:C++ BGridLayout::View方法的具体用法?C++ BGridLayout::View怎么用?C++ BGridLayout::View使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BGridLayout
的用法示例。
在下文中一共展示了BGridLayout::View方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NumberSliderControl
TransparencyToolConfigView::TransparencyToolConfigView(DrawingTool* tool)
: DrawingToolConfigView(tool)
{
if (BLayout* layout = GetLayout()) {
BMessage* message = new BMessage(OPTION_CHANGED);
message->AddInt32("option", SIZE_OPTION);
message->AddInt32("value", tool->GetCurrentValue(SIZE_OPTION));
fSizeSlider =
new NumberSliderControl(StringServer::ReturnString(SIZE_STRING),
"1", message, 1, 100, false);
layout->AddView(fSizeSlider);
message = new BMessage(OPTION_CHANGED);
message->AddInt32("option", PRESSURE_OPTION);
message->AddInt32("value", tool->GetCurrentValue(PRESSURE_OPTION));
fSpeedSlider =
new NumberSliderControl(StringServer::ReturnString(SPEED_STRING),
"1", message, 1, 100, false);
layout->AddView(fSpeedSlider);
BGridLayout* gridLayout = BGridLayoutBuilder(5.0, 5.0)
.Add(fSizeSlider->LabelLayoutItem(), 0, 0)
.Add(fSizeSlider->TextViewLayoutItem(), 1, 0)
.Add(fSizeSlider->Slider(), 2, 0)
.Add(fSpeedSlider->LabelLayoutItem(), 0, 1)
.Add(fSpeedSlider->TextViewLayoutItem(), 1, 1)
.Add(fSpeedSlider->Slider(), 2, 1);
gridLayout->SetMaxColumnWidth(1, StringWidth("1000"));
gridLayout->SetMinColumnWidth(2, StringWidth("SLIDERSLIDERSLIDER"));
layout->AddView(gridLayout->View());
}
}