To properly display this page you need a browser with JavaScript support.
Creating Pulldown Menus (continued)
Step 4: Program the Parts (continued)
Create a PRINTER Widget
Next, we set up the PRINTER widget. We had to wait until the menu bar was created to do this because we could not get a valid INSIDE WIDTH and INSIDE HEIGHT before that point.
880 ! ****************************************************
890 !
900 ! Now that you've set up the PULLDOWN MENU, get interior dimensions
910 ! of the PANEL and set up PRINTER widget accordingly.
920 !
930 STATUS @P;RETURN ("INSIDE WIDTH":Iw,"INSIDE HEIGHT":Ih)
940 Prx=Iw*.02
950 Pry=Ih*.02
960 Prwidth=Iw*.96
970 Prheight=Ih*.96
980 ASSIGN @Prn TO WIDGET "PRINTER";PARENT @P
990 CONTROL @Prn;SET ("X":Prx,"Y":Pry,"WIDTH":Prwidth,"HEIGHT":Prheight)
1000 !
1010 ! ****************************************************
Create Pulldown_2 Menu
Next, we create the pulldown menus themselves. We start with the PullDown_2 menu. The following lines create the following display.
1010 ! ****************************************************
1020 !
1030 ! Create menu for "PullDown_2" (using @Pd2 as PARENT).
1040 !
1050 S$="Button_1"
1060 ASSIGN @B21 TO WIDGET "MENU BUTTON";PARENT @Pd2,SET ("LABEL":S$)
1070 !
1080 S$="Button_2"
1090 ASSIGN @B22 TO WIDGET "MENU BUTTON";PARENT @Pd2,SET ("LABEL":S$)
1100 !
1110 ! ****************************************************
Pulldown_2 Menu Display