本文整理汇总了C++中PanelControl::Create方法的典型用法代码示例。如果您正苦于以下问题:C++ PanelControl::Create方法的具体用法?C++ PanelControl::Create怎么用?C++ PanelControl::Create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PanelControl
的用法示例。
在下文中一共展示了PanelControl::Create方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: layout
void
WaypointDetailsWidget::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
for (const auto &i : waypoint.files_embed) {
if (images.full())
break;
try {
if (!images.append().LoadFile(LocalPath(i.c_str())))
images.shrink(images.size() - 1);
} catch (const std::exception &e) {
LogFormat("Failed to load %s: %s",
(const char *)NarrowPathName(Path(i.c_str())),
e.what());
images.shrink(images.size() - 1);
}
}
const Layout layout(rc, waypoint);
WindowStyle dock_style;
dock_style.Hide();
dock_style.ControlParent();
WindowStyle button_style;
button_style.Hide();
button_style.TabStop();
if (allow_navigation)
goto_button.Create(parent, look.button, _("GoTo"), layout.goto_button,
button_style, *this, GOTO);
if (!images.empty()) {
magnify_button.Create(parent, layout.magnify_button, button_style,
new SymbolButtonRenderer(look.button, _T("+")),
*this, MAGNIFY);
shrink_button.Create(parent, layout.shrink_button, button_style,
new SymbolButtonRenderer(look.button, _T("-")),
*this, SHRINK);
}
if (allow_navigation) {
previous_button.Create(parent, layout.previous_button, button_style,
new SymbolButtonRenderer(look.button, _T("<")),
*this, PREVIOUS);
next_button.Create(parent, layout.next_button, button_style,
new SymbolButtonRenderer(look.button, _T(">")),
*this, NEXT);
}
close_button.Create(parent, look.button, _("Close"), layout.close_button,
button_style, dialog, mrOK);
info_dock.Create(parent, layout.main, dock_style);
info_dock.SetWidget(&info_widget);
details_panel.Create(parent, look, layout.main, dock_style);
details_text.Create(details_panel, layout.details_text);
details_text.SetFont(look.text_font);
details_text.SetText(waypoint.details.c_str());
#ifdef HAVE_RUN_FILE
const unsigned num_files = std::distance(waypoint.files_external.begin(),
waypoint.files_external.end());
if (num_files > 0) {
file_list.Create(details_panel, layout.file_list,
WindowStyle(), layout.file_list_item_height);
file_list.SetItemRenderer(&file_list_handler);
file_list.SetCursorHandler(&file_list_handler);
file_list.SetLength(num_files);
}
#endif
commands_dock.Create(parent, layout.main, dock_style);
commands_dock.SetWidget(&commands_widget);
if (!images.empty())
image_window.Create(parent, layout.main, dock_style,
[this](Canvas &canvas, const PixelRect &rc){
OnImagePaint(canvas, rc);
});
last_page = 2 + images.size();
}