]> 4ch.mooo.com Git - 16.git/blobdiff - 16/v2/source/verge/MAPED/GUICOMP.C
new file: 16/v2/CONSOLE.TXT
[16.git] / 16 / v2 / source / verge / MAPED / GUICOMP.C
diff --git a/16/v2/source/verge/MAPED/GUICOMP.C b/16/v2/source/verge/MAPED/GUICOMP.C
new file mode 100644 (file)
index 0000000..e9f8779
--- /dev/null
@@ -0,0 +1,137 @@
+/*\r
+Copyright (C) 1998 BJ Eirich (aka vecna)\r
+This program is free software; you can redistribute it and/or\r
+modify it under the terms of the GNU General Public License\r
+as published by the Free Software Foundation; either version 2\r
+of the License, or (at your option) any later version.\r
+This program is distributed in the hope that it will be useful,\r
+but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\r
+See the GNU General Public Lic\r
+See the GNU General Public License for more details.\r
+You should have received a copy of the GNU General Public License\r
+along with this program; if not, write to the Free Software\r
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.\r
+*/\r
+\r
+// Additional code by Richard Lau (aka Ric)\r
+\r
+#include "config.h"    // Colour definitions\r
+#include "vdriver.h"   // Video driver functions\r
+#include "smalfont.h"\r
+\r
+// ================================= Code ====================================\r
+\r
+void stdwindow(int x1, int y1, int x2, int y2)\r
+{\r
+  FilledBox(x1, y1, x2-x1, y2-y1, winbg);\r
+  HLine(x1, y1, x2-x1, black);     /* -- ric: 13/Jun/98 --     */\r
+  VLine(x1, y1, y2-y1, black);     /* Outline window in black */\r
+  HLine(x1+1, y2-1, x2-x1-1, black);\r
+  VLine(x2-1, y1+1, y2-y1-1, black);\r
+\r
+  HLine(x1+1, y1+1, x2-x1-2, brightw);\r
+  VLine(x1+1, y1+1, y2-y1-2, brightw);\r
+  HLine(x1+2, y2-2, x2-x1-3, darkw);\r
+  VLine(x2-2, y1+2, y2-y1-3, darkw);\r
+}\r
+\r
+void Window(int x1, int y1, int x2, int y2, char *title)\r
+{\r
+  FilledBox(x1, y1, x2-x1, y2-y1, winbg);\r
+  FilledBox(x1, y1, x2-x1, 8, titlebg);\r
+  HLine(x1, y1, x2-x1, brightw);\r
+  VLine(x1, y1, y2-y1, brightw);\r
+  HLine(x1+1, y2-1, x2-x1-1, darkw);\r
+  VLine(x2-1, y1+1, y2-y1-1, darkw);\r
+  FilledBox(x2-8, y1+2, 5, 5, winbg);\r
+  HLine(x2-8, y1+2, 6, brightw);\r
+  VLine(x2-8, y1+2, 5, brightw);\r
+  HLine(x2-7, y1+6, 4, darkw);\r
+  VLine(x2-3, y1+3, 4, darkw);\r
+\r
+  GotoXY(x1+2, y1+2);\r
+  printstring(title);\r
+}\r
+\r
+void CheckBox(int x, int y, char checked)\r
+{\r
+  FilledBox(x, y, 7, 6, 0);\r
+  HLine(x, y, 8, darkw);\r
+  VLine(x, y, 7, darkw);\r
+  HLine(x+1, y+6, 7, brightw);\r
+  VLine(x+7, y+1, 5, brightw);\r
+  if (checked)\r
+  {\r
+    GotoXY(x+2, y+2);\r
+    printstring("*");\r
+  }\r
+}\r
+\r
+void Button(int x, int y, char *str)\r
+{\r
+  stdwindow(x,y,x+30,y+10);\r
+//  HLine(x, y, 30, black);      /* -- ric: 13/Jun/98 --     */\r
+//  VLine(x, y, 10, black);      /* Outline buttons in black */\r
+/*  HLine(x+1, y+9, 29, black);\r
+  VLine(x+29, y+1, 9, black);\r
+\r
+  HLine(x+1, y+1, 28, white);\r
+  VLine(x+1, y+1, 8, white);\r
+  HLine(x+2, y+8, 27, darkw);\r
+  VLine(x+28, y+2, 7, darkw); */\r
+  GotoXY(x+(15-(pixels(str)/2)), y+2);\r
+  printstring(str);\r
+}\r
+\r
+void BigButton(int x, int y, char *str)\r
+{\r
+  stdwindow(x,y,x+50,y+10);\r
+//  HLine(x, y, 50, black);      /* -- ric: 13/Jun/98 --     */\r
+//  VLine(x, y, 10, black);      /* Outline buttons in black */\r
+/*  HLine(x+1, y+9, 49, black);\r
+  VLine(x+49, y+1, 9, black);\r
+\r
+  HLine(x+1, y+1, 48, white);\r
+  VLine(x+1, y+1, 8, white);\r
+  HLine(x+2, y+8, 47, darkw);\r
+  VLine(x+48, y+2, 7, darkw); */\r
+  GotoXY(x+(25-(pixels(str)/2)), y+2);\r
+  printstring(str);\r
+}\r
+\r
+void ButtonPressed(int x, int y, char *str)\r
+/* -- ric: 13/Jun/98 --     */\r
+/* Draws a depressed button */\r
+{\r
+  stdwindow(x,y,x+30,y+10);\r
+  HLine(x+1, y+1, 28, darkw);\r
+  VLine(x+1, y+1, 8, darkw);\r
+  HLine(x+2, y+8, 27, winbg);\r
+  VLine(x+28, y+2, 7, winbg);\r
+  GotoXY(x+1+(15-(pixels(str)/2)), y+3);\r
+  printstring(str);\r
+}\r
+\r
+void BigButtonPressed(int x, int y, char *str)\r
+{\r
+  stdwindow(x,y,x+50,y+10);\r
+  HLine(x+1, y+1, 48, darkw);\r
+  VLine(x+1, y+1, 8, darkw);\r
+  HLine(x+2, y+8, 47, winbg);\r
+  VLine(x+48, y+2, 7, winbg);\r
+  GotoXY(x+1+(25-(pixels(str)/2)), y+3);\r
+  printstring(str);\r
+}\r
+\r
+void TextField(int x, int y, int width, char *str, char blink)\r
+{\r
+  FilledBox(x, y, width, 9, 0);\r
+  HLine(x, y, width+1, darkw);\r
+  VLine(x, y, 9, darkw);\r
+  HLine(x+1, y+8, width-1, brightw);\r
+  VLine(x+width, y+1, 8, brightw);\r
+  GotoXY(x+2, y+2);\r
+  printstring(str);\r
+  if (blink) printstring("_");\r
+}\r