Advertisement
idsystems

CPP_RAD_Ejercicio28

May 20th, 2012
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.88 KB | None | 0 0
  1. /* ej28_SplitterVertical
  2. Ejemplo de control Splitter en formato Vertical */
  3. #include <radc++.h>
  4.  
  5. Form form1("Splitter Vertical - RAD C++ Ejemplo");
  6.  
  7. Splitter s(AUTO_ID,form1);
  8.  
  9. TextBox t1("Una caja de texto",AUTO_ID,0,  0,100,10,form1);
  10. Button  t2("Un boton",  AUTO_ID,105,0,200,10,form1);
  11.  
  12. FormProcedure proc(FormProcArgs) {
  13.     ON_CLOSE() Application.close();
  14.    
  15.     ON_SPLITTER_CHANGE(s) { //s is splitter varible
  16.         t1.width = splitPosition();
  17.         t2.left = splitPosition()+5;
  18.         t2.width  = form1.cwidth - (t1.width+5);
  19.     }
  20.     ON_RESIZE( ){
  21.         t1.fitToHeight();
  22.         t2.fitToHeight();
  23.         t2.width  = form1.cwidth - (t1.width+5);
  24.         s.fitToHeight();
  25.         s.setBounds(50,form1.cwidth-50);
  26.     }
  27.  
  28.     return 0;
  29. }
  30.  
  31. rad_main()
  32.  
  33.     s.setPosition(100);
  34.     form1.procedure = proc;
  35.     s.refresh();
  36.    
  37.     form1.resize(500,400); //resize form
  38.     form1.center();        //center form on screen
  39.    
  40. rad_end()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement