Advertisement
idsystems

CPP_RAD_Ejercicio02

May 17th, 2012
303
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.89 KB | None | 0 0
  1. /* ej02_BotonesYEventosForma
  2. Ejemplo para crear una forma, agregarle un boton y
  3. ver alguno de los eventos que puede tener dicha forma */
  4. #include <radc++.h>
  5.  
  6. //create new form
  7. Form Form1("Evento Boton - RAD C++ Ejemplo");
  8.  
  9. //create new button
  10. Button Button1("Soy un boton", AUTO_ID, 10, 15, 100, 150, Form1);
  11.  
  12.  
  13. //create new control procedure for form, procedure1 is procedure name
  14. FormProcedure procedure1 (FormProcArgs) {
  15.  
  16.         //capture event ON_CLOSE which is fired when form is closed, [X] is clicked
  17.         ON_CLOSE() {
  18.             //exit application
  19.             Application.close();
  20.         }
  21.         //capture button click, means Button has been clicked
  22.         ON_COMMAND_BY ( Button1 ) {
  23.             Form1.msgBox("Hola Universo!");
  24.         }
  25.      
  26.         //always return 0
  27.         return 0;      
  28. }
  29.  
  30. //rad c++ main program
  31. rad_main()
  32.  
  33.         //attach the created procedure with form
  34.         Form1.procedure = procedure1;
  35.  
  36. rad_end()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement