home *** CD-ROM | disk | FTP | other *** search
- #include <LEDA/window.h>
-
-
- main()
- {
-
-
- bool B = false;
- real R = 3.1415;
- int C = 0;
- int C1 = 0;
- int N = 100;
- string S = "dummy";
- string S1 = "menu";
-
- int but_num = 16;
- int but_per_line = 4;
-
- list(string) menu;
- cmd_istream ls("ls");
- menu.read(ls);
-
- for(;;)
- {
-
- panel P("PANEL DEMO");
-
- P.text_item("This program demonstrates the use of panels. ");
- P.text_item(" ");
-
- P.bool_item("BOOL",B);
-
- P.choice_item("CHOICE",C,"ZERO","ONE","TWO","THREE", "FOUR");
-
- P.int_item("INT",N);
- P.int_item("INT (CHOICE)",C1,0,100,20);
- P.int_item("INT (SLIDER)",but_num,1,64);
-
- P.real_item("REAL",R);
-
- P.string_item("STRING",S);
- P.string_item("STRING (MENU)",S1,menu);
-
-
- P.text_item("");
- P.text_item("BUTTONS ");
-
- int i;
-
- for(i = 1; i <= but_num; i++)
- { P.button(form("%2d",i));
- if (i % but_per_line == 0) P.new_button_line();
- }
-
- P.new_button_line();
-
- P.button("QUIT");
-
- int button = P.open();
-
-
- printf("BOOL = %d\n",B);
- printf("CHOICE = %d\n",C);
- printf("INT (CHOICE) = %d\n",C1);
- printf("INT (SLIDER) = %d\n",but_num);
- printf("INT = %d\n",N);
- printf("REAL = %f\n",~R);
- printf("STRING = %s\n",~S);
- printf("STRING (MENU) = %s\n",~S1);
- printf("BUTTON = %d\n",button);
- newline;
-
- if (button==but_num) break;
-
- but_per_line = button+1;
-
- }
-
- }
-
-