Advertisement
idsystems

CPP_RAD_Ejercicio51

Jun 21st, 2012
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.28 KB | None | 0 0
  1. /* ej51_CoolBars
  2. Ejemplo de varios controles colocados en barras de herramientas */
  3. #include <radc++.h>
  4.  
  5. Form  form1("Cool Bars / Rebar - RAD C++ Ejemplo");
  6.  
  7. //create three controls that we will add to the coolbar
  8. //NOTE : controls will report to form on events so parent of controls must be form1
  9. ComboBox  combo("Soy un combo", AUTO_ID,0,0,70,100,form1);
  10. CheckBox  check("Soy un check", AUTO_ID,0,0,100,25,form1);
  11. Button      btn("Soy un boton",AUTO_ID,0,0,120,25,form1);
  12. Radio     radio("Soy un radio", AUTO_ID,0,0, 70,25,form1);
  13.  
  14. //create a coolbar
  15. CoolBar cool(AUTO_ID,form1);
  16.  
  17. //main form procedure
  18. FormProcedure proc(FormProcArgs) {
  19.     ON_CLOSE() Application.close();
  20.    
  21.     //adjust coolbar properly on form, when form is resized
  22.     ON_RESIZE()
  23.         cool.adjust();  
  24.        
  25.     return 0;
  26. }
  27.  
  28. rad_main()
  29.     form1.procedure = proc;
  30.  
  31.     //add bands to coolbar
  32.     cool.add("",combo);
  33.     cool.add("",check);
  34.      
  35.     //add band on new line
  36.     cool.add("",btn, RCP_NEWBAND);         
  37.    
  38.     //add band with custom caption 'Extra' with text color blue, color in hex 0xFF0000
  39.     cool.add("Extra",radio,RCP_SAME,0xFF0000);
  40.     //RCP_SAME means add new band on same line
  41.    
  42.     //add some values to combo
  43.     combo.add("Item1");
  44.     combo.add("Item2");
  45.     combo.select(0); //select first item in combo
  46.    
  47. rad_end()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement