Ignore:
Timestamp:
Aug 19, 2002, 11:23:17 PM (23 years ago)
Author:
umoeller
Message:

Dialog formatter rewrite.

File:
1 edited

Legend:

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

    r196 r209  
    116116
    117117#pragma hdrstop
     118
     119/* ******************************************************************
     120 *
     121 *   "Separator line" control
     122 *
     123 ********************************************************************/
     124
     125PFNWP   G_pfnwpStatic = NULL;
     126
     127/*
     128 *@@ fnwpSeparatorLine:
     129 *      window proc for the subclassed static control that makes
     130 *      the "separator line" control.
     131 *
     132 *@@added V0.9.20 (2002-08-10) [umoeller]
     133 */
     134
     135static MRESULT EXPENTRY fnwpSeparatorLine(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
     136{
     137    MRESULT mrc = 0;
     138
     139    switch (msg)
     140    {
     141        case WM_PAINT:
     142        {
     143            RECTL rcl;
     144            HPS hps;
     145            WinQueryWindowRect(hwnd, &rcl);
     146            if (hps = WinBeginPaint(hwnd, NULLHANDLE, NULL))
     147            {
     148                POINTL ptl;
     149
     150                gpihSwitchToRGB(hps);
     151
     152                GpiSetColor(hps, WinQuerySysColor(HWND_DESKTOP, SYSCLR_BUTTONLIGHT, 0));
     153
     154                ptl.x = rcl.xLeft;
     155                ptl.y = (rcl.yTop - rcl.yBottom) / 2 - 1;
     156                GpiMove(hps, &ptl);
     157                ptl.x = rcl.xRight;
     158                GpiLine(hps, &ptl);
     159
     160                GpiSetColor(hps, WinQuerySysColor(HWND_DESKTOP, SYSCLR_BUTTONDARK, 0));
     161
     162                ptl.x = rcl.xLeft;
     163                ++ptl.y;
     164                GpiMove(hps, &ptl);
     165                ptl.x = rcl.xRight;
     166                GpiLine(hps, &ptl);
     167
     168                WinEndPaint(hps);
     169            }
     170        }
     171        break;
     172
     173        default:
     174            mrc = G_pfnwpStatic(hwnd, msg, mp1, mp2);
     175    }
     176
     177    return mrc;
     178}
     179
     180/*
     181 *@@ ctlMakeSeparatorLine:
     182 *      turns the given static control into a 3D separator line.
     183 *
     184 *@@added V0.9.21 (2002-08-12) [umoeller]
     185 */
     186
     187BOOL ctlRegisterSeparatorLine(HAB hab)
     188{
     189    CLASSINFO ciStatic;
     190    if (WinQueryClassInfo(hab,
     191                          WC_STATIC,
     192                          &ciStatic))
     193    {
     194        G_pfnwpStatic = ciStatic.pfnWindowProc;
     195
     196        return WinRegisterClass(hab,
     197                                WC_SEPARATORLINE,
     198                                fnwpSeparatorLine,
     199                                (ciStatic.flClassStyle & ~CS_PUBLIC),
     200                                ciStatic.cbWindowData);
     201
     202    }
     203
     204    return FALSE;
     205}
    118206
    119207/* ******************************************************************
Note: See TracChangeset for help on using the changeset viewer.