Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* ej40_VerticalSlider
- Ejemplo del mismo control Track pero ahora vertical */
- #include <radc++.h>
- Form form1("Slider Vertical - RAD C++ Ejemplo");
- Label label1("Por favor arrastre y mueva el slider con el raton",-1,100,20 ,200,30,form1);
- //create trackbar / slider
- Track track(AUTO_ID,100,60,30,150,form1,0,true,true,false,true);
- //check documentation for track constructor arguments,
- //8th argument is default number of ticks
- //12th argument is bool _vertical, we passed true to make it vertical
- Label label2("Introduzca nuevo numero de ticks",-1,150,60 ,150,20,form1);
- NumberBox txt_num("15",AUTO_ID,150,85 ,150,20,form1);
- Label label3("Introduzca nueva posicion",-1,150,155 ,150,20,form1);
- NumberBox txt_pos("0",AUTO_ID,150,180 ,150,20,form1);
- FormProcedure proc(FormProcArgs) {
- ON_CLOSE() Application.close();
- //user moved trackbar
- ON_TRACK_CHANGE(track) {
- int pos = track.position; //get track position
- label1.caption = str(pos);
- }
- ON_TEXT_CHANGED(txt_num) {
- //set new number of ticks
- track.ticks = val(txt_num.text);
- }
- ON_TEXT_CHANGED(txt_pos) {
- //set new number position
- track.position = val(txt_pos.text);
- }
- return 0;
- }
- rad_main()
- form1.procedure = proc;
- //set minmum and maximum range
- track.minRange = -15;
- track.maxRange = 15;
- rad_end()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement