本文整理汇总了C++中display_t类的典型用法代码示例。如果您正苦于以下问题:C++ display_t类的具体用法?C++ display_t怎么用?C++ display_t使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了display_t类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: assert
platform_display_type insert<reveal_t>(display_t& display,
platform_display_type& parent,
reveal_t& element)
{
assert(!element.control_m);
boost::shared_ptr<GG::StyleFactory> style = GG::GUI::GetGUI()->GetStyleFactory();
element.control_m = style->NewButton(GG::X0, GG::Y0, GG::X(100), GG::Y(100),
"", style->DefaultFont(), GG::CLR_GRAY);
const GG::SubTexture& subtexture =
element.current_value_m == element.show_value_m ? showing_image() : hidden_image();
element.control_m->SetUnpressedGraphic(subtexture);
element.control_m->SetPressedGraphic(subtexture);
element.control_m->SetRolloverGraphic(subtexture);
GG::Connect(element.control_m->ClickedSignal,
boost::bind(&reveal_clicked, boost::ref(element)));
if (!element.alt_text_m.empty())
implementation::set_control_alt_text(element.control_m, element.alt_text_m);
platform_display_type result(display.insert(parent, element.control_m));
if (element.using_label_m)
display.insert(parent, get_display(element.name_m));
return result;
}
开发者ID:Ablu,项目名称:freeorion,代码行数:29,代码来源:platform_reveal.cpp
示例2: insert
platform_display_type insert<color_button_t>(display_t& display,
platform_display_type& parent,
color_button_t& element)
{
if (element.using_label_m)
insert(display, parent, element.name_m);
assert(!element.control_m);
ColorButton* button = new ColorButton(GG::X(element.width_m),
GG::Y(element.height_m),
element.border_color_m,
2,
element.dialog_color_m,
element.dialog_border_color_m,
element.dialog_text_color_m);
element.original_size_m = GG::Pt(button->Width(), button->Height());
element.control_m = button;
GG::Connect(button->ColorChanged, boost::bind(&color_changed, boost::ref(element)));
if (!element.alt_text_m.empty())
adobe::implementation::set_control_alt_text(element.control_m, element.alt_text_m);
return display.insert(parent, element.control_m);
}
开发者ID:Syntaf,项目名称:GG,代码行数:27,代码来源:platform_color_button.cpp
示例3: assert
platform_display_type insert<toggle_t>(display_t& display,
platform_display_type& parent,
toggle_t& element)
{
assert(!element.control_m);
element.control_m = ::CreateWindowExW( WS_EX_COMPOSITED | WS_EX_TRANSPARENT, L"STATIC",
NULL,
WS_CHILD | WS_VISIBLE | SS_BITMAP | SS_NOTIFY,
0, 0, 100, 20,
parent,
0,
::GetModuleHandle(NULL),
NULL);
if (element.control_m == NULL)
ADOBE_THROW_LAST_ERROR;
set_font(element.control_m, EP_EDITTEXT); // REVISIT (fbrereto) : a better type?
::SetWindowSubclass(element.control_m, &toggle_subclass_proc, reinterpret_cast<UINT_PTR>(&element), 0);
if (!element.alt_text_m.empty())
implementation::set_control_alt_text(element.control_m, element.alt_text_m);
return display.insert(parent, element.control_m);
}
开发者ID:sehe,项目名称:legacy,代码行数:27,代码来源:platform_toggle.cpp
示例4: width
template <> platform_display_type insert<presets_t>(display_t& display,
platform_display_type& parent,
presets_t& element)
{
assert(!element.control_m);
insert(display, parent, element.category_popup_m);
insert(display, parent, element.popup_m);
GG::X width(26);
GG::Y height(21);
boost::shared_ptr<GG::StyleFactory> style = GG::GUI::GetGUI()->GetStyleFactory();
element.control_m = style->NewButton(GG::X0, GG::Y0, width, height,
"", style->DefaultFont(), GG::CLR_GRAY);
reset_textures(element);
GG::Connect(element.control_m->ClickedSignal,
boost::bind(&presets_button_clicked, boost::ref(element)));
element.popup_m.monitor(boost::bind(&presets_t::do_imbue, boost::ref(element), _1));
if (!element.alt_text_m.empty())
adobe::implementation::set_control_alt_text(element.control_m, element.alt_text_m);
return display.insert(parent, element.control_m);
}
开发者ID:Ablu,项目名称:freeorion,代码行数:27,代码来源:platform_presets.cpp
示例5: parent_hwnd
platform_display_type insert<group_t>(display_t& display,
platform_display_type& parent,
group_t& element)
{
HWND parent_hwnd(parent);
element.control_m = ::CreateWindowExW(WS_EX_CONTROLPARENT | WS_EX_COMPOSITED | WS_EX_TRANSPARENT,
L"BUTTON",
hackery::convert_utf(element.name_m).c_str(),
WS_CHILD | WS_VISIBLE | BS_GROUPBOX,
0, 0, 10, 10,
parent_hwnd,
0,
::GetModuleHandle(NULL),
NULL);
if (element.control_m == NULL)
ADOBE_THROW_LAST_ERROR;
set_font(element.control_m, BP_GROUPBOX);
::SetWindowSubclass(element.control_m, &group_subclass_proc, reinterpret_cast<UINT_PTR>(&element), 0);
return display.insert(parent, element.control_m);
}
开发者ID:ilelann,项目名称:adobe_platform_libraries,代码行数:25,代码来源:platform_group.cpp
示例6: initialize
platform_display_type insert<image_t>(display_t& display,
platform_display_type& parent,
image_t& element)
{
initialize(element, parent);
return display.insert(parent, element.control_m.get());
}
开发者ID:ilelann,项目名称:adobe_platform_libraries,代码行数:8,代码来源:platform_image.cpp
示例7: parent_hwnd
platform_display_type insert<display_number_t>(display_t& display,
platform_display_type& parent,
display_number_t& element)
{
HWND parent_hwnd(parent);
element.initialize(parent_hwnd);
return display.insert(parent, get_display(element));
}
开发者ID:ilelann,项目名称:legacy,代码行数:8,代码来源:platform_display_number.cpp
示例8: parent_hwnd
platform_display_type insert<tab_group_t>(display_t& display,
platform_display_type& parent,
tab_group_t& element)
{
HWND parent_hwnd(parent);
element.initialize(parent_hwnd);
return display.insert(parent, element.control_m);
}
开发者ID:tfiner,项目名称:adobe_asl,代码行数:10,代码来源:platform_tab_group.cpp
示例9: parent_hwnd
platform_display_type insert<checkbox_t>(display_t& display,
platform_display_type& parent,
checkbox_t& element)
{
HWND parent_hwnd(parent);
initialize(element, parent_hwnd);
return display.insert(parent, element.control_m);
}
开发者ID:ilelann,项目名称:adobe_platform_libraries,代码行数:10,代码来源:platform_checkbox.cpp
示例10: initialize
platform_display_type insert<checkbox_t>(display_t& display,
platform_display_type& parent,
checkbox_t& element)
{
::HIViewRef parent_ref(parent);
initialize(element, parent_ref);
return display.insert(parent, element.control_m);
}
开发者ID:ilelann,项目名称:adobe_platform_libraries,代码行数:10,代码来源:platform_checkbox.cpp
示例11: assert
platform_display_type insert<window_t>(display_t& display,
platform_display_type& parent,
window_t& element)
{
assert(!element.window_m);
assert(!parent);
element.window_m = new GG::EveDialog(element, element.color_m, element.text_color_m);
return display.insert(parent, element.window_m);
}
开发者ID:Syntaf,项目名称:GG,代码行数:11,代码来源:platform_window.cpp
示例12: parent_hwnd
platform_display_type insert<link_t>(display_t& display,
platform_display_type& parent,
link_t& element)
{
HWND parent_hwnd(parent);
element.control_m = ::CreateWindowExW(WS_EX_COMPOSITED, L"STATIC",
NULL,
WS_CHILD | WS_VISIBLE,
0, 0, 50, 50,
parent_hwnd,
0,
::GetModuleHandle(NULL),
NULL);
if (element.control_m == NULL)
ADOBE_THROW_LAST_ERROR;
if (!element.alt_text_m.empty())
implementation::set_control_alt_text(element.control_m, element.alt_text_m);
::SetWindowSubclass(element.control_m, link_subclass_proc, reinterpret_cast<UINT_PTR>(&element), 0);
element.link_icon_m = ::CreateWindowExW(WS_EX_COMPOSITED | WS_EX_TRANSPARENT, L"STATIC",
NULL,
WS_CHILD | WS_VISIBLE | SS_BITMAP | SS_NOTIFY,
0, 0, 9, 16,
parent_hwnd,
0,
::GetModuleHandle(NULL),
NULL);
if (element.link_icon_m == NULL)
ADOBE_THROW_LAST_ERROR;
::SendMessage(element.link_icon_m, STM_SETIMAGE, IMAGE_BITMAP, (LPARAM) link_bitmap());
display.insert(parent, element.link_icon_m);
return display.insert(parent, element.control_m);
}
开发者ID:ilelann,项目名称:adobe_platform_libraries,代码行数:40,代码来源:platform_link.cpp
示例13: assert
platform_display_type insert<tab_group_t>(display_t& display,
platform_display_type& parent,
tab_group_t& element)
{
assert (!element.control_m);
// This probably looks odd. The interface of tab groups in Eve is wildly
// different from that of GG's TabWnd. The most expedient way to get all
// the Wnds in the right styles and still match the Eve interface was to
// replace the built-in TabBar inside of TabWnd with one created here.
boost::shared_ptr<GG::StyleFactory> style = GG::GUI::GetGUI()->GetStyleFactory();
element.tab_bar_m = style->NewTabBar(GG::X0, GG::Y0, GG::X(100),
style->DefaultFont(), element.color_m, element.text_color_m,
element.style_m);
element.tab_bar_m->SetMinSize(GG::Pt(element.tab_bar_m->MinSize().x, element.tab_bar_m->Height()));
element.control_m = style->NewTabWnd(GG::X0, GG::Y0, GG::X(100), element.tab_bar_m->Height() + 20,
style->DefaultFont(), element.color_m, element.text_color_m,
element.style_m);
GG::Layout* layout = element.control_m->DetachLayout();
delete layout;
layout = new GG::Layout(GG::X0, GG::Y0,
element.control_m->Width(), element.control_m->Height(),
2, 1);
layout->SetRowStretch(1, 1.0);
layout->Add(element.tab_bar_m, 0, 0);
layout->Add(new Placeholder, 1, 0);
element.control_m->SetLayout(layout);
GG::Connect(element.tab_bar_m->TabChangedSignal,
boost::bind(&tab_changed, boost::ref(element), _1));
for (tab_group_t::tab_set_t::iterator
first(element.items_m.begin()), last(element.items_m.end());
first != last;
++first) {
element.tab_bar_m->AddTab(first->name_m);
}
element.color_proxy_m.initialize(
boost::bind(&GG::TabBar::SetColor, element.tab_bar_m, _1)
);
element.text_color_proxy_m.initialize(
boost::bind(&GG::TabBar::SetTextColor, element.tab_bar_m, _1)
);
return display.insert(parent, element.control_m);
}
开发者ID:Syntaf,项目名称:GG,代码行数:51,代码来源:platform_tab_group.cpp
示例14: parent_hwnd
platform_display_type insert<popup_t>(display_t& display, platform_display_type& parent, popup_t& element)
{
HWND parent_hwnd(parent);
if (element.using_label_m)
insert(display, parent, element.name_m);
::initialize(element, parent_hwnd);
::message_menu_item_set(element);
platform_display_type result(display.insert(parent, element.control_m));
return result;
}
开发者ID:ilelann,项目名称:adobe_platform_libraries,代码行数:14,代码来源:platform_popup.cpp
示例15: parent_hwnd
platform_display_type insert<edit_text_t>(display_t& display,
platform_display_type& parent,
edit_text_t& element)
{
HWND parent_hwnd(parent);
if (element.using_label_m)
{
insert(display, parent, element.get_label());
}
element.initialize(parent_hwnd);
return display.insert(parent, get_display(element));
}
开发者ID:sehe,项目名称:legacy,代码行数:15,代码来源:platform_edit_text.cpp
示例16: state
platform_display_type insert<button_t>(display_t& display,
platform_display_type& parent,
button_t& element)
{
assert(element.control_m == 0);
button_state_set_t::iterator state(button_default_state(element.state_set_m));
element.control_m =
implementation::Factory().NewButton(GG::X0, GG::Y0, GG::X1, implementation::StandardHeight(),
state->name_m, implementation::DefaultFont(),
element.color_m, element.text_color_m);
element.control_m->SetUnpressedGraphic(element.unpressed_m);
element.control_m->SetPressedGraphic(element.pressed_m);
element.control_m->SetRolloverGraphic(element.rollover_m);
const GG::X max_width =
std::max(element.unpressed_m.Empty() ? GG::X0 : element.unpressed_m.Width(),
std::max(element.pressed_m.Empty() ? GG::X0 : element.pressed_m.Width(),
element.rollover_m.Empty() ? GG::X0 : element.rollover_m.Width()));
const GG::Y max_height =
std::max(element.unpressed_m.Empty() ? GG::Y0 : element.unpressed_m.Height(),
std::max(element.pressed_m.Empty() ? GG::Y0 : element.pressed_m.Height(),
element.rollover_m.Empty() ? GG::Y0 : element.rollover_m.Height()));
const GG::X min_width =
std::min(element.unpressed_m.Empty() ? GG::X0 : element.unpressed_m.Width(),
std::min(element.pressed_m.Empty() ? GG::X0 : element.pressed_m.Width(),
element.rollover_m.Empty() ? GG::X0 : element.rollover_m.Width()));
const GG::Y min_height =
std::min(element.unpressed_m.Empty() ? GG::Y0 : element.unpressed_m.Height(),
std::min(element.pressed_m.Empty() ? GG::Y0 : element.pressed_m.Height(),
element.rollover_m.Empty() ? GG::Y0 : element.rollover_m.Height()));
if (max_width && max_height && min_width && min_height) {
element.control_m->SetMaxSize(GG::Pt(max_width, max_height));
element.control_m->SetMinSize(GG::Pt(min_width, min_height));
}
GG::Connect(element.control_m->ClickedSignal,
boost::bind(&button_clicked, boost::ref(element)));
if (!state->alt_text_m.empty())
implementation::set_control_alt_text(element.control_m, state->alt_text_m);
element.control_m->Disable(!element.enabled_m);
return display.insert(parent, element.control_m);
}
开发者ID:Syntaf,项目名称:GG,代码行数:48,代码来源:platform_button.cpp
示例17: parent_ref
platform_display_type insert<label_t>(display_t& display,
platform_display_type& parent,
label_t& element)
{
::HIViewRef parent_ref(parent);
initialize(element, parent_ref);
::HIViewRef ref(element.control_m.get());
platform_display_type result(display.insert(parent, ref));
element.subevent_m.handler_m.install(ref);
return result;
}
开发者ID:ilelann,项目名称:adobe_platform_libraries,代码行数:16,代码来源:platform_label.cpp
示例18:
platform_display_type insert<label_t>(display_t& display,
platform_display_type& parent,
label_t& element)
{
GG::X w = static_cast<int>(element.characters_m) * implementation::CharWidth();
GG::Pt extent = implementation::DefaultFont()->TextExtent(element.name_m, element.format_m, w);
element.window_m =
implementation::Factory().NewTextControl(GG::X0, GG::Y0, extent.x, extent.y,
element.name_m, implementation::DefaultFont(),
GG::CLR_BLACK, element.format_m);
if (!element.alt_text_m.empty())
implementation::set_control_alt_text(element.window_m, element.alt_text_m);
return display.insert(parent, get_display(element));
}
开发者ID:Ablu,项目名称:freeorion,代码行数:16,代码来源:platform_label.cpp
示例19: insert
platform_display_type insert<edit_text_t>(display_t& display,
platform_display_type& parent,
edit_text_t& element)
{
::HIViewRef parent_ref(parent);
if (element.using_label_m)
{
insert(display, parent, element.get_label());
}
initialize(element, parent_ref);
element.edit_text_handler_m.handler_m.install(element.control_m);
return display.insert(parent, get_display(element));
}
开发者ID:ilelann,项目名称:adobe_platform_libraries,代码行数:17,代码来源:platform_edit_text.cpp
示例20: assert
platform_display_type insert<slider_t>(display_t& display,
platform_display_type& parent,
slider_t& element)
{
assert(!element.control_m);
boost::shared_ptr<GG::StyleFactory> style = GG::GUI::GetGUI()->GetStyleFactory();
double min = element.format_m.at(0).cast<slider_t::model_type>();
double max = element.format_m.at(element.format_m.size() - 1).cast<slider_t::model_type>();
element.control_m =
style->NewDoubleSlider(GG::X0, GG::Y0, GG::X(100), GG::Y(100),
min, max, element.is_vertical_m ? GG::VERTICAL : GG::HORIZONTAL,
GG::GROOVED, GG::CLR_GRAY, 6);
GG::Connect(element.control_m->SlidSignal,
boost::bind(&slider_slid, boost::ref(element), _1, _2, _3));
return display.insert(parent, element.control_m);
}
开发者ID:Ablu,项目名称:freeorion,代码行数:19,代码来源:platform_slider.cpp
注:本文中的display_t类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论