You can subscribe to this list here.
2003 |
Jan
(30) |
Feb
(20) |
Mar
(151) |
Apr
(86) |
May
(23) |
Jun
(25) |
Jul
(107) |
Aug
(141) |
Sep
(55) |
Oct
(85) |
Nov
(65) |
Dec
(2) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(22) |
Feb
(18) |
Mar
(3) |
Apr
(16) |
May
(69) |
Jun
(3) |
Jul
(1) |
Aug
(3) |
Sep
(1) |
Oct
|
Nov
(6) |
Dec
(1) |
2005 |
Jan
(2) |
Feb
(16) |
Mar
|
Apr
|
May
|
Jun
(47) |
Jul
(1) |
Aug
|
Sep
(6) |
Oct
(4) |
Nov
|
Dec
(34) |
2006 |
Jan
(39) |
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(5) |
Oct
|
Nov
(4) |
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2008 |
Jan
|
Feb
|
Mar
(26) |
Apr
(1) |
May
(1) |
Jun
|
Jul
(5) |
Aug
(2) |
Sep
(8) |
Oct
(8) |
Nov
(22) |
Dec
(30) |
2009 |
Jan
(10) |
Feb
(13) |
Mar
(14) |
Apr
(14) |
May
(32) |
Jun
(25) |
Jul
(36) |
Aug
(10) |
Sep
(2) |
Oct
|
Nov
|
Dec
(10) |
2010 |
Jan
(9) |
Feb
(4) |
Mar
(2) |
Apr
(1) |
May
(2) |
Jun
(2) |
Jul
(1) |
Aug
(4) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: <kr_...@us...> - 2003-08-25 20:07:57
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv23998/src/cbits/Win32 Modified Files: Font.c Log Message: bugfix Index: Font.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Font.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Font.c 24 Aug 2003 19:02:45 -0000 1.2 --- Font.c 25 Aug 2003 20:07:53 -0000 1.3 *************** *** 286,290 **** void osDefaultFontDef(char **face, int *size, int *weight, int *style) { ! LOGFONT lf; GetObject(GetStockObject(DEFAULT_GUI_FONT), sizeof(LOGFONT), &lf); --- 286,290 ---- void osDefaultFontDef(char **face, int *size, int *weight, int *style) { ! static LOGFONT lf; GetObject(GetStockObject(DEFAULT_GUI_FONT), sizeof(LOGFONT), &lf); |
From: <kr_...@us...> - 2003-08-25 04:39:20
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO In directory sc8-pr-cvs1:/tmp/cvs-serv6171/gio/src/Graphics/UI/GIO Modified Files: Controls.hs Log Message: Implementation for Notebook control Index: Controls.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Controls.hs,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Controls.hs 23 Aug 2003 00:04:47 -0000 1.22 --- Controls.hs 24 Aug 2003 13:57:34 -0000 1.23 *************** *** 8,12 **** Portability : portable ! Controls. -} ----------------------------------------------------------------------------------------- --- 8,16 ---- Portability : portable ! This module contains interface to all controls supported from GIO. ! A control is a child window an application uses in conjunction with ! another window to perform simple input and output tasks. ! The controls provides the user with the means to type text, choose options, ! and execute an actions. -} ----------------------------------------------------------------------------------------- *************** *** 68,72 **** -- ** CompoundControl ! , CompoundControl, compoundControl ) where --- 72,83 ---- -- ** CompoundControl ! , CompoundControl, compoundControl ! ! -- ** Notebook ! -- | A notebook control is analogous to the dividers in a real notebook. ! -- By using a notebook control, an application can define multiple pages for ! -- the same area of a window or dialog box. ! , Notebook, notebook, labelsPosition, selectedPage ! , NotebookPage, notebookPageAt, notebookPage ) where *************** *** 647,651 **** = writeAttr "layout" (\w c -> do let lay = pack c - autosize <- get w autosize domain <- get w domain needed <- getLayoutSize lay --- 658,661 ---- *************** *** 662,663 **** --- 672,766 ---- instance Control CompoundControl where pack w = stdPack (ccparent w) (Port.getCompoundControlRequestSize (cchandle w)) (Port.moveResizeControl (cchandle w)) + + + -------------------------------------------------------------------- + -- Notebook + -------------------------------------------------------------------- + -- | A notebook control. + data Notebook = Notebook + { nbhandle :: !WindowHandle + , nbparent :: !WindowHandle + , nbpages :: !(Var [NotebookPage]) + } + + -- | Create a notebook control. + notebook :: Container w => [Prop Notebook] -> w -> IO Notebook + notebook props w + = do nb <- do hbook <- Port.createNotebook (hwindow w) + refPages <- newVar [] + return (Notebook hbook (hwindow w) refPages) + set nb props + return nb + + instance Control Notebook where + pack w = stdPack (nbparent w) getNotebookRequestSize (Port.moveResizeControl (nbhandle w)) + where + getNotebookRequestSize = do + outSize <- Port.getNotebookRequestSize (nbhandle w) + pages <- getVar (nbpages w) + pageSizes <- mapM (\page -> get page layoutSize) pages + let inSize = foldr maxSize (Size 10 10) pageSizes + return (addSize inSize outSize) + + labelsPosition :: Attr Notebook PositionType + labelsPosition = newStdAttr nbhandle Port.getNotebookLabelsPosition Port.setNotebookLabelsPosition + + instance SingleSelect Notebook where + selected = newStdAttr nbhandle Port.getNotebookSelection Port.setNotebookSelection + + selectedPage :: Attr Notebook NotebookPage + selectedPage = newAttr getPage setPage + where + getPage w = do + index <- Port.getNotebookSelection (nbhandle w) + pages <- getVar (nbpages w) + return (pages !! index) + + setPage w p = do + index <- Port.getNotebookPagePos (pghandle p) + Port.setNotebookSelection (nbhandle w)index + + -- | A notebook page control. + data NotebookPage = NotebookPage + { pghandle :: !WindowHandle + , pgparent :: !WindowHandle + , pglayout :: !(Var Layout) + } + + -- | Create a new page at specified position in the notebook. + notebookPageAt :: Maybe Int -> [Prop NotebookPage] -> Notebook -> IO NotebookPage + notebookPageAt mb_pos props (Notebook hNotebook _ refPages) + = do pg <- do hpage <- Port.insertNotebookPage hNotebook mb_pos + vlayout <- newVar empty + return (NotebookPage hpage hNotebook vlayout) + updateVar refPages ((:) pg) + set pg [on relayout =: relayoutNotebookPage pg] + set pg props + return pg + + notebookPage :: [Prop NotebookPage] -> Notebook -> IO NotebookPage + notebookPage = notebookPageAt Nothing + + relayoutNotebookPage :: NotebookPage -> IO () + relayoutNotebookPage c + = do size <- Port.getNotebookPageSize (pghandle c) + lay <- getVar (pglayout c) + layoutInRect (rectOfSize size) lay + return () + + instance Container NotebookPage where + layout = writeAttr "layout" (\w c -> setVar (pglayout w) (pack c)) + autosize = readAttr "autosize" (\c -> return True) + layoutSize = readAttr "layoutSize" (\c -> getVar (pglayout c) >>= getLayoutSize) + relayout = newStdEvent pghandle Port.getWindowReLayoutHandler Port.setWindowReLayoutHandler Port.setWindowReLayoutDefHandler + hwindow c = pghandle c + + instance Titled NotebookPage where + title = newStdAttr pghandle Port.getNotebookPageTitle Port.setNotebookPageTitle + + instance Positioned NotebookPage where + pos = readAttr "pos" (Port.getNotebookPagePos . pghandle) + + instance Deadly NotebookPage where + destroyWidget w = Port.destroyNotebookPage (pghandle w) + destroy = newStdEvent pghandle Port.getWindowDestroyHandler Port.setWindowDestroyHandler Port.setWindowDestroyDefHandler |
From: <kr_...@us...> - 2003-08-25 04:39:20
|
Update of /cvsroot/htoolkit/port/src/include In directory sc8-pr-cvs1:/tmp/cvs-serv6171/port/src/include Modified Files: HsPort.h Added Files: Notebook.h Log Message: Implementation for Notebook control --- NEW FILE: Notebook.h --- #ifndef NOTEBOOK_H #define NOTEBOOK_H #include "Types.h" WindowHandle osCreateNotebook(WindowHandle form); void osGetNotebookReqSize(WindowHandle notebook, int *res); void osSetNotebookLabelsPosition(WindowHandle notebook, PositionType position); PositionType osGetNotebookLabelsPosition(WindowHandle notebook); int osGetNotebookSelection(WindowHandle notebook); void osSetNotebookSelection(WindowHandle notebook, int index); WindowHandle osInsertNotebookPage(WindowHandle notebook, int pos); char *osGetNotebookPageTitle(WindowHandle window); void osSetNotebookPageTitle(WindowHandle window, char *txt); int osGetNotebookPagePos(WindowHandle handle); void osDestroyNotebookPage(WindowHandle window); void osGetNotebookPageSize(WindowHandle window, int *res); #endif Index: HsPort.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/include/HsPort.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** HsPort.h 16 Jul 2003 22:11:06 -0000 1.6 --- HsPort.h 24 Aug 2003 13:57:34 -0000 1.7 *************** *** 21,22 **** --- 21,23 ---- #include "port/Message.h" #include "port/ConfigKey.h" + #include "port/Notebook.h" |
From: <kr_...@us...> - 2003-08-25 03:16:10
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv10989/src/cbits/Win32 Modified Files: Frame.c Internals.h Notebook.c Util.c Log Message: Use system defined font (DEFAULT_GUI_FONT) for controls instead of hard coded constant value Index: Frame.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Frame.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Frame.c 15 Aug 2003 21:24:54 -0000 1.14 --- Frame.c 24 Aug 2003 14:39:00 -0000 1.15 *************** *** 37,41 **** notifyAllHandlesForDestroy(pData->pMenuHandlesMap); handleProcessDestroy(); - DeleteObject(pData->hControlFont); free(pData->lpszAppName); free(pData->lpszAppVersion); --- 37,40 ---- *************** *** 48,83 **** int nLen; LOGFONT lf; - HFONT hControlFont; - - // Globally, we create a logical font that is used in all controls. - lf.lfHeight = -8; - lf.lfWidth = 0; - lf.lfWeight = 400; - lf.lfItalic = FALSE; - lf.lfUnderline = FALSE; - lf.lfStrikeOut = FALSE; - lf.lfEscapement = 0; - lf.lfOrientation = 0; - lf.lfCharSet = DEFAULT_CHARSET; - lf.lfOutPrecision = OUT_DEFAULT_PRECIS; - lf.lfClipPrecision = CLIP_DEFAULT_PRECIS; - lf.lfQuality = DEFAULT_QUALITY; - lf.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE; - strcpy(lf.lfFaceName, "MS Sans Serif"); - hControlFont = CreateFontIndirect (&lf); - - if (!hControlFont) - return -1; pData = (FrameData *) malloc(sizeof(FrameData)); ! if (!pData) ! { ! DeleteObject(hControlFont); ! return -1; ! } pData->hClientWnd = NULL; pData->DocumentInterface = DocumentInterface; - pData->hControlFont = hControlFont; pData->lpszAppName = NULL; pData->lpszAppVersion = NULL; --- 47,56 ---- int nLen; LOGFONT lf; pData = (FrameData *) malloc(sizeof(FrameData)); ! if (!pData) return -1; pData->hClientWnd = NULL; pData->DocumentInterface = DocumentInterface; pData->lpszAppName = NULL; pData->lpszAppVersion = NULL; *************** *** 91,95 **** { free(pData); - DeleteObject(hControlFont); return -1; } --- 64,67 ---- Index: Internals.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Internals.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Internals.h 17 Aug 2003 18:15:08 -0000 1.6 --- Internals.h 24 Aug 2003 14:39:00 -0000 1.7 *************** *** 65,69 **** HWND hClientWnd; int DocumentInterface; - HFONT hControlFont; LPSTR lpszAppName; LPSTR lpszAppVersion; --- 65,68 ---- Index: Notebook.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Notebook.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Notebook.c 24 Aug 2003 13:57:34 -0000 1.1 --- Notebook.c 24 Aug 2003 14:39:00 -0000 1.2 *************** *** 122,126 **** { LONG lStyle; - FrameData *pFrameData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); lStyle = GetWindowLong(notebook, GWL_STYLE); --- 122,125 ---- *************** *** 137,141 **** SendMessage(notebook, WM_SETFONT, (WPARAM)NULL, TRUE); SetWindowLong(notebook, GWL_STYLE, lStyle); ! SendMessage(notebook, WM_SETFONT, (WPARAM)pFrameData->hControlFont, MAKELPARAM (TRUE,0)); ResizeNotebookPages(notebook); --- 136,140 ---- SendMessage(notebook, WM_SETFONT, (WPARAM)NULL, TRUE); SetWindowLong(notebook, GWL_STYLE, lStyle); ! SendMessage(notebook, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), MAKELPARAM (TRUE,0)); ResizeNotebookPages(notebook); *************** *** 166,170 **** { TCITEM item; - HWND hNotebookPage; int nOldIndex; --- 165,168 ---- Index: Util.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Util.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Util.c 24 Aug 2003 13:57:34 -0000 1.19 --- Util.c 24 Aug 2003 14:39:00 -0000 1.20 *************** *** 218,222 **** { HWND hParent; - FrameData *pFrameData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); if (!hWnd) --- 218,221 ---- *************** *** 226,230 **** } ! SendMessage(hWnd, WM_SETFONT, (WPARAM)pFrameData->hControlFont, MAKELPARAM (TRUE,0)); hParent = GetParent(hWnd); --- 225,229 ---- } ! SendMessage(hWnd, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), MAKELPARAM (TRUE,0)); hParent = GetParent(hWnd); |
From: <kr_...@us...> - 2003-08-24 23:59:00
|
Update of /cvsroot/htoolkit/port/src/Port In directory sc8-pr-cvs1:/tmp/cvs-serv6171/port/src/Port Modified Files: Controls.hs Log Message: Implementation for Notebook control Index: Controls.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/Controls.hs,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Controls.hs 21 Aug 2003 17:34:01 -0000 1.18 --- Controls.hs 24 Aug 2003 13:57:34 -0000 1.19 *************** *** 1,3 **** ! {-# OPTIONS -fglasgow-exts -#include Button.h -#include CheckBox.h -#include EditBox.h -#include Label.h -#include ListBox.h -#include PopUp.h -#include RadioBox.h -#include Window.h -#include ProgressBar.h -#include Slider.h #-} ----------------------------------------------------------------------------------------- {-| Module : Controls --- 1,3 ---- ! {-# OPTIONS -fglasgow-exts -#include Button.h -#include CheckBox.h -#include EditBox.h -#include Label.h -#include ListBox.h -#include PopUp.h -#include RadioBox.h -#include Window.h -#include ProgressBar.h -#include Slider.h -#include Notebook.h #-} ----------------------------------------------------------------------------------------- {-| Module : Controls *************** *** 30,33 **** --- 30,37 ---- * CompoundControl + + * Notebook + + * NotebookPage -} ----------------------------------------------------------------------------------------- *************** *** 85,88 **** --- 89,102 ---- -- * CompoundControl , createCompoundControl, getCompoundControlRequestSize + -- * Notebook + , createNotebook, getNotebookRequestSize + , getNotebookLabelsPosition, setNotebookLabelsPosition + , getNotebookSelection, setNotebookSelection + -- * NotebookPage + , insertNotebookPage + , getNotebookPageTitle, setNotebookPageTitle + , getNotebookPagePos + , destroyNotebookPage + , getNotebookPageSize ) where *************** *** 91,95 **** import Graphics.UI.Port.Types import Graphics.UI.Port.Handlers -- just for haddock ! ----------------------------------------------------------------------------------------- --- 105,109 ---- import Graphics.UI.Port.Types import Graphics.UI.Port.Handlers -- just for haddock ! import Data.Maybe(fromMaybe) ----------------------------------------------------------------------------------------- *************** *** 233,238 **** -- RadioBox ----------------------------------------------------------------------------------------- ! -- | Create a radio box. Takes a parent window handle, whether it is the first ! -- radio control of its group and a label as its arguments. -- An event handler for radio box clicks can be -- installed with 'setControlCommandHandler'. --- 247,251 ---- -- RadioBox ----------------------------------------------------------------------------------------- ! -- | Create a radio box. -- An event handler for radio box clicks can be -- installed with 'setControlCommandHandler'. *************** *** 435,436 **** --- 448,501 ---- getCompoundControlRequestSize hwnd = withCSizeResult (osGetCompoundControlReqSize hwnd) foreign import ccall osGetCompoundControlReqSize :: WindowHandle -> Ptr CInt -> IO () + + ----------------------------------------------------------------------------------------- + -- Notebook + ----------------------------------------------------------------------------------------- + + -- | Create a new notebook control. + foreign import ccall "osCreateNotebook" createNotebook :: WindowHandle -> IO WindowHandle + + getNotebookRequestSize :: WindowHandle -> IO Size + getNotebookRequestSize hwnd = withCSizeResult (osGetNotebookReqSize hwnd) + foreign import ccall osGetNotebookReqSize :: WindowHandle -> Ptr CInt -> IO () + + setNotebookLabelsPosition :: WindowHandle -> PositionType -> IO () + setNotebookLabelsPosition hwnd position = osSetNotebookLabelsPosition hwnd (toCPositionType position) + foreign import ccall osSetNotebookLabelsPosition :: WindowHandle -> CInt -> IO () + + getNotebookLabelsPosition :: WindowHandle -> IO PositionType + getNotebookLabelsPosition hwnd = fmap fromCPositionType (osGetNotebookLabelsPosition hwnd) + foreign import ccall osGetNotebookLabelsPosition :: WindowHandle -> IO CInt + + getNotebookSelection :: WindowHandle -> IO Int + getNotebookSelection hwnd + = do ci <- osGetNotebookSelection hwnd + return (fromCInt ci) + foreign import ccall osGetNotebookSelection :: WindowHandle -> IO CInt + + setNotebookSelection :: WindowHandle -> Int -> IO () + setNotebookSelection hwnd i + = osSetNotebookSelection hwnd (toCInt i) + foreign import ccall osSetNotebookSelection :: WindowHandle -> CInt -> IO () + + insertNotebookPage :: WindowHandle -> Maybe Int -> IO WindowHandle + insertNotebookPage hwnd mb_pos = osInsertNotebookPage hwnd (fromMaybe (-1) mb_pos) + foreign import ccall osInsertNotebookPage :: WindowHandle -> Int -> IO WindowHandle + + -- | Get the label of the notebook page. + getNotebookPageTitle :: WindowHandle -> IO String + getNotebookPageTitle hwnd = resultCString (osGetNotebookPageTitle hwnd) + foreign import ccall osGetNotebookPageTitle :: WindowHandle -> IO CString + + -- | Set the label of the notebook page. + setNotebookPageTitle :: WindowHandle -> String -> IO () + setNotebookPageTitle hwnd title = withCString title (osSetNotebookPageTitle hwnd) + foreign import ccall osSetNotebookPageTitle :: WindowHandle -> CString -> IO () + + foreign import ccall "osGetNotebookPagePos" getNotebookPagePos :: WindowHandle -> IO Int + + foreign import ccall "osDestroyNotebookPage" destroyNotebookPage :: WindowHandle -> IO () + + getNotebookPageSize :: WindowHandle -> IO Size + getNotebookPageSize hwnd = withCSizeResult (osGetNotebookPageSize hwnd) + foreign import ccall osGetNotebookPageSize :: WindowHandle -> Ptr CInt -> IO () |
From: <kr_...@us...> - 2003-08-24 23:59:00
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv6171/port/src/cbits/Win32 Modified Files: Util.c Window.c Added Files: Notebook.c Log Message: Implementation for Notebook control --- NEW FILE: Notebook.c --- #include "Notebook.h" #include "Internals.h" #include "Handlers_stub.h" WNDPROC DefTabCtrlProc; extern LRESULT CALLBACK HCompoundControlFunction(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); static void ResizeNotebookPages(HWND hWnd) { RECT rect; int i, nCount; TCITEM item; GetClientRect(hWnd, &rect); SendMessage(hWnd, TCM_ADJUSTRECT, FALSE, (LPARAM) &rect); nCount = SendMessage(hWnd, TCM_GETITEMCOUNT, 0, 0); for (i = 0; i < nCount; i++) { item.mask = TCIF_PARAM; SendMessage(hWnd, TCM_GETITEM, i, (LPARAM) &item); SetWindowPos((HWND) item.lParam,NULL,rect.left,rect.top, (rect.right-rect.left), (rect.bottom-rect.top), SWP_NOZORDER); } } LRESULT CALLBACK HNotebookFunction(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case WM_SIZE: ResizeNotebookPages(hWnd); break; case WM_NOTIFY: { NMHDR *pNMHDR = (NMHDR *) lParam; int nIndex; TCITEM item; HWND hNotebookPage; if (pNMHDR->hwndFrom == hWnd) { nIndex = SendMessage(hWnd, TCM_GETCURSEL, 0, 0); item.mask = TCIF_PARAM; SendMessage(hWnd, TCM_GETITEM, nIndex, (LPARAM) &item); hNotebookPage = (HWND) item.lParam; switch (pNMHDR->code) { case TCN_SELCHANGE: ShowWindow(hNotebookPage, SW_SHOW); break; case TCN_SELCHANGING: ShowWindow(hNotebookPage, SW_HIDE); break; } return 0; } } break; } return CallWindowProc(DefTabCtrlProc, hWnd, uMsg, wParam, lParam); } LRESULT CALLBACK HNotebookPageFunction(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case WM_SETTEXT: { TCITEM item; item.mask = TCIF_TEXT; item.pszText = (char *) lParam; SendMessage(GetParent(hWnd), TCM_SETITEM, osGetNotebookPagePos(hWnd), (LPARAM) &item); } break; case WM_DESTROY: { handleWindowDestroy(hWnd); SendMessage(GetParent(hWnd), TCM_DELETEITEM, osGetNotebookPagePos(hWnd), 0); } break; case WM_CTLCOLORSTATIC: return DefWindowProc(hWnd, uMsg, wParam, lParam); } return HCompoundControlFunction(hWnd, uMsg, wParam, lParam); } WindowHandle osCreateNotebook(WindowHandle form) { HWND hNotebook; hNotebook = CreateWindow( "HNOTEBOOK", NULL, WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0,0,0,0, form, NULL, ghModule, NULL ); return checkWindow(hNotebook, WC_TABCONTROL); }; void osGetNotebookReqSize(WindowHandle notebook, int *res) { RECT rect = {0,0,0,0}; SendMessage(notebook, TCM_ADJUSTRECT, TRUE, (LPARAM) &rect); res[0] = rect.right - rect.left; res[1] = rect.bottom - rect.top; } void osSetNotebookLabelsPosition(WindowHandle notebook, PositionType position) { LONG lStyle; FrameData *pFrameData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); lStyle = GetWindowLong(notebook, GWL_STYLE); lStyle &= ~(TCS_VERTICAL | TCS_RIGHT | TCS_BOTTOM); switch (position) { case PosLeft: lStyle |= TCS_VERTICAL; break; case PosTop: break; case PosRight: lStyle |= TCS_VERTICAL | TCS_RIGHT; break; case PosBottom: lStyle |= TCS_BOTTOM; break; } SendMessage(notebook, WM_SETFONT, (WPARAM)NULL, TRUE); SetWindowLong(notebook, GWL_STYLE, lStyle); SendMessage(notebook, WM_SETFONT, (WPARAM)pFrameData->hControlFont, MAKELPARAM (TRUE,0)); ResizeNotebookPages(notebook); } PositionType osGetNotebookLabelsPosition(WindowHandle notebook) { LONG lStyle = GetWindowLong(notebook, GWL_STYLE); if (lStyle & TCS_VERTICAL) if (lStyle & TCS_RIGHT) return PosRight; else return PosLeft; else if (lStyle & TCS_BOTTOM) return PosBottom; else return PosTop; } int osGetNotebookSelection(WindowHandle notebook) { return SendMessage(notebook, TCM_GETCURSEL, 0, 0); }; void osSetNotebookSelection(WindowHandle notebook, int index) { TCITEM item; HWND hNotebookPage; int nOldIndex; item.mask = TCIF_PARAM; nOldIndex = SendMessage(notebook, TCM_GETCURSEL, 0, 0); SendMessage(notebook, TCM_SETCURSEL, index, 0); SendMessage(notebook, TCM_GETITEM, nOldIndex, (LPARAM) &item); ShowWindow((HWND) item.lParam, SW_HIDE); SendMessage(notebook, TCM_GETITEM, index, (LPARAM) &item); ShowWindow((HWND) item.lParam, SW_SHOW); }; WindowHandle osInsertNotebookPage(WindowHandle notebook, int pos) { HWND hWnd; RECT rect; TCITEM item; int nCount; nCount = SendMessage(notebook, TCM_GETITEMCOUNT, 0, 0); if (pos < 0) pos = nCount; GetWindowRect(notebook, &rect); SendMessage(notebook, TCM_ADJUSTRECT, FALSE, (LPARAM) &rect); hWnd = CreateWindow("HNOTEBOOKPAGE", NULL, WS_CHILD | ((nCount > 0) ? 0 : WS_VISIBLE), 0,0,rect.right-rect.left,rect.bottom-rect.top, notebook, NULL, ghModule, NULL ); item.mask = TCIF_PARAM | TCIF_TEXT; item.lParam = (LPARAM) hWnd; item.pszText = ""; SendMessage(notebook, TCM_INSERTITEM, pos, (LPARAM) &item); return hWnd; } char *osGetNotebookPageTitle(WindowHandle window) { int nLen = GetWindowTextLength(window); char *buffer = (char *) malloc(nLen+1); if (buffer) GetWindowText(window, buffer, nLen+1); return buffer; }; void osSetNotebookPageTitle(WindowHandle window, char *txt) { SetWindowText(window, txt); }; int osGetNotebookPagePos(WindowHandle window) { HWND hNotebook = GetParent(window); int i, nCount = SendMessage(hNotebook, TCM_GETITEMCOUNT, 0, 0); TCITEM item; for (i = 0; i < nCount; i++) { item.mask = TCIF_PARAM; SendMessage(hNotebook, TCM_GETITEM, i, (LPARAM) &item); if (((HWND) item.lParam) == window) return i; } return -1; } void osDestroyNotebookPage(WindowHandle window) { DestroyWindow(window); } void osGetNotebookPageSize(WindowHandle window, int *res) { RECT rect; GetWindowRect(window,&rect); res[0] = rect.right-rect.left; res[1] = rect.bottom-rect.top; } Index: Util.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Util.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Util.c 20 Aug 2003 21:37:26 -0000 1.18 --- Util.c 24 Aug 2003 13:57:34 -0000 1.19 *************** *** 36,41 **** --- 36,44 ---- extern LRESULT CALLBACK HDockBarFunction(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); extern LRESULT CALLBACK HToolBarFunction(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); + extern LRESULT CALLBACK HNotebookFunction(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); + extern LRESULT CALLBACK HNotebookPageFunction(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); extern WNDPROC DefToolBarProc; + extern WNDPROC DefTabCtrlProc; void osInit(char *appName, char *appVersion, int DocumentInterface) *************** *** 145,148 **** --- 148,172 ---- wc.lpfnWndProc = HToolBarFunction; wc.lpszClassName = "HTOOLBAR"; + RegisterClass(&wc); + + // Notebook class (subclass of the standard TabCtrl class) + GetClassInfo(ghModule, WC_TABCONTROL, &wc); + DefTabCtrlProc = wc.lpfnWndProc; + wc.style = CS_DBLCLKS; + wc.lpfnWndProc = HNotebookFunction; + wc.lpszClassName = "HNOTEBOOK"; + RegisterClass(&wc); + + // NotebookPage class + wc.style = CS_DBLCLKS; + wc.lpfnWndProc = HNotebookPageFunction; + wc.cbClsExtra = 0; + wc.cbWndExtra = 0; + wc.hInstance = ghModule; + wc.hIcon = NULL; + wc.hCursor = NULL; + wc.hbrBackground = (HBRUSH) (COLOR_BTNFACE+1); + wc.lpszMenuName = NULL; + wc.lpszClassName = "HNOTEBOOKPAGE"; RegisterClass(&wc); Index: Window.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Window.c,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** Window.c 24 Aug 2003 11:30:14 -0000 1.41 --- Window.c 24 Aug 2003 13:57:34 -0000 1.42 *************** *** 212,215 **** --- 212,222 ---- } break; + case WM_NOTIFY: + { + NMHDR *pNMHDR = (NMHDR *) lParam; + if (pNMHDR->hwndFrom != hWnd) + SendMessage(pNMHDR->hwndFrom, uMsg, wParam, lParam); + } + break; case WM_PAINT: { |
From: <kr_...@us...> - 2003-08-24 23:54:59
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO In directory sc8-pr-cvs1:/tmp/cvs-serv8978/src/Graphics/UI/GIO Modified Files: Controls.hs Log Message: Comments Index: Controls.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Controls.hs,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Controls.hs 24 Aug 2003 13:57:34 -0000 1.23 --- Controls.hs 24 Aug 2003 14:21:01 -0000 1.24 *************** *** 66,72 **** --- 66,84 ---- -- ** CheckBox + -- | A check box consists of a square box and a label, that indicates a choice + -- the user can make by selecting the check. Each CheckBox has two states: + -- checked (a check mark inside the box) or cleared (no check mark). The + -- state is controled from the 'checked' attribute. Repeatedly clicking a + -- check box toggles it from checked to cleared and back again. , CheckBox, checkBox -- ** RadioBox + -- | A radio button consists of a round button and a label that indicates a + -- choice the user can make by selecting the button. An application typically + -- uses radio buttons in a group box to permit the user to choose from a set + -- of mutually exclusive options. The group is defined with 'setRadioBoxGroup' + -- function. When the user selects an radio button from group then the system + -- automatically sets its check state to 'checked' and clears all other + -- buttons within the same group. , RadioBox, radioBox, setRadioBoxGroup *************** *** 77,81 **** -- | A notebook control is analogous to the dividers in a real notebook. -- By using a notebook control, an application can define multiple pages for ! -- the same area of a window or dialog box. , Notebook, notebook, labelsPosition, selectedPage , NotebookPage, notebookPageAt, notebookPage --- 89,95 ---- -- | A notebook control is analogous to the dividers in a real notebook. -- By using a notebook control, an application can define multiple pages for ! -- the same area of a window or dialog box. Each page is represented from ! -- 'NotebookPage' type and is created from 'notebookPageAt' or 'notebookPage' ! -- function. , Notebook, notebook, labelsPosition, selectedPage , NotebookPage, notebookPageAt, notebookPage *************** *** 708,712 **** instance SingleSelect Notebook where selected = newStdAttr nbhandle Port.getNotebookSelection Port.setNotebookSelection ! selectedPage :: Attr Notebook NotebookPage selectedPage = newAttr getPage setPage --- 722,727 ---- instance SingleSelect Notebook where selected = newStdAttr nbhandle Port.getNotebookSelection Port.setNotebookSelection ! ! -- | The selected page in the notebook selectedPage :: Attr Notebook NotebookPage selectedPage = newAttr getPage setPage *************** *** 721,725 **** Port.setNotebookSelection (nbhandle w)index ! -- | A notebook page control. data NotebookPage = NotebookPage { pghandle :: !WindowHandle --- 736,740 ---- Port.setNotebookSelection (nbhandle w)index ! -- | A notebook page. data NotebookPage = NotebookPage { pghandle :: !WindowHandle *************** *** 739,742 **** --- 754,758 ---- return pg + -- | Appends a new page in the notebook. notebookPage :: [Prop NotebookPage] -> Notebook -> IO NotebookPage notebookPage = notebookPageAt Nothing |
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv4408/port/src/cbits/Win32 Modified Files: Button.c CheckBox.c EditBox.c Internals.h Label.c ListBox.c PopUp.c RadioBox.c Window.c Log Message: Rename WindowReLayout to ContainerReLayout Index: Button.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Button.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Button.c 24 Aug 2003 20:42:54 -0000 1.5 --- Button.c 24 Aug 2003 21:07:48 -0000 1.6 *************** *** 51,55 **** { SetWindowText(button, txt); ! osForceWindowReLayout(button); }; --- 51,55 ---- { SetWindowText(button, txt); ! osForceContainerReLayout(button); }; *************** *** 57,60 **** { SendMessage(button, WM_SETFONT, (WPARAM) font, MAKELPARAM (TRUE,0)); ! osForceWindowReLayout(button); }; --- 57,60 ---- { SendMessage(button, WM_SETFONT, (WPARAM) font, MAKELPARAM (TRUE,0)); ! osForceContainerReLayout(button); }; Index: CheckBox.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/CheckBox.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CheckBox.c 24 Aug 2003 20:42:54 -0000 1.6 --- CheckBox.c 24 Aug 2003 21:07:48 -0000 1.7 *************** *** 55,59 **** { SetWindowText(checkbox, txt); ! osForceWindowReLayout(checkbox); }; --- 55,59 ---- { SetWindowText(checkbox, txt); ! osForceContainerReLayout(checkbox); }; Index: EditBox.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/EditBox.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** EditBox.c 24 Aug 2003 20:42:54 -0000 1.8 --- EditBox.c 24 Aug 2003 21:07:48 -0000 1.9 *************** *** 89,92 **** { SendMessage(editbox, WM_SETFONT, (WPARAM) font, MAKELPARAM (TRUE,0)); ! osForceWindowReLayout(editbox); }; --- 89,92 ---- { SendMessage(editbox, WM_SETFONT, (WPARAM) font, MAKELPARAM (TRUE,0)); ! osForceContainerReLayout(editbox); }; Index: Internals.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Internals.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Internals.h 24 Aug 2003 20:42:54 -0000 1.8 --- Internals.h 24 Aug 2003 21:07:48 -0000 1.9 *************** *** 75,79 **** extern void *rmalloc(unsigned long bytes); ! void osForceWindowReLayout(HWND hCtrl); #endif --- 75,79 ---- extern void *rmalloc(unsigned long bytes); ! void osForceContainerReLayout(HWND hCtrl); #endif Index: Label.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Label.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Label.c 24 Aug 2003 20:42:54 -0000 1.6 --- Label.c 24 Aug 2003 21:07:48 -0000 1.7 *************** *** 51,57 **** { SetWindowText(label, txt); ! handleWindowReLayout(GetParent(label)); ! osForceWindowReLayout(label); ! }; --- 51,55 ---- { SetWindowText(label, txt); ! osForceContainerReLayout(label); }; *************** *** 59,62 **** { SendMessage(label, WM_SETFONT, (WPARAM) font, MAKELPARAM (TRUE,0)); ! osForceWindowReLayout(label); }; --- 57,60 ---- { SendMessage(label, WM_SETFONT, (WPARAM) font, MAKELPARAM (TRUE,0)); ! osForceContainerReLayout(label); }; Index: ListBox.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/ListBox.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ListBox.c 24 Aug 2003 20:42:54 -0000 1.5 --- ListBox.c 24 Aug 2003 21:07:48 -0000 1.6 *************** *** 24,28 **** { SendMessage(listbox, LB_ADDSTRING, 0, (LPARAM) title); ! osForceWindowReLayout(listbox); }; --- 24,28 ---- { SendMessage(listbox, LB_ADDSTRING, 0, (LPARAM) title); ! osForceContainerReLayout(listbox); }; *************** *** 30,34 **** { SendMessage(listbox, LB_INSERTSTRING, index, (LPARAM) title); ! osForceWindowReLayout(listbox); }; --- 30,34 ---- { SendMessage(listbox, LB_INSERTSTRING, index, (LPARAM) title); ! osForceContainerReLayout(listbox); }; *************** *** 36,40 **** { SendMessage(listbox, LB_DELETESTRING, index, 0); ! osForceWindowReLayout(listbox); }; --- 36,40 ---- { SendMessage(listbox, LB_DELETESTRING, index, 0); ! osForceContainerReLayout(listbox); }; *************** *** 42,46 **** { SendMessage(listbox, LB_RESETCONTENT,0,0); ! osForceWindowReLayout(listbox); }; --- 42,46 ---- { SendMessage(listbox, LB_RESETCONTENT,0,0); ! osForceContainerReLayout(listbox); }; Index: PopUp.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/PopUp.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PopUp.c 24 Aug 2003 20:42:54 -0000 1.4 --- PopUp.c 24 Aug 2003 21:07:48 -0000 1.5 *************** *** 23,27 **** { SendMessage(popup, CB_ADDSTRING, 0, (LPARAM) title); ! osForceWindowReLayout(popup); }; --- 23,27 ---- { SendMessage(popup, CB_ADDSTRING, 0, (LPARAM) title); ! osForceContainerReLayout(popup); }; *************** *** 29,33 **** { SendMessage(popup, CB_INSERTSTRING, index, (LPARAM) title); ! osForceWindowReLayout(popup); }; --- 29,33 ---- { SendMessage(popup, CB_INSERTSTRING, index, (LPARAM) title); ! osForceContainerReLayout(popup); }; *************** *** 35,39 **** { SendMessage(popup, CB_DELETESTRING, index, 0); ! osForceWindowReLayout(popup); }; --- 35,39 ---- { SendMessage(popup, CB_DELETESTRING, index, 0); ! osForceContainerReLayout(popup); }; *************** *** 41,45 **** { SendMessage(popup, CB_RESETCONTENT,0,0); ! osForceWindowReLayout(popup); }; --- 41,45 ---- { SendMessage(popup, CB_RESETCONTENT,0,0); ! osForceContainerReLayout(popup); }; Index: RadioBox.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/RadioBox.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** RadioBox.c 24 Aug 2003 20:42:54 -0000 1.7 --- RadioBox.c 24 Aug 2003 21:07:48 -0000 1.8 *************** *** 56,60 **** { SetWindowText(radiobox, txt); ! osForceWindowReLayout(radiobox); }; --- 56,60 ---- { SetWindowText(radiobox, txt); ! osForceContainerReLayout(radiobox); }; Index: Window.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Window.c,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** Window.c 24 Aug 2003 20:42:54 -0000 1.43 --- Window.c 24 Aug 2003 21:07:48 -0000 1.44 *************** *** 275,279 **** GetClientRect(hWnd,&rect); handleWindowResize(hWnd,rect.right-rect.left,rect.bottom-rect.top); ! handleWindowReLayout(hWnd); } break; --- 275,279 ---- GetClientRect(hWnd,&rect); handleWindowResize(hWnd,rect.right-rect.left,rect.bottom-rect.top); ! handleContainerReLayout(hWnd); } break; *************** *** 1330,1338 **** GetClientRect(hwnd,&rc); handleWindowResize(hwnd,rc.right-rc.left,rc.bottom-rc.top); ! handleWindowReLayout(hwnd); } } ! void osForceWindowReLayout(HWND hCtrl) { char buffer[20]; --- 1330,1338 ---- GetClientRect(hwnd,&rc); handleWindowResize(hwnd,rc.right-rc.left,rc.bottom-rc.top); ! handleContainerReLayout(hwnd); } } ! void osForceContainerReLayout(HWND hCtrl) { char buffer[20]; *************** *** 1346,1350 **** _stricmp(buffer, "HNOTEBOOKPAGE") != 0) { ! handleWindowReLayout(hWnd); break; } --- 1346,1350 ---- _stricmp(buffer, "HNOTEBOOKPAGE") != 0) { ! handleContainerReLayout(hWnd); break; } |
From: <kr_...@us...> - 2003-08-24 21:07:51
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK In directory sc8-pr-cvs1:/tmp/cvs-serv4408/port/src/cbits/GTK Modified Files: Button.c CheckBox.c EditBox.c Label.c RadioBox.c Window.c Log Message: Rename WindowReLayout to ContainerReLayout Index: Button.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Button.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Button.c 2 Apr 2003 21:10:16 -0000 1.7 --- Button.c 24 Aug 2003 21:07:48 -0000 1.8 *************** *** 42,46 **** GtkWidget *window = gtk_widget_get_parent(gtk_widget_get_parent(gtk_widget_get_parent(button))); gtk_button_set_label(GTK_BUTTON(button), szText); ! handleWindowReLayout(window); rfree(szText); }; --- 42,46 ---- GtkWidget *window = gtk_widget_get_parent(gtk_widget_get_parent(gtk_widget_get_parent(button))); gtk_button_set_label(GTK_BUTTON(button), szText); ! handleContainerReLayout(window); rfree(szText); }; *************** *** 50,53 **** GtkWidget *window = gtk_widget_get_parent(gtk_widget_get_parent(gtk_widget_get_parent(button))); gtk_widget_modify_font(button, font->font_descr); ! handleWindowReLayout(window); }; --- 50,53 ---- GtkWidget *window = gtk_widget_get_parent(gtk_widget_get_parent(gtk_widget_get_parent(button))); gtk_widget_modify_font(button, font->font_descr); ! handleContainerReLayout(window); }; Index: CheckBox.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/CheckBox.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** CheckBox.c 21 Aug 2003 19:55:05 -0000 1.6 --- CheckBox.c 24 Aug 2003 21:07:48 -0000 1.7 *************** *** 41,45 **** GtkWidget *window = gtk_widget_get_parent(gtk_widget_get_parent(gtk_widget_get_parent(button))); gtk_button_set_label(GTK_BUTTON(button), szText); ! handleWindowReLayout(window); rfree(szText); }; --- 41,45 ---- GtkWidget *window = gtk_widget_get_parent(gtk_widget_get_parent(gtk_widget_get_parent(button))); gtk_button_set_label(GTK_BUTTON(button), szText); ! handleContainerReLayout(window); rfree(szText); }; Index: EditBox.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/EditBox.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** EditBox.c 29 Mar 2003 08:12:18 -0000 1.8 --- EditBox.c 24 Aug 2003 21:07:48 -0000 1.9 *************** *** 61,64 **** gtk_widget_modify_font(entry, font->font_descr); // pango_layout_set_font_description(gtk_entry_get_layout(GTK_ENTRY(entry)), font->font_descr); ! handleWindowReLayout(gtk_widget_get_toplevel(entry)); }; --- 61,64 ---- gtk_widget_modify_font(entry, font->font_descr); // pango_layout_set_font_description(gtk_entry_get_layout(GTK_ENTRY(entry)), font->font_descr); ! handleContainerReLayout(gtk_widget_get_toplevel(entry)); }; Index: Label.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Label.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Label.c 2 Apr 2003 21:10:18 -0000 1.6 --- Label.c 24 Aug 2003 21:07:48 -0000 1.7 *************** *** 40,44 **** GtkWidget *window = gtk_widget_get_parent(gtk_widget_get_parent(gtk_widget_get_parent(label))); gtk_label_set_text_with_mnemonic(GTK_LABEL(label), szText); ! handleWindowReLayout(window); rfree(szText); }; --- 40,44 ---- GtkWidget *window = gtk_widget_get_parent(gtk_widget_get_parent(gtk_widget_get_parent(label))); gtk_label_set_text_with_mnemonic(GTK_LABEL(label), szText); ! handleContainerReLayout(window); rfree(szText); }; *************** *** 49,52 **** gtk_widget_modify_font(label, font->font_descr); //pango_layout_set_font_description(gtk_label_get_layout(GTK_LABEL(label)), font->font_descr); ! handleWindowReLayout(window); }; --- 49,52 ---- gtk_widget_modify_font(label, font->font_descr); //pango_layout_set_font_description(gtk_label_get_layout(GTK_LABEL(label)), font->font_descr); ! handleContainerReLayout(window); }; Index: RadioBox.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/RadioBox.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** RadioBox.c 21 Aug 2003 19:55:05 -0000 1.6 --- RadioBox.c 24 Aug 2003 21:07:48 -0000 1.7 *************** *** 42,46 **** GtkWidget *window = gtk_widget_get_parent(gtk_widget_get_parent(gtk_widget_get_parent(button))); gtk_button_set_label(GTK_BUTTON(button), szText); ! handleWindowReLayout(window); rfree(szText); }; --- 42,46 ---- GtkWidget *window = gtk_widget_get_parent(gtk_widget_get_parent(gtk_widget_get_parent(button))); gtk_button_set_label(GTK_BUTTON(button), szText); ! handleContainerReLayout(window); rfree(szText); }; Index: Window.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Window.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Window.c 21 Aug 2003 19:55:05 -0000 1.26 --- Window.c 24 Aug 2003 21:07:48 -0000 1.27 *************** *** 198,202 **** handleWindowResize(widget,allocation->width-4,allocation->height-4); ! handleWindowReLayout(widget); } }; --- 198,202 ---- handleWindowResize(widget,allocation->width-4,allocation->height-4); ! handleContainerReLayout(widget); } }; |
From: <kr_...@us...> - 2003-08-24 21:07:51
|
Update of /cvsroot/htoolkit/port/src/Port In directory sc8-pr-cvs1:/tmp/cvs-serv4408/port/src/Port Modified Files: Handlers.hs Log Message: Rename WindowReLayout to ContainerReLayout Index: Handlers.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/Handlers.hs,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Handlers.hs 17 Jul 2003 19:30:03 -0000 1.26 --- Handlers.hs 24 Aug 2003 21:07:48 -0000 1.27 *************** *** 42,46 **** -- ** Events ! ,setWindowReLayoutHandler, setWindowReLayoutDefHandler, getWindowReLayoutHandler ,setWindowDismissHandler, setWindowDismissDefHandler, getWindowDismissHandler ,setWindowDestroyHandler, setWindowDestroyDefHandler, getWindowDestroyHandler --- 42,46 ---- -- ** Events ! ,setContainerReLayoutHandler,setContainerReLayoutDefHandler,getContainerReLayoutHandler ,setWindowDismissHandler, setWindowDismissDefHandler, getWindowDismissHandler ,setWindowDestroyHandler, setWindowDestroyDefHandler, getWindowDestroyHandler *************** *** 55,59 **** -- ** Fire events ! , fireWindowReLayout -- * Process events --- 55,59 ---- -- ** Fire events ! , fireContainerReLayout -- * Process events *************** *** 130,134 **** unregisterAllWindowHandlers :: WindowHandle -> IO () unregisterAllWindowHandlers hwnd ! = do setWindowReLayoutDefHandler hwnd setWindowDismissDefHandler hwnd setWindowDestroyDefHandler hwnd --- 130,134 ---- unregisterAllWindowHandlers :: WindowHandle -> IO () unregisterAllWindowHandlers hwnd ! = do setContainerReLayoutDefHandler hwnd setWindowDismissDefHandler hwnd setWindowDestroyDefHandler hwnd *************** *** 204,234 **** ----------------------------------------------------------------------------------------- ! -- WindowReLayout ----------------------------------------------------------------------------------------- ! {-# NOINLINE handlersWindowReLayout #-} ! handlersWindowReLayout :: MVar (PtrMap WindowHandle (IO ())) ! handlersWindowReLayout = unsafePerformIO (newMVar empty) ! setWindowReLayoutHandler :: WindowHandle -> IO () -> IO () ! setWindowReLayoutHandler hwnd handler ! = setHandler hwnd handler handlersWindowReLayout ! setWindowReLayoutDefHandler :: WindowHandle -> IO () ! setWindowReLayoutDefHandler hwnd ! = setDefHandler hwnd handlersWindowReLayout ! getWindowReLayoutHandler :: WindowHandle -> IO (IO ()) ! getWindowReLayoutHandler hwnd ! = getHandler hwnd (return ()) handlersWindowReLayout ! handleWindowReLayout :: WindowHandle -> IO () ! handleWindowReLayout hwnd ! = fireWindowReLayout hwnd ! fireWindowReLayout :: WindowHandle -> IO () ! fireWindowReLayout hwnd ! = invokeHandler hwnd handlersWindowReLayout id ----------------------------------------------------------------------------------------- --- 204,234 ---- ----------------------------------------------------------------------------------------- ! -- ContainerReLayout ----------------------------------------------------------------------------------------- ! {-# NOINLINE handlersContainerReLayout #-} ! handlersContainerReLayout :: MVar (PtrMap WindowHandle (IO ())) ! handlersContainerReLayout = unsafePerformIO (newMVar empty) ! setContainerReLayoutHandler :: WindowHandle -> IO () -> IO () ! setContainerReLayoutHandler hwnd handler ! = setHandler hwnd handler handlersContainerReLayout ! setContainerReLayoutDefHandler :: WindowHandle -> IO () ! setContainerReLayoutDefHandler hwnd ! = setDefHandler hwnd handlersContainerReLayout ! getContainerReLayoutHandler :: WindowHandle -> IO (IO ()) ! getContainerReLayoutHandler hwnd ! = getHandler hwnd (return ()) handlersContainerReLayout ! handleContainerReLayout :: WindowHandle -> IO () ! handleContainerReLayout hwnd ! = fireContainerReLayout hwnd ! fireContainerReLayout :: WindowHandle -> IO () ! fireContainerReLayout hwnd ! = invokeHandler hwnd handlersContainerReLayout id ----------------------------------------------------------------------------------------- *************** *** 774,778 **** -----------------------------------------------------------------------------------------} foreign export ccall handleWindowDismiss :: WindowHandle -> IO () - foreign export ccall handleWindowReLayout :: WindowHandle -> IO () foreign export ccall handleWindowDestroy :: WindowHandle -> IO () foreign export ccall handleWindowPaint :: WindowHandle -> CanvasHandle -> CInt -> CInt -> CInt -> CInt -> IO () --- 774,777 ---- *************** *** 783,786 **** --- 782,786 ---- foreign export ccall handleWindowDeactivate :: WindowHandle -> IO () foreign export ccall handleWindowActivate :: WindowHandle -> IO () + foreign export ccall handleContainerReLayout :: WindowHandle -> IO () foreign export ccall handleDialogDeactivate :: WindowHandle -> IO () foreign export ccall handleDialogActivate :: WindowHandle -> IO () |
From: <kr_...@us...> - 2003-08-24 21:07:51
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO In directory sc8-pr-cvs1:/tmp/cvs-serv4408/gio/src/Graphics/UI/GIO Modified Files: Controls.hs Window.hs Log Message: Rename WindowReLayout to ContainerReLayout Index: Controls.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Controls.hs,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Controls.hs 24 Aug 2003 19:02:45 -0000 1.26 --- Controls.hs 24 Aug 2003 21:07:48 -0000 1.27 *************** *** 681,685 **** autosize = readAttr "autosize" (\c -> return False) layoutSize = readAttr "layoutSize" (\c -> getVar (vlayout c) >>= getLayoutSize) ! relayout = newStdEvent cchandle Port.getWindowReLayoutHandler Port.setWindowReLayoutHandler Port.setWindowReLayoutDefHandler hwindow c = cchandle c --- 681,685 ---- autosize = readAttr "autosize" (\c -> return False) layoutSize = readAttr "layoutSize" (\c -> getVar (vlayout c) >>= getLayoutSize) ! relayout = newStdEvent cchandle Port.getContainerReLayoutHandler Port.setContainerReLayoutHandler Port.setContainerReLayoutDefHandler hwindow c = cchandle c *************** *** 769,773 **** autosize = readAttr "autosize" (\c -> return True) layoutSize = readAttr "layoutSize" (\c -> getVar (pglayout c) >>= getLayoutSize) ! relayout = newStdEvent pghandle Port.getWindowReLayoutHandler Port.setWindowReLayoutHandler Port.setWindowReLayoutDefHandler hwindow c = pghandle c --- 769,773 ---- autosize = readAttr "autosize" (\c -> return True) layoutSize = readAttr "layoutSize" (\c -> getVar (pglayout c) >>= getLayoutSize) ! relayout = newStdEvent pghandle Port.getContainerReLayoutHandler Port.setContainerReLayoutHandler Port.setContainerReLayoutDefHandler hwindow c = pghandle c Index: Window.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Window.hs,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Window.hs 24 Aug 2003 19:02:45 -0000 1.25 --- Window.hs 24 Aug 2003 21:07:48 -0000 1.26 *************** *** 180,183 **** autosize = varAttr vautosize layoutSize = readAttr "layoutSize" (\w -> getVar (vlayout w) >>= getLayoutSize) ! relayout = newStdEvent hwindow Lib.getWindowReLayoutHandler Lib.setWindowReLayoutHandler Lib.setWindowReLayoutDefHandler hwindow w = hwnd w --- 180,183 ---- autosize = varAttr vautosize layoutSize = readAttr "layoutSize" (\w -> getVar (vlayout w) >>= getLayoutSize) ! relayout = newStdEvent hwindow Lib.getContainerReLayoutHandler Lib.setContainerReLayoutHandler Lib.setContainerReLayoutDefHandler hwindow w = hwnd w |
From: <kr_...@us...> - 2003-08-24 21:05:20
|
Update of /cvsroot/htoolkit/gio/src/examples/simple In directory sc8-pr-cvs1:/tmp/cvs-serv4196/src/examples/simple Added Files: SimpleControls.hs Log Message: Add new example --- NEW FILE: SimpleControls.hs --- module Main where import Graphics.UI.GIO main = start "Controls" "1.0" SDI [] demo demo :: IO () demo = do w <- window [] nb <- notebook [] w -- Buttons page pg1 <- notebookPage [title =: "Buttons"] nb b1pg1 <- button [title =: "Button1", on command =: messageAlert "Button1 clicked"] pg1 b2pg1 <- button [title =: "Button2", on command =: messageAlert "Button2 clicked"] pg1 set pg1 [layout =: b1pg1 <<<< b2pg1] -- page 2 pg2 <- notebookPage [title =: "Edit"] nb lbl <- label [title =: "Comments"] pg2 edit <- entry [] pg2 chk <- checkBox [title =: "Read only", on command =: set edit [readOnly ~: not]] pg2 set pg2 [layout =: (lbl <<<< (hglue <<< chk)) ^^^ hfill (vfill (edit))] -- radio buttons rtop <- radioBox [title =: "top", on command =: set nb [labelsPosition =: PosTop ]] w rleft <- radioBox [title =: "left", on command =: set nb [labelsPosition =: PosLeft ]] w rbottom <- radioBox [title =: "bottom", on command =: set nb [labelsPosition =: PosBottom]] w rright <- radioBox [title =: "right", on command =: set nb [labelsPosition =: PosRight ]] w setRadioBoxGroup [rtop,rleft,rbottom,rright] e <- entry [readOnly =: True, title =: "Hello, world!"] w set w [layout =: (vertical [rtop,rleft,rbottom,rright] <<< vfill (hfill nb)) ^^^ hfill e] |
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 |
From: <kr_...@us...> - 2003-08-24 19:29:01
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv22705/src/cbits/Win32 Modified Files: Menu.c RadioBox.c ToolBar.c Log Message: bugfixes Index: Menu.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Menu.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Menu.c 23 Aug 2003 08:30:50 -0000 1.15 --- Menu.c 24 Aug 2003 19:28:57 -0000 1.16 *************** *** 251,254 **** --- 251,257 ---- MenuHandle child, handle, *phandle; + if (!(handles && *handles)) + return; + phandle=handles; for (;;) Index: RadioBox.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/RadioBox.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RadioBox.c 24 Aug 2003 10:50:18 -0000 1.5 --- RadioBox.c 24 Aug 2003 19:28:57 -0000 1.6 *************** *** 66,70 **** void osSetRadioBoxState(WindowHandle radiobox, BOOL state) { ! SendMessage(radiobox,BM_SETCHECK,state ? BST_CHECKED : BST_UNCHECKED,0); }; --- 66,86 ---- void osSetRadioBoxState(WindowHandle radiobox, BOOL state) { ! HWND hNextCtrl; ! ! if (state) ! { ! SendMessage(radiobox,BM_SETCHECK,BST_CHECKED,0); ! ! hNextCtrl = radiobox; ! for (;;) ! { ! hNextCtrl = (WindowHandle) GetWindowLong(hNextCtrl, GWL_USERDATA); ! if (hNextCtrl == radiobox) break; ! ! SendMessage(hNextCtrl,BM_SETCHECK,BST_UNCHECKED,0); ! } ! } ! else ! SendMessage(radiobox,BM_SETCHECK,BST_UNCHECKED,0); }; *************** *** 73,76 **** --- 89,95 ---- WindowHandle first, next, child, handle, *phandle; + if (!(handles && *handles)) + return; + phandle=handles; for (;;) *************** *** 87,90 **** --- 106,111 ---- } SetWindowLong(child, GWL_USERDATA, (LONG) first); + + SendMessage(handle,BM_SETCHECK,(handle == *handles) ? BST_CHECKED : BST_UNCHECKED,0); phandle++; Index: ToolBar.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/ToolBar.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ToolBar.c 23 Aug 2003 11:05:59 -0000 1.16 --- ToolBar.c 24 Aug 2003 19:28:57 -0000 1.17 *************** *** 911,914 **** --- 911,917 ---- ToolHandle next, handle, *phandle; + if (!(handles && *handles)) + return; + phandle=handles; for (;;) |
From: <kr_...@us...> - 2003-08-24 19:02:48
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv18393/port/src/cbits/Win32 Modified Files: Canvas.c Font.c Log Message: The new defaultFontDef function now returns the default font which is specified in Windows. The defaultPen function is renamed to windowPen and now the window and dialog pens have colors whichs are given from Windows settings. Index: Canvas.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Canvas.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Canvas.c 13 Jul 2003 16:12:43 -0000 1.8 --- Canvas.c 24 Aug 2003 19:02:45 -0000 1.9 *************** *** 596,597 **** --- 596,611 ---- } /* osGetScaleFactor */ + unsigned int osGetDialogColor() + { + return GetSysColor(COLOR_3DFACE); + } + + unsigned int osGetWindowColor() + { + return GetSysColor(COLOR_WINDOW); + } + + unsigned int osGetTextColor() + { + return GetSysColor(COLOR_WINDOWTEXT); + } Index: Font.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Font.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Font.c 21 Jan 2003 22:01:12 -0000 1.1 --- Font.c 24 Aug 2003 19:02:45 -0000 1.2 *************** *** 152,161 **** } ! FontHandle osCreateFont(char *face, int size, int weight, int style, BOOL IsUnderlined, BOOL IsStriked) { LOGFONT lf; HDC hDC; ! if (style != 0 && style != 1) return NULL; --- 152,161 ---- } ! FontHandle osCreateFont(char *face, int size, int weight, int style) { LOGFONT lf; HDC hDC; ! if (style & FONT_OBLIQUE) return NULL; *************** *** 167,175 **** DeleteDC(hDC); ! lf.lfHeight = -size; ! lf.lfWeight = weight; ! lf.lfItalic = style ? TRUE : FALSE; ! lf.lfUnderline = IsUnderlined; ! lf.lfStrikeOut = IsStriked; lf.lfWidth = 0; lf.lfEscapement = 0; --- 167,175 ---- DeleteDC(hDC); ! lf.lfHeight = -size; ! lf.lfWeight = weight; ! lf.lfItalic = (style & FONT_TYPE_MASK) != 0; ! lf.lfUnderline = (style & FONT_UNDERLINED) != 0; ! lf.lfStrikeOut = (style & FONT_STRIKED) != 0; lf.lfWidth = 0; lf.lfEscapement = 0; *************** *** 286,301 **** void osDefaultFontDef(char **face, int *size, int *weight, int *style) { ! *face = "Times"; ! *size = 10; ! *weight = 400; ! *style = 0; ! } ! void osDialogFontDef(char **face, int *size, int *weight, int *style) ! { ! *face = "MS Sans Serif"; ! *size = 8; ! *weight = 400; *style = 0; } --- 286,300 ---- void osDefaultFontDef(char **face, int *size, int *weight, int *style) { ! LOGFONT lf; ! GetObject(GetStockObject(DEFAULT_GUI_FONT), sizeof(LOGFONT), &lf); ! *face = lf.lfFaceName; ! *size = -lf.lfHeight; ! *weight = lf.lfWeight; ! *style = 0; + if (lf.lfItalic) *style |= FONT_ITALIC; + if (lf.lfUnderline) *style |= FONT_UNDERLINED; + if (lf.lfStrikeOut) *style |= FONT_STRIKED; } |
From: <kr_...@us...> - 2003-08-24 19:02:48
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO In directory sc8-pr-cvs1:/tmp/cvs-serv18393/gio/src/Graphics/UI/GIO Modified Files: Canvas.hs Controls.hs Font.hs Types.hs Window.hs Log Message: The new defaultFontDef function now returns the default font which is specified in Windows. The defaultPen function is renamed to windowPen and now the window and dialog pens have colors whichs are given from Windows settings. Index: Canvas.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Canvas.hs,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Canvas.hs 8 Jun 2003 19:42:13 -0000 1.13 --- Canvas.hs 24 Aug 2003 19:02:45 -0000 1.14 *************** *** 73,77 **** import qualified Graphics.UI.Port as Port ! import Graphics.UI.Port( Pen(..), defaultPen ) import Graphics.UI.GIO.Types import Graphics.UI.GIO.Attributes --- 73,77 ---- import qualified Graphics.UI.Port as Port ! import Graphics.UI.Port( Pen(..) ) import Graphics.UI.GIO.Types import Graphics.UI.GIO.Attributes *************** *** 111,115 **** -- | The font metrics (read-only). -- ! -- > do metrics <- get canvas (fontMetrics dialogFont) -- fontMetrics :: Font -> Attr Canvas FontMetrics --- 111,115 ---- -- | The font metrics (read-only). -- ! -- > do metrics <- get canvas (fontMetrics defaultFont) -- fontMetrics :: Font -> Attr Canvas FontMetrics Index: Controls.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Controls.hs,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Controls.hs 24 Aug 2003 16:48:48 -0000 1.25 --- Controls.hs 24 Aug 2003 19:02:45 -0000 1.26 *************** *** 598,602 **** vlayout <- newVar empty vdomain <- newVar (sz 0 0) ! vpen <- newVar defaultPen vbufferMode<- newVar UnBuffered return (CompoundControl cchandle (hwindow w) vdomain vautosize vpen vbufferMode vpaint vlayout) --- 598,602 ---- vlayout <- newVar empty vdomain <- newVar (sz 0 0) ! vpen <- newVar windowPen vbufferMode<- newVar UnBuffered return (CompoundControl cchandle (hwindow w) vdomain vautosize vpen vbufferMode vpaint vlayout) Index: Font.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Font.hs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Font.hs 1 Jun 2003 09:42:31 -0000 1.2 --- Font.hs 24 Aug 2003 19:02:45 -0000 1.3 *************** *** 16,20 **** createFont , defaultFont - , dialogFont -- * Enumerate --- 16,19 ---- *************** *** 23,27 **** -- * Standard font definitions. , defaultFontDef - , dialogFontDef , serifFontDef , sansSerifFontDef --- 22,25 ---- Index: Types.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Types.hs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Types.hs 23 Aug 2003 18:03:57 -0000 1.16 --- Types.hs 24 Aug 2003 19:02:45 -0000 1.17 *************** *** 85,89 **** , LineStyle(..) , HatchStyle(..) ! , Pen(..), defaultPen, dialogPen -- ** Fonts --- 85,89 ---- , LineStyle(..) , HatchStyle(..) ! , Pen(..), windowPen, dialogPen -- ** Fonts *************** *** 116,120 **** import Graphics.UI.Port.Types import Graphics.UI.Port.Colors ! import Graphics.UI.Port.Canvas(Pen(..), defaultPen, dialogPen) import Control.Concurrent.MVar {-------------------------------------------------------------------- --- 116,120 ---- import Graphics.UI.Port.Types import Graphics.UI.Port.Colors ! import Graphics.UI.Port.Canvas(Pen(..), windowPen, dialogPen) import Control.Concurrent.MVar {-------------------------------------------------------------------- Index: Window.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Window.hs,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Window.hs 23 Aug 2003 00:04:47 -0000 1.24 --- Window.hs 24 Aug 2003 19:02:45 -0000 1.25 *************** *** 38,43 **** window :: [Prop Window] -> IO Window window props ! = do w <- Lib.createWindow >>= form defaultPen ! set w [bgcolor =: white] set w props Lib.showWindow (hwindow w) --- 38,42 ---- window :: [Prop Window] -> IO Window window props ! = do w <- Lib.createWindow >>= form windowPen set w props Lib.showWindow (hwindow w) |
From: <kr_...@us...> - 2003-08-24 19:02:48
|
Update of /cvsroot/htoolkit/port/src/include In directory sc8-pr-cvs1:/tmp/cvs-serv18393/port/src/include Modified Files: Canvas.h Font.h Types.h Log Message: The new defaultFontDef function now returns the default font which is specified in Windows. The defaultPen function is renamed to windowPen and now the window and dialog pens have colors whichs are given from Windows settings. Index: Canvas.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/include/Canvas.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Canvas.h 3 Feb 2003 16:53:41 -0000 1.6 --- Canvas.h 24 Aug 2003 19:02:45 -0000 1.7 *************** *** 58,60 **** --- 58,64 ---- extern void osGetScaleFactor(CanvasHandle canvas,int*,int*,int*,int*); + unsigned int osGetDialogColor(); + unsigned int osGetWindowColor(); + unsigned int osGetTextColor(); + #endif Index: Font.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/include/Font.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Font.h 22 Jan 2003 01:21:12 -0000 1.2 --- Font.h 24 Aug 2003 19:02:45 -0000 1.3 *************** *** 4,11 **** #include "Types.h" extern char *osGetAvailableFontNames(); extern int *osGetAvailableFontVariants(char *szFontName, int nLow, int nHigh); ! extern FontHandle osCreateFont(char *face, int size, int weight, int style, BOOL IsUnderlined, BOOL IsStriked); extern void osDeleteFont(FontHandle font); --- 4,22 ---- #include "Types.h" + // the following types are exqlusive + #define FONT_NORMAL 0x00 + #define FONT_ITALIC 0x01 + #define FONT_OBLIQUE 0x02 + + // types mask + #define FONT_TYPE_MASK 0x03 + + #define FONT_UNDERLINED 0x04 + #define FONT_STRIKED 0x08 + extern char *osGetAvailableFontNames(); extern int *osGetAvailableFontVariants(char *szFontName, int nLow, int nHigh); ! extern FontHandle osCreateFont(char *face, int size, int weight, int style); extern void osDeleteFont(FontHandle font); *************** *** 18,22 **** extern int osGetFontCharWidth(char,FontHandle font,CanvasHandle canvas); - extern void osDialogFontDef(char **face, int *size, int *weight, int *style); extern void osDefaultFontDef(char **face, int *size, int *weight, int *style); extern void osSerifFontDef(char **face, int *size, int *weight, int *style); --- 29,32 ---- Index: Types.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/include/Types.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Types.h 23 Aug 2003 11:05:59 -0000 1.16 --- Types.h 24 Aug 2003 19:02:45 -0000 1.17 *************** *** 103,108 **** PangoFontDescription *font_descr; PangoFontMetrics *metrics; ! ! gboolean IsUnderlined, IsStriked; } *FontHandle; --- 103,107 ---- PangoFontDescription *font_descr; PangoFontMetrics *metrics; ! gint style; } *FontHandle; |
From: <kr_...@us...> - 2003-08-24 19:02:47
|
Update of /cvsroot/htoolkit/port/src/Port In directory sc8-pr-cvs1:/tmp/cvs-serv18393/port/src/Port Modified Files: Canvas.hs Colors.hs Font.hs Types.hs Window.hs Log Message: The new defaultFontDef function now returns the default font which is specified in Windows. The defaultPen function is renamed to windowPen and now the window and dialog pens have colors whichs are given from Windows settings. Index: Canvas.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/Canvas.hs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Canvas.hs 17 Jul 2003 19:30:03 -0000 1.16 --- Canvas.hs 24 Aug 2003 19:02:45 -0000 1.17 *************** *** 42,46 **** -- * Pen ! , Pen(..), defaultPen, dialogPen -- ** Font --- 42,46 ---- -- * Pen ! , Pen(..), windowPen, dialogPen -- ** Font *************** *** 81,97 **** deriving Eq ! -- | Create a pen with default drawing values. That is: -- ! -- @'Pen'@ 1 @'DrawCopy'@ @'black'@ @'white'@ @'False'@ @'defaultFont'@ @'JoinMiter'@ @'CapFlat'@ @'LineSolid'@ @'HatchSolid'@ ! defaultPen :: Pen ! defaultPen ! = Pen 1 DrawCopy black white False defaultFont JoinMiter CapFlat LineSolid HatchSolid -- | Create a pen with default drawing values for dialogs. That is: -- ! -- @'Pen'@ 1 @'DrawCopy'@ @'black'@ @'dialoggrey'@ @'False'@ @'dialogFont'@ @'JoinMiter'@ @'CapFlat'@ @'LineSolid'@ @'HatchSolid'@ dialogPen :: Pen dialogPen ! = Pen 1 DrawCopy black dialoggray False dialogFont JoinMiter CapFlat LineSolid HatchSolid --- 81,97 ---- deriving Eq ! -- | Create a pen with default drawing values for windows. That is: -- ! -- @'Pen'@ 1 @'DrawCopy'@ @'textColor'@ @'windowColor'@ @'False'@ @'windowColor'@ @'JoinMiter'@ @'CapFlat'@ @'LineSolid'@ @'HatchSolid'@ ! windowPen :: Pen ! windowPen ! = Pen 1 DrawCopy textColor windowColor False defaultFont JoinMiter CapFlat LineSolid HatchSolid -- | Create a pen with default drawing values for dialogs. That is: -- ! -- @'Pen'@ 1 @'DrawCopy'@ @'textColor'@ @'dialogColor'@ @'False'@ @'dialogFont'@ @'JoinMiter'@ @'CapFlat'@ @'LineSolid'@ @'HatchSolid'@ dialogPen :: Pen dialogPen ! = Pen 1 DrawCopy textColor dialogColor False defaultFont JoinMiter CapFlat LineSolid HatchSolid Index: Colors.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/Colors.hs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Colors.hs 1 Jun 2003 13:00:09 -0000 1.3 --- Colors.hs 24 Aug 2003 19:02:45 -0000 1.4 *************** *** 1,3 **** ! {-# OPTIONS -fglasgow-exts #-} ----------------------------------------------------------------------------------------- {-| Module : Colors --- 1,3 ---- ! {-# OPTIONS -fglasgow-exts -#include Canvas.h #-} ----------------------------------------------------------------------------------------- {-| Module : Colors *************** *** 49,53 **** , snow, springgreen, steelblue, teal, thistle, tomato , turquoise, violet, wheat, white, whitesmoke, yellow ! , yellowgreen, dialoggray -- * Marshalling , CColor, fromCColor, toCColor --- 49,55 ---- , snow, springgreen, steelblue, teal, thistle, tomato , turquoise, violet, wheat, white, whitesmoke, yellow ! , yellowgreen ! -- * GUI specific colors ! , dialogColor, windowColor, textColor -- * Marshalling , CColor, fromCColor, toCColor *************** *** 60,63 **** --- 62,66 ---- import Text.Read import Text.ParserCombinators.ReadPrec + import System.IO.Unsafe(unsafePerformIO) newtype Color = Color Word deriving Eq *************** *** 204,208 **** | c == yellow = showString "yellow" | c == yellowgreen = showString "yellowgreen" - | c == dialoggray = showString "dialoggray" | otherwise = showParen (d > 0) (showString "rgbColor " . shows (colorRed c) . --- 207,210 ---- *************** *** 351,355 **** do { Ident "yellow" <- lexP; return yellow } +++ do { Ident "yellowgreen" <- lexP; return yellowgreen } +++ - do { Ident "dialoggray" <- lexP; return dialoggray } +++ parens ( prec 10 --- 353,356 ---- *************** *** 434,438 **** snow, springgreen, steelblue, teal, thistle, tomato, turquoise, violet, wheat, white, whitesmoke, yellow, ! yellowgreen, dialoggray :: Color aliceblue = Color 0xFFF8F0 --- 435,439 ---- snow, springgreen, steelblue, teal, thistle, tomato, turquoise, violet, wheat, white, whitesmoke, yellow, ! yellowgreen :: Color aliceblue = Color 0xFFF8F0 *************** *** 575,580 **** yellow = Color 0x00FFFF yellowgreen = Color 0x32CD9A - dialoggray = Color 0xC8D0D4 -- marshalling --- 576,598 ---- yellow = Color 0x00FFFF yellowgreen = Color 0x32CD9A + {-# NOINLINE dialogColor #-} + -- | the default color for dialogs + dialogColor :: Color + dialogColor = fromCColor (unsafePerformIO osGetDialogColor) + foreign import ccall osGetDialogColor :: IO CColor + + {-# NOINLINE windowColor #-} + -- | the default color for dialogs + windowColor :: Color + windowColor = fromCColor (unsafePerformIO osGetWindowColor) + foreign import ccall osGetWindowColor :: IO CColor + + {-# NOINLINE textColor #-} + -- | the default text color + textColor :: Color + textColor = fromCColor (unsafePerformIO osGetTextColor) + foreign import ccall osGetTextColor :: IO CColor + -- marshalling Index: Font.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/Font.hs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Font.hs 17 Jul 2003 19:30:03 -0000 1.6 --- Font.hs 24 Aug 2003 19:02:45 -0000 1.7 *************** *** 17,21 **** createFont , defaultFont - , dialogFont -- * Metrics (on a certain canvas). --- 17,20 ---- *************** *** 29,33 **** -- * Standard font definitions. , defaultFontDef - , dialogFontDef , serifFontDef , sansSerifFontDef --- 28,31 ---- *************** *** 59,67 **** createFont :: FontDef -> IO Font createFont fontDef ! = withCFontDef fontDef $ \cname csize cweight cstyle cunderline cstrikeout -> ! do handle <- osCreateFont cname csize cweight cstyle cunderline cstrikeout when (nullPtr == handle) (ioError (mkIOError doesNotExistErrorType "createFont" Nothing (Just (show fontDef)))) fromCFont fontDef handle ! foreign import ccall osCreateFont :: CString -> CInt -> CInt -> CInt -> CBool -> CBool -> IO FontHandle --- 57,65 ---- createFont :: FontDef -> IO Font createFont fontDef ! = withCFontDef fontDef $ \cname csize cweight cstyle -> ! do handle <- osCreateFont cname csize cweight cstyle when (nullPtr == handle) (ioError (mkIOError doesNotExistErrorType "createFont" Nothing (Just (show fontDef)))) fromCFont fontDef handle ! foreign import ccall osCreateFont :: CString -> CInt -> CInt -> CInt -> IO FontHandle *************** *** 103,106 **** --- 101,106 ---- allFontSizes = [low'..high'] + fst3 (x,y,z) = x + decodeVariants :: Ptr CInt -> IO (FiniteMap (FontWeight, FontStyle) [FontSize]) decodeVariants pints *************** *** 115,119 **** variants <- decodeVariants (pints `plusPtr` (sizeOf cweight * 3)) let sizes = if csize == 0 then allFontSizes else [fromCInt csize] ! return (addToFM_C (foldr insertUniq) variants (fromCWeight cweight,fromCStyle cstyle) sizes) foreign import ccall osGetAvailableFontVariants :: CString -> CInt -> CInt -> IO (Ptr CInt); --- 115,119 ---- variants <- decodeVariants (pints `plusPtr` (sizeOf cweight * 3)) let sizes = if csize == 0 then allFontSizes else [fromCInt csize] ! return (addToFM_C (foldr insertUniq) variants (fromCWeight cweight,fst3 (fromCStyle cstyle)) sizes) foreign import ccall osGetAvailableFontVariants :: CString -> CInt -> CInt -> IO (Ptr CInt); *************** *** 157,167 **** createFont defaultFontDef - {-# NOINLINE dialogFont #-} - -- | The default dialog font. - dialogFont :: Font - dialogFont - = unsafePerformIO $ - createFont dialogFontDef - {-# NOINLINE defaultFontDef #-} defaultFontDef :: FontDef --- 157,160 ---- *************** *** 171,182 **** osDefaultFontDef pname psize pweight pstyle foreign import ccall osDefaultFontDef :: Ptr CString -> Ptr CInt -> Ptr CInt -> Ptr CInt -> IO () - - {-# NOINLINE dialogFontDef #-} - dialogFontDef :: FontDef - dialogFontDef - = unsafePerformIO $ - withCFontDefResult $ \pname psize pweight pstyle punderline pstrikeout -> - osDialogFontDef pname psize pweight pstyle - foreign import ccall osDialogFontDef :: Ptr CString -> Ptr CInt -> Ptr CInt -> Ptr CInt -> IO () {-# NOINLINE serifFontDef #-} --- 164,167 ---- Index: Types.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/Types.hs,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** Types.hs 23 Aug 2003 18:03:57 -0000 1.31 --- Types.hs 24 Aug 2003 19:02:45 -0000 1.32 *************** *** 939,955 **** foreign import ccall "&osDeleteFont" osDeleteFont :: FinalizerPtr FH ! toCStyle :: FontStyle -> CInt ! toCStyle style ! = case style of ! Oblique -> toCInt 2 ! Italic -> toCInt 1 ! other -> toCInt 0 ! fromCStyle :: CInt -> FontStyle fromCStyle ci ! = case ci of ! 2 -> Oblique ! 1 -> Italic ! _ -> Roman toCWeight :: Int -> CInt --- 939,960 ---- foreign import ccall "&osDeleteFont" osDeleteFont :: FinalizerPtr FH ! toCStyle :: FontStyle -> Bool -> Bool -> CInt ! toCStyle style underline strikeout ! = (case style of ! Oblique -> toCInt 2 ! Italic -> toCInt 1 ! other -> toCInt 0) ! .|. (if underline then 4 else 0) ! .|. (if strikeout then 8 else 0) ! fromCStyle :: CInt -> (FontStyle,Bool,Bool) fromCStyle ci ! = (case ci of ! 2 -> Oblique ! 1 -> Italic ! _ -> Roman ! , ci .&. 4 /= 0 ! , ci .&. 8 /= 0 ! ) toCWeight :: Int -> CInt *************** *** 961,972 **** = min fontMaxWeight (max fontMinWeight (fromCInt w)) ! withCFontDef :: FontDef -> (CString -> CInt -> CInt -> CInt -> CBool -> CBool -> IO a) -> IO a withCFontDef (FontDef name size weight style underline strikeout) f = withCString name $ \cname -> f cname (toCInt size) (toCInt (min fontMaxWeight (max fontMinWeight weight))) ! (toCStyle style) ! (toCBool underline) ! (toCBool strikeout) withCFontDefResult :: (Ptr CString -> Ptr CInt -> Ptr CInt -> Ptr CInt -> Ptr CBool -> Ptr CBool -> IO ()) -> IO FontDef --- 966,975 ---- = min fontMaxWeight (max fontMinWeight (fromCInt w)) ! withCFontDef :: FontDef -> (CString -> CInt -> CInt -> CInt -> IO a) -> IO a withCFontDef (FontDef name size weight style underline strikeout) f = withCString name $ \cname -> f cname (toCInt size) (toCInt (min fontMaxWeight (max fontMinWeight weight))) ! (toCStyle style underline strikeout) withCFontDefResult :: (Ptr CString -> Ptr CInt -> Ptr CInt -> Ptr CInt -> Ptr CBool -> Ptr CBool -> IO ()) -> IO FontDef *************** *** 992,997 **** fromCFontDef cname csize cweight cstyle cunderline cstrikeout = do name <- peekCString cname ! return (FontDef name (fromCInt csize) (fromCWeight cweight) (fromCStyle cstyle) ! (fromCBool cunderline) (fromCBool cstrikeout)) withCFontMetricsResult :: (Ptr CInt -> Ptr CInt -> Ptr CInt -> Ptr CInt -> IO ()) -> IO FontMetrics --- 995,1000 ---- fromCFontDef cname csize cweight cstyle cunderline cstrikeout = do name <- peekCString cname ! let (style,underlined,striked) = fromCStyle cstyle ! return (FontDef name (fromCInt csize) (fromCWeight cweight) style underlined striked) withCFontMetricsResult :: (Ptr CInt -> Ptr CInt -> Ptr CInt -> Ptr CInt -> IO ()) -> IO FontMetrics Index: Window.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/Window.hs,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Window.hs 23 Aug 2003 20:05:00 -0000 1.14 --- Window.hs 24 Aug 2003 19:02:45 -0000 1.15 *************** *** 46,50 **** import Graphics.UI.Port.PtrMap import Graphics.UI.Port.Types ! import Graphics.UI.Port.Canvas(withCanvas, defaultPen, dialogPen) import Graphics.UI.Port.Handlers( getAllWindowHandles, registerWindow, setWindowDismissHandler, setWindowPaintHandler ) --- 46,50 ---- import Graphics.UI.Port.PtrMap import Graphics.UI.Port.Types ! import Graphics.UI.Port.Canvas(withCanvas, windowPen, dialogPen) import Graphics.UI.Port.Handlers( getAllWindowHandles, registerWindow, setWindowDismissHandler, setWindowPaintHandler ) *************** *** 87,91 **** return hwnd where ! onpaint canvas rect = withCanvas defaultPen UnBuffered canvas (return ()) foreign import ccall osCreateWindow :: IO WindowHandle --- 87,91 ---- return hwnd where ! onpaint canvas rect = withCanvas windowPen UnBuffered canvas (return ()) foreign import ccall osCreateWindow :: IO WindowHandle |
From: <kr_...@us...> - 2003-08-24 19:02:47
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK In directory sc8-pr-cvs1:/tmp/cvs-serv18393/port/src/cbits/GTK Modified Files: Canvas.c Font.c Log Message: The new defaultFontDef function now returns the default font which is specified in Windows. The defaultPen function is renamed to windowPen and now the window and dialog pens have colors whichs are given from Windows settings. Index: Canvas.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Canvas.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Canvas.c 13 Jul 2003 16:12:43 -0000 1.12 --- Canvas.c 24 Aug 2003 19:02:45 -0000 1.13 *************** *** 512,516 **** static void osSetupFont(FontHandle font, int len) { ! if (font->IsUnderlined || font->IsStriked) { PangoAttribute *attr; --- 512,516 ---- static void osSetupFont(FontHandle font, int len) { ! if (font->style & (FONT_UNDERLINED | FONT_STRIKED)) { PangoAttribute *attr; *************** *** 520,524 **** attr_list = pango_layout_get_attributes(font->layout); ! if (font->IsUnderlined) { attr = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE); --- 520,524 ---- attr_list = pango_layout_get_attributes(font->layout); ! if (font->style & FONT_UNDERLINED) { attr = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE); *************** *** 529,533 **** } ! if (font->IsStriked) { attr = pango_attr_strikethrough_new(gtk_true()); --- 529,533 ---- } ! if (font->style & FONT_STRIKED) { attr = pango_attr_strikethrough_new(gtk_true()); Index: Font.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Font.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Font.c 3 Mar 2003 00:14:10 -0000 1.4 --- Font.c 24 Aug 2003 19:02:45 -0000 1.5 *************** *** 90,94 **** } ! FontHandle osCreateFont(char *face, int size, int weight, int style, BOOL IsUnderlined, BOOL IsStriked) { FontHandle font; --- 90,94 ---- } ! FontHandle osCreateFont(char *face, int size, int weight, int style) { FontHandle font; *************** *** 106,110 **** pango_font_description_set_family(font->font_descr,face); pango_font_description_set_weight(font->font_descr,weight); ! pango_font_description_set_style(font->font_descr,style); pango_font_description_set_size(font->font_descr, size*PANGO_SCALE); --- 106,110 ---- pango_font_description_set_family(font->font_descr,face); pango_font_description_set_weight(font->font_descr,weight); ! pango_font_description_set_style(font->font_descr,style & FONT_TYPE_MASK); pango_font_description_set_size(font->font_descr, size*PANGO_SCALE); *************** *** 118,125 **** font->metrics = pango_font_get_metrics(pango_font, pango_context_get_language(pango_context)); ! font->IsUnderlined = IsUnderlined; ! font->IsStriked = IsStriked; ! if (font->IsUnderlined || font->IsStriked) pango_layout_set_attributes(font->layout, pango_attr_list_new()); --- 118,124 ---- font->metrics = pango_font_get_metrics(pango_font, pango_context_get_language(pango_context)); ! font->style = style; ! if (font->style & (FONT_UNDERLINED | FONT_STRIKED)) pango_layout_set_attributes(font->layout, pango_attr_list_new()); *************** *** 201,212 **** { *face = "helvetica"; - *size = 12; - *weight = 500; - *style = 0; - } - - void osDialogFontDef(char **face, int *size, int *weight, int *style) - { - *face = "helvetica"; *size = 12; *weight = 500; --- 200,203 ---- |
From: <kr_...@us...> - 2003-08-24 19:01:24
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO In directory sc8-pr-cvs1:/tmp/cvs-serv30210/src/Graphics/UI/GIO Modified Files: Controls.hs Log Message: Add Checked instance for NotebookPage Index: Controls.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Controls.hs,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Controls.hs 24 Aug 2003 14:21:01 -0000 1.24 --- Controls.hs 24 Aug 2003 16:48:48 -0000 1.25 *************** *** 778,781 **** --- 778,793 ---- pos = readAttr "pos" (Port.getNotebookPagePos . pghandle) + instance Checked NotebookPage where + checked = newAttr getChecked setChecked + where + getChecked p = do + index <- Port.getNotebookPagePos (pghandle p) + sel <- Port.getNotebookSelection (pgparent p) + return (index == sel) + + setChecked p _ = do + index <- Port.getNotebookPagePos (pghandle p) + Port.setNotebookSelection (pgparent p)index + instance Deadly NotebookPage where destroyWidget w = Port.destroyNotebookPage (pghandle w) |
From: <kr_...@us...> - 2003-08-24 18:45:46
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv11621/src/cbits/Win32 Modified Files: CheckBox.c RadioBox.c Log Message: Better implementation for *ReqSize* functions Index: CheckBox.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/CheckBox.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CheckBox.c 21 Aug 2003 17:34:01 -0000 1.4 --- CheckBox.c 24 Aug 2003 10:50:18 -0000 1.5 *************** *** 24,27 **** --- 24,28 ---- SIZE sz; TEXTMETRIC tm; + HFONT hOldFont; HDC hDC = GetDC(checkbox); int nLen = GetWindowTextLength(checkbox); *************** *** 29,39 **** nLen = GetWindowText(checkbox, buffer, nLen+1); GetTextExtentPoint32(hDC, buffer, nLen, &sz); GetTextMetrics(hDC, &tm); rfree(buffer); ReleaseDC(checkbox, hDC); ! res[0] = sz.cx + ((tm.tmHeight+tm.tmDescent)*3)/2; res[1] = tm.tmHeight+tm.tmDescent; }; --- 30,44 ---- nLen = GetWindowText(checkbox, buffer, nLen+1); + hOldFont = SelectObject(hDC, (HFONT) SendMessage(checkbox, WM_GETFONT, 0, 0)); + GetTextExtentPoint32(hDC, buffer, nLen, &sz); GetTextMetrics(hDC, &tm); + + SelectObject(hDC, hOldFont); rfree(buffer); ReleaseDC(checkbox, hDC); ! res[0] = sz.cx + 32; res[1] = tm.tmHeight+tm.tmDescent; }; Index: RadioBox.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/RadioBox.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RadioBox.c 21 Aug 2003 17:34:01 -0000 1.4 --- RadioBox.c 24 Aug 2003 10:50:18 -0000 1.5 *************** *** 5,11 **** WindowHandle osCreateRadioBox(WindowHandle window) { ! HWND hCheckBox; ! hCheckBox = CreateWindow( "BUTTON", NULL, --- 5,11 ---- WindowHandle osCreateRadioBox(WindowHandle window) { ! HWND hRadioBox; ! hRadioBox = CreateWindow( "BUTTON", NULL, *************** *** 17,22 **** NULL ); ! SetWindowLong(hCheckBox, GWL_USERDATA, (LONG) hCheckBox); ! return checkWindow(hCheckBox, "RADIOBOX"); }; --- 17,22 ---- NULL ); ! SetWindowLong(hRadioBox, GWL_USERDATA, (LONG) hRadioBox); ! return checkWindow(hRadioBox, "RADIOBOX"); }; *************** *** 25,28 **** --- 25,29 ---- SIZE sz; TEXTMETRIC tm; + HFONT hOldFont; HDC hDC = GetDC(radiobox); int nLen = GetWindowTextLength(radiobox); *************** *** 30,40 **** nLen = GetWindowText(radiobox, buffer, nLen+1); GetTextExtentPoint32(hDC, buffer, nLen, &sz); GetTextMetrics(hDC, &tm); rfree(buffer); ReleaseDC(radiobox, hDC); ! res[0] = sz.cx + ((tm.tmHeight+tm.tmDescent)*3)/2; res[1] = tm.tmHeight+tm.tmDescent; }; --- 31,45 ---- nLen = GetWindowText(radiobox, buffer, nLen+1); + hOldFont = SelectObject(hDC, (HFONT) SendMessage(radiobox, WM_GETFONT, 0, 0)); + GetTextExtentPoint32(hDC, buffer, nLen, &sz); GetTextMetrics(hDC, &tm); + + SelectObject(hDC, hOldFont); rfree(buffer); ReleaseDC(radiobox, hDC); ! res[0] = sz.cx + 32; res[1] = tm.tmHeight+tm.tmDescent; }; |
From: <kr_...@us...> - 2003-08-24 17:57:52
|
Update of /cvsroot/htoolkit/gio/src/examples/simple In directory sc8-pr-cvs1:/tmp/cvs-serv18920 Modified Files: Hanoi.hs Log Message: Replace drawInWindow with paintIn function. Index: Hanoi.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/examples/simple/Hanoi.hs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Hanoi.hs 15 Aug 2003 21:24:54 -0000 1.3 --- Hanoi.hs 24 Aug 2003 15:35:56 -0000 1.4 *************** *** 84,88 **** set timer [enabled =: False] stepHanoi towers = do ! drawInWindow UnBuffered w drawf writeIORef ref towers1 where --- 84,88 ---- set timer [enabled =: False] stepHanoi towers = do ! paintIn w UnBuffered drawf writeIORef ref towers1 where |
From: <kr_...@us...> - 2003-08-24 17:02:42
|
Update of /cvsroot/htoolkit/port In directory sc8-pr-cvs1:/tmp/cvs-serv6171/port Modified Files: makefile Log Message: Implementation for Notebook control Index: makefile =================================================================== RCS file: /cvsroot/htoolkit/port/makefile,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** makefile 23 Aug 2003 11:15:34 -0000 1.34 --- makefile 24 Aug 2003 13:57:33 -0000 1.35 *************** *** 48,52 **** FileDialog.c ColorDialog.c FontDialog.c AboutDialog.c PopUp.c Canvas.c Menu.c ListBox.c \ Label.c Font.c RadioBox.c Timer.c Frame.c Message.c Slider.c ProgressBar.c ConfigKey.c \ ! ToolBar.c ifeq "$(GUILIB)" "WIN32" --- 48,52 ---- FileDialog.c ColorDialog.c FontDialog.c AboutDialog.c PopUp.c Canvas.c Menu.c ListBox.c \ Label.c Font.c RadioBox.c Timer.c Frame.c Message.c Slider.c ProgressBar.c ConfigKey.c \ ! ToolBar.c Notebook.c ifeq "$(GUILIB)" "WIN32" |
From: <kr_...@us...> - 2003-08-24 11:44:54
|
Update of /cvsroot/htoolkit/gio In directory sc8-pr-cvs1:/tmp/cvs-serv18308 Modified Files: makefile Log Message: bugfix Index: makefile =================================================================== RCS file: /cvsroot/htoolkit/gio/makefile,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** makefile 16 Aug 2003 09:54:28 -0000 1.14 --- makefile 24 Aug 2003 11:44:51 -0000 1.15 *************** *** 96,100 **** # main, object files, dependencies and hi files MAINLIB = $(BUILDDIR)/libHS$(MAIN).a ! MAINOBJ = $(BUILDDIR)/HS$(MAIN).o HOBJS = $(patsubst %.hs,$(HOUTDIR)/%.o, $(HSOURCES)) --- 96,100 ---- # main, object files, dependencies and hi files MAINLIB = $(BUILDDIR)/libHS$(MAIN).a ! MAINOBJ = HS$(MAIN).o HOBJS = $(patsubst %.hs,$(HOUTDIR)/%.o, $(HSOURCES)) |
From: <kr_...@us...> - 2003-08-24 11:30:18
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv16601/src/cbits/Win32 Modified Files: Window.c Log Message: bugfix Index: Window.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Window.c,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** Window.c 21 Aug 2003 17:34:01 -0000 1.40 --- Window.c 24 Aug 2003 11:30:14 -0000 1.41 *************** *** 826,831 **** LOGBRUSH lb; WindowData *pData = (WindowData *) GetWindowLong(window,GWL_USERDATA); - pData->backColor = backColor; - pData->foreColor = foreColor; if (pData->backColor != backColor || --- 826,829 ---- *************** *** 835,842 **** if (pData->hBackBrush) DeleteObject(pData->hBackBrush); ! lb.lbColor = pData->backColor; SetupLogBrush(&lb, FALSE, pData->hatchStyle, pData->patBmp); pData->hBackBrush = CreateBrushIndirect(&lb); } } --- 833,843 ---- if (pData->hBackBrush) DeleteObject(pData->hBackBrush); ! lb.lbColor = backColor; SetupLogBrush(&lb, FALSE, pData->hatchStyle, pData->patBmp); pData->hBackBrush = CreateBrushIndirect(&lb); } + + pData->backColor = backColor; + pData->foreColor = foreColor; } |