home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / tolkit45.zip / os2tk45 / samples / os2 / hanoi / hanoi.h < prev    next >
Text File  |  1999-05-11  |  8KB  |  157 lines

  1. /*static char *SCCSID = "@(#)hanoi.h    6.10 92/03/03";*/
  2. /*==============================================================*\
  3.  *                                                              *
  4.  *  HANOI.H - Sample PM application hanoi header file           *
  5.  *      Created 1989 - 1995 IBM Corp.                           *
  6.  *                                                              *
  7.  *--------------------------------------------------------------*
  8.  *                                                              *
  9.  *  This header file contains the application wide constants    *
  10.  *  and structure definitions.                                  *
  11.  *                                                              *
  12. \*==============================================================*/
  13.  
  14. /*--------------------------------------------------------------*\
  15.  * Resource IDs                                                 *
  16. \*--------------------------------------------------------------*/
  17. #define ID_RESOURCE    1
  18. #define IDR_BITMAP     2
  19. #define IDC_BITMAP     3
  20.  
  21. /*--------------------------------------------------------------*\
  22.  *  Menu item IDs                                               *
  23. \*--------------------------------------------------------------*/
  24. #define IDM_START  (WM_USER+0)
  25. #define IDM_STOP   (WM_USER+1)
  26. #define IDM_SET    (WM_USER+2)
  27. #define IDM_DONE   (WM_USER+3) /* Message posted when thread terminates */
  28. #define IDM_ON     (WM_USER+4)
  29. #define IDM_OFF    (WM_USER+5)
  30.  
  31. /*--------------------------------------------------------------*\
  32.  *  Message item IDs                                            *
  33. \*--------------------------------------------------------------*/
  34. #define IDD_SETCOUNT                           1
  35. #define IDD_ENTRYFLD                           2
  36. #define IDD_MSGBOX                             3
  37. #define IDD_PRODUCTINFO                        4
  38. #define IDD_HELP                               5
  39.  
  40. #define IDM_HELPHELPFORHELP                 9100
  41. #define IDM_HELPEXTENDED                    9200
  42. #define IDM_HELPKEYS                        9300
  43. #define IDM_HELPINDEX                       9400
  44. #define IDM_HELPPRODUCTINFO                 9600
  45.  
  46. /*--------------------------------------------------------------*\
  47.  *  Help table and subtables                                    *
  48. \*--------------------------------------------------------------*/
  49. #define HANOI_HELP_TABLE                    1000
  50.  
  51. /*--------------------------------------------------------------*\
  52.  *  Main window help panels                                     *
  53. \*--------------------------------------------------------------*/
  54. #define SUBTABLE_MAIN                       2000
  55. #define PANEL_MAIN                          2100
  56. #define PANEL_HELP                          2910
  57. #define PANEL_HELPHELPFORHELP               2920
  58. #define PANEL_HELPEXTENDED                  2930
  59. #define PANEL_HELPKEYS                      2940
  60. #define PANEL_HELPINDEX                     2950
  61. #define PANEL_HELPPRODUCTINFO               2960
  62. #define PANEL_KEYSHELP                      2970
  63.  
  64. #define PANEL_HELPSTART                     2980
  65. #define PANEL_HELPSTOP                      2981
  66. #define PANEL_HELPSET                       2982
  67. #define PANEL_HELPON                        2983
  68. #define PANEL_HELPOFF                       2984
  69.  
  70. /*--------------------------------------------------------------*\
  71.  *  Enter text dialog help subtable                             *
  72. \*--------------------------------------------------------------*/
  73. #define SUBTABLE_PRODUCTINFODLG             3000
  74. #define PANEL_PRODUCTINFODLG                3100
  75. #define PANEL_PRODUCTINFO_OK                3110
  76.  
  77. /*--------------------------------------------------------------*\
  78.  *  Stringtable ids                                             *
  79. \*--------------------------------------------------------------*/
  80. #define IDS_TITLE                            101
  81. #define IDS_UNTITLED                         102
  82. #define IDS_APPNAME                          103
  83. #define IDS_HELPLIBRARYNAME                  104
  84. #define IDS_HELPWINDOWTITLE                  105
  85. #define IDS_OBJECTCLASS                      106
  86.  
  87. /*--------------------------------------------------------------*\
  88.  *  Messagetable ids                                            *
  89. \*--------------------------------------------------------------*/
  90. #define IDMSG_INITFAILED                     301
  91. #define IDMSG_MAINWINCREATEFAILED            302
  92. #define IDMSG_DISKNUMBERERROR                303
  93. #define IDMSG_CANNOTLOADEXITLIST             304
  94. #define IDMSG_CANNOTLOADSTRING               305
  95. #define IDMSG_HELPLOADERROR                  306
  96. #define IDMSG_HELPDISPLAYERROR               307
  97.  
  98. /*--------------------------------------------------------------*\
  99.  *  Other constants                                             *
  100. \*--------------------------------------------------------------*/
  101. #define MAXDISKCNT         16    /* Maximum # of disks allowable */
  102. #define BASEXOFFSET        10    /* X offset for platform base   */
  103. #define BASEYOFFSET        10    /* Y offset for platform base   */
  104. #define BASETHICK          10    /* Base thickness               */
  105. #define BASELEN           300    /* Base width                   */
  106. #define POSTOFFSET         62    /* First post offset from edge  */
  107. #define POSTSPACE         100    /* Distance between posts       */
  108. #define POSTWIDTH           5    /* Width of each post           */
  109. #define POSTHALF            2    /* 1/2 width for centering      */
  110. #define POSTEXTRAHT        25    /* Post height above top disk   */
  111. #define DISKTHICK           3    /* Thickness of each disk       */
  112. #define DISKSPACE         (DISKTHICK+1)     /* Thickness + space */
  113. #define MINDISKWIDTH       11    /* Width of the smallest disk   */
  114. #define MAXDISKWIDTH       91    /* Width of the thickest disk   */
  115. #define BOTDISKYPOS        (BASEYOFFSET+BASETHICK+DISKSPACE-DISKTHICK)
  116. #define STACK            8192    /* Stack size for thread        */
  117. #define fDRAW               1    /* Indicate draw to DrawDisk()  */
  118. #define fERASE              0    /* Indicate erase               */
  119. #define DEFAULTSIZE         5    /* Default number of disks      */
  120. #define MSGBUFSIZE         33    /* Space needed for sprintf msg */
  121. #define RETURN_SUCCESS      0    /* successful return in DosExit */
  122. #define RETURN_ERROR        1    /* error return in DosExit      */
  123. #define BEEP_WARN_FREQ      60   /* frequency of warning beep    */
  124. #define BEEP_WARN_DUR      100   /* duration of warning beep     */
  125. #define MESSAGELEN          50   /* maximum length for messages  */
  126. #define MAX_DIGITS          5
  127. #define THREADSTACKSIZE   8192L
  128. #define SEM_TIMEOUT      10000L
  129. #define HELPLIBRARYNAMELEN  20
  130. #define VERT_POS            15   /* from top to display text info*/
  131. #define HORZ_POS            50
  132. #define BUFF_SIZE          100
  133. #define ONCE               while(0)
  134. #define DELETE_WIDTH       50
  135.  
  136. /*--------------------------------------------------------------*\
  137.  *  Standard Dialog box ids                                     *
  138. \*--------------------------------------------------------------*/
  139. #define OBJECTID        1002
  140.  
  141. /*--------------------------------------------------------------*\
  142.  *  Macro constants                                             *
  143. \*--------------------------------------------------------------*/
  144. #define DrawRect(x1,y1,x2,y2,color)  ptl.x = (LONG) (x1);             \
  145.                                      ptl.y = (LONG) (y1);             \
  146.                                      GpiSetCurrentPosition(hps,&ptl); \
  147.                                      ptl.x = (LONG) (x2);             \
  148.                                      ptl.y = (LONG) (y2);             \
  149.                                      GpiSetColor(hps,color);          \
  150.                                      GpiBox(hps,DRO_FILL,&ptl,0L,0L);
  151.  
  152. /*--------------------------------------------------------------*\
  153.  *  Ids of messages used between threads                        *
  154. \*--------------------------------------------------------------*/
  155. #define TM_THREADINITFAILED           WM_USER+300
  156.  
  157.