Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* ej46_Toolbar
- Ejemplo del control Toolbar */
- #include <radc++.h>
- Form form1("Barras de Herramientas - RAD C++ Ejemplo");
- Label label("Toolbar's Opciones de Diseño",-1,100,120,200,20,form1);
- CheckBox _flat("Flat toolbar y botones",AUTO_ID,100,150,200,20,form1);
- CheckBox _divider("Agregar divisor en lo superior",AUTO_ID,100,180,200,20,form1);
- //create toolbar
- ToolBar tools(AUTO_ID,form1);
- //create toolbar button objects to track clicks
- ToolBarItem btn_exit, btn_about;
- //create iconlist for toolbar
- IconList icl(RCP_SMALL);
- //create some icon objects, IDI_XXXXX are predefined in system
- Icon icon1(IDI_APPLICATION);
- Icon icon2(IDI_EXCLAMATION);
- Icon icon3(IDI_HAND);
- Icon icon4(IDI_QUESTION);
- FormProcedure proc(FormProcArgs) {
- ON_CLOSE() Application.close();
- ON_COMMAND_BY(btn_exit)
- Application.close();
- ON_COMMAND_BY(btn_about)
- form1.infoBox("RAD C++ Toolbar Ejemplo, Marzo 20, 2007.");
- ON_CHECKBOX_EVENT(_flat)
- tools.flat = _flat.checked;
- ON_CHECKBOX_EVENT(_divider)
- tools.divider = _divider.checked;
- //adjust toolbar when form is resized
- ON_RESIZE()
- tools.adjust();
- //do not use this IF you want toolbar be on absolute position
- return 0;
- }
- rad_main()
- form1.procedure = proc;
- //add icons to icon list
- icl.add(icon1);
- icl.add(icon2);
- icl.add(icon3);
- icl.add(icon4);
- //attach iconlist with toolbar
- tools.setIconList(icl);
- tools.captions=true;
- //add buttons to toolbar
- tools.add("Item 1",0,AUTO_ID); //second argument is icon id in iconlist
- tools.add("Item 2",1,AUTO_ID);
- btn_exit =tools.add("Salida" ,2,AUTO_ID);
- btn_about=tools.add("Acerca" ,3,AUTO_ID);
- _flat.checked=true;
- _divider.checked=true;
- rad_end()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement