int CL_GUIComponent::exec() { CL_GUIComponent *owner_component = get_owner_component(); if (owner_component) owner_component->get_top_level_component()->set_enabled(false); get_gui_manager().exec(); if (owner_component) owner_component->get_top_level_component()->set_enabled(true); return get_gui_manager().get_exit_code(); }
void CL_GUIComponent::capture_proximity(bool capture) { if (capture) { get_gui_manager().set_tablet_proximity_component(this, true); } else { get_gui_manager().set_tablet_proximity_component(this, false); } }
void CL_GUIComponent::capture_mouse(bool capture) { if (capture) { get_gui_manager().set_capture_component(this, true); } else { if (get_gui_manager().get_capture_component() == this) get_gui_manager().set_capture_component(this, false); } }
void CL_Component_Generic::on_close() { owner->update(); // show(false); if(get_gui_manager() != NULL) get_gui_manager()->quit(); else CL_Log::log("debug", "CL_Component::close: gui manager pointer is null!"); if(parent != NULL) parent->remove_child(owner); else CL_Log::log("debug", "CL_Component::close: parent pointer is null!"); // set_gui_manager(NULL); }
ToolTip::ToolTip(GUIManager manager) : GUIComponent(&manager, ToolTip_Impl::create_description(), CssStr::ToolTip::type_name), impl(new ToolTip_Impl) { impl->tooltip = this; func_process_message().set(impl.get(), &ToolTip_Impl::on_process_message); func_render().set(impl.get(), &ToolTip_Impl::on_render); impl->timer_show_delayed.func_expired().set(impl.get(), &ToolTip_Impl::on_show_delayed); impl->slot_filter_message = get_gui_manager().sig_filter_message().connect(impl.get(), &ToolTip_Impl::on_filter_message); }
ToolTip::ToolTip(GUIManager manager) : GUIComponent(&manager, ToolTip_Impl::create_description(), CssStr::ToolTip::type_name), impl(std::make_shared<ToolTip_Impl>()) { impl->tooltip = this; func_process_message() = bind_member(impl.get(), &ToolTip_Impl::on_process_message); func_render() = bind_member(impl.get(), &ToolTip_Impl::on_render); impl->timer_show_delayed.func_expired() = bind_member(impl.get(), &ToolTip_Impl::on_show_delayed); impl->sc.connect(get_gui_manager().sig_filter_message(), bind_member(impl.get(), &ToolTip_Impl::on_filter_message)); }
int CL_GUIComponent::exec() { CL_GUIComponent *owner_component = get_owner_component(); if (owner_component) owner_component->get_top_level_component()->set_enabled(false); get_gui_manager().exec(); if (owner_component) { // To do: Move this special modal dialog code to the window manager. // Important: Do not remove any of these calls even though they seem pointless, redundant or even wrong. // They workaround various bugs in the focus handling in Windows itself. #ifdef WIN32 set_visible(false, false); #endif owner_component->get_top_level_component()->set_enabled(true); #ifdef WIN32 SetActiveWindow(owner_component->get_top_level_component()->get_display_window().get_hwnd()); #endif } return get_gui_manager().get_exit_code(); }
bool GridComponent::deliver_input_to_tab(const clan::InputEvent &e) { clan::GUIComponent *child = component_container->get_component_at(e.mouse_pos); if (child && child->get_tag_name() == "tabheader") { clan::InputEvent e_child = e; e_child.mouse_pos = child->window_to_component_coords(component_to_window_coords(e.mouse_pos)); std::shared_ptr<clan::GUIMessage> message(new clan::GUIMessage_Input(e_child)); message->target = child; get_gui_manager().dispatch_message(message); return true; } else { return false; } }
void GameComponent::on_message(std::shared_ptr<GUIMessage> &msg) { std::shared_ptr<GUIMessage_Input> input_msg = std::dynamic_pointer_cast<GUIMessage_Input>(msg); if (input_msg) { InputEvent &e = input_msg->input_event; if (e.type == InputEvent::pressed) { if(e.id == keycode_escape) { get_gui_manager().exit_with_code(0); } if(e.id == mouse_left) { show_radial_menu(e.mouse_pos); } } } }
Ribbon::Ribbon(GUIComponent *container) : GUIComponent(container, "ribbon"), impl(new Ribbon_Impl) { impl->component = this; impl->menu = new RibbonMenu(this); impl->tab_row = new GUIComponent(this, "ribbon-tab-row"); impl->menu_button = new PushButton(impl->tab_row); impl->menu_button->set_class("menu", true); impl->menu_button->func_clicked().set(impl.get(), &Ribbon_Impl::on_menu_button_clicked); impl->page_area = new GUIComponent(this, "ribbon-page-area"); if (get_gui_manager().get_window_manager().get_window_manager_type() == GUIWindowManager::cl_wm_type_system) { get_display_window().enable_alpha_channel(Rect()); get_display_window().extend_frame_into_client_area(23/*impl->tab_row->get_css_values().get_box().height.length.value*/); } }
void CL_GUIComponent::exit_with_code(int exit_code) { get_gui_manager().exit_with_code(exit_code); }
CL_ResourceManager CL_GUIComponent::get_resources() const { return get_gui_manager().get_theme().get_resources(); }
void CL_GUIComponent::request_repaint(CL_Rect request_repaint) { get_gui_manager().request_repaint(component_to_window_coords(request_repaint), get_top_level_component()); }