CL_ListView::CL_ListView(CL_GUIComponent *parent) : CL_GUIComponent(parent), impl(new CL_ListView_Impl) { set_type_name("listview"); set_focus_policy(focus_local); impl->listview = this; impl->renderer = new CL_ListViewRenderer(this); impl->renderer->create_parts(); impl->renderer->set_icon_list(impl->icon_list); impl->create_components(); func_process_message().set(impl.get(), &CL_ListView_Impl::on_process_message); func_render().set(impl.get(), &CL_ListView_Impl::on_render); func_resized().set(impl.get(), &CL_ListView_Impl::on_resized); func_style_changed().set(impl.get(), &CL_ListView_Impl::on_style_changed); impl->document_item.impl->func_item_added.set(impl.get(), &CL_ListView_Impl::on_item_added); impl->document_item.impl->func_item_modified.set(impl.get(), &CL_ListView_Impl::on_item_modified); impl->document_item.impl->func_item_deleted.set(impl.get(), &CL_ListView_Impl::on_item_deleted); impl->create_parts(); set_display_mode(listview_mode_details); // impl->update_part_positions(); }
ListBoxView::ListBoxView() : impl(new ListBoxViewImpl()) { impl->listbox = this; content_view()->style()->set("flex-direction: column"); set_focus_policy(FocusPolicy::accept); slots.connect(sig_key_press(), impl.get(), &ListBoxViewImpl::on_key_press); slots.connect(content_view()->sig_pointer_press(), impl.get(), &ListBoxViewImpl::on_pointer_press); slots.connect(content_view()->sig_pointer_release(), impl.get(), &ListBoxViewImpl::on_pointer_release); }
CL_TabHeader::CL_TabHeader(CL_GUIComponent *parent) : CL_GUIComponent(parent), impl(new CL_TabHeader_Impl) { set_type_name(CssStr::Tab::Header::type_name); set_focus_policy(focus_local); impl->component = this; func_process_message().set(impl.get(), &CL_TabHeader_Impl::on_process_message); func_render().set(impl.get(), &CL_TabHeader_Impl::on_render); func_style_changed().set(impl.get(), &CL_TabHeader_Impl::on_style_changed); // todo: enablemode, resize impl->on_style_changed(); }
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"); }
RadioButton::RadioButton(GUIComponent *parent) : GUIComponent(parent, CssStr::RadioButton::type_name), impl(new RadioButton_Impl) { set_focus_policy(focus_group); impl->radio = this; impl->create_parts(); func_process_message().set(impl.get(), &RadioButton_Impl::on_process_message); func_render().set(impl.get(), &RadioButton_Impl::on_render); func_enablemode_changed().set(impl.get(), &RadioButton_Impl::on_enablemode_changed); }
void button::init() { layout().set_margins(neogfx::margins(0.0)); iLabel.set_size_policy(neogfx::size_policy::Expanding); set_focus_policy(focus_policy::TabFocus); auto label_text_updated = [this]() { auto m = mnemonic_from_text(label().text().text()); if (!m.empty()) app::instance().add_mnemonic(*this); else app::instance().remove_mnemonic(*this); }; label().text().text_changed(label_text_updated, this); label_text_updated(); }