void GridComponent::on_render(clan::Canvas &canvas, const clan::Rect &update_rect) { set_cliprect(canvas, get_size()); clan::Rect g = get_geometry().get_size(); bool tab_parent = (get_parent_component()->get_tag_name() == "tabpage"); if (tab_parent) { canvas.fill_rect( g, clan::Colorf::whitesmoke); } else { //canvas.fill_rect( g, clan::Colorf::darkgray); canvas.fill_rect( g, clan::Colorf(199/255.0f, 209/255.0f, 224/255.0f)); canvas.fill_rect( boundary, clan::Colorf::lightgrey/*clan::Colorf("E0DFE3")*/); } /* if (!tab_parent) { clan::Draw::line(canvas, (float)boundary.left, (float)boundary.bottom, (float)boundary.right, (float)boundary.bottom, clan::Colorf::black); clan::Draw::line(canvas, (float)boundary.right, (float)boundary.top, (float)boundary.right, (float)boundary.bottom, clan::Colorf::black); // canvas.fill_rect( get_boundary_grabber_se(), clan::Colorf::darkslategray); } */ clan::Rect framebox = part_windowframe.get_content_box(boundary); framebox.translate(-framebox.left, -framebox.top); part_windowframe.render_box(canvas, framebox); reset_cliprect(canvas); }
bool CL_GUIComponent::is_visible() const { const CL_GUIComponent *parent = get_parent_component(); if (parent) { if (parent->is_visible() == false) return false; } return impl->visible; }
bool GUIComponent::is_enabled() const { const GUIComponent *parent = get_parent_component(); if (parent) { if (parent->is_enabled() == false) return false; } return impl->enabled; }
clan::GUIComponent *GridObject::get_toplevel_component() { clan::GUIComponent *test = get_parent_component(); while (true) { if (test->get_parent_component() == 0) break; test = test->get_parent_component(); } return test; }
void RadioButton::set_selected(bool selected) { impl->uncheck_radio_buttons(get_parent_component()); if (selected) { impl->part_checker.set_pseudo_class(CssStr::checked, true); impl->part_checker.set_pseudo_class(CssStr::unchecked, false); set_selected_in_component_group(true); } request_repaint(); }
CL_GUIComponent *CL_GUIComponent::get_group_selected_component() { CL_GUIComponent *parent = get_parent_component(); if (parent) { std::vector<CL_GUIComponent*> group = parent->get_child_component_group(get_component_group_name()); std::vector<CL_GUIComponent*>::size_type i; for (i = 0; i < group.size(); i++) { if (group[i]->is_selected_in_group()) { return group[i]; } } } return 0; }