home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / os2sdk / os2sdk12 / mdi / app.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-06  |  4.0 KB  |  120 lines

  1.  
  2. /* So that we don't have to use -Gw any more. */
  3. #ifdef    EXPENTRY
  4. #undef    EXPENTRY
  5. #endif
  6. #define EXPENTRY pascal far _loadds
  7.  
  8. /****** Resource IDs *****/
  9.  
  10. #define CHANGEMENU         /* allow toggling of main menu bar depending
  11.                               on which doc is active */
  12.  
  13.  
  14. #define IDR_MDI             1
  15.  
  16. #define IDR_DOC1MENU        11
  17. #define IDR_DOC2MENU        12
  18. #define IDR_DOC3MENU        13
  19. #define IDR_DOC4MENU        14
  20. #define IDR_DOC5MENU        15
  21. #define IDR_DOCXMENU        16
  22.  
  23. #define IDR_MDIDOC          2
  24. #define    IDD_ABOUT        3
  25.  
  26. /****** Menu command IDs *****/
  27.  
  28. #define ID_DUMMY    -126
  29.  
  30. /* File menu */
  31. #define IDM_FILE            -1
  32. #define CMD_NEW         0x0100
  33. #define CMD_OPEN        0x0101
  34. #define CMD_CLOSE       0x0102
  35. #define CMD_SAVE        0x0103
  36. #define CMD_SAVEAS      0x0104
  37. #define CMD_SAVEENV     0x0105
  38. #define CMD_PAGESETUP   0x0106
  39. #define CMD_PRINT       0x0107
  40. #define CMD_PRINTSETUP  0x0108
  41. #define CMD_EXIT        0x0109
  42. #define    CMD_ABOUT    0x010a
  43.  
  44. /* Edit menu */
  45. #define IDM_EDIT            -2
  46. #define CMD_UNDO        0x0200
  47. #define CMD_REDO        0x0201
  48. #define CMD_CUT         0x0202
  49. #define CMD_COPY        0x0203
  50. #define CMD_PASTE       0x0204
  51. #define CMD_CLEAR       0x0205
  52. #define CMD_SELECT      0x0206
  53. #define CMD_SELECTALL   0x0207
  54.  
  55. /* Window menu */
  56. #define IDM_WINDOW              -9
  57. #define CMD_ARRANGETILED    0x0900
  58. #define CMD_ARRANGECASCADED 0x0901
  59. #define CMD_WINDOWITEMS     0x0902
  60.  
  61. /* Help menu */
  62. #define IDM_HELP           -10
  63.  
  64.  
  65. #define AWP_TILED     1
  66. #define AWP_CASCADED  2
  67.  
  68. /*
  69.  * Style flags for the DOC structure.
  70.  */
  71. #define DS_HORZSPLITBAR     0x0001  /* Document has horizontal splitbar.   */
  72. #define DS_VERTSPLITBAR     0x0002  /* Document has vertical splitbar.     */
  73.  
  74. /*
  75.  * State flags for the DOC structure.
  76.  */
  77. #define DF_SPLITHORZ        0x0001  /* Document is split horzontally.      */
  78. #define DF_SPLITVERT        0x0002  /* Document is split vertically.       */
  79. #define DF_HSPLITOVERFLOW   0x0004  /* Window is smaller than split area.  */
  80. #define DF_VSPLITOVERFLOW   0x0008  /* Window is smaller than split area.  */
  81.  
  82. typedef struct _DOC {   /* doc */
  83.     USHORT  idMI;           /* The ID of the menu item on the Window menu. */
  84.     ULONG   clrBackground;  /* The background color of the document.       */
  85.     USHORT  fsStyle;        /* Style flags for the document.               */
  86.     USHORT  fs;             /* State flags for the document.               */
  87.  
  88.     HWND    hwndMainMenu;   /* The main menu bar for when this doc is active */
  89.                             /* added 17-Oct-1989 by johnba */
  90.     BOOL    fAabSysMenu;
  91.  
  92.     HWND    hwndFrame;      /* The frame window for this document.         */
  93.     SHORT   cxVertSplitPos; /* x position of the vertical splitbar.        */
  94.     SHORT   cyHorzSplitPos; /* x position of the horizontal splitbar.      */
  95.     HWND    hwndSysMenu;
  96.     HWND    hwndMinmax;
  97.     struct _DOC NEAR *npdocNext;    /* Next document in the application.   */
  98.     struct _VIEW NEAR *npviewFirst; /* The first in the linked list of     */
  99. } DOC;                              /*   views for this document.          */
  100. typedef DOC NEAR *NPDOC;
  101.  
  102. typedef struct _VIEW {  /* view */
  103.     SHORT   xOrigin;        /* The amount to offset by in the x direction. */
  104.     SHORT   yOrigin;        /* The amount to offset by in the y direction. */
  105.     USHORT  fs;             /* Flags for this view.                        */
  106.     HWND    hwndClient;     /* The window handle for this view.            */
  107.     NPDOC   npdoc;          /* The document this view is representing.     */
  108.     struct _VIEW NEAR *npviewNext;  /* The next view for the document.     */
  109. } VIEW;
  110. typedef VIEW NEAR *NPVIEW;
  111.  
  112. /*
  113.  * Macros for DOC/VIEW structures.
  114.  */
  115. #define NPDOCFROMCLIENT(hwndClient)  (((NPVIEW)WinQueryWindowUShort(\
  116.         hwndClient, QWS_USER))->npdoc)
  117.  
  118. #define NPVIEWFROMCLIENT(hwndClient)  ((NPVIEW)WinQueryWindowUShort(\
  119.         hwndClient, QWS_USER))
  120.