Ignore:
Timestamp:
Dec 12, 2001, 1:49:34 PM (24 years ago)
Author:
sandervl
Message:

font delete bugs removed

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/comctl32/tooltips.cpp

    r7408 r7616  
    2626#include "commctrl.h"
    2727#include "ccbase.h"
    28 #include "tooltips.h"
    2928#include "comctl32.h"
    3029
     
    3332#define ID_TIMERLEAVE  3    /* tool leave timer */
    3433
     34
     35typedef struct tagTT_SUBCLASS_INFO
     36{
     37    WNDPROC wpOrigProc;
     38    HWND    hwndToolTip;
     39    UINT    uRefCount;
     40} TT_SUBCLASS_INFO, *LPTT_SUBCLASS_INFO;
     41
     42
     43typedef struct tagTTTOOL_INFO
     44{
     45    UINT      uFlags;
     46    HWND      hwnd;
     47    UINT      uId;
     48    RECT      rect;
     49    HINSTANCE hinst;
     50    LPWSTR    lpszText;
     51    LPARAM    lParam;
     52} TTTOOL_INFO;
     53
     54
     55typedef struct tagTOOLTIPS_INFO
     56{
     57    COMCTL32_HEADER header;
     58
     59    WCHAR    szTipText[INFOTIPSIZE];
     60    BOOL     bActive;
     61    BOOL     bTrackActive;
     62    UINT     uNumTools;
     63    COLORREF clrBk;
     64    COLORREF clrText;
     65#ifdef __WIN32OS2__
     66    HFONT    hDefaultFont;
     67#endif
     68    HFONT    hFont;
     69    INT      xTrackPos;
     70    INT      yTrackPos;
     71    INT      nMaxTipWidth;
     72    INT      nTool;
     73    INT      nOldTool;
     74    INT      nCurrentTool;
     75    INT      nTrackTool;
     76    INT      nAutomaticTime;
     77    INT      nReshowTime;
     78    INT      nAutoPopTime;
     79    INT      nInitialTime;
     80    RECT     rcMargin;
     81
     82    TTTOOL_INFO *tools;
     83} TOOLTIPS_INFO;
    3584
    3685extern LPSTR COMCTL32_aSubclass; /* global subclassing atom */
     
    20022051    nclm.cbSize = sizeof(NONCLIENTMETRICSA);
    20032052    SystemParametersInfoA(SPI_GETNONCLIENTMETRICS,0,&nclm,0);
     2053
     2054#ifdef __WIN32OS2__
     2055    infoPtr->hFont = infoPtr-> hDefaultFont = CreateFontIndirectA(&nclm.lfStatusFont);
     2056#else
    20042057    infoPtr->hFont = CreateFontIndirectA(&nclm.lfStatusFont);
     2058#endif
    20052059
    20062060    infoPtr->nMaxTipWidth = -1;
     
    20792133
    20802134    /* delete font */
     2135#ifdef __WIN32OS2__
     2136    //NEVER delete the font object received by WM_SETFONT!
     2137    DeleteObject (infoPtr->hDefaultFont);
     2138#else
    20812139    DeleteObject (infoPtr->hFont);
     2140#endif
    20822141
    20832142    /* free tool tips info data */
     
    22862345    infoPtr->clrText = GetSysColor (COLOR_INFOTEXT);
    22872346
     2347#ifdef __WIN32OS2__
     2348    //NEVER delete the font object received by WM_SETFONT!
     2349    DeleteObject (infoPtr->hDefaultFont);
     2350#else
    22882351    DeleteObject (infoPtr->hFont);
     2352#endif
    22892353    nclm.cbSize = sizeof(NONCLIENTMETRICSA);
    22902354    SystemParametersInfoA (SPI_GETNONCLIENTMETRICS, 0, &nclm, 0);
     2355#ifdef __WIN32OS2__
     2356    infoPtr->hFont = infoPtr->hDefaultFont = CreateFontIndirectA (&nclm.lfStatusFont);
     2357#else
    22912358    infoPtr->hFont = CreateFontIndirectA (&nclm.lfStatusFont);
    2292 
     2359#endif
    22932360    return 0;
    22942361}
Note: See TracChangeset for help on using the changeset viewer.