Advertisement
idsystems

CPP_RAD_Ejercicio36

May 20th, 2012
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.18 KB | None | 0 0
  1. /*ej36_ComboBoxIcons
  2. Ejemplo para crear un control ComboBox con Iconos */
  3. #include <radc++.h>
  4.  
  5. Form Form1("Combo Box con iconos ejemplo - RAD C++ Ejemplo");
  6. ComboBox combo("", AUTO_ID, 10, 15, 200, 100, Form1);//create new combo box
  7.  
  8. FormProcedure procedure1 (FormProcArgs) {
  9.         ON_CLOSE() Application.close();
  10.         return 0;      
  11. }
  12. IconList icl; //create new iconlist
  13. Icon icon1(IDI_APPLICATION), //create 3 icon objects
  14.      icon2(IDI_EXCLAMATION),
  15.      icon3(IDI_HAND);
  16.  
  17. rad_main()
  18.  
  19.         //attach form procedure
  20.         Form1.procedure = procedure1;
  21.  
  22.         //add icons to icon list
  23.         icl.add(icon1);
  24.         icl.add(icon2);
  25.         icl.add(icon3);
  26.        
  27.         //attach iconlist to combobox
  28.         combo.setIconList(icl);
  29.  
  30.         //add some enteries to combobox
  31.         //note: 2nd argument is reserved and msut be -1
  32.         combo.add("entrada 1",-1,0); //3rd argument is ZERO basded index of iconin list
  33.         combo.add("entrada 2",-1,1);
  34.         combo.add("entrada 3",-1,2);
  35.         combo.add("entrada con icono por default"); //did nto pass last 2 arguments  so first icon is selected
  36.         combo.select(0); //select first entry
  37.        
  38.         combo.center(); //center the combo onto form
  39.  
  40. rad_end()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement