Changeset 159 for trunk/src/helpers/winh.c
- Timestamp:
- Apr 25, 2002, 7:25:16 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/helpers/winh.c
r158 r159 4031 4031 * controls which should be moved such an ID. 4032 4032 * 4033 * You can also specify how many dialog units4034 * all the other controls will be moved downward in4035 * ulDownUnits; this is useful to fill up the space4036 * which was used by the buttons before moving them.4037 * Returns TRUE if anything was changed.4033 * Note that this function will now automatically 4034 * find out the lowest y coordinate that was used 4035 * for a non-notebook button and move all controls 4036 * down accordingly. As a result, ulDownUnit must 4037 * no longer be specified (V0.9.19). 4038 4038 * 4039 4039 * This function is useful if you wish to create … … 4044 4044 * 4045 4045 *@@changed V0.9.16 (2002-02-02) [umoeller]: fixed entry fields 4046 *@@changed V0.9.19 (2002-04-24) [umoeller]: removed ulDownUnits 4046 4047 */ 4047 4048 4048 4049 BOOL winhAssertWarp4Notebook(HWND hwndDlg, 4049 USHORT usIdThreshold, // in: ID threshold 4050 ULONG ulDownUnits) // in: dialog units or 0 4050 USHORT usIdThreshold) // in: ID threshold 4051 4051 { 4052 4052 BOOL brc = FALSE; … … 4054 4054 if (doshIsWarp4()) 4055 4055 { 4056 POINTL ptl; 4057 HWND hwndItem; 4058 HENUM henum = 0; 4059 4060 BOOL fIsVisible = WinIsWindowVisible(hwndDlg); 4061 if (ulDownUnits) 4056 LONG yLowest = 10000; 4057 HWND hwndItem; 4058 HENUM henum = 0; 4059 PSWP paswp, 4060 pswpThis; 4061 ULONG cWindows = 0, 4062 ul; 4063 4064 BOOL fIsVisible; 4065 4066 if (fIsVisible = WinIsWindowVisible(hwndDlg)) 4067 // avoid flicker 4068 WinEnableWindowUpdate(hwndDlg, FALSE); 4069 4070 if (paswp = (PSWP)malloc(sizeof(SWP) * 100)) 4062 4071 { 4063 ptl.x = 0; 4064 ptl.y = ulDownUnits; 4065 WinMapDlgPoints(hwndDlg, &ptl, 1, TRUE); 4066 } 4067 4068 if (fIsVisible) 4069 WinEnableWindowUpdate(hwndDlg, FALSE); 4070 4071 henum = WinBeginEnumWindows(hwndDlg); 4072 while ((hwndItem = WinGetNextWindow(henum))) 4073 { 4074 USHORT usId = WinQueryWindowUShort(hwndItem, QWS_ID); 4075 // _Pmpf(("hwndItem: 0x%lX, ID: 0x%lX", hwndItem, usId)); 4076 if (usId <= usIdThreshold) 4072 pswpThis = paswp; 4073 4074 // loop 1: set notebook buttons, find lowest y used 4075 henum = WinBeginEnumWindows(hwndDlg); 4076 while ((hwndItem = WinGetNextWindow(henum))) 4077 4077 { 4078 // pushbutton to change: 4079 // _Pmpf((" Setting bit")); 4080 WinSetWindowBits(hwndItem, 4081 QWL_STYLE, 4082 BS_NOTEBOOKBUTTON, BS_NOTEBOOKBUTTON); 4083 brc = TRUE; 4084 } 4085 else 4086 // no pushbutton to change: move downwards 4087 // if desired 4088 if (ulDownUnits) 4078 USHORT usId = WinQueryWindowUShort(hwndItem, QWS_ID); 4079 // _Pmpf(("hwndItem: 0x%lX, ID: 0x%lX", hwndItem, usId)); 4080 if (usId <= usIdThreshold) 4089 4081 { 4082 // pushbutton to change: 4083 WinSetWindowBits(hwndItem, 4084 QWL_STYLE, 4085 BS_NOTEBOOKBUTTON, BS_NOTEBOOKBUTTON); 4086 brc = TRUE; 4087 } 4088 else 4089 { 4090 // no pushbutton to change: 4090 4091 CHAR szClass[10]; 4091 SWP swp; 4092 LONG lDeltaX = 0, 4093 lDeltaY = 0; 4092 4093 // check lowest y 4094 WinQueryWindowPos(hwndItem, pswpThis); 4095 if (pswpThis->y < yLowest) 4096 yLowest = pswpThis->y ; 4097 4094 4098 // special handling for entry fields 4095 4099 // V0.9.16 (2002-02-02) [umoeller] … … 4097 4101 if (!strcmp(szClass, "#6")) 4098 4102 { 4099 lDeltaX= 3 * WinQuerySysValue(HWND_DESKTOP, SV_CXBORDER);4100 lDeltaY= 3 * WinQuerySysValue(HWND_DESKTOP, SV_CYBORDER);4103 pswpThis->x += 3 * WinQuerySysValue(HWND_DESKTOP, SV_CXBORDER); 4104 pswpThis->y += 3 * WinQuerySysValue(HWND_DESKTOP, SV_CYBORDER); 4101 4105 } 4102 4106 4103 WinQueryWindowPos(hwndItem, &swp); 4104 WinSetWindowPos(hwndItem, 0, 4105 swp.x + lDeltaX, 4106 swp.y - ptl.y + lDeltaY, 4107 0, 0, 4108 SWP_MOVE); 4107 ++pswpThis; 4108 if (++cWindows == 100) 4109 break; 4109 4110 } 4111 } // end while ((hwndItem = WinGetNextWindow(henum))) 4112 WinEndEnumWindows(henum); 4113 4114 // now adjust window positions 4115 pswpThis = paswp; 4116 for (ul = 0; 4117 ul < cWindows; 4118 ++ul, ++pswpThis) 4119 { 4120 pswpThis->y -= (yLowest - 8); 4121 // 8 is magic to match the lower border of the 4122 // standard WPS notebook pages V0.9.19 (2002-04-24) [umoeller] 4123 pswpThis->fl = SWP_MOVE; 4124 } 4125 4126 WinSetMultWindowPos(WinQueryAnchorBlock(hwndDlg), 4127 paswp, 4128 cWindows); 4129 4130 free(paswp); 4110 4131 } 4111 WinEndEnumWindows(henum);4112 4132 4113 4133 if (fIsVisible)
Note:
See TracChangeset
for help on using the changeset viewer.