Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* ej50_GruposObjetosLogicos
- Ejemplo con varios controles agrupados */
- #include <radc++.h>
- Form form1("Grupo de Objectos (agrupando objetos) - RAD C++ Ejemplo");
- //5 Object that will make a group, trying different controls
- Button obj1("obj1",AUTO_ID,50,100,100,20,form1);
- TextBox obj2("obj2",AUTO_ID,50,130,100,20,form1);
- ScrollBar obj3( AUTO_ID,50,160,100,20,form1);
- CheckBox obj4("obj4",AUTO_ID,50,190,100,20,form1);
- //a separate form to be part of this logical group
- Form obj5("obj5",200,200,100,50,RCP_POPUP,true,true,false,false,false,form1);
- ObjectGroup my_group; //creat a logicla group variable
- Label label("Grupo logico siguiendo objetos",-1,40,50,150,30,form1);
- Separator line (200,0,2,300,form1);
- //buttons to perform functions of logical group
- Button btn_hide("Ocultar Grupo",AUTO_ID,250,50,100,25,form1);
- Button btn_show("Mostrar Grupo",AUTO_ID,250,80,100,25,form1);
- Button btn_disa("Desactivar Grupo",AUTO_ID,250,110,100,25,form1);
- Button btn_enab("Activar Grupo",AUTO_ID,250,140,100,25,form1);
- FormProcedure proc(FormProcArgs) {
- ON_CLOSE() Application.close();
- ON_COMMAND_BY(btn_hide)
- my_group.hide(); //hide the group objects
- ON_COMMAND_BY(btn_show)
- my_group.show(); //show all group objects, if any or all were hidden
- ON_COMMAND_BY(btn_disa)
- my_group.disable(); //disable all gorup objects
- ON_COMMAND_BY(btn_enab)
- my_group.enable(); //enable all group objects, if any or all were duisabled
- return 0;
- }
- rad_main()
- form1.procedure = proc;
- //add objects to group, either form, button, check, radio, or any kind of object
- my_group.add(obj1);
- my_group.add(obj2);
- my_group.add(obj3);
- my_group.add(obj4);
- my_group.add(obj5);
- //reposition child for obj5
- obj5.left = form1.left + 50;
- obj5.top = form1.top + form1.height - 60;
- obj5.icon = Icon::Icon(IDI_EXCLAMATION);
- //set focus on main form
- form1.focus();
- rad_end()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement