Rev 740 | Rev 747 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 740 | Rev 746 | ||
---|---|---|---|
Line 13... | Line 13... | ||
13 | 13 | ||
14 | uses |
14 | uses |
15 | StrList; |
15 | StrList; |
16 | 16 | ||
17 | const |
17 | const |
- | 18 | (* These are available in DRIVERS.TPU, but require a call of InitVideo |
|
18 | ScreenWidth = 80; |
19 | ScreenWidth = 80; |
19 | ScreenHeight = 25; |
20 | ScreenHeight = 25; |
- | 21 | *) |
|
20 | SINGLE_LINE_BOX_PADDING = 3; |
22 | SINGLE_LINE_BOX_PADDING = 3; |
21 | SINGLE_LINE_BOX_PADDING_INNER = 10; |
23 | SINGLE_LINE_BOX_PADDING_INNER = 10; |
22 | 24 | ||
23 | procedure DrawThinBorder(x, y, width, height: integer); |
25 | procedure DrawThinBorder(x, y, width, height: integer); |
24 | procedure DrawDoubleBorder(x, y, width, height: integer); |
26 | procedure DrawDoubleBorder(x, y, width, height: integer); |
Line 30... | Line 32... | ||
30 | Title: string; borderStrength: integer): integer; |
32 | Title: string; borderStrength: integer): integer; |
31 | procedure ClearSection(x, y, width, height: integer); |
33 | procedure ClearSection(x, y, width, height: integer); |
32 | function QueryVal(var s: string; initX, initY, width, height: integer; |
34 | function QueryVal(var s: string; initX, initY, width, height: integer; |
33 | Title: string; borderStrength: integer): boolean; |
35 | Title: string; borderStrength: integer): boolean; |
34 | procedure ShowMessage(msg: string; title: string; dobeep: boolean); |
36 | procedure ShowMessage(msg: string; title: string; dobeep: boolean); |
- | 37 | procedure CursorOn; |
|
- | 38 | procedure CursorOff; |
|
35 | 39 | ||
36 | implementation |
40 | implementation |
37 | 41 | ||
38 | uses |
42 | uses |
39 | Crt, Drivers, VtsFuncs; |
43 | Crt, Drivers, VtsFuncs; |
Line 180... | Line 184... | ||
180 | (* since the char in the right bottom corner is written! *) |
184 | (* since the char in the right bottom corner is written! *) |
181 | for i := 1 to right-1 do |
185 | for i := 1 to right-1 do |
182 | begin |
186 | begin |
183 | Write(' '); |
187 | Write(' '); |
184 | end; |
188 | end; |
- | 189 | GoToXY(1,1); |
|
185 | 190 | ||
186 | TextBackground(Black); |
191 | TextBackground(Black); |
187 | TextColor(White); |
192 | TextColor(White); |
188 | end; |
193 | end; |
189 | 194 | ||
190 | procedure DrawTitleBar(center, left, right: string); |
195 | procedure DrawTitleBar(center, left, right: string); |
- | 196 | var |
|
- | 197 | bakx, baky: integer; |
|
191 | begin |
198 | begin |
- | 199 | bakx := WhereX; |
|
- | 200 | baky := WhereY; |
|
- | 201 | ||
192 | DrawTextBar(center, 1); |
202 | DrawTextBar(center, 1); |
193 | 203 | ||
194 | (* Put left text into the title bar *) |
204 | (* Put left text into the title bar *) |
195 | GoToXY(1,1); |
205 | GoToXY(1,1); |
196 | TextBackground(White); |
206 | TextBackground(White); |
Line 204... | Line 214... | ||
204 | TextBackground(White); |
214 | TextBackground(White); |
205 | TextColor(Black); |
215 | TextColor(Black); |
206 | WriteLn(right); |
216 | WriteLn(right); |
207 | TextBackground(Black); |
217 | TextBackground(Black); |
208 | TextColor(White); |
218 | TextColor(White); |
- | 219 | ||
- | 220 | GoToXY(bakx, baky); |
|
209 | end; |
221 | end; |
210 | 222 | ||
211 | procedure DrawStatusBar(str: string); |
223 | procedure DrawStatusBar(str: string); |
- | 224 | var |
|
- | 225 | bakx, baky: integer; |
|
212 | begin |
226 | begin |
- | 227 | bakx := WhereX; |
|
- | 228 | baky := WhereY; |
|
213 | DrawTextBar(str, ScreenHeight); |
229 | DrawTextBar(str, ScreenHeight); |
- | 230 | GoToXY(bakx, baky); |
|
214 | end; |
231 | end; |
215 | 232 | ||
216 | function DrawSelectionList(X, Y, ListWidth, ListHeight: integer; |
233 | function DrawSelectionList(X, Y, ListWidth, ListHeight: integer; |
217 | items: PStringList; allowESC: boolean; |
234 | items: PStringList; allowESC: boolean; |
218 | Title: string; borderStrength: integer): integer; |
235 | Title: string; borderStrength: integer): integer; |
Line 562... | Line 579... | ||
562 | GoToXY(x, y+1); |
579 | GoToXY(x, y+1); |
563 | Write(msg); |
580 | Write(msg); |
564 | if DoBeep then Beep; |
581 | if DoBeep then Beep; |
565 | end; |
582 | end; |
566 | 583 | ||
- | 584 | procedure CursorOn; assembler; |
|
- | 585 | asm |
|
- | 586 | mov ah,1 (* Set text-mode cursor shape *) |
|
- | 587 | mov cx,0607h (* normal underline cursor *) |
|
- | 588 | int 10h |
|
- | 589 | end; |
|
- | 590 | ||
- | 591 | procedure CursorOff; assembler; |
|
- | 592 | asm |
|
- | 593 | mov ah,1 (* Set text-mode cursor shape *) |
|
- | 594 | mov cx,2607h (* hide cursor (Start>End) *) |
|
- | 595 | int 10h |
|
- | 596 | end; |
|
- | 597 | ||
567 | end. |
598 | end. |