Advertisement
idsystems

CPP_RAD_Ejercicio45

Jun 21st, 2012
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.95 KB | None | 0 0
  1. /* ej45_ScrollBars2
  2. Ejemplo de ScrollBars */
  3. #include <radc++.h>
  4.  
  5. Form      form1("Scroll Bars 2 - RAD C++ Ejemplo");
  6.  
  7. Label     label("Mover la scrollbar con el raton",-1,100,35,200,20,form1);
  8.  
  9. //create scrollbars
  10. ScrollBar scroll1(AUTO_ID,100,80,200,25,form1,RCP_HORIZONTAL); //horizontal
  11. ScrollBar scroll2(AUTO_ID,190,120,25,100,form1,RCP_VERTICAL);  //vertical
  12.  
  13. FormProcedure proc(FormProcArgs) {
  14.     ON_CLOSE() Application.close();    
  15.    
  16.     ON_SCROLL_CHANGE(scroll1)
  17.         label.caption = str(scroll1.position);
  18.  
  19.     ON_SCROLL_CHANGE(scroll2)
  20.         label.caption = str(scroll2.position);  
  21.  
  22.     return 0;
  23. }
  24.  
  25. rad_main()
  26.  
  27.     form1.procedure = proc;
  28.    
  29.     //set scrollbar minimum and maximum range
  30.     scroll1.minRange = -100;
  31.     scroll1.maxRange = 100;
  32.     //you can also use scroll1.setRange(-100,100);
  33.    
  34.     //NOTE if you do not set range, it is 1 minimum to 100 maximum automatically
  35.    
  36.     //set scrollbar default position
  37.     scroll1.position = -50;
  38.    
  39. rad_end()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement