コード例 #1
0
void ListViewLayoutThumbnails::create_parts()
{
	part_row = GUIThemePart(listview, "row");
	part_opener = GUIThemePart(listview, "row_opener");
	part_cell = GUIThemePart(listview, "cell");

	part_cell.set_pseudo_class("thumbnails", true);
	part_cell.set_pseudo_class(CssStr::normal, true);
	part_row.set_pseudo_class(CssStr::normal, true);

	size_icon.width = part_cell.get_property_int(CssStr::icon_width, "100");
	size_icon.height = part_cell.get_property_int(CssStr::icon_height, "100");

	Font font = part_cell.get_font();
	height_text = font.get_text_size(canvas, "l").height;

	size_cell = part_cell.get_css_size();
	height_row = size_cell.height;

	update_rows_cols_visible();

	lineedit_textrect_offset.left = part_cell.get_property_int("line-edit-offset-left", "0");
	lineedit_textrect_offset.top = part_cell.get_property_int("line-edit-offset-top", "0");
	lineedit_textrect_offset.bottom = part_cell.get_property_int("line-edit-offset-bottom", "0");
	lineedit_textrect_offset.right = part_cell.get_property_int("line-edit-offset-right", "0");

	GUIThemePart part_icon_selection(listview, "icon_selection");
	icon_sel_shrink_box = part_icon_selection.get_content_shrink_box();

	rect_cell_shrink = part_cell.get_content_shrink_box();
}
コード例 #2
0
ファイル: progressbar.cpp プロジェクト: wbyang1985/ClanLib
ProgressBar::ProgressBar(GUIComponent *parent)
: GUIComponent(parent, CssStr::ProgressBar::type_name), impl(std::make_shared<ProgressBar_Impl>())
{
	impl->progressbar = this;
	impl->part_progress = GUIThemePart(this, "progress");
	impl->part_chunk = GUIThemePart(this, "chunk");

	impl->progressbar->set_pseudo_class(CssStr::normal, true);

	func_process_message() = bind_member(impl.get(), &ProgressBar_Impl::on_process_message);
	func_render() = bind_member(impl.get(), &ProgressBar_Impl::on_render);
}
コード例 #3
0
void RadioButton_Impl::create_parts()
{
	part_checker = GUIThemePart(radio, CssStr::RadioButton::part_checker);
	part_checker.set_pseudo_class(CssStr::hover, false);
	part_checker.set_pseudo_class(CssStr::normal, true);
	part_checker.set_pseudo_class(CssStr::pressed, false);
	part_checker.set_pseudo_class(CssStr::checked, false);
	part_checker.set_pseudo_class(CssStr::indeterminated, false);
	part_checker.set_pseudo_class(CssStr::unchecked, true);
	part_checker.set_pseudo_class(CssStr::disabled, false);

	part_focus = GUIThemePart(radio, CssStr::RadioButton::part_focus);
}
コード例 #4
0
ファイル: window.cpp プロジェクト: wbyang1985/ClanLib
void Window_Impl::create_parts()
{
	if (has_frame)
	{
		part_caption = GUIThemePart(window, CssStr::Window::part_caption);
		part_frameleft = GUIThemePart(window, CssStr::Window::part_frameleft);
		part_frameright = GUIThemePart(window, CssStr::Window::part_frameright);
		part_framebottom = GUIThemePart(window, CssStr::Window::part_framebottom);
		part_buttonclose = GUIThemePart(window, CssStr::Window::part_buttonclose);

		part_buttonclose.set_pseudo_class(CssStr::normal, true);
	}

}
コード例 #5
0
ファイル: ribbon_menu.cpp プロジェクト: Cassie90/ClanLib
RibbonMenu::RibbonMenu(GUIComponent *owner)
: GUIComponent(owner, RibbonMenu_Impl::create_toplevel_description(), "ribbon-menu"), impl(new RibbonMenu_Impl)
{
	impl->component = this;
	func_render().set(impl.get(), &RibbonMenu_Impl::on_render);
	func_resized().set(impl.get(), &RibbonMenu_Impl::on_resized);
	impl->part_menu_item = GUIThemePart(this, "menu-item");
	impl->part_menu_item_selected = GUIThemePart(this, "menu-item");
	impl->part_menu_item_selected.set_pseudo_class("selected", true);
	impl->part_menu_item_separator = GUIThemePart(this, "menu-item");
	impl->part_menu_item_separator.set_pseudo_class("separator", true);

	impl->slot_filter = owner->get_gui_manager().sig_filter_message().connect(impl.get(), &RibbonMenu_Impl::on_filter_message);
}
コード例 #6
0
ファイル: workspace.cpp プロジェクト: Cassie90/ClanLib
Workspace::Workspace(GUIComponent *main_window)
: GUIComponent(main_window, "workspace"), root_docking_group(0), next_dockinggroup_id(1)
{
	part_empty = GUIThemePart(this, "empty-center");
	_instance = this;
	func_render().set(this, &Workspace::on_render);

	root_docking_group = new DockingGroup(this);
}
コード例 #7
0
ファイル: tab_header.cpp プロジェクト: Cassie90/ClanLib
TabHeader::TabHeader(GUIComponent *parent)
: GUIComponent(parent, CssStr::Tab::Header::type_name), impl(new TabHeader_Impl)
{
	set_focus_policy(focus_local);
	impl->component = this;
	func_process_message().set(impl.get(), &TabHeader_Impl::on_process_message);
	func_render().set(impl.get(), &TabHeader_Impl::on_render);
	// todo: enablemode, resize

	impl->part_focus = GUIThemePart(this, CssStr::Tab::Header::part_focus);
	impl->first_tab_x_offset = get_property_int(CssStr::first_tab_x_offset, "0");

}
コード例 #8
0
void ToolBar_Impl::create_parts()
{
    toolbar->set_pseudo_class(CssStr::horizontal, true);
    part_item_normal = GUIThemePart(toolbar, CssStr::ToolBar::part_item);
    part_item_normal.set_pseudo_class(CssStr::normal, true);
    part_item_disabled = GUIThemePart(toolbar, CssStr::ToolBar::part_item);
    part_item_disabled.set_pseudo_class(CssStr::disabled, true);
    part_item_pressed = GUIThemePart(toolbar, CssStr::ToolBar::part_item);
    part_item_pressed.set_pseudo_class(CssStr::pressed, true);
    part_item_hot = GUIThemePart(toolbar, CssStr::ToolBar::part_item);
    part_item_hot.set_pseudo_class(CssStr::hover, true);
    part_item_on = GUIThemePart(toolbar, CssStr::ToolBar::part_item);
    part_item_on.set_pseudo_class(CssStr::on, true);

    size_icon.width = part_item_normal.get_property_int(CssStr::icon_width, "0");
    size_icon.height = part_item_normal.get_property_int(CssStr::icon_height, "0");
    std::string str_alignment = toolbar->get_property(CssStr::layout, "left");
    if (str_alignment == "center")
        layout = layout_center;
    else
        layout = layout_left;

    need_layout_update = true;
}
コード例 #9
0
ファイル: popupmenu_window.cpp プロジェクト: Cassie90/ClanLib
void PopupMenuWindow::create_parts()
{
	part_item_row = GUIThemePart(this, CssStr::PopupMenuWindow::part_item_row);
	part_item_icon = GUIThemePart(this, CssStr::PopupMenuWindow::part_item_icon);
	part_item_label = GUIThemePart(this, CssStr::PopupMenuWindow::part_item_label);
	part_item_check = GUIThemePart(this, CssStr::PopupMenuWindow::part_item_check);
	part_separator = GUIThemePart(this, CssStr::PopupMenuWindow::part_separator);
	part_submenu_arrow = GUIThemePart(this, CssStr::PopupMenuWindow::part_submenu_arrow);
	part_item_accel_label = GUIThemePart(this, CssStr::PopupMenuWindow::part_item_accel_label);
	part_menubar_joiner = GUIThemePart(this, CssStr::PopupMenuWindow::part_menubar_joiner);

	icon_column_width = get_property_int("icon-column-width", "30");
	icon_size = part_item_icon.get_css_size();
	check_size = part_item_check.get_css_size();

	func_render().set(this, &PopupMenuWindow::on_render);
}
コード例 #10
0
ファイル: tab_header.cpp プロジェクト: Cassie90/ClanLib
void TabHeader::add_page(TabPage *tab_page, const std::string &label)
{
	TabHeader_Impl::Handle handle;
	handle.part = GUIThemePart(this, CssStr::Tab::Header::part_page);
	handle.tab_page = tab_page;
	handle.label = label;

	handle.part.set_pseudo_class(CssStr::normal, true);
	handle.part.set_pseudo_class(CssStr::hover, false);
	handle.part.set_pseudo_class(CssStr::selected, false);
	impl->tabs.push_back(handle);

	impl->update_handle_rects();

	request_repaint();
}
コード例 #11
0
ファイル: statusbar.cpp プロジェクト: kyelin/ClanLib
void StatusBar_Impl::create_parts()
{
	part_status_text = GUIThemePart(statusbar, "statustext");
	part_status_part = GUIThemePart(statusbar, "statuspart");
	part_size_grip = GUIThemePart(statusbar, "sizegrip");
}