home *** CD-ROM | disk | FTP | other *** search
- Procedure DrawBox(StartPosIn, StartPosDown, LengthBox, WidthBox : Integer);
-
- (* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ *)
- (* This procedure will draw a box on the screen. It is good for framing *)
- (* menus and such. The input is four numeric values, the first two values *)
- (* are the X, Y coordinates of the screen, the next two values are the *)
- (* length and width of the box. *)
- (* *)
- (* Example DrawBox(10,5,60,15) *)
- (* 10 = X coordinate of the screen. *)
- (* 5 = Y coordinate of the screen. *)
- (* 60 = Length of the box. *)
- (* 15 = Width of the box. *)
- (* *)
- (* Written by *)
- (* Tony Tunison - 75106,2317 *)
- (* Bill Cote - 71256,402 *)
- (* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ *)
-
- Const
- DoubleHorizontal = #205; (* M *)
- SingleVertical = #179; (* 3 *)
- CornerOne = #213; (* U *)
- CornerTwo = #184; (* 8 *)
- CornerThree = #190; (* > *)
- CornerFour = #212; (* T *)
-
- Var
- Count : Integer;
-
- Procedure CheckBox;
-
- (* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ *)
- (* This procedure will make sure that the box will fit on the screen. *)
- (* The parameters 'LengthBox' and 'LengthWidth' will be modified so that *)
- (* it will fit. *)
- (* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ *)
-
- Var
- TotalLength,
- TotalWidth,
- LeftOver : Integer;
-
- Begin
- TotalLength := StartPosIn + LengthBox;
- If TotalLength > 80 Then
- Begin
- LeftOver := TotalLength - 79;
- LengthBox := LengthBox - LeftOver
- End;
-
- TotalWidth := StartPosDown + WidthBox;
- If TotalWidth > 25 Then
- Begin
- LeftOver := TotalWidth - 24;
- WidthBox := WidthBox - LeftOver;
- End
- End;
-
- Begin
- CheckBox;
- GotoXY(StartPosIn, StartPosDown);
-
- For Count := 1 To LengthBox Do
- Write(DoubleHorizontal);
- Write(CornerTwo);
-
- For Count := 1 To WidthBox Do
- Begin
- GotoXY(StartPosIn + LengthBox, StartPosDown + Count);
- Write(SingleVertical)
- End;
-
- GotoXY(StartPosIn, StartPosDown + WidthBox);
- For Count := 1 To LengthBox Do
- Begin
- Write(DoubleHorizontal)
- End;
- Write(CornerThree);
-
- For Count := 1 To WidthBox Do
- Begin
- GotoXY(StartPosIn, StartPosDown + Count);
- Write(SingleVertical)
- End;
-
- GotoXY(StartPosIn, StartPosDown);
- Write(CornerOne);
- For Count := 2 To WidthBox Do
- Begin
- GotoXY(StartPosIn, StartPosDown + Count);
- Write(SingleVertical)
- End;
- GotoXY(StartPosIn, StartPosDown + Count);
- Write(CornerFour)
- End;