当前位置: 首页>>代码示例>>C++>>正文


C++ BGridLayout::SetMinColumnWidth方法代码示例

本文整理汇总了C++中BGridLayout::SetMinColumnWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ BGridLayout::SetMinColumnWidth方法的具体用法?C++ BGridLayout::SetMinColumnWidth怎么用?C++ BGridLayout::SetMinColumnWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BGridLayout的用法示例。


在下文中一共展示了BGridLayout::SetMinColumnWidth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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());
	}
}
开发者ID:HaikuArchives,项目名称:ArtPaint,代码行数:34,代码来源:TransparencyTool.cpp

示例2: NumberSliderControl

HairyBrushToolConfigView::HairyBrushToolConfigView(DrawingTool* tool)
	: DrawingToolConfigView(tool)
{
	if (BLayout* layout = GetLayout()) {
		BMessage* message = new BMessage(OPTION_CHANGED);
		message->AddInt32("option", PRESSURE_OPTION);
		message->AddInt32("value", tool->GetCurrentValue(PRESSURE_OPTION));

		fBrushSize =
			new NumberSliderControl(StringServer::ReturnString(SIZE_STRING),
			"0", message, 2, 50, false);
		layout->AddView(fBrushSize);

		message = new BMessage(OPTION_CHANGED);
		message->AddInt32("option", SIZE_OPTION);
		message->AddInt32("value", tool->GetCurrentValue(SIZE_OPTION));

		fBrushHairs =
			new NumberSliderControl(StringServer::ReturnString(HAIRS_STRING),
			"0", message, 5, 100, false);
		layout->AddView(fBrushHairs);

		fColorAmount =
			new BSlider("", StringServer::ReturnString(COLOR_AMOUNT_STRING),
			new BMessage(COLOR_AMOUNT_CHANGED), 1, 500, B_HORIZONTAL,
			B_TRIANGLE_THUMB);
		fColorAmount->SetLimitLabels(StringServer::ReturnString(LITTLE_STRING),
			StringServer::ReturnString(MUCH_STRING));
		fColorAmount->SetValue(tool->GetCurrentValue(CONTINUITY_OPTION));

		fColorVariance =
			new BSlider("", StringServer::ReturnString(COLOR_VARIANCE_STRING),
			new BMessage(COLOR_VARIANCE_CHANGED), 0, 128, B_HORIZONTAL,
			B_TRIANGLE_THUMB);
		fColorVariance->SetLimitLabels(StringServer::ReturnString(NONE_STRING),
			StringServer::ReturnString(RANDOM_STRING));
		fColorVariance->SetValue(tool->GetCurrentValue(TOLERANCE_OPTION));

		BGridLayout* gridLayout = BGridLayoutBuilder(5.0, 5.0)
			.Add(fBrushSize->LabelLayoutItem(), 0, 0)
			.Add(fBrushSize->TextViewLayoutItem(), 1, 0)
			.Add(fBrushSize->Slider(), 2, 0)
			.Add(fBrushHairs->LabelLayoutItem(), 0, 1)
			.Add(fBrushHairs->TextViewLayoutItem(), 1, 1)
			.Add(fBrushHairs->Slider(), 2, 1)
			.SetInsets(5.0, 0.0, 0.0, 0.0);
		gridLayout->SetMaxColumnWidth(1, StringWidth("1000"));
		gridLayout->SetMinColumnWidth(2, StringWidth("SLIDERSLIDERSLIDER"));

		layout->AddItem(BGroupLayoutBuilder(B_VERTICAL)
			.Add(gridLayout)
			.Add(fColorAmount)
			.Add(fColorVariance)
		);
	}
}
开发者ID:HaikuArchives,项目名称:ArtPaint,代码行数:56,代码来源:HairyBrushTool.cpp


注:本文中的BGridLayout::SetMinColumnWidth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。