home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / iapp300.zip / SAMPLES / VIOSCR.C < prev    next >
C/C++ Source or Header  |  1995-03-01  |  4KB  |  98 lines

  1. /************************************************************************/
  2. /*                    VIO Screen Sample Program                                            */
  3. /************************************************************************/
  4. /* Function        Display a sample panel on the screen.                             */
  5. /* Author        (c) Copyright Infoline AG 1995                                    */
  6. /*                    Schaffhauserstrasse 121                                                */
  7. /*                    CH-8302 Kloten - Switzerland                                        */
  8. /*                    Phone: +41 1 803 07 06 / Fax: +41 1 881 17 55                */
  9. /* History        V3.00 01/Mar/1995 Andy Brunner    Initial program version    */
  10. /************************************************************************/
  11.  
  12. #define    INCL_BASE
  13. #define    USER_OS2
  14.  
  15. #include "user.h"                                /* Include the necessary files    */
  16. #include "iapp.h"                                /* Include IAPP user file            */
  17.  
  18. /*======================================================================*/
  19. /*    Function: main                                                                             */ 
  20. /*======================================================================*/
  21.  
  22. SHORT main(SHORT sArgCounter, PUCHAR *pszArgVariables)
  23. {
  24.     /*-------------------------------------------------------------------*/
  25.     /* Automatic variables                                                                */
  26.     /*-------------------------------------------------------------------*/
  27.  
  28.     UCHAR                    szWorkString[10];
  29.  
  30.     USHORT                usCounter                            = 0;
  31.  
  32.     /*-------------------------------------------------------------------*/
  33.     /* Check program arguments                                                            */
  34.     /*-------------------------------------------------------------------*/
  35.  
  36.     if (sArgCounter != 1)
  37.         IAppAbortProgram("Usage: VIOSCR");
  38.  
  39.     /*-------------------------------------------------------------------*/
  40.     /* Disable Ctrl-Break and Ctrl-C signals                                        */
  41.     /*-------------------------------------------------------------------*/
  42.  
  43.     IAppDisableKill(TRUE);
  44.     IAppDisableBreak(TRUE);
  45.  
  46.     /*-------------------------------------------------------------------*/
  47.     /* Display screen panel                                                                */
  48.     /*-------------------------------------------------------------------*/
  49.  
  50.     IAppScreenClear(1, 1, 25, 80, IAPP_COLOR_WHITE_ON_BLUE);
  51.  
  52.     IAppScreenWrite(1, 1, "VIO Screen Sample Program Version 3.00            (c) Copyright Infoline AG 1995", IAPP_COLOR_YELLOW_ON_BLUE);
  53.     IAppScreenWrite(2, 1, "────────────────────────────────────────────────────────────────────────────────", IAPP_COLOR_WHITE_ON_BLUE);
  54.  
  55.     IAppScreenWrite(24, 1, "───────────────────────────────────────────────────────────────────────────────", IAPP_COLOR_WHITE_ON_BLUE);
  56.     IAppScreenWrite(25, 1, "Please wait ...", IAPP_COLOR_WHITE_ON_BLUE);
  57.  
  58.     IAppScreenSetCursor(25,80);
  59.  
  60.     /*-------------------------------------------------------------------*/
  61.     /* Show counter                                                                        */
  62.     /*-------------------------------------------------------------------*/
  63.  
  64.     IAppScreenWrite(10, 10, "Counter:", IAPP_COLOR_WHITE_ON_BLUE);
  65.  
  66.     for (usCounter = 0; usCounter <= 10000; usCounter++)
  67.     {
  68.         sprintf(szWorkString, "%hu", usCounter);
  69.         IAppScreenWrite(10, 19, szWorkString, IAPP_COLOR_WHITE_ON_BLUE);
  70.     }
  71.  
  72.     /*-------------------------------------------------------------------*/
  73.     /* Wait until user press enter key                                                */
  74.     /*-------------------------------------------------------------------*/
  75.  
  76.     IAppScreenClear(25, 1, 25, 80, IAPP_COLOR_WHITE_ON_BLUE);
  77.     IAppScreenWrite(25, 1, "Press [Enter] to terminate", IAPP_COLOR_WHITE_ON_BLUE);
  78.  
  79.     for (;;)
  80.     {
  81.         IAppKeyboardFlush();
  82.  
  83.         if (IAppKeyboardRead() == IAPP_KBD_ENTER)
  84.             break;
  85.  
  86.         IAppBeep();
  87.     }
  88.  
  89.     /*-------------------------------------------------------------------*/
  90.     /* Return to the caller                                                                */
  91.     /*-------------------------------------------------------------------*/
  92.  
  93.     IAppScreenClear(1, 1, 25, 80, IAPP_COLOR_WHITE_ON_BLUE);
  94.     IAppScreenSetCursor(1, 1);
  95.  
  96.     return (0);
  97. }
  98.