Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* ej44_StatusBar
- Ejemplo del control StatusBar */
- #include <radc++.h>
- Form form1("StatusBar - RAD C++ Ejemplo");
- StatusBar status("Parte 1 texto;Parte 2 texto",AUTO_ID,form1,2); //2 parts
- Label lbl1("Introduzca texto para las partes, delimite con ';'",-1,100,35,200,20,form1);
- TextBox txt1("Part 1 text;Part 2 text",AUTO_ID,100,60,200,20,form1);
- Label lbl2("Introduzca nuevo numero de partes",-1,100,110,200,20,form1);
- NumberBox txt2("2",AUTO_ID,100,135,50,20,form1);
- Label lbl3("Introduzca parte # para mostrar",-1,100,165,200,20,form1);
- NumberBox txt3("0",AUTO_ID,100,185,50,20,form1);
- FormProcedure proc(FormProcArgs) {
- ON_CLOSE() Application.close();
- ON_RESIZE() { //when form is resized, adjust the statusbar
- status.adjust();
- }
- ON_TEXT_CHANGED(txt1) { //change text of parts
- status.setText(txt1.text);
- }
- ON_TEXT_CHANGED(txt2) {
- int num = val(txt2.text);
- if(num > 0) {
- status.setParts(num); //set new number of parts
- //NOTE: application can crash if number of new parts is supplied ZERO
- status.setText(txt1.text); //remake popout effects
- }
- }
- ON_TEXT_CHANGED(txt3) {
- status.popOut(val(txt3.text),true);
- }
- return 0;
- }
- rad_main()
- form1.procedure = proc;
- txt2.setLimit(2);
- //1.You can use single string having values delimitted with ';' semicolin
- //status.setText("Part 1 text;Part 2 text");
- //2. Second way to set text in statusbar parts
- //StringList list;
- //list.add("Part 1 text");
- //list.add("Part 2 text");
- //status.setText(list);
- //3.OR you can set text of certain part individually as:
- //status.setText(0,"some text");
- String part1_text = status[0]; //access the part 1 text, ZERO based index
- rad_end()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement