2 Copyright (C) 1998 BJ Eirich (aka vecna)
\r
3 This program is free software; you can redistribute it and/or
\r
4 modify it under the terms of the GNU General Public License
\r
5 as published by the Free Software Foundation; either version 2
\r
6 of the License, or (at your option) any later version.
\r
7 This program is distributed in the hope that it will be useful,
\r
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
\r
10 See the GNU General Public Lic
\r
11 See the GNU General Public License for more details.
\r
12 You should have received a copy of the GNU General Public License
\r
13 along with this program; if not, write to the Free Software
\r
14 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
\r
17 // Additional code by Richard Lau (aka Ric)
\r
19 #include "config.h" // Colour definitions
\r
20 #include "vdriver.h" // Video driver functions
\r
21 #include "smalfont.h"
\r
23 // ================================= Code ====================================
\r
25 void stdwindow(int x1, int y1, int x2, int y2)
\r
27 FilledBox(x1, y1, x2-x1, y2-y1, winbg);
\r
28 HLine(x1, y1, x2-x1, black); /* -- ric: 13/Jun/98 -- */
\r
29 VLine(x1, y1, y2-y1, black); /* Outline window in black */
\r
30 HLine(x1+1, y2-1, x2-x1-1, black);
\r
31 VLine(x2-1, y1+1, y2-y1-1, black);
\r
33 HLine(x1+1, y1+1, x2-x1-2, brightw);
\r
34 VLine(x1+1, y1+1, y2-y1-2, brightw);
\r
35 HLine(x1+2, y2-2, x2-x1-3, darkw);
\r
36 VLine(x2-2, y1+2, y2-y1-3, darkw);
\r
39 void Window(int x1, int y1, int x2, int y2, char *title)
\r
41 FilledBox(x1, y1, x2-x1, y2-y1, winbg);
\r
42 FilledBox(x1, y1, x2-x1, 8, titlebg);
\r
43 HLine(x1, y1, x2-x1, brightw);
\r
44 VLine(x1, y1, y2-y1, brightw);
\r
45 HLine(x1+1, y2-1, x2-x1-1, darkw);
\r
46 VLine(x2-1, y1+1, y2-y1-1, darkw);
\r
47 FilledBox(x2-8, y1+2, 5, 5, winbg);
\r
48 HLine(x2-8, y1+2, 6, brightw);
\r
49 VLine(x2-8, y1+2, 5, brightw);
\r
50 HLine(x2-7, y1+6, 4, darkw);
\r
51 VLine(x2-3, y1+3, 4, darkw);
\r
57 void CheckBox(int x, int y, char checked)
\r
59 FilledBox(x, y, 7, 6, 0);
\r
60 HLine(x, y, 8, darkw);
\r
61 VLine(x, y, 7, darkw);
\r
62 HLine(x+1, y+6, 7, brightw);
\r
63 VLine(x+7, y+1, 5, brightw);
\r
71 void Button(int x, int y, char *str)
\r
73 stdwindow(x,y,x+30,y+10);
\r
74 // HLine(x, y, 30, black); /* -- ric: 13/Jun/98 -- */
\r
75 // VLine(x, y, 10, black); /* Outline buttons in black */
\r
76 /* HLine(x+1, y+9, 29, black);
\r
77 VLine(x+29, y+1, 9, black);
\r
79 HLine(x+1, y+1, 28, white);
\r
80 VLine(x+1, y+1, 8, white);
\r
81 HLine(x+2, y+8, 27, darkw);
\r
82 VLine(x+28, y+2, 7, darkw); */
\r
83 GotoXY(x+(15-(pixels(str)/2)), y+2);
\r
87 void BigButton(int x, int y, char *str)
\r
89 stdwindow(x,y,x+50,y+10);
\r
90 // HLine(x, y, 50, black); /* -- ric: 13/Jun/98 -- */
\r
91 // VLine(x, y, 10, black); /* Outline buttons in black */
\r
92 /* HLine(x+1, y+9, 49, black);
\r
93 VLine(x+49, y+1, 9, black);
\r
95 HLine(x+1, y+1, 48, white);
\r
96 VLine(x+1, y+1, 8, white);
\r
97 HLine(x+2, y+8, 47, darkw);
\r
98 VLine(x+48, y+2, 7, darkw); */
\r
99 GotoXY(x+(25-(pixels(str)/2)), y+2);
\r
103 void ButtonPressed(int x, int y, char *str)
\r
104 /* -- ric: 13/Jun/98 -- */
\r
105 /* Draws a depressed button */
\r
107 stdwindow(x,y,x+30,y+10);
\r
108 HLine(x+1, y+1, 28, darkw);
\r
109 VLine(x+1, y+1, 8, darkw);
\r
110 HLine(x+2, y+8, 27, winbg);
\r
111 VLine(x+28, y+2, 7, winbg);
\r
112 GotoXY(x+1+(15-(pixels(str)/2)), y+3);
\r
116 void BigButtonPressed(int x, int y, char *str)
\r
118 stdwindow(x,y,x+50,y+10);
\r
119 HLine(x+1, y+1, 48, darkw);
\r
120 VLine(x+1, y+1, 8, darkw);
\r
121 HLine(x+2, y+8, 47, winbg);
\r
122 VLine(x+48, y+2, 7, winbg);
\r
123 GotoXY(x+1+(25-(pixels(str)/2)), y+3);
\r
127 void TextField(int x, int y, int width, char *str, char blink)
\r
129 FilledBox(x, y, width, 9, 0);
\r
130 HLine(x, y, width+1, darkw);
\r
131 VLine(x, y, 9, darkw);
\r
132 HLine(x+1, y+8, width-1, brightw);
\r
133 VLine(x+width, y+1, 8, brightw);
\r
136 if (blink) printstring("_");
\r