home *** CD-ROM | disk | FTP | other *** search
- {-----------------------------SHAPES.ORL---------------------------------
- This program draws a variety of graphic shapes. It illustrates how you
- can control the background color, the brush color and fill pattern,
- they line pattern and color, as well as the font style and color.
- ------------------------------------------------------------------------}
- {Maximize the window and set its caption}
- SetWindow(MAXIMIZE)
- UseCaption("Color, Brush, Font")
-
- {Initialize variables}
- Set Br_Red=0 {Blue brush}
- Set Br_Green=0
- Set Br_Blue=255
- Set Br_Type=0 {Solid}
-
- Set Pen_Red=0 {Black pen}
- Set Pen_Green=0
- Set Pen_Blue=0
- Set Pen_Type=0 {Solid}
-
- Set Font_Red=0 {Black font}
- Set Font_Green=0
- Set Font_Blue=0
- Set Font_Type=9 {System font}
-
- Set B_Red=255 {White background}
- Set B_Green=255
- Set B_Blue=255
- Set B_Type=1 {Transparent}
-
- {Set up the menu}
- SetMenu("&Brush",IGNORE,
- "&Solid", Brush_Solid,
- "Diagonal &Up", Brush_Diagonalup,
- "Diagonal &Down", Brush_Diagonaldown,
- "Diagonal &Cross", Brush_Diagonalcross,
- "&Horizontal", Brush_Horizontal,
- "&Vertical", Brush_Vertical,
- "&Cross", Brush_Cross,
- "&Null", Brush_Null,
- SEPARATOR,
- "&White", Brush_White,
- "&Gray", Brush_Gray,
- "&Red", Brush_Red,
- "&Yellow", Brush_Yel,
- "Gree&n", Brush_Grn,
- "&Light Blue", Brush_Ltblu,
- "&Blue", Brush_Blue,
- "&Pink", Brush_Pink,
- "Blac&k", Brush_Black,
- ENDPOPUP,
- "&Pen",IGNORE,
- "&Solid narrow", Pen_Solid_Narrow,
- "Solid &thick", Pen_Solid_Thick,
- "&Dash", Pen_Dash,
- "D&ot", Pen_Dot,
- "Da&sh dot", Pen_Dashdot,
- "Dash do&t dot", Pen_Dashdotdot,
- "&Null", Pen_Null,
- SEPARATOR,
- "&White", Pen_White,
- "&Gray", Pen_Gray,
- "&Red", Pen_Red,
- "&Yellow", Pen_Yel,
- "Gree&n", Pen_Grn,
- "&Light Blue", Pen_Ltblu,
- "&Blue", Pen_Blue,
- "&Pink", Pen_Pink,
- "Blac&k", Pen_Black,
- ENDPOPUP,
- "&Font",IGNORE,
- "&Terminal", Font_Terminal,
- "R&oman", Font_Roman,
- "&Script", Font_Script,
- "&Modern", Font_Modern,
- "&Helv", Font_Helv,
- "&Courier", Font_Courier,
- "T&ms Rmn", Font_TmsRmn,
- "S&ymbol", Font_Symbol,
- "&DIGITAL", Font_Digital,
- "&System", Font_System,
- SEPARATOR,
- "&White", Font_White,
- "&Gray", Font_Gray,
- "&Red", Font_Red,
- "&Yellow", Font_Yel,
- "Gree&n", Font_Grn,
- "&Light Blue", Font_Ltblu,
- "&Blue", Font_Blue,
- "&Pink", Font_Pink,
- "Blac&k", Font_Black,
- ENDPOPUP,
- "Back&ground",IGNORE,
- "&White", Back_Col_White,
- "&Gray", Back_Col_Gray,
- "&Red", Back_Col_Red,
- "&Yellow", Back_Col_Yel,
- "Gree&n", Back_Col_Grn,
- "&Light Blue", Back_Col_Ltblu,
- "&Blue", Back_Col_Blue,
- "&Pink", Back_Col_Pink,
- "Blac&k", Back_Col_Black,
- ENDPOPUP,
- "Exit!", Bye,
- ENDPOPUP)
-
- {Set the drawing tools}
- Set_Br: {Set the brush}
- If Br_Type = 0 Then UseBrush(SOLID,Br_Red,Br_Green,Br_Blue) | Goto Set_Pen
- If Br_Type = 1 Then UseBrush(DIAGONALUP,Br_Red,Br_Green,Br_Blue) | Goto Set_Pen
- If Br_Type = 2 Then UseBrush(DIAGONALDOWN,Br_Red,Br_Green,Br_Blue) | Goto Set_Pen
- If Br_Type = 3 Then UseBrush(DIAGONALCROSS,Br_Red,Br_Green,Br_Blue) | Goto Set_Pen
- If Br_Type = 4 Then UseBrush(HORIZONTAL,Br_Red,Br_Green,Br_Blue) | Goto Set_Pen
- If Br_Type = 5 Then UseBrush(VERTICAL,Br_Red,Br_Green,Br_Blue) | Goto Set_Pen
- If Br_Type = 6 Then UseBrush(CROSS,Br_Red,Br_Green,Br_Blue) | Goto Set_Pen
- {Else} UseBrush(NULL,Br_Red,Br_Green,Br_Blue)
-
- Set_Pen: {Set the pen}
- If Pen_Type = 0 Then UsePen(SOLID,1,Pen_Red,Pen_Green,Pen_Blue) | Goto Set_Font
- If Pen_Type = 1 Then UsePen(SOLID,3,Pen_Red,Pen_Green,Pen_Blue) | Goto Set_Font
- If Pen_Type = 2 Then UsePen(DASH,1,Pen_Red,Pen_Green,Pen_Blue) | Goto Set_Font
- If Pen_Type = 3 Then UsePen(DOT,1,Pen_Red,Pen_Green,Pen_Blue) | Goto Set_Font
- If Pen_Type = 4 Then UsePen(DASHDOT,1,Pen_Red,Pen_Green,Pen_Blue) | Goto Set_Font
- If Pen_Type = 5 Then UsePen(DASHDOTDOT,1,Pen_Red,Pen_Green,Pen_Blue) | Goto Set_Font
- {ELSE} UsePen(NULL,1,Pen_Red,Pen_Green,Pen_Blue) | Goto Set_Font
-
- Set_Font: {Establish the font}
- If Font_Type = 0 Then UseFont("Terminal",0,0,NOBOLD,NOITALIC,NOUNDERLINE,Font_Red,Font_Green,Font_Blue) | Goto Draw:
- If Font_Type = 1 Then UseFont("Roman",0,0,NOBOLD,NOITALIC,NOUNDERLINE,Font_Red,Font_Green,Font_Blue) | Goto Draw:
- If Font_Type = 2 Then UseFont("Script",0,0,NOBOLD,NOITALIC,NOUNDERLINE,Font_Red,Font_Green,Font_Blue) | Goto Draw:
- If Font_Type = 3 Then UseFont("Modern",0,0,NOBOLD,NOITALIC,NOUNDERLINE,Font_Red,Font_Green,Font_Blue) | Goto Draw:
- If Font_Type = 4 Then UseFont("Helv",0,0,NOBOLD,NOITALIC,NOUNDERLINE,Font_Red,Font_Green,Font_Blue) | Goto Draw:
- If Font_Type = 5 Then UseFont("Courier",0,0,NOBOLD,NOITALIC,NOUNDERLINE,Font_Red,Font_Green,Font_Blue) | Goto Draw:
- If Font_Type = 6 Then UseFont("Tms Rmn",0,0,NOBOLD,NOITALIC,NOUNDERLINE,Font_Red,Font_Green,Font_Blue) | Goto Draw:
- If Font_Type = 7 Then UseFont("Symbol",0,0,NOBOLD,NOITALIC,NOUNDERLINE,Font_Red,Font_Green,Font_Blue) | Goto Draw:
- If Font_Type = 8 Then UseFont("DIGITAL",0,0,NOBOLD,NOITALIC,NOUNDERLINE,Font_Red,Font_Green,Font_Blue) | Goto Draw:
- {ELSE} UseFont("System",0,0,NOBOLD,NOITALIC,NOUNDERLINE,Font_Red,Font_Green,Font_Blue)
-
- Draw:
- UseBackground(TRANSPARENT,B_Red,B_Green,B_Blue)
- DrawBackground
-
- DrawPie(0,10,45,40,40,30,13,12)
- DrawText(27,40,"Pie")
- DrawChord(45,10,90,40,85,30,58,12)
- DrawText(67,40,"Chord")
- DrawArc(90,10,135,40,130,30,103,12)
- DrawText(112,40,"Arc")
- DrawLine(150,10,180,32)
- DrawText(157,40,"Line")
-
- DrawEllipse(10,60,55,90)
- DrawText(25,93,"Ellipse")
- DrawRectangle(69,60,114,90)
- DrawText(81,93,"Rectangle")
- DrawRoundRectangle(128,60,173,90,6,6)
- DrawText(133,93,"Round Rectangle")
-
- {Wait for input}
- WaitInput()
-
- Brush_Solid:
- Set Br_Type = 0
- Goto Set_Br
-
- Brush_Diagonalup:
- Set Br_Type = 1
- Goto Set_Br
-
- Brush_Diagonaldown:
- Set Br_Type = 2
- Goto Set_Br
-
- Brush_Diagonalcross:
- Set Br_Type = 3
- Goto Set_Br
-
- Brush_Horizontal:
- Set Br_Type = 4
- Goto Set_Br
-
- Brush_Vertical:
- Set Br_Type = 5
- Goto Set_Br
-
- Brush_Cross:
- Set Br_Type = 6
- Goto Set_Br
-
- Brush_Null:
- Set Br_Type = 7
- Goto Set_Br
-
- Brush_White:
- Set Br_Red = 255
- Set Br_Green = 255
- Set Br_Blue = 255
- Goto Set_Br
-
- Brush_Gray:
- Set Br_Red = 192
- Set Br_Green = 192
- Set Br_Blue = 192
- Goto Set_Br
-
- Brush_Red:
- Set Br_Red = 255
- Set Br_Green = 0
- Set Br_Blue = 0
- Goto Set_Br
-
- Brush_Yel:
- Set Br_Red = 255
- Set Br_Green = 255
- Set Br_Blue = 0
- Goto Set_Br
-
- Brush_Grn:
- Set Br_Red = 0
- Set Br_Green = 255
- Set Br_Blue = 0
- Goto Set_Br
-
- Brush_Ltblu:
- Set Br_Red = 0
- Set Br_Green = 255
- Set Br_Blue = 255
- Goto Set_Br
-
- Brush_Blue:
- Set Br_Red = 0
- Set Br_Green = 0
- Set Br_Blue = 255
- Goto Set_Br
-
- Brush_Pink:
- Set Br_Red = 255
- Set Br_Green = 0
- Set Br_Blue = 255
- Goto Set_Br
-
- Brush_Black:
- Set Br_Red = 0
- Set Br_Green = 0
- Set Br_Blue = 0
- Goto Set_Br
-
- Pen_Solid_Narrow:
- Set Pen_Type = 0
- Goto Set_Pen
-
- Pen_Solid_Thick:
- Set Pen_Type = 1
- Goto Set_Pen
-
- Pen_Dash:
- Set Pen_Type = 2
- Goto Set_Pen
-
- Pen_Dot:
- Set Pen_Type = 3
- Goto Set_Pen
-
- Pen_Dashdot:
- Set Pen_Type = 4
- Goto Set_Pen
-
- Pen_Dashdotdot:
- Set Pen_Type = 5
- Goto Set_Pen
-
- Pen_Null:
- Set Pen_Type = 6
- Goto Set_Pen
-
- Pen_White:
- Set Pen_Red = 255
- Set Pen_Green = 255
- Set Pen_Blue = 255
- Goto Set_Pen
-
- Pen_Gray:
- Set Pen_Red = 192
- Set Pen_Green = 192
- Set Pen_Blue = 192
- Goto Set_Pen
-
- Pen_Red:
- Set Pen_Red = 255
- Set Pen_Green = 0
- Set Pen_Blue = 0
- Goto Set_Pen
-
- Pen_Yel:
- Set Pen_Red = 255
- Set Pen_Green = 255
- Set Pen_Blue = 0
- Goto Set_Pen
-
- Pen_Grn:
- Set Pen_Red = 0
- Set Pen_Green = 255
- Set Pen_Blue = 0
- Goto Set_Pen
-
- Pen_Ltblu:
- Set Pen_Red = 0
- Set Pen_Green = 255
- Set Pen_Blue = 255
- Goto Set_Pen
-
- Pen_Blue:
- Set Pen_Red = 0
- Set Pen_Green = 0
- Set Pen_Blue = 255
- Goto Set_Pen
-
- Pen_Pink:
- Set Pen_Red = 255
- Set Pen_Green = 0
- Set Pen_Blue = 255
- Goto Set_Pen
-
- Pen_Black:
- Set Pen_Red = 0
- Set Pen_Green = 0
- Set Pen_Blue = 0
- Goto Set_Pen
-
- Font_Terminal:
- Set Font_Type = 0
- Goto Set_Font
-
- Font_Roman:
- Set Font_Type = 1
- Goto Set_Font
-
- Font_Script:
- Set Font_Type = 2
- Goto Set_Font
-
- Font_Modern:
- Set Font_Type = 3
- Goto Set_Font
-
- Font_Helv:
- Set Font_Type = 4
- Goto Set_Font
-
- Font_Courier:
- Set Font_Type = 5
- Goto Set_Font
-
- Font_TmsRmn:
- Set Font_Type = 6
- Goto Set_Font
-
- Font_Symbol:
- Set Font_Type = 7
- Goto Set_Font
-
- Font_Digital:
- Set Font_Type = 8
- Goto Set_Font
-
- Font_System:
- Set Font_Type = 9
- Goto Set_Font
-
- Font_White:
- Set Font_Red = 255
- Set Font_Green = 255
- Set Font_Blue = 255
- Goto Set_Font
-
- Font_Gray:
- Set Font_Red = 192
- Set Font_Green = 192
- Set Font_Blue = 192
- Goto Set_Font
-
- Font_Red:
- Set Font_Red = 255
- Set Font_Green = 0
- Set Font_Blue = 0
- Goto Set_Font
-
- Font_Yel:
- Set Font_Red = 255
- Set Font_Green = 255
- Set Font_Blue = 0
- Goto Set_Font
-
- Font_Grn:
- Set Font_Red = 0
- Set Font_Green = 255
- Set Font_Blue = 0
- Goto Set_Font
-
- Font_Ltblu:
- Set Font_Red = 0
- Set Font_Green = 255
- Set Font_Blue = 255
- Goto Set_Font
-
- Font_Blue:
- Set Font_Red = 0
- Set Font_Green = 0
- Set Font_Blue = 255
- Goto Set_Font
-
- Font_Pink:
- Set Font_Red = 255
- Set Font_Green = 0
- Set Font_Blue = 255
- Goto Set_Font
-
- Font_Black:
- Set Font_Red = 0
- Set Font_Green = 0
- Set Font_Blue = 0
- Goto Set_Font
-
- Back_Col_White:
- Set B_Red = 255
- Set B_Green = 255
- Set B_Blue = 255
- Goto Draw
-
- Back_Col_Gray:
- Set B_Red = 192
- Set B_Green = 192
- Set B_Blue = 192
- Goto Draw
-
- Back_Col_Red:
- Set B_Red = 255
- Set B_Green = 0
- Set B_Blue = 0
- Goto Draw
-
- Back_Col_Yel:
- Set B_Red = 255
- Set B_Green = 255
- Set B_Blue = 0
- Goto Draw
-
- Back_Col_Grn:
- Set B_Red = 0
- Set B_Green = 255
- Set B_Blue = 0
- Goto Draw
-
- Back_Col_Ltblu:
- Set B_Red = 0
- Set B_Green = 255
- Set B_Blue = 255
- Goto Draw
-
- Back_Col_Blue:
- Set B_Red = 0
- Set B_Green = 0
- Set B_Blue = 255
- Goto Draw
-
- Back_Col_Pink:
- Set B_Red = 255
- Set B_Green = 0
- Set B_Blue = 255
- Goto Draw
-
- Back_Col_Black:
- Set B_Red = 0
- Set B_Green = 0
- Set B_Blue = 0
- Goto Draw
-
- Bye:
- End