Advertisement
idsystems

CPP_RAD_Ejercicio50

Jun 21st, 2012
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.96 KB | None | 0 0
  1. /* ej50_GruposObjetosLogicos
  2. Ejemplo con varios controles agrupados */
  3. #include <radc++.h>
  4.  
  5. Form      form1("Grupo de Objectos (agrupando objetos) - RAD C++ Ejemplo");
  6.  
  7. //5 Object that will make a group, trying different controls
  8. Button    obj1("obj1",AUTO_ID,50,100,100,20,form1);
  9. TextBox   obj2("obj2",AUTO_ID,50,130,100,20,form1);
  10. ScrollBar obj3(       AUTO_ID,50,160,100,20,form1);
  11. CheckBox  obj4("obj4",AUTO_ID,50,190,100,20,form1);
  12. //a separate form to be part of this logical group
  13. Form      obj5("obj5",200,200,100,50,RCP_POPUP,true,true,false,false,false,form1);
  14.  
  15.  
  16. ObjectGroup my_group; //creat a logicla group variable
  17.  
  18. Label     label("Grupo logico siguiendo objetos",-1,40,50,150,30,form1);
  19. Separator line (200,0,2,300,form1);  
  20.  
  21. //buttons to perform functions of logical group
  22. Button     btn_hide("Ocultar Grupo",AUTO_ID,250,50,100,25,form1);
  23. Button     btn_show("Mostrar Grupo",AUTO_ID,250,80,100,25,form1);
  24. Button     btn_disa("Desactivar Grupo",AUTO_ID,250,110,100,25,form1);
  25. Button     btn_enab("Activar Grupo",AUTO_ID,250,140,100,25,form1);
  26.  
  27.  
  28. FormProcedure proc(FormProcArgs) {
  29.     ON_CLOSE() Application.close();
  30.    
  31.     ON_COMMAND_BY(btn_hide)
  32.         my_group.hide();    //hide the group objects
  33.        
  34.        
  35.     ON_COMMAND_BY(btn_show)
  36.         my_group.show();    //show all group objects, if any or all were hidden
  37.    
  38.    
  39.     ON_COMMAND_BY(btn_disa)
  40.         my_group.disable(); //disable all gorup objects
  41.    
  42.    
  43.     ON_COMMAND_BY(btn_enab)
  44.         my_group.enable();  //enable all group objects, if any or all were duisabled
  45.    
  46.    
  47.     return 0;
  48. }
  49.  
  50.  
  51. rad_main()
  52.  
  53.     form1.procedure = proc;
  54.    
  55.     //add objects to group, either form, button, check, radio, or any kind of object
  56.     my_group.add(obj1);
  57.     my_group.add(obj2);
  58.     my_group.add(obj3);
  59.     my_group.add(obj4);
  60.     my_group.add(obj5);
  61.    
  62.     //reposition child for obj5
  63.     obj5.left = form1.left + 50;
  64.     obj5.top  = form1.top + form1.height - 60;
  65.     obj5.icon = Icon::Icon(IDI_EXCLAMATION);
  66.    
  67.     //set focus on main form
  68.     form1.focus();
  69.  
  70. rad_end()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement