Ignore:
Timestamp:
May 8, 2002, 1:26:30 PM (23 years ago)
Author:
sandervl
Message:

merge with latest Wine

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/comctl32/commctrl.c

    r7815 r8382  
    55 * Copyright 1998,2000 Eric Kohl
    66 *
     7 * This library is free software; you can redistribute it and/or
     8 * modify it under the terms of the GNU Lesser General Public
     9 * License as published by the Free Software Foundation; either
     10 * version 2.1 of the License, or (at your option) any later version.
     11 *
     12 * This library is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     15 * Lesser General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU Lesser General Public
     18 * License along with this library; if not, write to the Free Software
     19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    720 */
    821
     
    1730#include "shlwapi.h"
    1831#include "comctl32.h"
    19 #include "debugtools.h"
    20 
    21 DEFAULT_DEBUG_CHANNEL(commctrl);
     32#include "wine/debug.h"
     33
     34WINE_DEFAULT_DEBUG_CHANNEL(commctrl);
    2235
    2336extern void ANIMATE_Register(void);
     
    6881LANGID  COMCTL32_uiLang = MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL);
    6982HBRUSH  COMCTL32_hPattern55AABrush = (HANDLE)NULL;
     83COMCTL32_SysColor  comctl32_color;
    7084
    7185static HBITMAP COMCTL32_hPattern55AABitmap = (HANDLE)NULL;
     
    111125            COMCTL32_hPattern55AABitmap = CreateBitmap (8, 8, 1, 1, wPattern55AA);
    112126            COMCTL32_hPattern55AABrush = CreatePatternBrush (COMCTL32_hPattern55AABitmap);
     127
     128            /* Get all the colors at DLL load */
     129            COMCTL32_RefreshSysColors();
    113130
    114131            /* register all Win95 common control classes */
     
    396413 */
    397414
    398 VOID WINAPI
    399 DrawStatusTextW (HDC hdc, LPRECT lprc, LPCWSTR text, UINT style)
     415void WINAPI DrawStatusTextW (HDC hdc, LPRECT lprc, LPCWSTR text, UINT style)
    400416{
    401417    RECT r = *lprc;
     
    403419
    404420    if (style & SBT_POPOUT)
    405       border = BDR_RAISEDOUTER;
     421        border = BDR_RAISEDOUTER;
    406422    else if (style & SBT_NOBORDERS)
    407       border = 0;
    408 
    409     DrawEdge (hdc, &r, border, BF_RECT|BF_ADJUST|BF_MIDDLE);
     423        border = 0;
     424
     425    DrawEdge (hdc, &r, border, BF_RECT|BF_ADJUST);
    410426
    411427    /* now draw text */
    412428    if (text) {
    413       int oldbkmode = SetBkMode (hdc, TRANSPARENT);
    414       r.left += 3;
    415       DrawTextW (hdc, text, lstrlenW(text),
    416                    &r, DT_LEFT|DT_VCENTER|DT_SINGLELINE); 
    417       if (oldbkmode != TRANSPARENT)
     429        int oldbkmode = SetBkMode (hdc, TRANSPARENT);
     430        UINT align = DT_LEFT;
     431        if (*text == L'\t') {
     432            text++;
     433            align = DT_CENTER;
     434            if (*text == L'\t') {
     435                text++;
     436                align = DT_RIGHT;
     437            }
     438        }
     439        r.left += 3;
     440        if (style & SBT_RTLREADING)
     441            FIXME("Usupported RTL style!");
     442        DrawTextW (hdc, text, -1, &r, align|DT_VCENTER|DT_SINGLELINE);
    418443        SetBkMode(hdc, oldbkmode);
    419444    }
     
    437462 */
    438463
    439 VOID WINAPI
    440 DrawStatusTextA (HDC hdc, LPRECT lprc, LPCSTR text, UINT style)
     464void WINAPI DrawStatusTextA (HDC hdc, LPRECT lprc, LPCSTR text, UINT style)
    441465{
    442466    INT len;
     
    10151039    return hwndToolTip;
    10161040}
     1041
     1042
     1043/***********************************************************************
     1044 * COMCTL32_RefreshSysColors [NOT AN API]
     1045 *
     1046 * Invoked on any control recognizing a WM_SYSCOLORCHANGE message to
     1047 * refresh the color values in the color structure
     1048 *
     1049 * PARAMS
     1050 *     none
     1051 *
     1052 * RETURNS
     1053 *     none
     1054 */
     1055VOID
     1056COMCTL32_RefreshSysColors(void)
     1057{
     1058    comctl32_color.clrBtnHighlight = GetSysColor (COLOR_BTNHIGHLIGHT);
     1059    comctl32_color.clrBtnShadow = GetSysColor (COLOR_BTNSHADOW);
     1060    comctl32_color.clrBtnText = GetSysColor (COLOR_BTNTEXT);
     1061    comctl32_color.clrBtnFace = GetSysColor (COLOR_BTNFACE);
     1062    comctl32_color.clrHighlight = GetSysColor (COLOR_HIGHLIGHT);
     1063    comctl32_color.clrHighlightText = GetSysColor (COLOR_HIGHLIGHTTEXT);
     1064    comctl32_color.clr3dHilight = GetSysColor (COLOR_3DHILIGHT);
     1065    comctl32_color.clr3dShadow = GetSysColor (COLOR_3DSHADOW);
     1066    comctl32_color.clr3dDkShadow = GetSysColor (COLOR_3DDKSHADOW);
     1067    comctl32_color.clr3dFace = GetSysColor (COLOR_3DFACE);
     1068    comctl32_color.clrWindow = GetSysColor (COLOR_WINDOW);
     1069    comctl32_color.clrWindowText = GetSysColor (COLOR_WINDOWTEXT);
     1070    comctl32_color.clrGrayText = GetSysColor (COLOR_GRAYTEXT);
     1071    comctl32_color.clrActiveCaption = GetSysColor (COLOR_ACTIVECAPTION);
     1072    comctl32_color.clrInfoBk = GetSysColor (COLOR_INFOBK);
     1073    comctl32_color.clrInfoText = GetSysColor (COLOR_INFOTEXT);
     1074}
Note: See TracChangeset for help on using the changeset viewer.