Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv417/port/src/cbits/Win32 Modified Files: Button.c CheckBox.c EditBox.c Internals.h Label.c ListBox.c PopUp.c RadioBox.c Util.c Window.c Log Message: FIX: When some control changes its required size the usually it sends WindowReLayout event to parent. In this commit if the parent is Notebook or NotebookPage then the event is redirected to parent of the Notebook. This allows to resize Notebook when the required size of pages is changed Index: Button.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Button.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Button.c 26 Mar 2003 22:09:58 -0000 1.4 --- Button.c 24 Aug 2003 20:42:54 -0000 1.5 *************** *** 51,55 **** { SetWindowText(button, txt); ! handleWindowReLayout(GetParent(button)); }; --- 51,55 ---- { SetWindowText(button, txt); ! osForceWindowReLayout(button); }; *************** *** 57,60 **** { SendMessage(button, WM_SETFONT, (WPARAM) font, MAKELPARAM (TRUE,0)); ! handleWindowReLayout(GetParent(button)); }; --- 57,60 ---- { SendMessage(button, WM_SETFONT, (WPARAM) font, MAKELPARAM (TRUE,0)); ! osForceWindowReLayout(button); }; Index: CheckBox.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/CheckBox.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CheckBox.c 24 Aug 2003 10:50:18 -0000 1.5 --- CheckBox.c 24 Aug 2003 20:42:54 -0000 1.6 *************** *** 55,59 **** { SetWindowText(checkbox, txt); ! handleWindowReLayout(GetParent(checkbox)); }; --- 55,59 ---- { SetWindowText(checkbox, txt); ! osForceWindowReLayout(checkbox); }; Index: EditBox.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/EditBox.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** EditBox.c 23 Jul 2003 16:25:21 -0000 1.7 --- EditBox.c 24 Aug 2003 20:42:54 -0000 1.8 *************** *** 89,92 **** { SendMessage(editbox, WM_SETFONT, (WPARAM) font, MAKELPARAM (TRUE,0)); ! handleWindowReLayout(GetParent(editbox)); }; --- 89,92 ---- { SendMessage(editbox, WM_SETFONT, (WPARAM) font, MAKELPARAM (TRUE,0)); ! osForceWindowReLayout(editbox); }; Index: Internals.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Internals.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Internals.h 24 Aug 2003 14:39:00 -0000 1.7 --- Internals.h 24 Aug 2003 20:42:54 -0000 1.8 *************** *** 75,77 **** --- 75,79 ---- extern void *rmalloc(unsigned long bytes); + void osForceWindowReLayout(HWND hCtrl); + #endif Index: Label.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Label.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Label.c 23 Jul 2003 16:25:21 -0000 1.5 --- Label.c 24 Aug 2003 20:42:54 -0000 1.6 *************** *** 52,55 **** --- 52,57 ---- SetWindowText(label, txt); handleWindowReLayout(GetParent(label)); + osForceWindowReLayout(label); + }; *************** *** 57,60 **** { SendMessage(label, WM_SETFONT, (WPARAM) font, MAKELPARAM (TRUE,0)); ! handleWindowReLayout(GetParent(label)); }; --- 59,62 ---- { SendMessage(label, WM_SETFONT, (WPARAM) font, MAKELPARAM (TRUE,0)); ! osForceWindowReLayout(label); }; Index: ListBox.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/ListBox.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ListBox.c 10 Jul 2003 20:14:25 -0000 1.4 --- ListBox.c 24 Aug 2003 20:42:54 -0000 1.5 *************** *** 24,28 **** { SendMessage(listbox, LB_ADDSTRING, 0, (LPARAM) title); ! handleWindowReLayout(GetParent(listbox)); }; --- 24,28 ---- { SendMessage(listbox, LB_ADDSTRING, 0, (LPARAM) title); ! osForceWindowReLayout(listbox); }; *************** *** 30,34 **** { SendMessage(listbox, LB_INSERTSTRING, index, (LPARAM) title); ! handleWindowReLayout(GetParent(listbox)); }; --- 30,34 ---- { SendMessage(listbox, LB_INSERTSTRING, index, (LPARAM) title); ! osForceWindowReLayout(listbox); }; *************** *** 36,40 **** { SendMessage(listbox, LB_DELETESTRING, index, 0); ! handleWindowReLayout(GetParent(listbox)); }; --- 36,40 ---- { SendMessage(listbox, LB_DELETESTRING, index, 0); ! osForceWindowReLayout(listbox); }; *************** *** 42,46 **** { SendMessage(listbox, LB_RESETCONTENT,0,0); ! handleWindowReLayout(GetParent(listbox)); }; --- 42,46 ---- { SendMessage(listbox, LB_RESETCONTENT,0,0); ! osForceWindowReLayout(listbox); }; Index: PopUp.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/PopUp.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PopUp.c 10 Feb 2003 22:42:10 -0000 1.3 --- PopUp.c 24 Aug 2003 20:42:54 -0000 1.4 *************** *** 23,27 **** { SendMessage(popup, CB_ADDSTRING, 0, (LPARAM) title); ! handleWindowReLayout(GetParent(popup)); }; --- 23,27 ---- { SendMessage(popup, CB_ADDSTRING, 0, (LPARAM) title); ! osForceWindowReLayout(popup); }; *************** *** 29,33 **** { SendMessage(popup, CB_INSERTSTRING, index, (LPARAM) title); ! handleWindowReLayout(GetParent(popup)); }; --- 29,33 ---- { SendMessage(popup, CB_INSERTSTRING, index, (LPARAM) title); ! osForceWindowReLayout(popup); }; *************** *** 35,39 **** { SendMessage(popup, CB_DELETESTRING, index, 0); ! handleWindowReLayout(GetParent(popup)); }; --- 35,39 ---- { SendMessage(popup, CB_DELETESTRING, index, 0); ! osForceWindowReLayout(popup); }; *************** *** 41,45 **** { SendMessage(popup, CB_RESETCONTENT,0,0); ! handleWindowReLayout(GetParent(popup)); }; --- 41,45 ---- { SendMessage(popup, CB_RESETCONTENT,0,0); ! osForceWindowReLayout(popup); }; Index: RadioBox.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/RadioBox.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** RadioBox.c 24 Aug 2003 19:28:57 -0000 1.6 --- RadioBox.c 24 Aug 2003 20:42:54 -0000 1.7 *************** *** 56,60 **** { SetWindowText(radiobox, txt); ! handleWindowReLayout(GetParent(radiobox)); }; --- 56,60 ---- { SetWindowText(radiobox, txt); ! osForceWindowReLayout(radiobox); }; Index: Util.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Util.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Util.c 24 Aug 2003 14:39:00 -0000 1.20 --- Util.c 24 Aug 2003 20:42:54 -0000 1.21 *************** *** 218,221 **** --- 218,222 ---- { HWND hParent; + FrameData *pFrameData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); if (!hWnd) Index: Window.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Window.c,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** Window.c 24 Aug 2003 13:57:34 -0000 1.42 --- Window.c 24 Aug 2003 20:42:54 -0000 1.43 *************** *** 11,15 **** SIZE LineSize, PageSize; BOOL bInDragMode; - int nWindowKind; COLORREF foreColor; --- 11,14 ---- *************** *** 123,128 **** case WM_CREATE: { - LPCREATESTRUCT lpcs = (LPCREATESTRUCT) lParam; - pData = (WindowData *) rmalloc(sizeof(WindowData)); pData->Origin.x = 0; --- 122,125 ---- *************** *** 140,144 **** pData->patBmp = NULL; pData->hBackBrush = CreateSolidBrush (pData->backColor); - pData->nWindowKind = ((int) lpcs->lpCreateParams); pData->enabled = TRUE; pData->disabledCtrlsCount = 0; --- 137,140 ---- *************** *** 1337,1338 **** --- 1333,1352 ---- } } + + void osForceWindowReLayout(HWND hCtrl) + { + char buffer[20]; + HWND hWnd = hCtrl; + while (hWnd) + { + hWnd = GetParent(hWnd); + GetClassName(hWnd,buffer,sizeof(buffer)); + + if (_stricmp(buffer, "HNOTEBOOK") != 0 && + _stricmp(buffer, "HNOTEBOOKPAGE") != 0) + { + handleWindowReLayout(hWnd); + break; + } + } + } \ No newline at end of file |