⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bossdemo.c

📁 BOSS窗口开发 C 语言程序库
💻 C
字号:
/*
** Demo for The Window Boss
**
** Copyright (c) 1985-1990 - Philip A. Mongelluzzo
** All rights reserved.
**
*/

#include "windows.h"                    /* windows header file */

#if DLC
int _stack = 8192;                      /* Datalight C */
#endif

#if BORLAND
unsigned _stklen = 8192;
#endif

#define MAXWIN 100                      /* for 100 windows */
WINDOWPTR wins[MAXWIN];                 /* DONT INCREASE IN SMALL MODEL */

unsigned blue = BLUE;                   /* remap for mono */

/*
** Prototypes to keep the new ANSI Compilers Happy
*/

#if BORLAND | WATCOM | MSC
int main(int argc, char **argv);
int dedemo(void);
int pddemo(void);
int dotelecom(int ch);
int dosetup(int ch);
int dofileman(int ch);
int dooutput(int ch);
int dorun(int ch);
int doedit(int ch);
int nap(int ticks);
int hiber(int seconds);
int chkesc(void);
int paktc(void);
#endif

main(argc,argv)
int argc;
char *argv[];
{
WINDOWPTR     w2, w3;                   /* a few windows */
WINDOWPTR tw1, tw2, tw3;                /* and a few more */

WINDOWPTR wn_qpopup();                  /* function returns WP */
int i,j;                                /* scratch integers */
int t50rib;                             /* top 50 atrib */
int watrib,batrib;                      /* scratch atributes */
int rv;                                 /* for popup */
int row,col;                            /* for 100 windows */

MOUSEPTR mm;                            /* my mouse ptr */
int mstat, mclik, mrow, mcol;           /* mouse stuff */

  static struct pmenu m1 = {
    00, FALSE, 00,
    00, 00, {
    01, 02, "Presenting", 0,
    99, 99, "",99 }
  };

  static struct pmenu m2 = {
    00, FALSE, 00,
    00, 00, {
    01, 02, "The", 0,
    03, 02, "W i n d o w   B O S S", 0,
    05, 02, "Fast - Easy - Windows", 0,
    07, 02, "for the C Language", 0,
    99, 99, "",99 }
  };

  static struct pmenu intelc = {
    00, FALSE, 00,
    02, 06, {
    01, 02, "         Intellicom", 0,
    02, 02, "        Quick - Help", 0,
    04, 05, "1 General Information  ", 1,
    05, 05, "2 Terminal Mode Options", 2,
    06, 05, "3 XMODEM File Send     ", 3,
    07, 05, "4 XMODEM File Receive  ", 4,
#if MSC | DLC | CI86 | LC3
     8, 05, "5 CompuServe Exec Mode ", 5,
#else         
    08, 05, "5 CompuServe Exec Mode ", 5,
#endif
    10, 02, "Press: ESC to quit or Cursor", 0,
    11, 02, " Keys to Position Cursor then", 0,
    12, 02, " press RETURN for MORE info.", 0,
    99, 99, "",99 }
  };

if(argc > 2) wn_dmaflg=FALSE;         /* for testing bios access */
  if(wns_mtflg == 7) blue = BLACK;      /* remap if mono */
  if(argc > 1) wn_dmode(PAINT);         /* pretend CGA */

  wn_init();                            /* save entry screen */

  batrib = v_setatr(WHITE,BLACK,0,BOLD);/* set border atrib */
  watrib = v_setatr(WHITE,RED,0,0);     /* make it american */
  w2 = wn_qpopup(0,0,0,16,3,watrib,batrib,&m1);
  for(i=1; i<11; i++)                   /* move it into place */
    w2 = wn_move(w2, i, i*2); 

  hiber(1);                             /* wait 1 second (aprx) */

  batrib = v_setatr(RED,WHITE,0,BOLD);  /* set border atrib */
  watrib = v_setatr(blue,WHITE,0,BOLD); /* make this american too */
  w3 = wn_qpopup(0,0,0,30,9,watrib|BOLD,batrib,&m2);
  for(i=1; i<8; i++)                    /* move into place */
    w3 = wn_move(w3,i,6*i);             /* move into place */

  hiber(5);                             /* reading time.. */

  wn_clr(w3);
  wn_title(w3," PLEASE NOTE ");
  wn_printf(w3,"\n");
  wn_printf(w3,"This demo contains reading\n");
  wn_printf(w3,"time delays that you can\n");
  wn_printf(w3,"shorten by pressing the ESC\n");
  wn_printf(w3,"key.\n\n");
  wn_printf(w3,"Press any key to continue...");
  paktc();

  wn_close(w3);                         /* close a couple */
  hiber(1);
  wn_close(w2);
  hiber(1);

  watrib = v_setatr(WHITE,BLACK,0,BOLD);
  for(i=0; i<25; i++) {                 /* build the back drop */
    v_locate(0,i,0);                    /* position cursor */
    v_wca(0, 0xb0, watrib, 80);         /* the fast way */
  }
  v_hidec();                            /* hide the cursor */

  watrib = v_setatr(WHITE,BLACK,0,0);   /* window attribute */
  batrib = v_setatr(blue,WHITE,0,0);    /* border attribute */
  w3 = wn_open(800,1,9,60,21,watrib,batrib);
  w3->bstyle |= BOLD;                   /* toggle bold on then off */
  wn_title(w3," The Window BOSS for C ");
  w3->bstyle ^= BOLD;
  wn_puts(w3,1,1,"The Window BOSS puts YOU in control of the most important");
  wn_puts(w3,2,1,"sophisticated state-of-the-art screen handling techniques");
  wn_puts(w3,3,1,"available today.  Pop-up windows, pull-down menus, status ");
  wn_puts(w3,4,1,"lines and context sensitive help functions are a breeze ");
  wn_puts(w3,5,1,"to implement!  Your program automatically senses the ");
  wn_puts(w3,6,1,"video card installed and ALL your video output takes ");
  wn_puts(w3,7,1,"place with no snow, no flicker, and no delay. But best of");
  wn_puts(w3,8,1,"all, The Window BOSS is available as SHAREWARE software!");
  wn_puts(w3,9,1," ");
  wn_puts(w3,10,1,"The Window BOSS is available for the Lattice, Microsoft,  ");
  wn_puts(w3,11,1,"Datalight, Borland, Mix Power C, Aztec, WATCOM, Zortech,");
  wn_puts(w3,12,1,"and Computer Innovation CI86 C Compilers.  Registered");
  wn_puts(w3,13,1,"users receive complete documentation, all source code,");
  wn_puts(w3,14,1,"and libaries for the small and large memory models for");
  wn_puts(w3,15,1,"all supported compilers (others can be locally created)!");
  wn_puts(w3,16,1," ");
  wn_puts(w3,17,1,"I challenge you to compare: The Window BOSS is faster");
  wn_puts(w3,18,1,"and easier to use than most commercial products on the");
  wn_puts(w3,19,1,"market today!");
  hiber(30);

  wn_clr(w3);
  wn_puts(w3, 1,1,"Tim Parker's column in the February 87 issue of Computer ");
  wn_puts(w3, 2,1,"Language stated \"the ease of use will cause some ");
  wn_puts(w3, 3,1,"programmers to go overboard with windows\", and \"if you ");
  wn_puts(w3, 4,1,"are a die-hard C programmer looking for a useful, ");
  wn_puts(w3, 5,1,"license-free product, this is it\".");
  wn_puts(w3, 6,1," ");
  wn_puts(w3, 7,1,"Hardin Bothers' column in the June 88 issue of PC ");
  wn_puts(w3, 8,1,"Resource stated \"Within its domain, The Window BOSS is ");
  wn_puts(w3, 9,1,"as useful and as powerful as any C library I've used\". ");
  wn_puts(w3,10,1,"\"The Window BOSS owes much of its power to its ");
  wn_puts(w3,11,1,"uncluttered organization. Although the product supports ");
  wn_puts(w3,12,1,"five C Compilers - Microsoft C, Lattice C, Borland's ");
  wn_puts(w3,13,1,"Turbo C, Computer Innovations CI86, and Datalight C - it ");
  wn_puts(w3,14,1,"does it with a minmum of fuss\".");
  wn_puts(w3,15,1," ");
  wn_puts(w3,16,1,"The BOSS is currently being used by dozens of Fortune ");
  wn_puts(w3,17,1,"500 Companies, numerous universities, and discriminating ");
  wn_puts(w3,18,1,"\"C\" programmers around the world!  Haven't you waited ");
  wn_puts(w3,19,1,"long enough?");
  hiber(30);


  wn_clr(w3);
  wn_puts(w3, 1,1,"  Psst...");
  wn_puts(w3, 2,1,"  ");
  wn_puts(w3, 3,1,"    The Window BOSS is one of ");
  wn_puts(w3, 4,1,"               PC-SIG's TOP 50 Best Selling Programs");
  wn_puts(w3, 5,1,"  ");
  wn_puts(w3, 6,1,"              圹圹圹     圹圹

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -