From: <kr_...@us...> - 2003-11-14 22:35:23
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv32717/src/cbits/Win32 Modified Files: DockBar.c Frame.c Internals.h Menu.c Window.c Added Files: StatusBar.c Log Message: Basic support for statusbar --- NEW FILE: StatusBar.c --- #include "StatusBar.h" #include "DockBar.h" #include "Internals.h" void osSetStatusBarVisible(BOOL visible) { FrameData *pData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); ShowWindow(pData->hStatusBar, visible ? SW_SHOWNORMAL : SW_HIDE); RelayoutFrameBars(); } BOOL osGetStatusBarVisible() { FrameData *pData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); return (GetWindowLong(pData->hStatusBar, GWL_STYLE) & WS_VISIBLE) != 0; } Index: DockBar.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/DockBar.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** DockBar.c 4 Oct 2003 09:24:22 -0000 1.7 --- DockBar.c 14 Nov 2003 22:35:20 -0000 1.8 *************** *** 91,110 **** RECT rect; FrameData *pData; ! int nWidth, nHeight, nLeft, nTop, nRight, nBottom; if (!ghWndFrame) ! return NULL; pData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); GetClientRect(ghWndFrame, &rect); nWidth = rect.right-rect.left; ! nHeight = rect.bottom-rect.top; nLeft = GetDockBarSize(pData->hLeftBar); nTop = GetDockBarSize(pData->hTopBar); nRight = GetDockBarSize(pData->hRightBar); nBottom = GetDockBarSize(pData->hBottomBar); ! SetWindowPos(pData->hLeftBar, NULL,0,nTop,nLeft,nHeight-(nBottom+nTop),SWP_NOZORDER); SetWindowPos(pData->hTopBar, NULL,0,0,nWidth,nTop,SWP_NOZORDER); --- 91,117 ---- RECT rect; FrameData *pData; ! int nWidth, nHeight; ! int nLeft, nTop, nRight, nBottom; ! int nStatusHeight; if (!ghWndFrame) ! return; pData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); + if (GetWindowLong(pData->hStatusBar, GWL_STYLE) & WS_VISIBLE) + nStatusHeight = 20; + else + nStatusHeight = 0; + GetClientRect(ghWndFrame, &rect); nWidth = rect.right-rect.left; ! nHeight = rect.bottom-rect.top-nStatusHeight; nLeft = GetDockBarSize(pData->hLeftBar); nTop = GetDockBarSize(pData->hTopBar); nRight = GetDockBarSize(pData->hRightBar); nBottom = GetDockBarSize(pData->hBottomBar); ! SetWindowPos(pData->hLeftBar, NULL,0,nTop,nLeft,nHeight-(nBottom+nTop),SWP_NOZORDER); SetWindowPos(pData->hTopBar, NULL,0,0,nWidth,nTop,SWP_NOZORDER); *************** *** 113,116 **** --- 120,125 ---- SetWindowPos(pData->hClientWnd,NULL,nLeft,nTop,nWidth-(nRight+nLeft),nHeight-(nBottom+nTop),SWP_NOZORDER); + + SetWindowPos(pData->hStatusBar,NULL,0,nHeight,nWidth,nStatusHeight,SWP_NOZORDER); } Index: Frame.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Frame.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Frame.c 4 Oct 2003 09:58:36 -0000 1.17 --- Frame.c 14 Nov 2003 22:35:20 -0000 1.18 *************** *** 100,103 **** --- 100,112 ---- (HANDLE) ghModule, NULL); + + pData->hStatusBar = CreateWindow("msctls_statusbar32", + NULL, + WS_CHILD, + 0,0,0,0, + hWnd, + NULL, + (HANDLE) ghModule, + NULL); SetWindowLong(hWnd,GWL_USERDATA,(LONG) pData); Index: Internals.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Internals.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Internals.h 17 Oct 2003 08:52:22 -0000 1.12 --- Internals.h 14 Nov 2003 22:35:20 -0000 1.13 *************** *** 70,73 **** --- 70,74 ---- HWND hLeftBar, hTopBar, hRightBar, hBottomBar; + HWND hStatusBar; } FrameData; Index: Menu.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Menu.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Menu.c 4 Oct 2003 09:53:44 -0000 1.17 --- Menu.c 14 Nov 2003 22:35:20 -0000 1.18 *************** *** 1,4 **** --- 1,5 ---- #include "Menu.h" #include "Window.h" + #include "DockBar.h" #include "Internals.h" #include "Handlers_stub.h" *************** *** 94,102 **** if (!parent) { ! RECT rc; ! FrameData *pFrameData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); ! ! GetClientRect(ghWndFrame, &rc); ! SetWindowPos(pFrameData->hClientWnd,NULL,rc.left,rc.top,rc.right-rc.left,rc.bottom-rc.top,SWP_NOZORDER); DrawMenuBar(ghWndFrame); } --- 95,99 ---- if (!parent) { ! RelayoutFrameBars(); DrawMenuBar(ghWndFrame); } *************** *** 238,242 **** mii.fState = MFS_ENABLED; mii.fType = MFT_RADIOCHECK | MFT_STRING; ! mii.dwTypeData = (DWORD) ""; mii.cch = 0; InsertMenuItem(getParentHMENU(handle),getMenuPos(pFrameData->pMenuHandlesMap, handle),TRUE,&mii); --- 235,239 ---- mii.fState = MFS_ENABLED; mii.fType = MFT_RADIOCHECK | MFT_STRING; ! mii.dwTypeData = ""; mii.cch = 0; InsertMenuItem(getParentHMENU(handle),getMenuPos(pFrameData->pMenuHandlesMap, handle),TRUE,&mii); Index: Window.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Window.c,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** Window.c 17 Oct 2003 08:52:22 -0000 1.59 --- Window.c 14 Nov 2003 22:35:20 -0000 1.60 *************** *** 1,4 **** --- 1,5 ---- #include "Window.h" #include "Menu.h" + #include "DockBar.h" #include "Internals.h" #include "Handlers_stub.h" *************** *** 790,794 **** NULL, WS_CHILD | WS_HSCROLL | WS_VSCROLL, ! 0,0,rect.right-rect.left,rect.bottom-rect.top, ghWndFrame, NULL, --- 791,795 ---- NULL, WS_CHILD | WS_HSCROLL | WS_VSCROLL, ! 0,0,0,0, ghWndFrame, NULL, *************** *** 797,800 **** --- 798,803 ---- ); pFrameData->hClientWnd = hWnd; + + RelayoutFrameBars(); break; case 2: // MDI |