Advertisement
idsystems

CPP_RAD_Ejercicio09

May 18th, 2012
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.89 KB | None | 0 0
  1. /* ej09_Mouse
  2. Este ejemplo muestra algunas operaciones con el mouse
  3. y como controlarlo */
  4. #include <radc++.h>
  5.  
  6. Form form1("Operaciones con Raton - RAD C++ Ejemplo");
  7.  
  8.  
  9. TextBox t1("X",AUTO_ID,100,100,50,30,form1);
  10. TextBox t2("Y",AUTO_ID,160,100,50,30,form1);
  11.  
  12. Button b1("&Esconder Mouse",AUTO_ID,100,150,150,30,form1);
  13. Button b2("&Mostrar Mouse",AUTO_ID,100,210,150,30,form1);
  14.  
  15.  
  16. FormProcedure proc(FormProcArgs) {
  17.     ON_CLOSE() Application.close();
  18.    
  19.    
  20.     ON_TEXT_CHANGED(t1)
  21.         Mouse.x = val(t1.text); //set mouse x coordinates
  22.        
  23.     ON_TEXT_CHANGED(t2)
  24.         Mouse.y = val(t2.text); //set mouse y coordinates
  25.        
  26.     ON_COMMAND_BY(b1)  
  27.         Mouse.visible=false;    //hide mouse cursor
  28.        
  29.     ON_COMMAND_BY(b2)  
  30.         Mouse.visible=true;     //show mouse cursor if not visible
  31.    
  32.     return 0;
  33. }
  34.  
  35.  
  36. //Where Mouse is a global object of class _RAD_MOUSE
  37.  
  38.  
  39. rad_main()
  40.  
  41.     form1.procedure = proc;
  42.  
  43. rad_end()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement