Changeset 19


Ignore:
Timestamp:
Jan 3, 2001, 10:05:57 PM (25 years ago)
Author:
umoeller
Message:

Reworked tooltip.

Location:
trunk
Files:
4 edited

Legend:

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

    r18 r19  
    439439
    440440    // TOOLINFO.uFlags flags (ORed)
    441     #define TTF_IDISHWND            0x0001
    442     #define TTF_CENTERTIP           0x0002
    443     #define TTF_RTLREADING          0x0004
     441    // #define TTF_IDISHWND            0x0001
     442                // V0.9.7 (2001-01-03) [umoeller]: removed this win95 bullshit
     443    #define TTF_CENTERBELOW         0x0002
     444    #define TTF_CENTERABOVE         0x0004
     445    // #define TTF_RTLREADING          0x0004
     446                // V0.9.7 (2001-01-03) [umoeller]: removed this win95 bullshit
    444447    #define TTF_SUBCLASS            0x0008
    445448    // non-Win95 flags
    446449    #define TTF_SHYMOUSE            0x0010
    447450
    448     #define LPSTR_TEXTCALLBACK      (PSZ)-1
     451    #define PSZ_TEXTCALLBACK      (PSZ)-1
    449452
    450453    #define TT_SHADOWOFS            10
     
    456459     *      tooltip control. Used with TTM_ADDTOOL
    457460     *      and many other TTM_* messages.
     461     *
     462     *@@changed V0.9.7 (2001-01-03) [umoeller]: removed all that win95 bullshit
    458463     */
    459464
    460465    typedef struct _TOOLINFO
    461466    {
    462         ULONG /* UINT */ cbSize;       // in: sizeof(TOOLINFO)
    463         ULONG /* UINT */ uFlags;
     467        ULONG   ulFlags;
    464468                    // in: flags for the tool, any combination of:
    465                     // -- TTF_IDISHWND: Indicates that the uId member is the window
    466                     //      handle to the tool. If this flag is not set, uId is
    467                     //      the identifier of the tool.
    468                     // -- TTF_CENTERTIP:  Centers the tooltip window below the
    469                     //      tool specified by the uId member.
    470                     // -- TTF_RTLREADING: Windows 95 only: Displays text using
    471                     //      right-to-left reading order on Hebrew or Arabic systems.
    472                     //      (Ignored on OS/2).
     469                    // -- TTF_CENTERBELOW:  centers the tooltip window below the
     470                    //      tool specified by the hwndTool member.
     471                    // -- TTF_CENTERABOVE:  centers the tooltip window above the
     472                    //      tool specified by the hwndTool member.
    473473                    // -- TTF_SUBCLASS: Indicates that the tooltip control should
    474                     //      subclass the tool's window to intercept messages,
     474                    //      subclass hwndTool to intercept messages,
    475475                    //      such as WM_MOUSEMOVE. See TTM_RELAYEVENT.
    476476                    // -- TTF_SHYMOUSE (OS/2 only): shy away from mouse pointer;
     
    478478                    //      covered by the mouse pointer (for readability);
    479479                    //      added V0.9.1 (2000-02-04) [umoeller]
    480         HWND      hwnd;
     480        HWND    hwndToolOwner;
    481481                    // in: handle to the window that contains the tool. If
    482482                    // lpszText includes the LPSTR_TEXTCALLBACK value, this
    483483                    // member identifies the window that receives TTN_NEEDTEXT
    484484                    // notification messages.
    485         ULONG /* UINT */ uId;
    486                     // in: application-defined identifier of the tool. If uFlags
    487                     // includes the TTF_IDISHWND value, uId must specify the
    488                     // window handle to the tool.
    489         RECTL /* RECT */ rect;
    490                     // in: coordinates of the bounding rectangle of the tool.
    491                     // The coordinates are relative to the upper-left corner of
    492                     // the client area of the window identified by hwnd. If
    493                     // uFlags includes the TTF_IDISHWND value, this member is
    494                     // ignored.
    495         HMODULE /* HINSTANCE */ hinst;
    496                     // in: handle to the instance that contains the string
    497                     // resource for the tool. If lpszText specifies the identifier
    498                     // of a string resource, this member is used.
    499                     // Note: On Win32, this is an HINSTANCE field. On OS/2,
    500                     // this is a HMODULE field. The field name is retained for
    501                     // compatibility.
    502         PSZ /* LPTSTR */ lpszText;
     485        HWND    hwndTool;
     486                    // in: window handle of the tool.
     487                    // ### simple rectangles of hwndToolOwner not yet supported
     488        PSZ     pszText;
    503489                    // in: pointer to the buffer that contains the text for the
    504490                    // tool (if the hiword is != NULL), or identifier of the string
    505491                    // resource that contains the text (if the hiword == NULL).
    506                     // If this member is set to the LPSTR_TEXTCALLBACK value,
     492                    // If this member is set to the PSZ_TEXTCALLBACK value,
    507493                    // the control sends the TTN_NEEDTEXT notification message to
    508                     // the owner window to retrieve the text.
     494                    // hwndToolOwner to retrieve the text.
    509495    } TOOLINFO, *PTOOLINFO;
    510496
     
    529515    #define TTM_SETDELAYTIME            (TTM_FIRST + 6)
    530516
    531     /*
    532      *@@ NMHDR:
    533      *      structure used with TOOLTIPTEXT;
    534      *      under Win32, this is a generic structure which
    535      *      comes with all WM_NOTIFY messages.
    536      */
    537 
    538     typedef struct _NMHDR
    539     {
    540         HWND    hwndFrom;       // control sending the message
    541         ULONG   idFrom;         // ID of that control
    542         USHORT  code;           // notification code
    543     } NMHDR, *PNMHDR;
     517    #define TTFMT_PSZ           0x01
     518    #define TTFMT_STRINGRES     0x02
    544519
    545520    /*
    546521     *@@ TOOLTIPTEXT:
    547522     *      identifies a tool for which text is to be displayed and
    548      *      receives the text for the tool.
     523     *      receives the text for the tool. The tool must fill all
     524     *      fields of this structure.
    549525     *
    550526     *      This structure is used with the TTN_NEEDTEXT notification.
     527     *
     528     *@@changed V0.9.7 (2001-01-03) [umoeller]: got rid of this win95 bullshit
    551529     */
    552530
    553531    typedef struct _TOOLTIPTEXT
    554532    {
    555         NMHDR     hdr;          // on Win95, this is required for all WM_NOTIFY msgs
    556         PSZ /* LPTSTR */ lpszText;
    557                     // out: pointer to a string that contains or receives the text
    558                     // for a tool. If hinst specifies an instance handle, this
    559                     // member must be the identifier of a string resource.
    560         char      szText[80];
    561                     // out: buffer that receives the tooltip text. An application can
    562                     // copy the text to this buffer as an alternative to specifying a
    563                     // string address or string resource.
    564         HMODULE /* HINSTANCE */ hinst;
    565                     // out: handle to the instance (OS/2: module) that contains a string
    566                     // resource to be used as the tooltip text. If lpszText is the
    567                     // pointer to the tooltip text, this member is NULL.
    568                     // Note: On Win32, this is an HINSTANCE field. On OS/2,
    569                     // this is a HMODULE field. The field name is retained for
    570                     // compatibility.
    571         ULONG /* UINT */ uFlags;
    572                     // in: flag that indicates how to interpret the idFrom member of
    573                     // the NMHDR structure that is included in the structure. If this
    574                     // member is the TTF_IDISHWND value, idFrom is the handle of the
    575                     // tool. Otherwise, idFrom is the identifier of the tool.
    576                     // Windows 95 only: If this member is the TTF_RTLREADING value,
    577                     // then text on Hebrew or Arabic systems is displayed using
    578                     // right-to-left reading order. (Ignored on OS/2.)
     533        HWND    hwndTooltip;
     534                    // in: tooltip control who's sending this.
     535        HWND    hwndTool;
     536                    // in: tool for which the text is needed.
     537        ULONG   ulFormat;
     538                    // out: one of:
     539                    // -- TTFMT_PSZ: pszText contains the new, zero-terminated string.
     540                    // -- TTFMT_STRINGRES: hmod and idResource specify a string resource
     541                    //    to be loaded.
     542        PSZ     pszText;
     543                    // out: with TTFMT_PSZ, pointer to a string that contains the
     544                    // tool text. Note that this is not copied into the tooltip...
     545                    // so this must point to a static buffer.
     546        HMODULE hmod;
     547                    // out: with TTFMT_STRINGRES, the module handle of the resource.
     548        ULONG   idResource;
     549                    // out: with TTFMT_STRINGRES, the string resource ID.
    579550    } TOOLTIPTEXT, *PTOOLTIPTEXT;
    580551
  • trunk/src/helpers/cctl_tooltip.c

    r14 r19  
    182182            qmsg.mp1 = mp1;
    183183            qmsg.mp2 = mp2;
    184             /* WinQueryMsgPos(pst->hab,
    185                            &qmsg.ptl);
    186             qmsg.time = WinQueryMsgTime(pst->hab); */
    187             // _Pmpf(("ctl_fnwpSubclassedTool: sending TTM_RELAYEVENT"));
     184            _Pmpf((__FUNCTION__ ": sending TTM_RELAYEVENT"));
    188185            WinSendMsg(pst->hwndTooltip,
    189186                       TTM_RELAYEVENT,
     
    194191
    195192        case WM_DESTROY:
    196             mrc = (pst->pfnwpOrig)(hwndTool, msg, mp1, mp2);
    197193            lstRemoveItem(G_pllSubclassedTools, pst);         // this frees the item
    198194            if (lstCountItems(G_pllSubclassedTools) == 0)
     
    201197                lstFree(G_pllSubclassedTools);
    202198                G_pllSubclassedTools = NULL;
     199                _Pmpf((__FUNCTION__ ": removed hwnd 0x%lX", hwndTool));
    203200            }
     201            mrc = (pst->pfnwpOrig)(hwndTool, msg, mp1, mp2);
    204202        break;
    205203
     
    240238
    241239            lstAppendItem(G_pllSubclassedTools, pst);
     240            _Pmpf((__FUNCTION__ ": subclassed hwnd 0x%lX", hwndTool));
    242241        }
    243242    }
     
    284283    BOOL        fIsVisible;         // TRUE if tooltip is visible
    285284
    286     CHAR        szTextBuf[256];     // static buffer for copying/loading strings
     285    // CHAR        szTextBuf[256];     // static buffer for copying/loading strings
    287286} TOOLTIPDATA, *PTOOLTIPDATA;
    288287
     
    435434                    BOOL fShow)  // if TRUE: show, else: HIDE
    436435{
     436    _Pmpf((__FUNCTION__ ": fShow %d", fShow));
    437437    if (fShow)
    438438    {
     
    458458           )
    459459        {
    460             pttd->pszPaintText = NULL;
    461460            // mouse not moved since timer was started:
    462461            // find the current TOOLINFO
     462            _Pmpf((__FUNCTION__ ": mouse not moved... pttd->ptiMouseOver 0x%lX", pttd->ptiMouseOver));
    463463            if (pttd->ptiMouseOver)
    464464            {
     
    470470                           (MPARAM)0,
    471471                           (MPARAM)&tiTemp);
    472                 if (tiTemp.lpszText)
    473                     pttd->pszPaintText = strdup(tiTemp.lpszText);
     472                if (tiTemp.pszText)
     473                    pttd->pszPaintText = strdup(tiTemp.pszText);
    474474                else
    475475                    pttd->pszPaintText = NULL;
    476476            }
     477
     478            _Pmpf((__FUNCTION__ ": pttd->pszPaintText %s",
     479                    (pttd->pszPaintText) ? pttd->pszPaintText : "NULL"));
    477480
    478481            if (pttd->pszPaintText)
     
    499502
    500503                // calc x and y pos of tooltip
    501                 if (pttd->ptiMouseOver->uFlags & TTF_CENTERTIP)
     504                if (    (pttd->ptiMouseOver->ulFlags & TTF_CENTERBELOW)
     505                     || (pttd->ptiMouseOver->ulFlags & TTF_CENTERABOVE)
     506                   )
    502507                {
    503508                    // center below control:
    504                     if (pttd->ptiMouseOver->uFlags & TTF_IDISHWND)
    505                     {
    506                         SWP swpTool;
    507                         WinQueryWindowPos(pttd->ptiMouseOver->uId, &swpTool);
    508                         ptlTooltip.x = swpTool.x;
    509                         ptlTooltip.y = swpTool.y;
    510                         // convert x, y to desktop points
    511                         WinMapWindowPoints(WinQueryWindow(pttd->ptiMouseOver->uId,
    512                                                           QW_PARENT), // hwndFrom
    513                                            HWND_DESKTOP,            // hwndTo
    514                                            &ptlTooltip,
    515                                            1);
    516                         ptlTooltip.x += ((swpTool.cx - cx) / 2L);
     509                    SWP swpTool;
     510                    WinQueryWindowPos(pttd->ptiMouseOver->hwndTool, &swpTool);
     511                    ptlTooltip.x = swpTool.x;
     512                    ptlTooltip.y = swpTool.y;
     513                    // convert x, y to desktop points
     514                    WinMapWindowPoints(WinQueryWindow(pttd->ptiMouseOver->hwndTool,
     515                                                      QW_PARENT), // hwndFrom
     516                                       HWND_DESKTOP,            // hwndTo
     517                                       &ptlTooltip,
     518                                       1);
     519                    ptlTooltip.x += ((swpTool.cx - cx) / 2L);
     520                    if (pttd->ptiMouseOver->ulFlags & TTF_CENTERBELOW)
    517521                        ptlTooltip.y -= cy;
    518                     }
    519                     // else xxx rectangle def
     522                    else
     523                        ptlTooltip.y += swpTool.cy;
    520524                }
    521525                else
     
    594598                                                     TOOLTIP_ID_TIMER_AUTOPOP,
    595599                                                     pttd->ulTimeoutAutopop);
    596             }
    597         }
     600            } // end if (pttd->pszPaintText)
     601        } // end if (    (ptlPointer.x == pttd->ptlPointerLast.x)...
    598602    } // end if (mp1)
    599603    else
     
    847851                    case TOOLTIP_ID_TIMER_INITIAL:
    848852                        // _Pmpf(("WM_TIMER: Stopping initial timer: %d", usTimer));
     853                        _Pmpf((__FUNCTION__ ": TOOLTIP_ID_TIMER_INITIAL"));
    849854                        WinStopTimer(pttd->hab,
    850855                                     hwndTooltip,
     
    944949             *      the address of a TOOLINFO structure, which provides
    945950             *      information the tooltip control needs to display text
    946              *      for the tool. The cbSize member is required and must
    947              *      specify the size of the structure.
     951             *      for the tool.
    948952             *
    949953             *      A tooltip control supports tools implemented as windows
     
    952956             *
    953957             *      --  When you add a tool implemented as a rectangular area, the
    954              *          "hwnd" member of TOOLINFO must specify the handle of the
    955              *          window that contains the area, and the "rect" member must
     958             *          "hwndToolOwner" member of TOOLINFO must specify the handle
     959             *          of the window that contains the area, and the "rect" member must
    956960             *          specify the client coordinates of the area's bounding
    957              *          rectangle. In addition, the "uId" member must specify the
    958              *          application-defined identifier for the tool.
    959              *
    960              *      --  When you add a tool implemented as a window, the "uId"
     961             *          rectangle. ### not implemented yet
     962             *
     963             *      --  When you add a tool implemented as a window, the "hwndTool"
    961964             *          member of TOOLINFO must contain the window handle of the
    962              *          tool. Also, the "uFlags" member must specify the TTF_IDISHWND
    963              *          value, which tells the tooltip control to interpret the "uId"
    964              *          member as a window handle.
    965              *
    966              *      When you add a tool to a tooltip control, the "lpszText"
    967              *      member of the TOOLINFO structure must specify the address
    968              *      of the string to display for the tool. You can change the
    969              *      text any time after adding the tool by using the
    970              *      TTM_UPDATETIPTEXT message.
    971              *
    972              *      If the high-order word of lpszText is zero, the low-order
    973              *      word must be the identifier of a string resource. When
    974              *      the tooltip control needs the text, the system loads
    975              *      the specified string resource from the application instance
    976              *      identified by the "hinst" member of TOOLINFO.
    977              *
    978              *      If you specify the LPSTR_TEXTCALLBACK value in the lpszText
    979              *      member, the tooltip control notifies the window specified
    980              *      in the hwnd member of TOOLINFO whenever the tooltip control
    981              *      needs to display text for the tool. The tooltip control
    982              *      sends the TTN_NEEDTEXT notification message to the window.
     965             *          tool. hwndToolOwner should be the owner of the tool.
     966             *
     967             *      When you add a tool to a tooltip control, the "pszText"
     968             *      member of the TOOLINFO structure must specify the string
     969             *      to display for the tool. You can change the text any time
     970             *      after adding the tool by using the TTM_UPDATETIPTEXT message.
     971             *
     972             *      If you specify the PSZ_TEXTCALLBACK value in the pszText
     973             *      member, whenever the tooltip control needs the text for the
     974             *      tool, it sends a WM_CONTROL message to hwndToolOwner with
     975             *      the TTN_NEEDTEXT notification code.
     976             *
    983977             *      The message includes the address of a TOOLTIPTEXT structure,
    984              *      which contains the window handle as well as the
    985              *      application-defined identifier for the tool. The window
    986              *      examines the structure to determine the tool for which text
    987              *      is needed, and it fills the appropriate structure members
    988              *      with information that the tooltip control needs to display
    989              *      the string.
    990              *
    991              *      Many applications create toolbars containing tools that
    992              *      correspond to menu commands. For such tools, it is convenient
    993              *      for the tooltip control to display the same text as the
    994              *      corresponding menu item. Windows automatically strips the
    995              *      ampersand (&) accelerator characters from all strings passed
    996              *      to a tooltip control, unless the control has the TTS_NOPREFIX style.
    997              *
    998              *      OS/2 note: This implementation does this too, but will not
    999              *      strip the ampersand, but the tilde (~) character.
     978             *      which contains the window handle of the tool. You can then
     979             *      fill the TOOLTIPTEXT structure with the tool text.
    1000980             *
    1001981             *      To retrieve the text for a tool, use the TTM_GETTEXT message.
     
    1010990                    if (ptiNew)
    1011991                    {
    1012                         memcpy(ptiNew, ptiPassed, ptiPassed->cbSize);
     992                        memcpy(ptiNew, ptiPassed, sizeof(TOOLINFO));
    1013993                        lstAppendItem(&pttd->llTools,
    1014994                                      ptiNew);
    1015995
    1016                         if (ptiPassed->uFlags & TTF_IDISHWND)
    1017                             if (ptiPassed->uFlags & TTF_SUBCLASS)
    1018                                 SubclassToolForToolinfo(hwndTooltip,
    1019                                                         ptiPassed->uId);
     996                        if (ptiPassed->ulFlags & TTF_SUBCLASS)
     997                            SubclassToolForToolinfo(hwndTooltip,
     998                                                    ptiPassed->hwndTool);
    1020999
    10211000                        mrc = (MPARAM)TRUE;
     
    10461025                    {
    10471026                        PTOOLINFO ptiThis = (PTOOLINFO)pToolNode->pItemData;
    1048                         if (    (ptiThis->hwnd == ptiSearch->hwnd)
    1049                              && (ptiThis->uId == ptiSearch->uId)
     1027                        if (    (ptiThis->hwndToolOwner == ptiSearch->hwndToolOwner)
     1028                             && (ptiThis->hwndTool == ptiSearch->hwndTool)
    10501029                           )
    10511030                        {
     
    11781157                    {
    11791158                        PTOOLINFO pti = (PTOOLINFO)pToolNode->pItemData;
    1180                         if (    (pti->uFlags &TTF_IDISHWND)
    1181                              && (pti->uId == pqmsg->hwnd)
    1182                            )
     1159                        if (pti->hwndTool == pqmsg->hwnd)
    11831160                        {
     1161                            _Pmpf((__FUNCTION__ ": found tool"));
    11841162                            pttd->ptiMouseOver = pti;
    11851163                            break;
     
    11961174                    {
    11971175                        // mouse pos changed:
     1176                        // hide tooltip
    11981177                        WinPostMsg(hwndTooltip,
    11991178                                   TTM_SHOWTOOLTIPNOW,
     
    12021181                        memcpy(&pttd->ptlPointerLast, &ptlPointer, sizeof(POINTL));
    12031182
     1183                        _Pmpf((__FUNCTION__ ": pttd->ptiMouseOver: 0x%lX", pttd->ptiMouseOver));
     1184                        _Pmpf((__FUNCTION__ ": pttd->fIsActive: 0x%lX", pttd->fIsActive));
    12041185                        if (    (pttd->ptiMouseOver)
    12051186                             && (pttd->fIsActive)
     
    13031284                PTOOLINFO pti = (PTOOLINFO)mp2;
    13041285
    1305                 if (pti->lpszText == LPSTR_TEXTCALLBACK)
     1286                if (pti->pszText == PSZ_TEXTCALLBACK)
    13061287                {
    13071288                    // TTN_NEEDTEXT notification desired:
    13081289                    // compose values for that msg
    1309                     TOOLTIPTEXT     ttt;
    1310                     memset(&ttt, 0, sizeof(ttt));
    1311                     ttt.hdr.hwndFrom = hwndTooltip;
    1312 
    1313                     if (pti->uFlags & TTF_IDISHWND)
    1314                         // HWND mode:
    1315                         ttt.uFlags = TTF_IDISHWND;
    1316                     ttt.hdr.idFrom = pti->uId;      // HWND or app-def'd ID
    1317                     ttt.hdr.code = TTN_NEEDTEXT;
    1318                     WinSendMsg(pti->hwnd,
     1290                    TOOLTIPTEXT ttt = {0};
     1291                    _Pmpf(("TTM_GETTEXT: LPSTR_TEXTCALLBACK"));
     1292                    ttt.hwndTooltip = hwndTooltip;
     1293                    ttt.hwndTool = pti->hwndTool;
     1294                    WinSendMsg(pti->hwndTool,
    13191295                               WM_CONTROL,
    13201296                               MPFROM2SHORT(pttd->ulTooltipID,  // tooltip control wnd ID
     
    13241300                    // in case of error: set lpszText to NULL; this
    13251301                    // is not specified in the docs however.
    1326                     pti->lpszText = NULL;
    1327 
    1328                     if (ttt.szText[0] != 0)
     1302                    pti->pszText = NULL;
     1303
     1304                    switch (ttt.ulFormat)
    13291305                    {
    1330                         // owner copied string to ttt.szText:
    1331                         // copy that to our buffer in the window words
    1332                         // to make it static
    1333                         strcpy(pttd->szTextBuf, ttt.szText);    // maxlen is 80 chars
    1334                         pti->lpszText = pttd->szTextBuf;
    1335                     }
    1336                     else if (   (ttt.lpszText != 0)
    1337                              && (((ULONG)ttt.lpszText & 0xFFFF0000) != 0)
    1338                             )
    1339                         // owner specified pointer to static buffer somewhere:
    1340                         pti->lpszText = ttt.lpszText;
    1341                     else if ((ULONG)ttt.lpszText & 0xFFFF)
    1342                     {
    1343                         if (WinLoadString(pttd->hab,
    1344                                           ttt.hinst,
    1345                                           (ULONG)ttt.lpszText,
    1346                                           sizeof(pttd->szTextBuf),  // 256 chars
    1347                                           pttd->szTextBuf))
    1348                             pti->lpszText = pttd->szTextBuf;
     1306                        case TTFMT_PSZ:
     1307                            if (ttt.pszText)
     1308                                pti->pszText = ttt.pszText;
     1309                        break;
     1310
     1311                        case TTFMT_STRINGRES:
     1312                            // ### not supported yet
     1313                        break;
    13491314                    }
    13501315                }
     
    14401405                    if (ptiFound)
    14411406                    {
    1442                         memcpy(ptiTarget, ptiFound, ptiTarget->cbSize);
     1407                        memcpy(ptiTarget, ptiFound, sizeof(TOOLINFO));
    14431408                        mrc = (MRESULT)TRUE;
    14441409                    }
     
    14681433                    if (pttd->ptiMouseOver)
    14691434                    {
    1470                         memcpy(ptiTarget, pttd->ptiMouseOver, ptiTarget->cbSize);
     1435                        memcpy(ptiTarget, pttd->ptiMouseOver, sizeof(TOOLINFO));
    14711436                        mrc = (MPARAM)TRUE;
    14721437                    }
     
    15121477                    {
    15131478                        PTOOLINFO ptiThis = (PTOOLINFO)pToolNode->pItemData;
    1514                         if (    (ptiThis->hwnd == ptiSearch->hwnd)
    1515                              && (ptiThis->uId == ptiSearch->uId)
     1479                        if (    (ptiThis->hwndToolOwner == ptiSearch->hwndToolOwner)
     1480                             && (ptiThis->hwndTool == ptiSearch->hwndTool)
    15161481                           )
    15171482                        {
    15181483                            // found:
    1519                             memcpy(ptiSearch, ptiThis, ptiSearch->cbSize);
     1484                            memcpy(ptiSearch, ptiThis, sizeof(TOOLINFO));
    15201485                            mrc = (MPARAM)TRUE;
    15211486                            break;
     
    15551520
    15561521            case TTM_SHOWTOOLTIPNOW:
     1522                _Pmpf((__FUNCTION__ ": TTM_SHOWTOOLTIPNOW %d", mp1));
    15571523                TtmShowTooltip(hwndTooltip, pttd, (BOOL)mp1);
    15581524            break;
  • trunk/src/helpers/threads.c

    r18 r19  
    175175 *         typical PM "Worker" thread where you need to disable
    176176 *         menu items on thread 1 while the thread is running.
     177 *
     178 *      -- THRF_TRANSIENT: creates a "transient" thread where
     179 *         pti may be NULL. A THREADINFO structure is then
     180 *         allocated from the heap internally, but not visible
     181 *         to the caller.
    177182 *
    178183 *@@changed V0.9.0 [umoeller]: default stack size raised for Watcom (thanks, Rdiger Ihle)
  • trunk/src/helpers/timer.c

    r17 r19  
    3636 *
    3737 *      --  When a window is deleted, its timers are not
    38  *          automatically cleaned up. To be on the safe
    39  *          side, always call tmrStopAllTimers when
    40  *          WM_DESTROY comes into a window which has used
    41  *          timers.
     38 *          automatically cleaned up. The timer thread does
     39 *          detect invalid windows and removes them from the
     40 *          timers list before posting, but to be on the safe
     41 *          side, always call tmrStopAllTimers when WM_DESTROY
     42 *          comes into a window which has used timers.
    4243 *
    4344 *      Function prefixes:
     
    204205    while (!ptiMyself->fExit)
    205206    {
    206         ULONG ulNesting = 0;
     207        // ULONG ulNesting = 0;
    207208
    208209        ULONG ulTimeNow;
     
    216217        ulInterval = 100;
    217218
    218         DosEnterMustComplete(&ulNesting);
     219        // DosEnterMustComplete(&ulNesting);
    219220
    220221        TRY_LOUD(excpt1)
     
    240241                                    &ulTimeNow, sizeof(ulTimeNow));
    241242
    242                     while (pTimerNode)
     243                    while ((pTimerNode) && (!ptiMyself->fExit))
    243244                    {
    244245                        PXTIMER pTimer = (PXTIMER)pTimerNode->pItemData;
     
    279280
    280281                    // destroy invalid timers, if any
    281                     if (fFoundInvalid)
     282                    if ((fFoundInvalid) && (!ptiMyself->fExit))
    282283                    {
    283284                        PLISTNODE pNodeNode = lstQueryFirstNode(&llInvalidTimers);
     
    302303        }
    303304
    304         DosExitMustComplete(&ulNesting);
     305        // DosExitMustComplete(&ulNesting);
    305306
    306307    } // end while (!ptiMyself->fExit)
Note: See TracChangeset for help on using the changeset viewer.