home *** CD-ROM | disk | FTP | other *** search
AMOS Source Code | 1993-01-06 | 1.8 KB | 90 lines |
- '
- ' SETUP SCREEN
- '
- Screen Open 0,640,200,8,Hires
- Flash Off
- Curs Off
- Cls 0
- Palette $AA,$FFF,$DDD,$333,$888,$F00,$FF0,$4A4
- '
- ' *** Example Buttons.
- '
- B[10,10,210,100,"STICKING OUT",1,7,1]
- '
- B[429,10,629,100,"STICKING IN",0,5,6]
- '
- B[210,110,429,190,"",0,0,0]
- B[211,111,428,189,"FANCY",1,4,5]
- '
- Direct
- '
- Procedure B[X1,Y1,X2,Y2,A$,IN,_BUTTON_COLOUR,_TEXT_COLOUR]
- '
- '
- ' *** X1, Y1 To X2, Y2 : These are the button coordinates.
- '
- ' *** A$ : This is the text inside the button (If any).
- '
- ' *** IN : Position of button, 1 if sticking out, 0 if in.
- '
- ' *** _BUTTON_COLOUR : Colour of button.
- '
- ' *** _TEXT_COLOUR : Colour of writing inside button.
- '
- '
- ' *** Check if button is sticking in or out.
- '
- If IN=1
- C1=2
- C2=3
- Else
- C1=3
- C2=2
- End If
- '
- ' *** Draw button.
- '
- Ink _BUTTON_COLOUR
- '
- Bar X1,Y1 To X2,Y2
- Ink C1
- Box X1,Y1 To X2,Y2
- Ink C2
- Polyline X1,Y2 To X2,Y2 To X2,Y1
- '
- ' *** If button sticking out, put light in corner.
- '
- If IN=1
- Plot X1+1,Y1+1,1
- End If
- '
- ' *** If text has been entered, draw it inside button.
- '
- If A$<>""
- '
- ' *** Centre text inside button.
- '
- WID=Text Length(A$)
- X7=(((X2-X1)/2)+X1)-(WID/2)
- '
- Gr Writing 0
- '
- ' *** Draw outline text.
- '
- Ink 3,_BUTTON_COLOUR
- '
- Text X7+1,((Y2-Y1)/2)+Y1+3,A$
- Text X7-1,((Y2-Y1)/2)+Y1+3,A$
- Text X7,((Y2-Y1)/2)+Y1+4,A$
- Text X7,((Y2-Y1)/2)+Y1+2,A$
- '
- ' *** Draw normal text on top of outlined.
- '
- Ink _TEXT_COLOUR,_BUTTON_COLOUR
- '
- Text X7,((Y2-Y1)/2)+Y1+3,A$
- '
- Gr Writing 1
- '
- End If
- End Proc