Ignore:
Timestamp:
May 19, 2001, 3:47:20 PM (24 years ago)
Author:
umoeller
Message:

New folder sorting. Updated folder refresh. Misc other changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/helpers/winh.c

    r62 r69  
    5757#define INCL_WINPROGRAMLIST
    5858#define INCL_WINSWITCHLIST
     59#define INCL_WINBUTTONS
    5960#define INCL_WINMENUS
    6061#define INCL_WINSCROLLBARS
     
    8889
    8990/*
     91 *@@category: Helpers\PM helpers\Wrappers
     92 */
     93
     94/* ******************************************************************
     95 *
     96 *   Wrappers
     97 *
     98 ********************************************************************/
     99
     100#ifdef WINH_STANDARDWRAPPERS
     101
     102    /*
     103     *@@ winhSendMsg:
     104     *      wrapper for WinSendMsg.
     105     *
     106     *      If WINH_STANDARDWRAPPERS is #defined before
     107     *      including win.h, all WinSendMsg calls are
     108     *      redefined to use this wrapper instead. This
     109     *      reduces the amount of external fixups required
     110     *      for loading the module.
     111     *
     112     *@@added V0.9.12 (2001-05-18) [umoeller]
     113     */
     114
     115    MRESULT winhSendMsg(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
     116    {
     117        // put the call in brackets so the macro won't apply here
     118        return ((WinSendMsg)(hwnd, msg, mp1, mp2));
     119    }
     120
     121    /*
     122     *@@ winhPostMsg:
     123     *      wrapper for WinPostMsg.
     124     *
     125     *      If WINH_STANDARDWRAPPERS is #defined before
     126     *      including win.h, all WinSendMsg calls are
     127     *      redefined to use this wrapper instead. This
     128     *      reduces the amount of external fixups required
     129     *      for loading the module.
     130     *
     131     *@@added V0.9.12 (2001-05-18) [umoeller]
     132     */
     133
     134    BOOL winhPostMsg(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
     135    {
     136        // put the call in brackets so the macro won't apply here
     137        return ((WinPostMsg)(hwnd, msg, mp1, mp2));
     138    }
     139
     140    /*
     141     *@@ winhWindowFromID:
     142     *
     143     *@@added V0.9.12 (2001-05-18) [umoeller]
     144     */
     145
     146    HWND winhWindowFromID(HWND hwnd, ULONG id)
     147    {
     148        // put the call in brackets so the macro won't apply here
     149        return ((WinWindowFromID)(hwnd, id));
     150    }
     151
     152    /*
     153     *@@ winhQueryWindow:
     154     *
     155     *@@added V0.9.12 (2001-05-18) [umoeller]
     156     */
     157
     158    HWND winhQueryWindow(HWND hwnd, LONG lCode)
     159    {
     160        // put the call in brackets so the macro won't apply here
     161        return ((WinQueryWindow)(hwnd, lCode));
     162    }
     163
     164#endif // WINH_STANDARDWRAPPERS
     165
     166/*
    90167 *@@category: Helpers\PM helpers\Rectangle helpers
    91168 */
     
    119196
    120197/*
     198 *@@category: Helpers\PM helpers\Generics
     199 */
     200
     201/* ******************************************************************
     202 *
     203 *   Generics
     204 *
     205 ********************************************************************/
     206
     207/*
     208 *@@ winhSetDlgItemChecked:
     209 *      checks a check box.
     210 *
     211 *      This has been turned into a real function
     212 *      because this is used hundreds of times in
     213 *      XWP, and each WinSendDlgItemMsg in each
     214 *      macro produced a fixup relocation record.
     215 *
     216 *@@added V0.9.12 (2001-05-18) [umoeller]
     217 */
     218
     219BOOL winhSetDlgItemChecked(HWND hwnd,       // in: dialog
     220                           SHORT id,        // in: dialog item ID
     221                           SHORT bCheck)    // in: 0, 1, or (for tri-state) 2
     222{
     223    return ((BOOL)WinSendDlgItemMsg(hwnd,
     224                                    id,
     225                                    BM_SETCHECK,
     226                                    MPFROMSHORT(bCheck),
     227                                    MPNULL));
     228}
     229
     230/*
     231 *@@ winhIsDlgItemChecked:
     232 *      returns the current check state of the
     233 *      specified check box, which can be 0, 1,
     234 *      or (for tri-state checkboxes) 2.
     235 *
     236 *@@added V0.9.12 (2001-05-18) [umoeller]
     237 */
     238
     239SHORT winhIsDlgItemChecked(HWND hwnd,       // in: dialog
     240                           SHORT id)        // in: dialog item ID
     241{
     242    return (SHORT1FROMMR(WinSendDlgItemMsg(hwnd,
     243                                           id,
     244                                           BM_QUERYCHECK,
     245                                           MPNULL,
     246                                           MPNULL)));
     247}
     248
     249/*
     250 *@@ winhEnableDlgItem:
     251 *
     252 *@@added V0.9.12 (2001-05-18) [umoeller]
     253 */
     254
     255BOOL winhEnableDlgItem(HWND hwndDlg,
     256                       SHORT id,
     257                       BOOL fEnable)
     258{
     259    return (WinEnableWindow(WinWindowFromID(hwndDlg, id), fEnable));
     260}
     261
     262/*
     263 *@@ winhIsDlgItemEnabled:
     264 *
     265 *@@added V0.9.12 (2001-05-18) [umoeller]
     266 */
     267
     268BOOL winhIsDlgItemEnabled(HWND hwndDlg,
     269                          SHORT id)
     270{
     271    return (WinIsWindowEnabled(WinWindowFromID(hwndDlg, id)));
     272}
     273
     274
     275/*
    121276 *@@category: Helpers\PM helpers\Menu helpers
    122277 */
     
    127282 *
    128283 ********************************************************************/
     284
     285/*
     286 *@@ winhQueryMenuItem:
     287 *      wrapper around MM_QUERYITEM.
     288 *
     289 *@@added V0.9.12 (2001-05-18) [umoeller]
     290 */
     291
     292BOOL winhQueryMenuItem(HWND hwndMenu,
     293                       USHORT usItemID,
     294                       BOOL fSearchSubmenus,
     295                       PMENUITEM pmi)           // out: MENUITEM data
     296{
     297    return ((BOOL)WinSendMsg(hwndMenu,
     298                             MM_QUERYITEM,
     299                             MPFROM2SHORT(usItemID, fSearchSubmenus),
     300                             (MPARAM)pmi));
     301}
    129302
    130303/*
     
    15251698                                                    // which considers this inclusive!
    15261699                         LONG ulViewportPels,       // in: total viewport dimension,
    1527                                                     // into which *plCurPelsOfs is an offset
     1700                                                    // into which *pulCurPelsOfs is an offset
    15281701                         USHORT usLineStepPels,     // in: pixels to scroll line-wise
    15291702                                                    // (scroll bar buttons pressed)
     
    16021775    if (*pulCurPelsOfs > (lMaxAllowedUnitOfs * usScrollUnitPels))
    16031776    {
    1604         // _Pmpf(("        !!! limiting 2: %d to %d", *plCurUnitOfs, lMaxAllowedUnitOfs));
    16051777        *pulCurPelsOfs = (lMaxAllowedUnitOfs * usScrollUnitPels);
    16061778    }
Note: See TracChangeset for help on using the changeset viewer.