Advertisement
idsystems

CPP_RAD_Ejercicio27

May 20th, 2012
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1. /* ej27_Subclase ListBox
  2. Ejemplo de subclase para el control ListBox */
  3. #include <radc++.h>
  4.  
  5. Form form1("Subclass listbox - RAD C++ Example");
  6. ListBox l("",     AUTO_ID,0,0,100,  100,form1);
  7.  
  8. WNDPROC ActualListBoxProcedure=NULL;
  9.        
  10. FormProcedure form1Proc(FormProcArgs) {
  11.     ON_CLOSE()  Application.close();
  12.  
  13.     return 0;
  14. }
  15.  
  16. //subclass procedure
  17. ControlProcedure CustomListBoxProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) {
  18.     ON_LEFT_CLICK()
  19.             form1.text = "ON_LEFT_CLICK";
  20.  
  21.     ON_LEFT_CLICK_RELEASE()
  22.             form1.text = "ON_LEFT_CLICK_RELEASE";
  23.        
  24.     ON_MOUSEMOVE()
  25.             form1.text = "ON_MOUSEMOVE";
  26.    
  27.     return CallWindowProc(ActualListBoxProcedure, hwnd, message, wParam, lParam);
  28. }
  29.  
  30. rad_main()
  31.  
  32.         form1.procedure = form1Proc;
  33.         ActualListBoxProcedure = (WNDPROC)l.setWProcedure(CustomListBoxProcedure);
  34.    
  35. rad_end()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement