Changeset 232 for trunk/include/helpers


Ignore:
Timestamp:
Dec 5, 2002, 9:36:28 PM (23 years ago)
Author:
umoeller
Message:

New toolbar control.

Location:
trunk/include/helpers
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/helpers/comctl.h

    r229 r232  
    3939    /* ******************************************************************
    4040     *
     41     *   Shared stuff
     42     *
     43     ********************************************************************/
     44
     45    MRESULT ctlSendWmControl(HWND hwndControl,
     46                             USHORT usCode,
     47                             MPARAM mp2);
     48
     49    BOOL ctlPostWmControl(HWND hwndControl,
     50                          USHORT usCode,
     51                          MPARAM mp2);
     52
     53    /*
     54     *@@ SYSCOLORSET:
     55     *
     56     *@@added V1.0.1 (2002-11-30) [umoeller]
     57     */
     58
     59    typedef struct _SYSCOLORSET
     60    {
     61        BOOL    fInheritPP;
     62
     63        LONG    lBackIndex,
     64                lForeIndex;
     65    } SYSCOLORSET, *PSYSCOLORSET;
     66
     67    /*
     68     *@@ DEFWINDOWDATA:
     69     *
     70     *@@added V1.0.1 (2002-11-30) [umoeller]
     71     */
     72
     73    typedef struct _DEFWINDATA
     74    {
     75        HWND        hwnd;
     76        HAB         hab;
     77
     78        PFNWP       pDefWindowProc;
     79        const SYSCOLORSET *pSysColorSet;
     80
     81        LONG        lcolBackground,
     82                    lcolForeground;
     83
     84        SIZEL       szlWin;             // current window dimensions
     85
     86        PSZ         pszText;            // window text or NULL
     87
     88    } DEFWINDATA, *PDEFWINDATA;
     89
     90    VOID ctlInitDWD(HWND hwnd,
     91                    MPARAM mp2,
     92                    PDEFWINDATA pdwd,
     93                    PFNWP pDefWindowProc,
     94                    const SYSCOLORSET *pSysColorSet);
     95
     96    VOID ctlRefreshColors(PDEFWINDATA pdwd);
     97
     98    MRESULT ctlDefWindowProc(PDEFWINDATA pdwd, ULONG msg, MPARAM mp1, MPARAM mp2);
     99
     100    /* ******************************************************************
     101     *
    41102     *   "Separator line" control
    42103     *
    43104     ********************************************************************/
    44105
    45     #define WC_SEPARATORLINE        "XwpSeparatorLine"
     106    #define WC_CCTL_SEPARATOR       "ComctlSeparator"
     107
     108    #define SEPS_HORIZONTAL         0x0000
     109    #define SEPS_VERTICAL           0x0001
    46110
    47111    BOOL ctlRegisterSeparatorLine(HAB hab);
    48 
    49     /* ******************************************************************
    50      *
    51      *   "XButton" control
    52      *
    53      ********************************************************************/
    54 
    55     /*
    56      *@@ XBUTTONDATA:
    57      *      paint data for ctlPaintXButton.
    58      *
    59      *@@added V0.9.13 (2001-06-21) [umoeller]
    60      */
    61 
    62     typedef struct _XBUTTONDATA
    63     {
    64         RECTL       rcl;                // size of button (in presentation space
    65                                         // coordinates); exclusive!
    66 
    67         ULONG       cxIconOrBitmap,     // icon size
    68                     cyIconOrBitmap;
    69 
    70         LONG        lcol3DDark,         // lo-3D color
    71                     lcol3DLight,        // hi-3D color
    72                     lMiddle;            // color for center (button background)
    73 
    74         HPOINTER    hptr;               // icon to paint or NULLHANDLE
    75 
    76     } XBUTTONDATA, *PXBUTTONDATA;
    77 
    78     #define XBF_FLAT                0x00000001
    79     #define XBF_BITMAP              0x00000002
    80 
    81     #define XBF_PRESSED             0x00010000
    82     #define XBF_BACKGROUND          0x00020000
    83     #define XBF_INUSE               0x00040000
    84 
    85     VOID ctlPaintXButton(HPS hps,
    86                          ULONG fl,
    87                          PXBUTTONDATA pxbd);
    88112
    89113    /* ******************************************************************
     
    670694     ********************************************************************/
    671695
     696    #define WC_CCTL_TOOLTIP         "ComctlTooltipClass"
     697                    // define identifier changed V1.0.1 (2002-11-30) [umoeller]
     698
    672699    // addt'l tooltip window styles: use lower 16 bits
    673700    #define TTS_ALWAYSTIP           0x0001
     
    927954    #define TTN_POP             1002
    928955
    929     #define COMCTL_TOOLTIP_CLASS    "ComctlTooltipClass"
    930 
    931956    BOOL ctlRegisterTooltip(HAB hab);
    932957
    933958    MRESULT EXPENTRY ctl_fnwpTooltip(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
     959
     960    /* ******************************************************************
     961     *
     962     *   "Tool bar button" control
     963     *
     964     ********************************************************************/
     965
     966    #define WC_CCTL_TOOLBAR         "ComctlToolbarClass"
     967
     968    // toolbar button styles: use lower 16 bits
     969    #define TBBS_BIGICON            0x0001
     970    #define TBBS_MINIICON           0x0002
     971    #define TBBS_BITMAP             0x0004
     972    #define TBBS_TEXT               0x0008
     973
     974    #define TBBS_CHECK              0x0010
     975    #define TBBS_RADIO              0x0020
     976    #define TBBS_CHECKINITIAL       0x0040
     977
     978    #define TBBS_AUTORESIZE         0x0100
     979    #define TBBS_HILITE             0x0200
     980    #define TBBS_FLAT               0x0400
     981    #define TBBS_DROPMNEMONIC       0x0800
     982
     983    #define TBBS_COMMAND            0x1000
     984    #define TBBS_SYSCOMMAND         0x2000
     985
     986    // tool bar button messages
     987
     988    #define TBBM_CHECK              (WM_USER + 1)
     989
     990    #define TBBM_QUERYCHECK         (WM_USER + 2)
     991
     992    /*
     993     *@@ XBUTTONDATA:
     994     *      paint data for ctlPaintTBButton.
     995     *
     996     *@@added V0.9.13 (2001-06-21) [umoeller]
     997     */
     998
     999    typedef struct _XBUTTONDATA
     1000    {
     1001        DEFWINDATA  dwd;              // color for center (button background)
     1002
     1003        SIZEL       szlIconOrBitmap;
     1004
     1005        HPOINTER    hptr;               // icon to paint or NULLHANDLE
     1006
     1007        // BOOL        fPaintButtonSunk;
     1008
     1009    } XBUTTONDATA, *PXBUTTONDATA;
     1010
     1011    /*
     1012     *@@ XBUTTONSTATE:
     1013     *
     1014     *@@added V1.0.1 (2002-11-30) [umoeller]
     1015     */
     1016
     1017    typedef struct _XBUTTONSTATE
     1018    {
     1019        BOOL        fMB1Pressed;            // if TRUE, mouse button is currently pressed
     1020        BOOL        fIgnoreMB1Up;
     1021        BOOL        fPaintButtonSunk;       // if TRUE, button control is to be painted "down"
     1022        BOOL        fMouseCaptured;         // if TRUE, mouse is currently captured
     1023        BOOL        fMouseOver;
     1024    } XBUTTONSTATE, *PXBUTTONSTATE;
     1025
     1026    // the following styles are only for painting and not stored
     1027    #define TBBS_BACKGROUND          0x00010000
     1028    #define TBBS_INUSE               0x00020000
     1029
     1030    VOID ctlPaintTBButton(HPS hps,
     1031                          ULONG fl,
     1032                          PXBUTTONDATA pbd,
     1033                          PXBUTTONSTATE pbs);
     1034
     1035    MRESULT EXPENTRY ctl_fnwpToolbarButton(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
     1036
     1037    /* ******************************************************************
     1038     *
     1039     *   "Tool bar" control
     1040     *
     1041     ********************************************************************/
     1042
     1043    #define WC_CCTL_TBBUTTON        "ComCtlToolbarButton"
     1044                    // define identifier changed V1.0.1 (2002-11-30) [umoeller]
     1045
     1046    // tool bar window styles: use lower 16 bits
     1047    #define TBS_TOOLTIPS            0x0001
     1048    #define TBS_AUTORESIZE          0x0002
     1049
     1050    /*
     1051     *@@ TOOLBARCONTROL:
     1052     *
     1053     *@@added V1.0.1 (2002-11-30) [umoeller]
     1054     */
     1055
     1056    typedef struct _TOOLBARCONTROL
     1057    {
     1058        PCSZ        pcszClass;
     1059        PCSZ        pcszTitle;
     1060        ULONG       flStyle;
     1061        ULONG       id;
     1062        LONG        cx,
     1063                    cy;
     1064    } TOOLBARCONTROL, *PTOOLBARCONTROL;
     1065
     1066    /*
     1067     *@@ TOOLBARCDATA:
     1068     *
     1069     *@@added V1.0.1 (2002-11-30) [umoeller]
     1070     */
     1071
     1072    typedef struct _TOOLBARCDATA
     1073    {
     1074        USHORT      cb;
     1075
     1076        HWND        hwndControlsOwner;
     1077
     1078        ULONG       cControls;
     1079        PTOOLBARCONTROL patbc;
     1080
     1081    } TOOLBARCDATA, *PTOOLBARCDATA;
     1082
     1083    #define TBM_ADDCONTROLS         (WM_USER + 1)
     1084
     1085    /*
     1086     *@@ TBN_RESIZED:
     1087     *      notification code posted with WM_CONTROL when
     1088     *      a tool bar has resized itself, e.g. because
     1089     *      controls were added or removed.
     1090     *
     1091     *      Parameters:
     1092     *
     1093     *      --  SHORT1FROMMP(mp1): ID of the tool bar control.
     1094     *
     1095     *      --  SHORT2FROMMP(mp1): TBN_RESIZED code.
     1096     *
     1097     *      --  mp2: unused.
     1098     *
     1099     *@@added V1.0.1 (2002-11-30) [umoeller]
     1100     */
     1101
     1102    #define TBN_RESIZED             1
     1103
     1104    MRESULT EXPENTRY ctl_fnwpToolbar(HWND hwndToolbar, ULONG msg, MPARAM mp1, MPARAM mp2);
     1105
     1106    BOOL ctlRegisterToolbar(HAB hab);
     1107
     1108    HWND ctlCreateToolBar(HWND hwndParent,
     1109                          HWND hwndOwner,
     1110                          ULONG flStyle,
     1111                          HWND hwndControlsOwner,
     1112                          ULONG cControls,
     1113                          PTOOLBARCONTROL patbc);
     1114
     1115    /* ******************************************************************
     1116     *
     1117     *   Extended frame
     1118     *
     1119     ********************************************************************/
     1120
     1121    #define FID_TOOLBAR             0x8101
     1122    #define FID_STATUSBAR           0x8100
     1123
     1124    /*
     1125     *@@ EXTFRAMECDATA:
     1126     *
     1127     *@@added V0.9.16 (2001-09-29) [umoeller]
     1128     */
     1129
     1130    typedef struct _EXTFRAMECDATA
     1131    {
     1132        PSWP        pswpFrame;          // in: frame wnd pos (can be NULL)
     1133        ULONG       flFrame;            // in: standard FCF_* flags
     1134        ULONG       flExtFrame;         // in: XFCF_* flags
     1135                #define XFCF_STATUSBAR          0x0001
     1136                            // create a status bar for the frame
     1137                #define XFCF_TOOLBAR            0x0002
     1138                            // create a tool bar for the frame
     1139                #define XFCF_FORCETBOWNER       0x0004
     1140                            // if set, we will enfore that all toolbar controls have
     1141                            // the main frame as their owner, otherwise they'll have
     1142                            // the frame's client, if one exists
     1143        ULONG       flStyleFrame;       // in: frame style (WS_* flags, e.g. WS_VISIBLE | WS_ANIMATE)
     1144        PCSZ        pcszFrameTitle;     // in: frame title (title bar)
     1145        ULONG       ulResourcesID;      // in: according to FCF_* flags
     1146
     1147        PCSZ        pcszClassClient;    // in: client class name or NULL for no client
     1148        ULONG       flStyleClient;      // in: client style (WS_* flags, e.g. WS_VISIBLE)
     1149
     1150        ULONG       ulID;               // in: frame window ID
     1151        PVOID       pClientCtlData;     // in: pCtlData structure pointer for client
     1152
     1153        HINI        hiniSaveWinPos;     // in: HINI for saving window position or NULLHANDLE
     1154        PCSZ        pcszIniApp,
     1155                    pcszIniKey;
     1156
     1157        ULONG       cTBControls;        // in: count of tool bar controls in paTBControls or 0
     1158        PTOOLBARCONTROL paTBControls;
     1159
     1160    } EXTFRAMECDATA, *PEXTFRAMECDATA;
     1161
     1162    /*
     1163     *@@ XFRAMECONTROLS:
     1164     *
     1165     *@@added V1.0.1 (2002-11-30) [umoeller]
     1166     */
     1167
     1168    typedef struct _XFRAMECONTROLS
     1169    {
     1170        PFNWP           pfnwpOrig;      // original frame wnd proc from subclassing
     1171
     1172        HWND            hwndToolBar,
     1173                        hwndStatusBar;
     1174
     1175        LONG            lToolBarHeight,
     1176                        lStatusBarHeight;
     1177
     1178    } XFRAMECONTROLS, *PXFRAMECONTROLS;
     1179
     1180    /*
     1181     *@@ EXTFRAMEDATA:
     1182     *
     1183     *@@added V0.9.16 (2001-09-29) [umoeller]
     1184     */
     1185
     1186    typedef struct _EXTFRAMEDATA
     1187    {
     1188        EXTFRAMECDATA   CData;
     1189
     1190        XFRAMECONTROLS  xfc;
     1191
     1192        PVOID           pvUser;         // more data for user (e.g. for additional subclassing)
     1193
     1194    } EXTFRAMEDATA, *PEXTFRAMEDATA;
     1195
     1196    MRESULT ctlFormatExtFrame(HWND hwndFrame,
     1197                              PXFRAMECONTROLS pxfc,
     1198                              MPARAM mp1,
     1199                              MPARAM mp2);
     1200
     1201    VOID ctlCalcExtFrameRect(MPARAM mp1,
     1202                             MPARAM mp2,
     1203                             LONG lStatusBarHeight);
     1204
     1205    HWND ctlCreateStatusBar(HWND hwndFrame,
     1206                            HWND hwndOwner,
     1207                            const char *pcszText,
     1208                            const char *pcszFont,
     1209                            LONG lColor);
     1210
     1211    HWND ctlCreateStdWindow(PEXTFRAMECDATA pData,
     1212                            PHWND phwndClient);
    9341213
    9351214    /* ******************************************************************
  • trunk/include/helpers/dialog.h

    r229 r232  
    485485
    486486    // the following require #include helpers\comctl.h
    487     #define CONTROLDEF_SEPARATORLINE(id, cx, cy) { WC_SEPARATORLINE, NULL, \
     487    #define CONTROLDEF_SEPARATORLINE(id, cx, cy) { WC_CCTL_SEPARATOR, NULL, \
    488488            WS_VISIBLE, \
    489489            id, NULL, {cx, cy}, COMMON_SPACING }
  • trunk/include/helpers/gpih.h

    r214 r232  
    4444    VOID gpihInflateRect(PRECTL prcl,
    4545                         LONG l);
     46
     47    VOID gpihCopyRectIncl(PRECTL prclGpi,
     48                          PRECTL prclWin);
    4649
    4750    /* ******************************************************************
  • trunk/include/helpers/standards.h

    r132 r232  
    116116    #define STRINGORNULL(s) (s) ? (s) : "NULL"
    117117
     118    /*
     119     *@@ STOREIFMAX:
     120     *      helpful macro to store a in b if it is
     121     *      larger than b.
     122     *
     123     *@@added V1.0.1 (2002-11-30) [umoeller]
     124     */
     125
     126    #define STOREIFMAX(a, b) if ((a) > (b)) { b = a; }
     127
    118128#endif
    119129
  • trunk/include/helpers/winh.h

    r218 r232  
    7171    #define BM_INDETERMINATE       2   // for tri-state checkboxes: indeterminate
    7272
     73    // these undocumented msgs are posted whenever the mouse
     74    // enters or leaves a window V1.0.1 (2002-11-30) [umoeller]
     75    #ifndef WM_MOUSEENTER
     76        #define WM_MOUSEENTER   0x041E
     77        #define WM_MOUSELEAVE   0x041F
     78    #endif
     79
    7380    /* ******************************************************************
    7481     *
     
    172179     ********************************************************************/
    173180
     181    extern LONG G_cxScreen,
     182                G_cyScreen,
     183                G_cxIcon,
     184                G_cyIcon,
     185                G_lcol3DDark,
     186                G_lcol3DLight;
     187
     188    VOID XWPENTRY winhInitGlobals(VOID);
     189
    174190    ULONG XWPENTRY winhQueryWindowStyle(HWND hwnd);
    175191
     
    184200     ********************************************************************/
    185201
     202    // now including all this only with INCL_WINMENUS
     203    // V1.0.1 (2002-11-30) [umoeller]
    186204    #ifdef INCL_WINMENUS
     205
     206        #ifndef MM_QUERYITEMBYPOS16
     207            #define MM_QUERYITEMBYPOS16 0x01f3
     208            // this undocumented message is sent to retrieve the definition
     209            // of a menu item by its position.  This message will only query
     210            // an item in the specified menu.
     211            //
     212            // Parameters:
     213            //     SHORT1FROMMP(mp1) = position of item in the menu
     214            //     SHORT2FROMMP(mp1) = reserved, set to 0
     215            //     mp2 = (16 bit pointer) points to a MENUITEM structure
     216            //           to be filled in.
     217        #endif
     218        #ifndef MAKE_16BIT_POINTER
     219            #define MAKE_16BIT_POINTER(p) \
     220                    ((PVOID)MAKEULONG(LOUSHORT(p),(HIUSHORT(p) << 3) | 7))
     221            // converts a flat 32bit pointer to its 16bit offset/selector form
     222        #endif
     223
    187224        BOOL XWPENTRY winhQueryMenuItem(HWND hwndMenu,
    188225                                        USHORT usItemID,
    189226                                        BOOL fSearchSubmenus,
    190227                                        PMENUITEM pmi);
     228
     229        HWND XWPENTRY winhQuerySubmenu(HWND hMenu, SHORT sID);
     230
     231        /*
     232         * winhCreateEmptyMenu:
     233         *      this macro creates an empty menu, which can
     234         *      be used with winhInsertMenuItem etc. later.
     235         *      Useful for creating popup menus on the fly.
     236         *      Note that even though HWND_DESKTOP is specified
     237         *      here as both the parent and the owner, the
     238         *      actual owner and parent are specified later
     239         *      with WinPopupMenu.
     240         */
     241
     242        #define winhCreateEmptyMenu()                                   \
     243        WinCreateWindow(HWND_DESKTOP, WC_MENU, "", 0, 0, 0, 0, 0,       \
     244                        HWND_DESKTOP, HWND_TOP, 0, 0, 0)
     245
     246        SHORT XWPENTRY winhInsertMenuItem(HWND hwndMenu,
     247                                          SHORT iPosition,
     248                                          SHORT sItemId,
     249                                          const char *pcszItemTitle,
     250                                          SHORT afStyle,
     251                                          SHORT afAttr);
     252        typedef SHORT XWPENTRY WINHINSERTMENUITEM(HWND hwndMenu,
     253                                                  SHORT iPosition,
     254                                                  SHORT sItemId,
     255                                                  const char *pcszItemTitle,
     256                                                  SHORT afStyle,
     257                                                  SHORT afAttr);
     258        typedef WINHINSERTMENUITEM *PWINHINSERTMENUITEM;
     259
     260        HWND XWPENTRY winhInsertSubmenu(HWND hwndMenu,
     261                                        ULONG iPosition,
     262                                        SHORT sMenuId,
     263                                        const char *pcszSubmenuTitle,
     264                                        USHORT afMenuStyle,
     265                                        SHORT sItemId,
     266                                        const char *pcszItemTitle,
     267                                        USHORT afItemStyle,
     268                                        USHORT afAttribute);
     269        typedef HWND XWPENTRY WINHINSERTSUBMENU(HWND hwndMenu,
     270                                                ULONG iPosition,
     271                                                SHORT sMenuId,
     272                                                const char *pcszSubmenuTitle,
     273                                                USHORT afMenuStyle,
     274                                                SHORT sItemId,
     275                                                const char *pcszItemTitle,
     276                                                USHORT afItemStyle,
     277                                                USHORT afAttribute);
     278        typedef WINHINSERTSUBMENU *PWINHINSERTSUBMENU;
     279
     280        BOOL XWPENTRY winhSetMenuCondCascade(HWND hwndMenu,
     281                                             LONG lDefaultItem);
     282
     283        /*
     284         *@@ winhRemoveMenuItem:
     285         *      removes a menu item (SHORT) from the
     286         *      given menu (HWND). Returns the no. of
     287         *      remaining menu items (SHORT).
     288         *
     289         *      This works for whole submenus too.
     290         */
     291
     292        #define winhRemoveMenuItem(hwndMenu, sItemID) \
     293                SHORT1FROMMR(WinSendMsg(hwndMenu, MM_REMOVEITEM, MPFROM2SHORT(sItemID, FALSE), 0))
     294
     295        BOOL XWPENTRY winhRemoveMenuItems(HWND hwndMenu,
     296                                          const SHORT *asItemIDs,
     297                                          ULONG cItemIDs);
     298
     299        /*
     300         *@@ winhDeleteMenuItem:
     301         *      deleted a menu item (SHORT) from the
     302         *      given menu (HWND). Returns the no. of
     303         *      remaining menu items (SHORT).
     304         *
     305         *      As opposed to MM_REMOVEITEM, MM_DELETEITEM
     306         *      frees submenus and bitmaps also.
     307         *
     308         *      This works for whole submenus too.
     309         */
     310
     311        #define winhDeleteMenuItem(hwndMenu, sItemId) \
     312                (SHORT)WinSendMsg(hwndMenu, MM_DELETEITEM, MPFROM2SHORT(sItemId, FALSE), 0)
     313
     314        SHORT XWPENTRY winhInsertMenuSeparator(HWND hMenu,
     315                                               SHORT iPosition,
     316                                               SHORT sId);
     317
     318        #define COPYFL_STRIPTABS            0x0001
     319
     320        BOOL XWPENTRY winhCopyMenuItem2(HWND hmenuTarget,
     321                                        HWND hmenuSource,
     322                                        USHORT usID,
     323                                        SHORT sTargetPosition,
     324                                        ULONG fl);
     325
     326        BOOL XWPENTRY winhCopyMenuItem(HWND hmenuTarget,
     327                                       HWND hmenuSource,
     328                                       USHORT usID,
     329                                       SHORT sTargetPosition);
     330        typedef BOOL XWPENTRY WINHCOPYMENUITEM(HWND hmenuTarget,
     331                                       HWND hmenuSource,
     332                                       USHORT usID,
     333                                       SHORT sTargetPosition);
     334        typedef WINHCOPYMENUITEM *PWINHCOPYMENUITEM;
     335
     336        HWND XWPENTRY winhMergeIntoSubMenu(HWND hmenuTarget,
     337                                           SHORT sTargetPosition,
     338                                           const char *pcszTitle,
     339                                           SHORT sID,
     340                                           HWND hmenuSource);
     341        typedef HWND XWPENTRY WINHMERGEINTOSUBMENU(HWND hmenuTarget,
     342                                           SHORT sTargetPosition,
     343                                           const char *pcszTitle,
     344                                           SHORT sID,
     345                                           HWND hmenuSource);
     346        typedef WINHMERGEINTOSUBMENU *PWINHMERGEINTOSUBMENU;
     347
     348        ULONG XWPENTRY winhMergeMenus(HWND hmenuTarget,
     349                                      SHORT sTargetPosition,
     350                                      HWND hmenuSource,
     351                                      ULONG fl);
     352        typedef ULONG XWPENTRY WINHMERGEMENUS(HWND hmenuTarget,
     353                                              SHORT sTargetPosition,
     354                                              HWND hmenuSource,
     355                                              ULONG fl);
     356        typedef WINHMERGEMENUS *PWINHMERGEMENUS;
     357
     358        ULONG XWPENTRY winhClearMenu(HWND hwndMenu);
     359
     360        PSZ XWPENTRY winhQueryMenuItemText(HWND hwndMenu,
     361                                           USHORT usItemID);
     362
     363        BOOL XWPENTRY winhAppend2MenuItemText(HWND hwndMenu,
     364                                              USHORT usItemID,
     365                                              const char *pcszAppend,
     366                                              BOOL fTab);
     367
     368        VOID XWPENTRY winhMenuRemoveEllipse(HWND hwndMenu,
     369                                            USHORT usItemId);
     370
     371        SHORT XWPENTRY winhQueryItemUnderMouse(HWND hwndMenu, POINTL *pptlMouse, RECTL *prtlItem);
     372
    191373    #endif
    192 
    193     HWND XWPENTRY winhQuerySubmenu(HWND hMenu, SHORT sID);
    194 
    195     /*
    196      * winhCreateEmptyMenu:
    197      *      this macro creates an empty menu, which can
    198      *      be used with winhInsertMenuItem etc. later.
    199      *      Useful for creating popup menus on the fly.
    200      *      Note that even though HWND_DESKTOP is specified
    201      *      here as both the parent and the owner, the
    202      *      actual owner and parent are specified later
    203      *      with WinPopupMenu.
    204      */
    205 
    206     #define winhCreateEmptyMenu()                                   \
    207     WinCreateWindow(HWND_DESKTOP, WC_MENU, "", 0, 0, 0, 0, 0,       \
    208                     HWND_DESKTOP, HWND_TOP, 0, 0, 0)
    209 
    210     SHORT XWPENTRY winhInsertMenuItem(HWND hwndMenu,
    211                                       SHORT iPosition,
    212                                       SHORT sItemId,
    213                                       const char *pcszItemTitle,
    214                                       SHORT afStyle,
    215                                       SHORT afAttr);
    216     typedef SHORT XWPENTRY WINHINSERTMENUITEM(HWND hwndMenu,
    217                                               SHORT iPosition,
    218                                               SHORT sItemId,
    219                                               const char *pcszItemTitle,
    220                                               SHORT afStyle,
    221                                               SHORT afAttr);
    222     typedef WINHINSERTMENUITEM *PWINHINSERTMENUITEM;
    223 
    224     HWND XWPENTRY winhInsertSubmenu(HWND hwndMenu,
    225                                     ULONG iPosition,
    226                                     SHORT sMenuId,
    227                                     const char *pcszSubmenuTitle,
    228                                     USHORT afMenuStyle,
    229                                     SHORT sItemId,
    230                                     const char *pcszItemTitle,
    231                                     USHORT afItemStyle,
    232                                     USHORT afAttribute);
    233     typedef HWND XWPENTRY WINHINSERTSUBMENU(HWND hwndMenu,
    234                                             ULONG iPosition,
    235                                             SHORT sMenuId,
    236                                             const char *pcszSubmenuTitle,
    237                                             USHORT afMenuStyle,
    238                                             SHORT sItemId,
    239                                             const char *pcszItemTitle,
    240                                             USHORT afItemStyle,
    241                                             USHORT afAttribute);
    242     typedef WINHINSERTSUBMENU *PWINHINSERTSUBMENU;
    243 
    244     BOOL XWPENTRY winhSetMenuCondCascade(HWND hwndMenu,
    245                                          LONG lDefaultItem);
    246 
    247     /*
    248      *@@ winhRemoveMenuItem:
    249      *      removes a menu item (SHORT) from the
    250      *      given menu (HWND). Returns the no. of
    251      *      remaining menu items (SHORT).
    252      *
    253      *      This works for whole submenus too.
    254      */
    255 
    256     #define winhRemoveMenuItem(hwndMenu, sItemID) \
    257             SHORT1FROMMR(WinSendMsg(hwndMenu, MM_REMOVEITEM, MPFROM2SHORT(sItemID, FALSE), 0))
    258 
    259     BOOL XWPENTRY winhRemoveMenuItems(HWND hwndMenu,
    260                                       const SHORT *asItemIDs,
    261                                       ULONG cItemIDs);
    262 
    263     /*
    264      *@@ winhDeleteMenuItem:
    265      *      deleted a menu item (SHORT) from the
    266      *      given menu (HWND). Returns the no. of
    267      *      remaining menu items (SHORT).
    268      *
    269      *      As opposed to MM_REMOVEITEM, MM_DELETEITEM
    270      *      frees submenus and bitmaps also.
    271      *
    272      *      This works for whole submenus too.
    273      */
    274 
    275     #define winhDeleteMenuItem(hwndMenu, sItemId) \
    276             (SHORT)WinSendMsg(hwndMenu, MM_DELETEITEM, MPFROM2SHORT(sItemId, FALSE), 0)
    277 
    278     SHORT XWPENTRY winhInsertMenuSeparator(HWND hMenu,
    279                                            SHORT iPosition,
    280                                            SHORT sId);
    281 
    282     #define COPYFL_STRIPTABS            0x0001
    283 
    284     BOOL XWPENTRY winhCopyMenuItem2(HWND hmenuTarget,
    285                                     HWND hmenuSource,
    286                                     USHORT usID,
    287                                     SHORT sTargetPosition,
    288                                     ULONG fl);
    289 
    290     BOOL XWPENTRY winhCopyMenuItem(HWND hmenuTarget,
    291                                    HWND hmenuSource,
    292                                    USHORT usID,
    293                                    SHORT sTargetPosition);
    294     typedef BOOL XWPENTRY WINHCOPYMENUITEM(HWND hmenuTarget,
    295                                    HWND hmenuSource,
    296                                    USHORT usID,
    297                                    SHORT sTargetPosition);
    298     typedef WINHCOPYMENUITEM *PWINHCOPYMENUITEM;
    299 
    300     HWND XWPENTRY winhMergeIntoSubMenu(HWND hmenuTarget,
    301                                        SHORT sTargetPosition,
    302                                        const char *pcszTitle,
    303                                        SHORT sID,
    304                                        HWND hmenuSource);
    305     typedef HWND XWPENTRY WINHMERGEINTOSUBMENU(HWND hmenuTarget,
    306                                        SHORT sTargetPosition,
    307                                        const char *pcszTitle,
    308                                        SHORT sID,
    309                                        HWND hmenuSource);
    310     typedef WINHMERGEINTOSUBMENU *PWINHMERGEINTOSUBMENU;
    311 
    312     ULONG XWPENTRY winhMergeMenus(HWND hmenuTarget,
    313                                   SHORT sTargetPosition,
    314                                   HWND hmenuSource,
    315                                   ULONG fl);
    316     typedef ULONG XWPENTRY WINHMERGEMENUS(HWND hmenuTarget,
    317                                           SHORT sTargetPosition,
    318                                           HWND hmenuSource,
    319                                           ULONG fl);
    320     typedef WINHMERGEMENUS *PWINHMERGEMENUS;
    321 
    322     ULONG XWPENTRY winhClearMenu(HWND hwndMenu);
    323 
    324     PSZ XWPENTRY winhQueryMenuItemText(HWND hwndMenu,
    325                                        USHORT usItemID);
    326 
    327     BOOL XWPENTRY winhAppend2MenuItemText(HWND hwndMenu,
    328                                           USHORT usItemID,
    329                                           const char *pcszAppend,
    330                                           BOOL fTab);
    331 
    332     VOID XWPENTRY winhMenuRemoveEllipse(HWND hwndMenu,
    333                                         USHORT usItemId);
    334 
    335     SHORT XWPENTRY winhQueryItemUnderMouse(HWND hwndMenu, POINTL *pptlMouse, RECTL *prtlItem);
    336374
    337375    /* ******************************************************************
     
    711749    typedef WINHQUERYWINDOWFONT *PWINHQUERYWINDOWFONT;
    712750
     751    PCSZ XWPENTRY winhQueryDefaultFont(VOID);
     752
    713753    BOOL XWPENTRY winhSetWindowFont(HWND hwnd, const char *pcszFont);
    714754    typedef BOOL XWPENTRY WINHSETWINDOWFONT(HWND hwnd, const char *pcszFont);
     
    735775                                         ULONG cbData,
    736776                                         PVOID pData);
     777
     778        PPRESPARAMS XWPENTRY winhCreateDefaultPresparams(VOID);
    737779    #endif
    738780
     
    788830    typedef WINHFREE *PWINHFREE;
    789831
     832    /*
     833     *@@ winhMyAnchorBlock:
     834     *      returns the HAB of the current thread.
     835     *
     836     *      Many Win* functions require an HAB to be
     837     *      passed in. While many of them will work
     838     *      when passing in NULLHANDLE, some (such as
     839     *      WinGetMsg) won't. If you don't know the
     840     *      anchor block of the calling thread, use
     841     *      this function.
     842     *
     843     *      The HAB is simply a LONG whose hiword has
     844     *      the current PID and the lowword has the
     845     *      current TID. The previous function that
     846     *      created a temporary window to figure this
     847     *      out has been replaced with this macro, since
     848     *      WinQueryAnchorBlock(HWND_DESKTOP) yields the
     849     *      same result.
     850     *
     851     *@@added V1.0.1 (2002-11-30) [umoeller]
     852     */
     853
     854    #define winhMyAnchorBlock() WinQueryAnchorBlock(HWND_DESKTOP)
     855
     856    /*
    790857    HAB XWPENTRY winhMyAnchorBlock(VOID);
    791858    typedef HAB XWPENTRY WINHMYANCHORBLOCK(VOID);
    792859    typedef WINHMYANCHORBLOCK *PWINHMYANCHORBLOCK;
     860    */
    793861
    794862    VOID XWPENTRY winhSleep(ULONG ulSleep);
     
    804872                              const char *pcszApplication,
    805873                              const char *pcszKey);
     874
     875    HPOINTER XWPENTRY winhQueryWaitPointer(VOID);
    806876
    807877    HPOINTER XWPENTRY winhSetWaitPointer(VOID);
     
    903973                                       ULONG cbSize);
    904974
    905     /*
    906      *@@ winhQueryScreenCX:
    907      *      helper macro for getting the screen width.
    908      */
    909 
    910     #define winhQueryScreenCX() (WinQuerySysValue(HWND_DESKTOP, SV_CXSCREEN))
    911 
    912     /*
    913      *@@ winhQueryScreenCY:
    914      *      helper macro for getting the screen height.
    915      */
    916 
    917     #define winhQueryScreenCY() (WinQuerySysValue(HWND_DESKTOP, SV_CYSCREEN))
    918 
    919     /* ******************************************************************
    920      *
    921      *   Extended frame
    922      *
    923      ********************************************************************/
    924 
    925     #define XFCF_STATUSBAR          0x0001
    926 
    927     #define FID_STATUSBAR           0x8100
    928 
    929     VOID winhCalcExtFrameRect(MPARAM mp1,
    930                               MPARAM mp2,
    931                               LONG lStatusBarHeight);
    932 
    933     /*
    934      *@@ EXTFRAMECDATA:
    935      *
    936      *@@added V0.9.16 (2001-09-29) [umoeller]
    937      */
    938 
    939     typedef struct _EXTFRAMECDATA
    940     {
    941         PSWP        pswpFrame;          // in: frame wnd pos
    942         ULONG       flFrameCreateFlags; // in: FCF_* flags
    943         ULONG       flExtFlags;         // in: XFCF_* flags
    944         ULONG       ulFrameStyle;       // in: WS_* flags (e.g. WS_VISIBLE, WS_ANIMATE)
    945         const char  *pcszFrameTitle;    // in: frame title (title bar)
    946         ULONG       ulResourcesID;      // in: according to FCF_* flags
    947         const char  *pcszClassClient;   // in: client class name
    948         ULONG       flStyleClient;      // in: client style
    949         ULONG       ulID;               // in: frame window ID
    950         PVOID       pClientCtlData;     // in: pCtlData structure pointer for client
    951     } EXTFRAMECDATA, *PEXTFRAMECDATA;
    952 
    953     /*
    954      *@@ EXTFRAMEDATA:
    955      *
    956      *@@added V0.9.16 (2001-09-29) [umoeller]
    957      */
    958 
    959     typedef struct _EXTFRAMEDATA
    960     {
    961         EXTFRAMECDATA   CData;
    962 
    963         PFNWP           pfnwpOrig;      // original frame wnd proc from subclassing
    964 
    965         PVOID           pvUser;         // more data for user (e.g. for additional subclassing)
    966 
    967     } EXTFRAMEDATA, *PEXTFRAMEDATA;
    968 
    969     HWND winhCreateStatusBar(HWND hwndFrame,
    970                              HWND hwndOwner,
    971                              const char *pcszText,
    972                              const char *pcszFont,
    973                              LONG lColor);
    974 
    975     HWND winhCreateExtStdWindow(PEXTFRAMECDATA pData,
    976                                 PHWND phwndClient);
    977 
    978975    /* ******************************************************************
    979976     *
Note: See TracChangeset for help on using the changeset viewer.