home *** CD-ROM | disk | FTP | other *** search
- Procedure DrawBox (UpperLeftX, UpperLeftY, LengthBox, WidthBox : Integer);
-
- (* This procedure draws a box on the screen. It's good for framing *)
- (* menus and such. The first two input values are the upper left *)
- (* X, Y coordinates of the screen. The next two values are the *)
- (* length and width of the box. *)
-
- Const
- HorizLine = #205;
- VertLine = #179;
- UpLeftCorner = #213;
- UpRightCorner = #184;
- LowLeftCorner = #190;
- LowRightCorner = #212;
-
- Var
- Count : Integer;
-
- Procedure CheckBox;
-
- Var
- TotalLength,
- TotalWidth,
- LeftOver : Integer;
-
- Begin
- TotalLength := UpperLeftX + LengthBox;
- If TotalLength > 80 Then
- Begin
- LeftOver := TotalLength - 79;
- LengthBox := LengthBox - LeftOver;
- End;
-
- TotalWidth := UpperLeftY + WidthBox;
- If TotalWidth > 25 Then
- Begin
- LeftOver := TotalWidth - 24;
- WidthBox := WidthBox - LeftOver;
- End;
- End;
-
- Begin
- CheckBox;
- GotoXY(UpperLeftX, UpperLeftY);
-
- For Count := 1 To LengthBox Do
- Write(HorizLine);
- Write(UpRightCorner);
-
- For Count := 1 To WidthBox Do
- Begin
- GotoXY(UpperLeftX + LengthBox, UpperLeftY + Count);
- Write(VertLine);
- End;
-
- GotoXY(UpperLeftX, UpperLeftY + WidthBox);
- For Count := 1 To LengthBox Do
- Begin
- Write(HorizLine);
- End;
- Write(LowLeftCorner);
-
- For Count := 1 To WidthBox Do
- Begin
- GotoXY(UpperLeftX, UpperLeftY + Count);
- Write(VertLine);
- End;
-
- GotoXY(UpperLeftX, UpperLeftY);
- Write(UpLeftCorner);
-
- For Count := 2 To WidthBox Do
- Begin
- GotoXY(UpperLeftX, UpperLeftY + Count);
- Write(VertLine);
- End;
-
- GotoXY(UpperLeftX, UpperLeftY + Count);
- Write(LowRightCorner);
- End;
-
-