Toolbar question - set/modify listButton string options
Posted: 9 Mar 2018 17:53
How can I dynamically or statically add strings to a toolbar listButton? The Create Project Item wizard creates a listButton with an empty list in ProjectToolbar.pro. It is possible to edit the generated code, but the list is regenerated as  when the project is rebuilt -- and we are amply warned to avoid modifying that code.
vpiToolbar::setValue/3 can set/unset the listbox item selected (I think) but I can't find any way to initialize or modify the listbutton selection list. It might be convenient in the future to be able to define/edit the initial strings n the creation wizard, but dynamic modification would be much more useful.
Code: Select all
constants % in ProjectToolbar.pro style : vpiToolbar::style = tb_top. controlList : vpiToolbar::control_list = [ tb_ctrl(id_file_new, pushb, resId(idb_NewFileBitmap), "New;New File", 1, 1), % ... lines deleted here ... tb_text(id_tb_1_3, tb_static, 60, 0, 5, 10, 0x0, "LBuTest:"), tb_lbut(id_tb_1_2, 128, ["one","two","three"], b_true, 0), % <== THIS LIST IS CREATED AS  vpiToolbar::separator, tb_ctrl(id_help_contents, pushb, resId(idb_HelpBitmap), "Help;Help", 1, 1) ].