Advertisement
idsystems

CPP_RAD_Ejercicio26

May 20th, 2012
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.96 KB | None | 0 0
  1. /* ej26_SubClaseBoton
  2. Ejemplo para manejar una subclase con el contro Boton */
  3. #include <radc++.h>
  4.  
  5. Form form1("Subclase boton - RAD C++ Ejemplo");
  6. Icon icon1(IDI_APPLICATION);   
  7.  
  8. Button btn;
  9.                
  10. FormProcedure form1Proc(FormProcArgs) {
  11.     ON_CLOSE()  Application.close();
  12.     ON_COMMAND_BY(btn) {
  13.         form1.caption = "Subclase boton oprimido";
  14.     }
  15.     return 0;
  16. }
  17. WNDPROC oldprocedure=NULL;
  18. ControlProcedure btnProc(ControlProcArgs) {
  19.  
  20.     ON_LEFT_CLICK_RELEASE() {
  21.         form1.caption = "release";
  22.         SendMessage(GetParent(hwnd),WM_COMMAND,wParam,lParam);
  23.     }
  24.     return CallWindowProc(oldprocedure, hwnd, message, wParam, lParam);
  25. }
  26.  
  27. rad_main()
  28.  
  29. //      form1.setDProcedure((FORMPROC)form1Proc);
  30.         form1.procedure = form1Proc;
  31.         btn.create("button1",AUTO_ID,100,100,100,100,form1,true,true,false,false,0,true,icon1);
  32.         SetClassLong(lbl.hwnd,GCL_STYLE,(LONG)(CS_VREDRAW| CS_HREDRAW));
  33.         oldprocedure = (WNDPROC)btn.setWProcedure(btnProc);
  34.        
  35.    
  36. rad_end()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement