Advertisement
idsystems

CPP_RAD_Ejercicio03

May 17th, 2012
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.02 KB | None | 0 0
  1. /* ej03_EventosTexto
  2. En este ejemplo veremos como se crea una forma, como se pone texto
  3. dentro de la forma con un control de texto y como se usan algunos
  4. eventos de dicho control */
  5. #include <radc++.h>
  6.  
  7. //create new form
  8. Form Form1("Eventos Texto - RAD C++ Ejemplo");
  9.  
  10. //create new text box
  11. TextBox text1("Teclee aqui", AUTO_ID, 10, 15, 200, 25, Form1);
  12.  
  13.  
  14. //create new control procedure for form, procedure1 is procedure name
  15. FormProcedure procedure1 (FormProcArgs) {
  16.  
  17.         //capture event ON_CLOSE which is fired when form is closed, [X] is clicked
  18.         ON_CLOSE() {
  19.             //exit application
  20.             Application.close();
  21.         }
  22.         //capture text change event, means text hs been changed
  23.         ON_TEXT_CHANGED ( text1 ) {
  24.             Form1.caption = "Cambio a : " + text1.text;
  25.         }
  26.      
  27.         //always return 0
  28.         return 0;      
  29. }
  30.  
  31. //rad c++ main program
  32. rad_main()
  33.  
  34.         //attach the created procedure with form
  35.         Form1.procedure = procedure1;
  36.        
  37.         //set focus to textbox when program starts
  38.         text1.focus();
  39.  
  40. rad_end()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement