Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* ej39_HorizontalSlider
- Ejemplo para mostrar el control Slider de manera horizontal */
- #include <radc++.h>
- Form form1("Slider Horizontal - RAD C++ Ejemplo");
- Label label1("Por favor arrastre y mueva el slider con el raton",-1,100,20 ,200,30,form1);
- Track track(AUTO_ID,100,60,200,30,form1); //create trackbar / slider
- Label label2("Introduzca el numero de ticks",-1,100,110 ,200,20,form1);
- NumberBox txt_num("15",AUTO_ID,100,135 ,200,20,form1);
- Label label3("Introduzca una nueva posicion",-1,100,165 ,200,20,form1);
- NumberBox txt_pos("0",AUTO_ID,100,190 ,200,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