Ignore:
Timestamp:
Jul 5, 2002, 9:13:36 AM (23 years ago)
Author:
umoeller
Message:

Second round of fixes for 0.9.19.

File:
1 edited

Legend:

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

    r167 r184  
    735735        }
    736736
    737         hwndSplit = WinCreateWindow(psbcd->hwndParentAndOwner,  // parent
    738                                     WC_SPLITWINDOW,
    739                                     "",
    740                                     WS_VISIBLE,
    741                                     0, 0, 10, 10,
    742                                     psbcd->hwndParentAndOwner,  // owner
    743                                     HWND_TOP,
    744                                     psbcd->ulSplitWindowID,
    745                                     NULL,
    746                                     NULL);
    747         if (hwndSplit)
     737        if (    (hwndSplit = WinCreateWindow(psbcd->hwndParentAndOwner,  // parent
     738                                             WC_SPLITWINDOW,
     739                                             "",
     740                                             WS_VISIBLE,
     741                                             0, 0, 10, 10,
     742                                             psbcd->hwndParentAndOwner,  // owner
     743                                             HWND_TOP,
     744                                             psbcd->ulSplitWindowID,
     745                                             NULL,
     746                                             NULL))
     747             && (hwndBar = WinCreateWindow(psbcd->hwndParentAndOwner,  // parent
     748                                           WC_STATIC,
     749                                           "",
     750                                           WS_VISIBLE            // wnd style
     751                                             | SS_TEXT,
     752                                           0, 0, 10, 10,
     753                                           psbcd->hwndParentAndOwner,  // owner
     754                                           HWND_TOP,
     755                                           ID_SPLITBAR,          // win ID
     756                                           NULL,                 // cdata
     757                                           NULL))                // presparams
     758           )
    748759        {
    749             hwndBar    = WinCreateWindow(psbcd->hwndParentAndOwner,  // parent
    750                                          WC_STATIC,
    751                                          "",
    752                                          WS_VISIBLE            // wnd style
    753                                            | SS_TEXT,
    754                                          0, 0, 10, 10,
    755                                          psbcd->hwndParentAndOwner,  // owner
    756                                          HWND_TOP,
    757                                          ID_SPLITBAR,          // win ID
    758                                          NULL,                 // cdata
    759                                          NULL                  // presparams
    760                                      );
    761             if (hwndBar)
     760            // create SPLITBARDATA to store in split bar's QWL_USER
     761            PSPLITBARDATA pData;
     762            if (pData = (PSPLITBARDATA)malloc(sizeof(SPLITBARDATA)))
    762763            {
    763                 // create SPLITBARDATA to store in split bar's QWL_USER
    764                 PSPLITBARDATA pData = (PSPLITBARDATA)malloc(sizeof(SPLITBARDATA));
    765                 if (pData)
    766                 {
    767                     // set parent for split bar
    768                     WinSetParent(hwndBar, hwndSplit, FALSE);
    769 
    770                     memset(pData, 0, sizeof(SPLITBARDATA));
    771 
    772                     // copy control data
    773                     memcpy(&(pData->sbcd), psbcd, sizeof(SPLITBARCDATA));
    774                     // set other data
    775                     /* WinQueryWindowRect(hwndBar, &(pData->rclBar));
    776                     (pData->rclBar.xRight)--;
    777                     (pData->rclBar.yTop)--; */
    778                     // subclass static control to make it a split bar
    779                     pData->OldStaticProc = WinSubclassWindow(hwndBar, ctl_fnwpSplitBar);
    780                     pData->hptrOld = NULLHANDLE;
    781                     pData->hptrMove = WinQuerySysPointer(HWND_DESKTOP,
    782                                 (psbcd->ulCreateFlags & SBCF_HORIZONTAL)
    783                                     ? SPTR_SIZENS
    784                                     : SPTR_SIZEWE,
    785                                 FALSE);     // don't make copy
    786                     pData->fCaptured = FALSE;
    787                     pData->hwndLinked1 =
    788                     pData->hwndLinked2 = NULLHANDLE;
    789 
    790                     WinSetWindowULong(hwndBar, QWL_USER, (ULONG)pData);
    791                 }
     764                // set parent for split bar
     765                WinSetParent(hwndBar, hwndSplit, FALSE);
     766
     767                memset(pData, 0, sizeof(SPLITBARDATA));
     768
     769                // copy control data
     770                memcpy(&(pData->sbcd), psbcd, sizeof(SPLITBARCDATA));
     771                // set other data
     772                /* WinQueryWindowRect(hwndBar, &(pData->rclBar));
     773                (pData->rclBar.xRight)--;
     774                (pData->rclBar.yTop)--; */
     775                // subclass static control to make it a split bar
     776                pData->OldStaticProc = WinSubclassWindow(hwndBar, ctl_fnwpSplitBar);
     777                pData->hptrOld = NULLHANDLE;
     778                pData->hptrMove = WinQuerySysPointer(HWND_DESKTOP,
     779                            (psbcd->ulCreateFlags & SBCF_HORIZONTAL)
     780                                ? SPTR_SIZENS
     781                                : SPTR_SIZEWE,
     782                            FALSE);     // don't make copy
     783                pData->fCaptured = FALSE;
     784                pData->hwndLinked1 =
     785                pData->hwndLinked2 = NULLHANDLE;
     786
     787                WinSetWindowULong(hwndBar, QWL_USER, (ULONG)pData);
    792788            }
    793789        }
    794790    }
    795791
    796     return (hwndSplit);
     792    return hwndSplit;
    797793}
    798794
     
    999995LONG ctlQuerySplitPos(HWND hwndSplit)
    1000996{
    1001     ULONG lrc = 0;
    1002 
    1003997    // the split bar data is stored in QWL_USER of the
    1004998    // split bar (not the split window)
    1005     HWND    hwndSplitBar = WinWindowFromID(hwndSplit, ID_SPLITBAR);
    1006     if (hwndSplitBar)
    1007     {
    1008         PSPLITBARDATA psbd = (PSPLITBARDATA)WinQueryWindowULong(hwndSplitBar, QWL_USER);
    1009         if (psbd)
    1010             lrc = psbd->sbcd.lPos;
    1011     }
    1012 
    1013     return (lrc);
     999    HWND    hwndSplitBar;
     1000    PSPLITBARDATA psbd;
     1001    if (    (hwndSplitBar = WinWindowFromID(hwndSplit, ID_SPLITBAR))
     1002         && (psbd = (PSPLITBARDATA)WinQueryWindowULong(hwndSplitBar, QWL_USER))
     1003       )
     1004        return psbd->sbcd.lPos;
     1005
     1006    return 0;
    10141007}
    10151008
Note: See TracChangeset for help on using the changeset viewer.