void initialize_widgets() { static internationalization i18n{}; auto bg_color = 0xefefef; fm.icon(main_icon()); fm.caption(i18n("form_title")); fm.background(bg_color); auto width = fm.size().width; lst_songs.append_header(i18n("Artist"), width / 6); lst_songs.append_header(i18n("Title"), width / 3); lst_songs.append_header(i18n("File"), width / 2); lbl_songs.caption(i18n("Songs") + L":"); lbl_songs.background(bg_color); lbl_songs.text_align(align::left, align_v::center); chk_matched.caption(i18n("Matched only")); chk_matched.background(bg_color); txt_search.multi_lines(false); btn_search.background(bg_color); pl.div("margin=10 vertical" "<weight=22 <search arrange=[variable, 120, 100, 22]> >" "<weight=10>" "<lst>" ); pl["lst"] << lst_songs; pl["search"] << lbl_songs << chk_matched << txt_search << btn_search; pl.collocate(); }
//Now we implement the virtual function declared by uiface void create_ui_element(const data& dat) override { btn_pair p{ std::make_shared<button>(*this) , dat} ; //Make the click event p.first->events().click( [&](const arg_mouse& ei){_m_click( ei);} ); p.first->caption(nana::string(charset(dat.url))) ; plc_["abc"]<< *(p.first); plc_.collocate(); ui_el_.push_back(p); }