Changeset 65


Ignore:
Timestamp:
Apr 29, 2001, 2:10:31 PM (24 years ago)
Author:
umoeller
Message:

Misc fixes.

Location:
trunk
Files:
6 edited

Legend:

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

    r52 r65  
    486486        HWND    hwndToolOwner;
    487487                    // in: handle to the window that contains the tool. If
    488                     // lpszText includes the PSZ_TEXTCALLBACK value, this
     488                    // pszText includes the PSZ_TEXTCALLBACK value, this
    489489                    // member identifies the window that receives TTN_NEEDTEXT
    490490                    // notification messages.
    491491        HWND    hwndTool;
    492492                    // in: window handle of the tool.
    493                     // ### simple rectangles of hwndToolOwner not yet supported
    494493        PSZ     pszText;
    495494                    // in: pointer to the buffer that contains the text for the
     
    501500    } TOOLINFO, *PTOOLINFO;
    502501
     502    /*
     503     *  tooltip messages
     504     *
     505     */
     506
    503507    #define TTM_FIRST                   (WM_USER + 1000)
    504508
     
    519523    #define TTDT_RESHOW                 4
    520524
    521     #define TTM_SETDELAYTIME            (TTM_FIRST + 6)
     525    #define TTM_GETDELAYTIME            (TTM_FIRST + 6)
     526                // added V0.9.12 (2001-04-28) [umoeller]
     527
     528    #define TTM_SETDELAYTIME            (TTM_FIRST + 7)
    522529
    523530    #define TTFMT_PSZ           0x01
     
    556563    } TOOLTIPTEXT, *PTOOLTIPTEXT;
    557564
    558     #define TTM_GETTEXT                 (TTM_FIRST + 7)
    559 
    560     #define TTM_UPDATETIPTEXT           (TTM_FIRST + 8)
     565    #define TTM_GETTEXT                 (TTM_FIRST + 8)
     566
     567    #define TTM_UPDATETIPTEXT           (TTM_FIRST + 9)
    561568
    562569    /*
     
    577584    } TTHITTESTINFO, *PHITTESTINFO;
    578585
    579     #define TTM_HITTEST                 (TTM_FIRST + 9)
    580 
    581     #define TTM_WINDOWFROMPOINT         (TTM_FIRST + 10)
    582 
    583     #define TTM_ENUMTOOLS               (TTM_FIRST + 11)
    584 
    585     #define TTM_GETCURRENTTOOL          (TTM_FIRST + 12)
    586 
    587     #define TTM_GETTOOLCOUNT            (TTM_FIRST + 13)
    588 
    589     #define TTM_GETTOOLINFO             (TTM_FIRST + 14)
    590 
    591     #define TTM_SETTOOLINFO             (TTM_FIRST + 15)
     586    #define TTM_HITTEST                 (TTM_FIRST + 10)
     587
     588    #define TTM_WINDOWFROMPOINT         (TTM_FIRST + 11)
     589
     590    #define TTM_ENUMTOOLS               (TTM_FIRST + 12)
     591
     592    #define TTM_GETCURRENTTOOL          (TTM_FIRST + 13)
     593
     594    #define TTM_GETTOOLCOUNT            (TTM_FIRST + 14)
     595
     596    #define TTM_GETTOOLINFO             (TTM_FIRST + 15)
     597
     598    #define TTM_SETTOOLINFO             (TTM_FIRST + 16)
    592599
    593600    // non-Win95 messages
    594601
    595     #define TTM_SHOWTOOLTIPNOW          (TTM_FIRST + 16)
     602    #define TTM_SHOWTOOLTIPNOW          (TTM_FIRST + 17)
     603
     604    /*
     605     *  tooltip notification codes (WM_CONTROL)
     606     *
     607     */
    596608
    597609    /*
  • trunk/src/helpers/cctl_tooltip.c

    r54 r65  
    9696// linked list of all tools which were subclassed for tooltip
    9797HMTX        G_hmtxSubclassedTools = NULLHANDLE;
    98 PLINKLIST   G_pllSubclassedTools = NULL;      // linked list of SUBCLASSEDTOOL items
     98LINKLIST    G_llSubclassedTools;        // linked list of SUBCLASSEDTOOL items
    9999
    100100/* ******************************************************************
     
    126126}
    127127
     128/* ******************************************************************
     129 *
     130 *   Subclassing
     131 *
     132 ********************************************************************/
     133
     134/*
     135 *@@ LockSubclassedTools:
     136 *      locks the global list of subclassed tools.
     137 *
     138 *@@added V0.9.12 (2001-04-28) [umoeller]
     139 */
     140
     141BOOL LockSubclassedTools(VOID)
     142{
     143    if (!G_hmtxSubclassedTools)
     144    {
     145        // first call:
     146
     147        // initialize the list
     148        lstInit(&G_llSubclassedTools,
     149                TRUE);      // auto-free
     150
     151        // create mutex and request it right away
     152        return (!DosCreateMutexSem(NULL,
     153                                   &G_hmtxSubclassedTools,
     154                                   0,
     155                                   TRUE));      // request!
     156    }
     157
     158    return (!WinRequestMutexSem(G_hmtxSubclassedTools, SEM_INDEFINITE_WAIT));
     159}
     160
     161/*
     162 *@@ UnlockSubclassedTools:
     163 *      unlocks the global list of subclassed tools.
     164 *
     165 *@@added V0.9.12 (2001-04-28) [umoeller]
     166 */
     167
     168VOID UnlockSubclassedTools(VOID)
     169{
     170}
     171
    128172/*
    129173 *@@ SUBCLASSEDTOOL:
     
    143187
    144188/*
    145  *@@ ctl_fnwpSubclassedTool:
    146  *      window procedure for tools which were subclassed
    147  *      to support tooltips.
    148  *
    149  *@@added V0.9.0 [umoeller]
     189 *@@ FindSubclassedTool:
     190 *      returns the SUBCLASSEDTOOL struct from the
     191 *      global list which matches hwndTool or NULL
     192 *      if not found.
     193 *
     194 *      Preconditions: Caller must hold the subclassed
     195 *      tools mutex.
     196 *
     197 *@@added V0.9.12 (2001-04-28) [umoeller]
    150198 */
    151199
    152 MRESULT EXPENTRY ctl_fnwpSubclassedTool(HWND hwndTool, ULONG msg, MPARAM mp1, MPARAM mp2)
     200PSUBCLASSEDTOOL FindSubclassedTool(HWND hwndTool)
    153201{
    154     MRESULT mrc = 0;
    155 
    156     PSUBCLASSEDTOOL pst = NULL;
    157 
    158     PLISTNODE pNode = lstQueryFirstNode(G_pllSubclassedTools);
     202    PLISTNODE pNode = lstQueryFirstNode(&G_llSubclassedTools);
    159203    while (pNode)
    160204    {
     
    162206        if (pstThis->hwndTool == hwndTool)
    163207        {
    164             pst = pstThis;
    165             break;
     208            return (pstThis);
    166209        }
    167210        pNode = pNode->pNext;
    168211    }
    169212
    170     switch (msg)
     213    return (NULL);
     214}
     215
     216/*
     217 *@@ ctl_fnwpSubclassedTool:
     218 *      window procedure for tools which were subclassed
     219 *      to support tooltips.
     220 *
     221 *@@added V0.9.0 [umoeller]
     222 *@@changed V0.9.12 (2001-04-28) [umoeller]: added mutex protection
     223 */
     224
     225MRESULT EXPENTRY ctl_fnwpSubclassedTool(HWND hwndTool, ULONG msg, MPARAM mp1, MPARAM mp2)
     226{
     227    MRESULT mrc = 0;
     228
     229    PFNWP           pfnwpOrig = NULL;
     230
     231    if (LockSubclassedTools())
    171232    {
    172         case WM_MOUSEMOVE:
    173         case WM_BUTTON1DOWN:
    174         case WM_BUTTON1UP:
    175         case WM_BUTTON2DOWN:
    176         case WM_BUTTON2UP:
    177         case WM_BUTTON3DOWN:
    178         case WM_BUTTON3UP:
     233        PSUBCLASSEDTOOL pst = FindSubclassedTool(hwndTool);
     234
     235        switch (msg)
    179236        {
    180             QMSG qmsg;
    181             qmsg.hwnd = hwndTool;
    182             qmsg.msg = msg;
    183             qmsg.mp1 = mp1;
    184             qmsg.mp2 = mp2;
    185             // _Pmpf((__FUNCTION__ ": sending TTM_RELAYEVENT"));
    186             WinSendMsg(pst->hwndTooltip,
    187                        TTM_RELAYEVENT,
    188                        (MPARAM)0,
    189                        (MPARAM)&qmsg);
    190             mrc = (pst->pfnwpOrig)(hwndTool, msg, mp1, mp2);
    191         break; }
    192 
    193         case WM_DESTROY:
    194             lstRemoveItem(G_pllSubclassedTools, pst);         // this frees the item
    195             if (lstCountItems(G_pllSubclassedTools) == 0)
     237            case WM_MOUSEMOVE:
     238            case WM_BUTTON1DOWN:
     239            case WM_BUTTON1UP:
     240            case WM_BUTTON2DOWN:
     241            case WM_BUTTON2UP:
     242            case WM_BUTTON3DOWN:
     243            case WM_BUTTON3UP:
    196244            {
    197                 // last item: destroy list
    198                 lstFree(G_pllSubclassedTools);
    199                 G_pllSubclassedTools = NULL;
    200                 // _Pmpf((__FUNCTION__ ": removed hwnd 0x%lX", hwndTool));
    201             }
    202             mrc = (pst->pfnwpOrig)(hwndTool, msg, mp1, mp2);
    203         break;
    204 
    205         default:
    206             mrc = (pst->pfnwpOrig)(hwndTool, msg, mp1, mp2);
     245                QMSG qmsg;
     246                qmsg.hwnd = hwndTool;
     247                qmsg.msg = msg;
     248                qmsg.mp1 = mp1;
     249                qmsg.mp2 = mp2;
     250                // _Pmpf((__FUNCTION__ ": sending TTM_RELAYEVENT"));
     251                WinSendMsg(pst->hwndTooltip,
     252                           TTM_RELAYEVENT,
     253                           (MPARAM)0,
     254                           (MPARAM)&qmsg);
     255                pfnwpOrig = pst->pfnwpOrig;     // call default
     256            break; }
     257
     258            case WM_DESTROY:
     259                lstRemoveItem(&G_llSubclassedTools, pst);         // this frees the item
     260                pfnwpOrig = pst->pfnwpOrig;     // call default
     261            break;
     262
     263            default:
     264                pfnwpOrig = pst->pfnwpOrig;     // call default
     265        }
     266
     267        UnlockSubclassedTools();
    207268    }
     269
     270    if (pfnwpOrig)
     271        mrc = (pfnwpOrig)(hwndTool, msg, mp1, mp2);
    208272
    209273    return (mrc);
     
    211275
    212276/*
    213  *@@ SubclassToolForToolinfo:
     277 *@@ SubclassTool:
    214278 *      this gets called from ctl_fnwpTooltip if a control
    215279 *      is to be subclassed to support mouse messaging
    216280 *      (TTF_SUBCLASS flag).
    217281 *
     282 *      Preconditions: Caller must hold the subclassed
     283 *      tools mutex.
     284 *
    218285 *@@added V0.9.0 [umoeller]
     286 *@@changed V0.9.12 (2001-04-28) [umoeller]: renamed from SubclassToolForToolInfo
    219287 */
    220288
    221 BOOL SubclassToolForToolinfo(HWND hwndTooltip,
    222                              HWND hwndTool)
     289BOOL SubclassTool(HWND hwndTooltip,
     290                  HWND hwndTool)
    223291{
    224292    BOOL    brc = FALSE;
    225     PFNWP   pfnwpOrig = WinSubclassWindow(hwndTool,
    226                                           ctl_fnwpSubclassedTool);
    227     if (pfnwpOrig)
     293
     294    // make sure the tool is not on the list yet
     295    // V0.9.12 (2001-04-28) [umoeller]
     296    if (!FindSubclassedTool(hwndTool))
    228297    {
    229         PSUBCLASSEDTOOL pst = (PSUBCLASSEDTOOL)malloc(sizeof(SUBCLASSEDTOOL));
    230         if (pst)
     298        PFNWP   pfnwpOrig = WinSubclassWindow(hwndTool,
     299                                              ctl_fnwpSubclassedTool);
     300        if (pfnwpOrig)
    231301        {
    232             pst->pfnwpOrig = pfnwpOrig;
    233             pst->hwndTooltip = hwndTooltip;
    234             pst->hwndTool = hwndTool;
    235             pst->hab = WinQueryAnchorBlock(hwndTool);
    236 
    237             if (G_pllSubclassedTools == NULL)
    238                 G_pllSubclassedTools = lstCreate(TRUE);   // auto-free items
    239 
    240             lstAppendItem(G_pllSubclassedTools, pst);
    241             // _Pmpf((__FUNCTION__ ": subclassed hwnd 0x%lX", hwndTool));
     302            PSUBCLASSEDTOOL pst = (PSUBCLASSEDTOOL)malloc(sizeof(SUBCLASSEDTOOL));
     303            if (pst)
     304            {
     305                pst->pfnwpOrig = pfnwpOrig;
     306                pst->hwndTooltip = hwndTooltip;
     307                pst->hwndTool = hwndTool;
     308                pst->hab = WinQueryAnchorBlock(hwndTool);
     309
     310                brc = !!lstAppendItem(&G_llSubclassedTools, pst);
     311            }
    242312        }
    243313    }
     314
    244315    return (brc);
    245316}
     317
     318/*
     319 *@@ UnSubclassTool:
     320 *      un-subclasses a tool previously subclassed by
     321 *      SubclassToolForToolinfo.
     322 *
     323 *      Preconditions: Caller must hold the subclassed
     324 *      tools mutex.
     325 *
     326 *@@added V0.9.12 (2001-04-28) [umoeller]
     327 */
     328
     329BOOL UnSubclassTool(HWND hwndTool)
     330{
     331    PSUBCLASSEDTOOL pst = FindSubclassedTool(hwndTool);
     332    if (pst)
     333    {
     334        WinSubclassWindow(hwndTool,
     335                          pst->pfnwpOrig);
     336                            // orig winproc == un-subclass
     337        return (lstRemoveItem(&G_llSubclassedTools, pst));
     338                    // this frees the item
     339    }
     340
     341    return (FALSE);
     342}
     343
     344/* ******************************************************************
     345 *
     346 *   Implementation
     347 *
     348 ********************************************************************/
    246349
    247350/*
     
    654757 *
    655758 *      To clarify: There is usually one tooltip control, which is hidden
    656  *      most of the time, for many tools (parts of a visible window).
     759 *      most of the time, for many "tools" (parts of a visible window).
    657760 *      When the user puts the cursor on a tool and leaves it there for
    658761 *      approximately one-half second, the tooltip control is set up for
     
    728831 *
    729832 *@@added V0.9.0 [umoeller]
     833 *@@changed V0.9.12 (2001-04-28) [umoeller]: various fixes WRT subclassing
    730834 */
    731835
     
    826930                if (pttd->pszPaintText)
    827931                    free(pttd->pszPaintText);
     932
     933                // un-subclass all tools that we subclassed
     934                // V0.9.12 (2001-04-28) [umoeller]
     935                if (LockSubclassedTools())
     936                {
     937                    PLISTNODE pNode;
     938                    PSUBCLASSEDTOOL pst;
     939                    for (pNode = lstQueryFirstNode(&pttd->llTools);
     940                         pNode;
     941                         pNode = pNode->pNext)
     942                    {
     943                        PTOOLINFO pti = (PTOOLINFO)pNode->pItemData;
     944                        if (pst = FindSubclassedTool(pti->hwndTool))
     945                            UnSubclassTool(pti->hwndTool);
     946                    }
     947
     948                    UnlockSubclassedTools();
     949                }
     950                // end V0.9.12 (2001-04-28) [umoeller]
     951
    828952                lstClear(&pttd->llTools);
     953
    829954                free(pttd);
    830955
     
    9631088             *      rectangular areas within a window's client area.
    9641089             *
    965              *      --  When you add a tool implemented as a rectangular area, the
    966              *          "hwndToolOwner" member of TOOLINFO must specify the handle
    967              *          of the window that contains the area, and the "rect" member must
    968              *          specify the client coordinates of the area's bounding
    969              *          rectangle.
    970              *
    971              *      --  When you add a tool implemented as a window, the "hwndTool"
    972              *          member of TOOLINFO must contain the window handle of the
    973              *          tool. hwndToolOwner should be the owner of the tool.
     1090             *      --  When you add a tool implemented as a rectangular
     1091             *          area, the "hwndToolOwner" member of TOOLINFO must
     1092             *          specify the handle of the window that contains the
     1093             *          area, and the "rect" member must specify the client
     1094             *          coordinates of the area's bounding rectangle.
     1095             *
     1096             *      --  When you add a tool implemented as a window, the
     1097             *          "hwndTool" member of TOOLINFO must contain the
     1098             *          window handle of the tool. hwndToolOwner should be
     1099             *          the owner of the tool.
    9741100             *
    9751101             *      When you add a tool to a tooltip control, the "pszText"
     
    10041130                                      ptiNew);
    10051131
    1006                         if (ptiPassed->ulFlags & TTF_SUBCLASS)
    1007                             SubclassToolForToolinfo(hwndTooltip,
    1008                                                     ptiPassed->hwndTool);
     1132                        if (    (ptiPassed->ulFlags & TTF_SUBCLASS)
     1133                             && (LockSubclassedTools()) // V0.9.12 (2001-04-28) [umoeller]
     1134                           )
     1135                        {
     1136                            // caller wants this tool to be subclassed:
     1137                            // well, do it then
     1138                            SubclassTool(hwndTooltip,
     1139                                         ptiPassed->hwndTool);
     1140
     1141                            UnlockSubclassedTools();
     1142                        }
    10091143
    10101144                        mrc = (MPARAM)TRUE;
     
    10401174                        {
    10411175                            // found:
     1176
     1177                            // V0.9.12 (2001-04-28) [umoeller]
     1178                            // unsubclass if this was subclassed
     1179                            if (ptiThis->ulFlags & TTF_SUBCLASS)
     1180                            {
     1181                                if (LockSubclassedTools())
     1182                                {
     1183                                    UnSubclassTool(ptiSearch->hwndTool);
     1184                                }
     1185                            }
     1186
     1187                            // remove the tool from the list
    10421188                            lstRemoveNode(&pttd->llTools, pToolNode);
     1189
    10431190                            break;
    10441191                        }
     
    10721219
    10731220            case TTM_NEWTOOLRECT:
     1221
    10741222            break;
    10751223
     
    12091357
    12101358            /*
     1359             *@@ TTM_GETDELAYTIME:
     1360             *      returns the current value of the specified
     1361             *      timeout value. See TTM_SETDELAYTIME.
     1362             *
     1363             *      Parameters:
     1364             *
     1365             *      -- USHORT mp1: timer value to query. One of:
     1366             *              -- TTDT_AUTOPOP
     1367             *              -- TTDT_INITIAL
     1368             *              -- TTDT_RESHOW
     1369             *
     1370             *      Returns: ULONG timeout value.
     1371             *
     1372             *@@added V0.9.12 (2001-04-28) [umoeller]
     1373             */
     1374
     1375            case TTM_GETDELAYTIME:
     1376                switch ((USHORT)mp1)
     1377                {
     1378                    case TTDT_AUTOPOP:
     1379                        mrc = (MRESULT)pttd->ulTimeoutAutopop;
     1380                    break;
     1381
     1382                    case TTDT_INITIAL:
     1383                        mrc = (MRESULT)pttd->ulTimeoutInitial;
     1384                    break;
     1385
     1386                    case TTDT_RESHOW:
     1387                        mrc = (MRESULT)pttd->ulTimeoutReshow;
     1388                    break;
     1389                }
     1390            break;
     1391
     1392            /*
    12111393             *@@ TTM_SETDELAYTIME:
    12121394             *      overrides a few default timeout values for the
     
    12321414             *      -- USHORT mp1: parameter selection. One of the following:
    12331415             *              -- TTDT_AUTOMATIC: automatically calculates the initial,
    1234              *                 reshow, and autopopup durations based on the value of iDelay.
     1416             *                 reshow, and autopopup durations based on the value of mp2.
    12351417             *              -- TTDT_AUTOPOP: sets the length of time before the tooltip
    12361418             *                  window is hidden if the cursor remains stationary
     
    12791461             *      Parameters:
    12801462             *      -- mp1: always 0
    1281              *      -- PTOOLINFO mp2: pointer to a TOOLINFO structure. When sending the
    1282              *          message, the hwnd and uId members identify a tool. If the tooltip
    1283              *          control includes the tool, the lpszText member receives the pointer
    1284              *          to the string.
     1463             *      -- PTOOLINFO mp2: pointer to a TOOLINFO structure.
     1464             *         When sending the message, the hwnd and uId members
     1465             *         identify a tool. If the tooltip control includes
     1466             *         the tool, the lpszText member receives the pointer
     1467             *         to the string.
    12851468             *
    12861469             *      Return value: 0 always.
     
    12891472             *      this sends the TTN_NEEDTEXT notification to TOOLINFO.hwnd.
    12901473             *
    1291              *@@todo add TTFMT_STRINGRES
    12921474             */
    12931475
     
    13221504
    13231505                        case TTFMT_STRINGRES:
    1324 
     1506                                // @@todo
    13251507                        break;
    13261508                    }
     
    13341516             *      Parameters:
    13351517             *      -- mp1: always 0.
    1336              *      -- PTOOLINFO mp2: pointer to a TOOLINFO structure. The "hinst"
    1337              *          and "lpszText" members must specify the instance handle and
    1338              *          the pointer to the text.
    1339              *          The "hwnd" and "uId" members identify the tool to update.
     1518             *      -- PTOOLINFO mp2: pointer to a TOOLINFO structure.
     1519             *         The "hinst" and "lpszText" members must specify
     1520             *         the instance handle and the pointer to the text.
     1521             *         The "hwnd" and "uId" members identify the tool
     1522             *         to update.
    13401523             */
    13411524
  • trunk/src/helpers/dialog.c

    r61 r65  
    400400
    401401VOID ProcessColumn(PCOLUMNDEF pColumnDef,
    402                    PROWDEF pOwningRow,
    403                    PROCESSMODE ProcessMode,
     402                   PROWDEF pOwningRow,          // in: current row from ProcessRow
     403                   PROCESSMODE ProcessMode,     // in: processing mode (see ProcessAll)
    404404                   PLONG plX,                   // in/out: PROCESS_CALC_POSITIONS only
    405405                   PDLGPRIVATE pDlgData)
     
    673673/*
    674674 *@@ ProcessRow:
    675  *
     675 *      level-3 procedure (called from ProcessTable),
     676 *      which in turn calls ProcessColumn for each column
     677 *      in the row.
     678 *
     679 *      See ProcessAll for the meaning of ProcessMode.
    676680 */
    677681
    678682VOID ProcessRow(PROWDEF pRowDef,
    679                 PTABLEDEF pOwningTable,
    680                 PROCESSMODE ProcessMode,
    681                 PLONG plY,
     683                PTABLEDEF pOwningTable,     // in: current table from ProcessTable
     684                PROCESSMODE ProcessMode,    // in: processing mode (see ProcessAll)
     685                PLONG plY,                  // in/out: current y position (decremented)
    682686                PDLGPRIVATE pDlgData)
    683687{
     
    727731/*
    728732 *@@ ProcessTable:
    729  *
    730  *      This routine is a bit sick because it can be
    731  *      called recursively if a nested table is found
    732  *      in a COLUMNDEF.
     733 *      level-2 procedure (called from ProcessAll),
     734 *      which in turn calls ProcessRow for each row
     735 *      in the table (which in turn calls ProcessColumn
     736 *      for each column in the row).
     737 *
     738 *      See ProcessAll for the meaning of ProcessMode.
     739 *
     740 *      This routine is a bit sick because it can even be
     741 *      called recursively from ProcessColumn (!) if a
     742 *      nested table is found in a COLUMNDEF.
    733743 *
    734744 *      With PROCESS_CALC_POSITIONS, pptl must specify
     
    742752VOID ProcessTable(PTABLEDEF pTableDef,
    743753                  const CONTROLPOS *pcpTable,       // in: table position with PROCESS_CALC_POSITIONS
    744                   PROCESSMODE ProcessMode,
     754                  PROCESSMODE ProcessMode,          // in: processing mode (see ProcessAll)
    745755                  PDLGPRIVATE pDlgData)
    746756{
     
    783793/*
    784794 *@@ ProcessAll:
     795 *      level-1 procedure, which in turn calls ProcessTable
     796 *      for each root-level table found (which in turn
     797 *      calls ProcessRow for each row in the table, which
     798 *      in turn calls ProcessColumn for each column in
     799 *      the row).
     800 *
     801 *      The first trick to formatting is that ProcessAll will
     802 *      get three times, thus going down the entire tree three
     803 *      times, with ProcessMode being set to one of the
     804 *      following for each call (in this order):
    785805 *
    786806 *      -- PROCESS_CALC_SIZES: calculates the sizes
    787807 *         of all tables, rows, columns, and controls.
    788808 *
     809 *         After this first call, we know all the sizes
     810 *         only and then then calculate the positions.
     811 *
    789812 *      -- PROCESS_CALC_POSITIONS: calculates the positions
    790813 *         based on the sizes calculated before.
     
    793816 *         positions and sizes calculated before.
    794817 *
     818 *      The second trick is the precondition that tables may
     819 *      nest by allowing a table definition instead of a
     820 *      control definition in a column. This way we can
     821 *      recurse from columns back into tables and thus
     822 *      know the size and position of a nested table column
     823 *      just as if it were a regular control.
    795824 */
    796825
  • trunk/src/helpers/xml.c

    r63 r65  
    88 *
    99 *      --  The bottom layer is implemented by @expat, which I have
    10  *          ported and hacked to the xwphelpers. See xmlparse.c for
    11  *          an introduction.
     10 *          ported and hacked to the xwphelpers.
     11 *
     12 *          See xmlparse.c for an introduction.
    1213 *
    1314 *      --  Because expat requires so many callbacks and is non-validating,
  • trunk/src/helpers/xprf.c

    r21 r65  
    3939 *         If you open the profile on one thread and write and read
    4040 *         concurrently on two threads, there's no protection, and everything
    41  *         will blow up. The functions are reeantrant though, so for different
     41 *         will blow up. The functions are reentrant though, so for different
    4242 *         profiles there will be no problems.
    4343 *
  • trunk/src/helpers/xstring.c

    r63 r65  
    523523 *      If pxstr is empty, this behaves just like xstrcpy.
    524524 *
    525  *      With ulSourceLength, specify the length of pcszSource.
    526  *      If you specify 0, this function will run strlen(pcszSource)
    527  *      itself.
    528  *
    529  *      If you already know the length of pcszSource, you can
    530  *      speed this function up a bit this way.
    531  *
    532  *      You are required to specify ulSourceLength if you only want
    533  *      to copy a substring, or pcszSource is not zero-terminated.
     525 *      With ulSourceLength, specify the length of pcszSource
     526 *      or 0 (see xstrcpy for details).
    534527 *
    535528 *      Returns the length of the new string (excluding the null
     
    590583                memcpy(pxstr->psz + pxstr->ulLength,
    591584                       pcszSource,
    592                        ulSourceLength);     // null terminator
     585                       ulSourceLength);
    593586
    594587                *(pxstr->psz + pxstr->ulLength + ulSourceLength) = '\0';
     
    629622 +          XSTRING str;
    630623 +          xstrInit(&str, 0);
    631  +          xstrcpy(&str, "blu");
     624 +          xstrcpy(&str, "blu", 0);
    632625 +          xstrcatc(&str, 'p');
    633626 *
Note: See TracChangeset for help on using the changeset viewer.