TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: ANTHONY TIBBS
from: KURT KUZBA
date: 1997-12-27 13:05:00
subject: Windowing 5/5

/*_|_|   begin   WINDERS.CPP   (part 5 of 5)                       **
_|_|_|   PUBLIC DOMAIN   by Kurt Kuzba   12/25/1997                **
_|_|_|   A simple example of using windowed text in Borland C++.   **
_|_|_|   No warrantees or guarantees given or implied.             **
_|_|*/
//   Test code   ****************************************************
int main(void)
{
   short cursor = *((short*)0x00400050L);
   // just getting the cursor position so I can restore it later
   BasicWindow *Plain = new BasicWindow;
   Plain->Create(6, 11, 75, 15);
   // the syntax is compatible with Borland's. easier to remember.
   Plain->TxtOut(
      "A plain window with no border or shadow.");
   Plain->SetColors(0x30);
   // example of how we can change text colors
   Plain->TxtOut("Just keep hitting keys until you exit the"
      " program.", 3, 0);
   // giving a zero parameter automatically centers our text.
   getch();
   BorderWindow *Border = new BorderWindow;
   Border->Create(21, 6, 60, 20, 0x2e, 0x30);
   // we can specify our border and window colors
   Border->TxtOut("A Bordered Window.", 0, 0);
   // centering works for vertical as well as for horizontal
   getch();
   DoubleShadowWindow *Shadow = new DoubleShadowWindow;
   Shadow->Create(1, 2, 45, 11, 0x6a, 0x60);
   Shadow->TxtOut("A window with a double shadow.", 2, 0);
   getch();
   delete Shadow;
   getch();
   delete Border;
   getch();
   delete Plain;
   getch();
   window(1, 1, WIDE, HIGH);
   *((short*)0x00400050L) = cursor;
   cprintf("\r");
   // restore startup cursor position and move to column one
   return 0;
}
/*_|_|   end   WINDERS.CPP   (part 5 of 5)                         */
> ] You cannot enter the Underground without a Tolkien..........
---
---------------
* Origin: *YOPS ]I[* 3.1 GIG * RA/FD/FE RADist * Milwaukee, WI (1:154/750)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.