本文整理汇总了C++中Bar::ToolBreak方法的典型用法代码示例。如果您正苦于以下问题:C++ Bar::ToolBreak方法的具体用法?C++ Bar::ToolBreak怎么用?C++ Bar::ToolBreak使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bar
的用法示例。
在下文中一共展示了Bar::ToolBreak方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateToolBar
void FormEdit::CreateToolBar(Bar& bar)
{
Vector<int> sel = _View.GetSelected();
int count = _View.IsLayout() ? _View.GetObjects()->GetCount() : 0;
dword first;
bool align = true;
bool valign = true;
if (sel.GetCount() == 0)
{
count = 0;
}
else if (sel.GetCount() == 1)
{
_View.SetHAlign( (*_View.GetObjects())[ sel[0] ].GetHAlign() );
_View.SetVAlign( (*_View.GetObjects())[ sel[0] ].GetVAlign() );
}
else
{
for (int i = 0; i < sel.GetCount(); ++i)
{
if (i == 0) first = (*_View.GetObjects())[ sel[i] ].GetHAlign();
if (first != (*_View.GetObjects())[ sel[i] ].GetHAlign()) { align = false; break; }
}
for (int i = 0; i < sel.GetCount(); ++i)
{
if (i == 0) first = (*_View.GetObjects())[ sel[i] ].GetVAlign();
if (first != (*_View.GetObjects())[ sel[i] ].GetVAlign()) { valign = false; break; }
}
}
bar.Add(FormEditImg::New(), THISBACK(NewFile)).Tip(t_("Create new form..."));
bar.Add(FormEditImg::Open(), THISBACK(OpenFile)).Tip(t_("Open form..."));
bar.Add(FormEditImg::Save(), THISBACK(SaveFile)).Enable(!IsProjectSaved() && _View.IsLayout())
.Tip(t_("Save changes to file..."));
bar.Add(FormEditImg::SaveAs(), THISBACK(SaveAsFile)).Enable(_View.IsLayout())
.Tip(t_("Save form to another file..."));
bar.Separator();
bar.Add(FormViewImg::ViewModeAsIs(), THISBACK1(SetViewMode, VIEW_MODE_AS_IS))
.Check(_ViewMode == VIEW_MODE_AS_IS).Enable(_View.IsLayout())
.Tip(t_("Switch to as-is view..."));
bar.Add(FormViewImg::ViewModeInfo(), THISBACK1(SetViewMode, VIEW_MODE_INFO))
.Check(_ViewMode == VIEW_MODE_INFO).Enable(_View.IsLayout())
.Tip(t_("Switch to detailed view..."));
bar.Add(FormViewImg::ViewModeWireframe(), THISBACK1(SetViewMode, VIEW_MODE_WIREFRAME))
.Check(_ViewMode == VIEW_MODE_WIREFRAME).Enable(_View.IsLayout())
.Tip(t_("Switch to solid view..."));
bar.Add(FormViewImg::GridBinding(), THISBACK2(ToggleFlag, "Grid.Binding", false))
.Check(GetFlag("Grid.Binding", false)).Enable(_View.IsLayout())
.Tip(t_("Bind to grid..."));
bar.Add(FormEditImg::Coloring(), THISBACK(ToggleColoring))
.Check(GetFlag("View.Coloring", true)).Enable(_View.IsLayout())
.Tip(t_("Coloring of the objects..."));
bar.Separator();
bar.Add(FormViewImg::LayoutProperties(), THISBACK(OpenLayoutProperties))
.Enable(_View.IsLayout())
.Tip(t_("Change form settings..."));
bar.Add(FormViewImg::Layout(), THISBACK(TestLayout))
.Enable(_View.IsLayout())
.Tip(t_("Preview"));
bar.Separator();
bar.Add(FormEditImg::FontZoom(), THISBACK(StdFontZoom)).Check(IsStandardZoom())
.Enable(_View.IsLayout())
.Tip(t_("Use system font..."));
bar.Add(FormEditImg::FontZoomStd(), THISBACK(SmallFontZoom)).Check(IsSmallZoom())
.Enable(_View.IsLayout())
.Tip(t_("Use larger font..."));
bar.Add(FormEditImg::FontZoomLarge(), THISBACK(LargeFontZoom)).Check(IsLargeZoom())
.Enable(_View.IsLayout())
.Tip(t_("Use largest font..."));
bar.Separator();
bar.AddTool(_GUILayouts, _ToolSize);
_GUILayouts.Enable(_GUILayouts.GetCount());
_GUILayouts.GetButton(2).Enable(_GUILayouts.GetCount() > 1
&& (~_GUILayouts).ToString() != t_(" Default"));
_GUILayouts.GetButton(3).Enable(_GUILayouts.GetCount());
bar.ToolBreak();
bar.Add(FormViewImg::SpringLeft(), THISBACK2(SetSprings, Ctrl::LEFT, -1))
.Check(_View.GetHAlign() == Ctrl::LEFT && align).Enable(count)
.Tip(t_("Spring left side"));
bar.Add(FormViewImg::SpringRight(), THISBACK2(SetSprings, Ctrl::RIGHT, -1))
.Check(_View.GetHAlign() == Ctrl::RIGHT && align).Enable(count)
.Tip(t_("Spring right side"));
bar.Add(FormViewImg::SpringHSize(), THISBACK2(SetSprings, Ctrl::SIZE, -1))
//.........这里部分代码省略.........