Advertisement
idsystems

CPP_RAD_Ejercicio29

May 20th, 2012
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.96 KB | None | 0 0
  1. /* ej29_SplitterHorizontal
  2. Otro ejemplo de splitter, pero esta vez de manera horizontal */
  3. #include <radc++.h>
  4.  
  5. Form form1("Horizontal Splitter - RAD C++ Ejemplo");
  6. Splitter s(AUTO_ID,form1,RCP_HORIZONTAL);
  7. TextBox t1("Una caja de texto",AUTO_ID,0,  0,10,100,form1);
  8. Button  t2("Un boton",  AUTO_ID,0,105,10,10 ,form1);
  9.  
  10. FormProcedure proc(FormProcArgs) {
  11.     ON_CLOSE() Application.close();
  12.    
  13.     ON_SPLITTER_CHANGE(s) {
  14.         t1.height = splitPosition(); //macro that gets current moving splitter's position
  15.         t2.top = splitPosition()+5;
  16.         t2.height  = form1.cheight - (t1.height+5);
  17.     }
  18.     ON_RESIZE( ) { //adjust all objects wen form is resized
  19.         t1.fitToWidth();
  20.         t2.fitToWidth();
  21.         t2.height  = form1.cheight - (t1.height+5);
  22.         s.fitToWidth();
  23.         s.setBounds(50,form1.cheight-50);
  24.     }
  25.  
  26.     return 0;
  27. }
  28.  
  29. rad_main()
  30.  
  31.     s.setPosition(100); //set splitter's position
  32.     form1.procedure = proc;
  33.     s.refresh();
  34.    
  35.     form1.resize(500,250);
  36.     form1.center();
  37.    
  38. rad_end()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement