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-10-11 08:50:58
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32
In directory sc8-pr-cvs1:/tmp/cvs-serv15983/src/cbits/Win32
Modified Files:
Window.c
Log Message:
Add size grippers to resizeable dialogs
Index: Window.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Window.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -C2 -d -r1.55 -r1.56
*** Window.c 10 Oct 2003 22:55:13 -0000 1.55
--- Window.c 11 Oct 2003 08:50:54 -0000 1.56
***************
*** 23,26 ****
--- 23,27 ----
HWND hTooltip;
+ HWND hGripWnd;
} WindowData;
***************
*** 126,129 ****
--- 127,159 ----
}
+ static void EnableGripWindow(HWND hWnd, BOOL bEnabled)
+ {
+ WindowData *pData = (WindowData *) GetWindowLong(hWnd,GWL_USERDATA);
+
+ if (GetParent(hWnd) != NULL)
+ return;
+
+ if (bEnabled)
+ {
+ if (pData->hGripWnd)
+ return;
+
+ pData->hGripWnd =
+ CreateWindow("SCROLLBAR",
+ NULL,
+ WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | SBS_SIZEGRIP,
+ 0,0,0,0,
+ hWnd,
+ NULL,
+ ghModule,
+ NULL);
+ }
+ else
+ {
+ DestroyWindow(pData->hGripWnd);
+ pData->hGripWnd = NULL;
+ }
+ }
+
LRESULT CALLBACK HWindowSharedFunction(WNDPROC pDefWindowProc, HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
***************
*** 153,156 ****
--- 183,187 ----
pData->disabledCtrls = NULL;
pData->hTooltip = NULL;
+ pData->hGripWnd = NULL;
SetWindowLong(hWnd,GWL_USERDATA,(LONG) pData);
***************
*** 662,667 ****
LRESULT CALLBACK HDialogFunction(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
! {
case WM_DESTROY:
{
--- 693,701 ----
LRESULT CALLBACK HDialogFunction(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
+ LRESULT lResult;
+ WindowData *pData = (WindowData *) GetWindowLong(hWnd,GWL_USERDATA);
+
switch (uMsg)
! {
case WM_DESTROY:
{
***************
*** 690,694 ****
}
! return HWindowSharedFunction(DefDlgProc, hWnd, uMsg, wParam, lParam);
}
--- 724,749 ----
}
! lResult = HWindowSharedFunction(DefDlgProc, hWnd, uMsg, wParam, lParam);
!
! switch (uMsg)
! {
! case WM_CREATE:
! EnableGripWindow(hWnd, TRUE);
! break;
! case WM_SIZE:
! if (pData->hGripWnd)
! {
! int nWidth = LOWORD(lParam);
! int nHeight = HIWORD(lParam);
! int nGripWidth = GetSystemMetrics(SM_CXVSCROLL);
! int nGripHeight = GetSystemMetrics(SM_CYHSCROLL);
!
! SetWindowPos(pData->hGripWnd,NULL,
! nWidth-nGripWidth,nHeight-nGripHeight,nGripWidth,nGripHeight,SWP_NOZORDER);
! }
! break;
! }
!
! return lResult;
}
***************
*** 1374,1377 ****
--- 1429,1434 ----
style &= ~(WS_THICKFRAME | WS_MAXIMIZEBOX);
SetWindowLong(hTargetWnd, GWL_STYLE, style);
+
+ EnableGripWindow(hwnd, resizeable);
GetWindowRect(hTargetWnd,&rc);
|
|
From: <kr_...@us...> - 2003-10-10 22:59:07
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32
In directory sc8-pr-cvs1:/tmp/cvs-serv32238/src/cbits/Win32
Modified Files:
Util.c
Log Message:
formatting
Index: Util.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Util.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** Util.c 10 Oct 2003 22:55:12 -0000 1.25
--- Util.c 10 Oct 2003 22:59:03 -0000 1.26
***************
*** 66,91 ****
// SDIWindow class
! wc.style = CS_DBLCLKS;
! wc.lpfnWndProc = HSDIWindowFunction;
! wc.cbClsExtra = 0;
! wc.cbWndExtra = 0;
! wc.hInstance = ghModule;
! wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
! wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH) (COLOR_BTNFACE + 1);
! wc.lpszMenuName = NULL;
wc.lpszClassName = "HSDIWINDOW";
RegisterClass(&wc);
// Dialog class
! wc.style = CS_DBLCLKS;
! wc.lpfnWndProc = HDialogFunction;
! wc.cbClsExtra = 0;
! wc.cbWndExtra = DLGWINDOWEXTRA;
! wc.hInstance = ghModule;
! wc.hIcon = NULL;//LoadIcon(NULL, IDI_APPLICATION);
! wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH) (COLOR_BTNFACE + 1);
! wc.lpszMenuName = NULL;
wc.lpszClassName = "HDIALOG";
RegisterClass(&wc);
--- 66,91 ----
// SDIWindow class
! wc.style = CS_DBLCLKS;
! wc.lpfnWndProc = HSDIWindowFunction;
! wc.cbClsExtra = 0;
! wc.cbWndExtra = 0;
! wc.hInstance = ghModule;
! wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
! wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH) (COLOR_BTNFACE + 1);
! wc.lpszMenuName = NULL;
wc.lpszClassName = "HSDIWINDOW";
RegisterClass(&wc);
// Dialog class
! wc.style = CS_DBLCLKS;
! wc.lpfnWndProc = HDialogFunction;
! wc.cbClsExtra = 0;
! wc.cbWndExtra = DLGWINDOWEXTRA;
! wc.hInstance = ghModule;
! wc.hIcon = NULL;
! wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH) (COLOR_BTNFACE + 1);
! wc.lpszMenuName = NULL;
wc.lpszClassName = "HDIALOG";
RegisterClass(&wc);
|
|
From: <kr_...@us...> - 2003-10-10 22:55:20
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32
In directory sc8-pr-cvs1:/tmp/cvs-serv31387/src/cbits/Win32
Modified Files:
Util.c Window.c
Log Message:
more natural look and feel for dialogs
Index: Util.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Util.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** Util.c 1 Sep 2003 20:27:49 -0000 1.24
--- Util.c 10 Oct 2003 22:55:12 -0000 1.25
***************
*** 84,88 ****
wc.cbWndExtra = DLGWINDOWEXTRA;
wc.hInstance = ghModule;
! wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH) (COLOR_BTNFACE + 1);
--- 84,88 ----
wc.cbWndExtra = DLGWINDOWEXTRA;
wc.hInstance = ghModule;
! wc.hIcon = NULL;//LoadIcon(NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.hbrBackground = (HBRUSH) (COLOR_BTNFACE + 1);
Index: Window.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Window.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -C2 -d -r1.54 -r1.55
*** Window.c 10 Oct 2003 22:30:41 -0000 1.54
--- Window.c 10 Oct 2003 22:55:13 -0000 1.55
***************
*** 791,795 ****
// start to fill in the dlgtemplate information. Addressing by WORDs
! lStyle = WS_CAPTION | DS_SETFONT | WS_OVERLAPPEDWINDOW | WS_HSCROLL | WS_VSCROLL;
p = dlgtemplate;
--- 791,795 ----
// start to fill in the dlgtemplate information. Addressing by WORDs
! lStyle = WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | DS_CENTER | DS_MODALFRAME;
p = dlgtemplate;
***************
*** 1366,1371 ****
style = GetWindowLong(hTargetWnd, GWL_STYLE);
! if (resizeable) style |= WS_THICKFRAME;
! else style &= ~WS_THICKFRAME;
SetWindowLong(hTargetWnd, GWL_STYLE, style);
--- 1366,1376 ----
style = GetWindowLong(hTargetWnd, GWL_STYLE);
! if (resizeable)
! if (style & DS_MODALFRAME)
! style |= WS_THICKFRAME;
! else
! style |= WS_THICKFRAME | WS_MAXIMIZEBOX;
! else
! style &= ~(WS_THICKFRAME | WS_MAXIMIZEBOX);
SetWindowLong(hTargetWnd, GWL_STYLE, style);
|
|
From: <kr_...@us...> - 2003-10-10 22:30:45
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32
In directory sc8-pr-cvs1:/tmp/cvs-serv28211/src/cbits/Win32
Modified Files:
Window.c
Log Message:
bugfixes
Index: Window.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Window.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -C2 -d -r1.53 -r1.54
*** Window.c 10 Oct 2003 13:15:30 -0000 1.53
--- Window.c 10 Oct 2003 22:30:41 -0000 1.54
***************
*** 40,44 ****
while (hCtrl)
{
! if (GetWindowLong(hWnd,GWL_STYLE) & WS_VISIBLE)
{
GetWindowRect(hCtrl,&rect);
--- 40,44 ----
while (hCtrl)
{
! if (GetWindowLong(hCtrl,GWL_STYLE) & WS_VISIBLE)
{
GetWindowRect(hCtrl,&rect);
***************
*** 68,72 ****
// fill background for all windows except GroupBox
! if (_stricmp(buffer, "HGROUPBOX") != 0 && (GetWindowLong(hWnd,GWL_STYLE) & WS_VISIBLE))
{
GetWindowRect(hCtrl,&rect);
--- 68,72 ----
// fill background for all windows except GroupBox
! if (_stricmp(buffer, "HGROUPBOX") != 0 && (GetWindowLong(hCtrl,GWL_STYLE) & WS_VISIBLE))
{
GetWindowRect(hCtrl,&rect);
***************
*** 827,831 ****
"HCOMPOUND",
NULL,
! WS_CHILD | WS_BORDER | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL,
0,0,0,0,
form,
--- 827,831 ----
"HCOMPOUND",
NULL,
! WS_CHILD | WS_BORDER | WS_HSCROLL | WS_VSCROLL,
0,0,0,0,
form,
***************
*** 1217,1221 ****
void osSetControlVisible(WindowHandle ctrl, BOOL visible)
{
! SetWindowLong(ctrl, GWL_STYLE, GetWindowLong(ctrl, GWL_STYLE) | WS_VISIBLE);
}
--- 1217,1234 ----
void osSetControlVisible(WindowHandle ctrl, BOOL visible)
{
! RECT rect;
! HWND hParent;
! LONG lStyle;
!
! lStyle = GetWindowLong(ctrl, GWL_STYLE);
! lStyle = visible ? (lStyle | WS_VISIBLE) : (lStyle & ~WS_VISIBLE);
! SetWindowLong(ctrl, GWL_STYLE, lStyle);
!
! hParent = GetParent(ctrl);
!
! GetWindowRect(ctrl, &rect);
! ScreenToClient(hParent, ((LPPOINT) &rect) );
! ScreenToClient(hParent, ((LPPOINT) &rect)+1);
! InvalidateRect(GetParent(ctrl),&rect,FALSE);
}
|
|
From: <kr_...@us...> - 2003-10-10 20:54:27
|
Update of /cvsroot/htoolkit/gio/src/examples/simple
In directory sc8-pr-cvs1:/tmp/cvs-serv9788
Added Files:
DynamicLayout.hs
Log Message:
Add example for dynamic layout
--- NEW FILE: DynamicLayout.hs ---
module Main where
import Graphics.UI.GIO
main = start "DynamicLayout" "1.0" SDI [] demo -- "start" initializes the GUI.
demo :: IO ()
demo = do
w <- window [pen =: dialogPen, autosize =: False]
e <- entry [] w
b <- button [title =: "Ok"] w
c <- checkBox [title =: "Simple", on command =:: showHide w (fill e <<< b), checked =: True] w
showWindow w
where
showHide w lay c = do
chk <- get c checked
set w [layout =: pad 10 (if chk then pack c else c ^^^^ lay)]
|
|
From: <kr_...@us...> - 2003-10-10 20:27:08
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK
In directory sc8-pr-cvs1:/tmp/cvs-serv4194/src/cbits/GTK
Modified Files:
Window.c
Log Message:
bugfix
Index: Window.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Window.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** Window.c 9 Oct 2003 07:56:44 -0000 1.36
--- Window.c 10 Oct 2003 20:27:04 -0000 1.37
***************
*** 646,650 ****
gtk_window_set_modal(GTK_WINDOW(toplevel), TRUE);
! gtk_signal_connect (GTK_OBJECT(toplevel), "delete-event",
GTK_SIGNAL_FUNC(gtk_main_quit),
NULL);
--- 646,650 ----
gtk_window_set_modal(GTK_WINDOW(toplevel), TRUE);
! gtk_signal_connect (GTK_OBJECT(toplevel), "destroy",
GTK_SIGNAL_FUNC(gtk_main_quit),
NULL);
***************
*** 666,670 ****
void osDestroyWindow(WindowHandle window)
{
! gtk_widget_destroy(window);
}
--- 666,675 ----
void osDestroyWindow(WindowHandle window)
{
! GtkWidget *toplevel = gtk_widget_get_toplevel(window);
!
! if (toplevel != gFrameWidget)
! gtk_widget_destroy(toplevel);
! else
! gtk_widget_destroy(window);
}
|
|
From: <kr_...@us...> - 2003-10-10 14:21:56
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO
In directory sc8-pr-cvs1:/tmp/cvs-serv31021/src/Graphics/UI/GIO
Modified Files:
Controls.hs Layout.hs Window.hs
Log Message:
support for dynamic layout
Index: Controls.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Controls.hs,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** Controls.hs 7 Oct 2003 20:22:18 -0000 1.33
--- Controls.hs 10 Oct 2003 14:21:52 -0000 1.34
***************
*** 161,166 ****
instance Control Label where
! pack w
! = stdPack (lparent w) (Port.getLabelRequestSize (lhandle w)) (Port.moveResizeControl (lhandle w))
--------------------------------------------------------------------
--- 161,165 ----
instance Control Label where
! pack = stdPack lparent lhandle Port.getLabelRequestSize
--------------------------------------------------------------------
***************
*** 198,203 ****
instance Control Button where
! pack b
! = stdPack (bparent b) (Port.getButtonRequestSize (bhandle b)) (Port.moveResizeControl (bhandle b))
instance Commanding Button where
--- 197,201 ----
instance Control Button where
! pack = stdPack bparent bhandle Port.getButtonRequestSize
instance Commanding Button where
***************
*** 238,243 ****
instance Control Entry where
! pack w
! = stdPack (eparent w) (Port.getEditRequestSize (ehandle w)) (Port.moveResizeControl (ehandle w))
-- | Determines if the user can edit the text in the editable widget or not.
--- 236,240 ----
instance Control Entry where
! pack = stdPack eparent ehandle Port.getEditRequestSize
-- | Determines if the user can edit the text in the editable widget or not.
***************
*** 321,325 ****
instance Control Popup where
! pack p = stdPack (pparent p) (Port.getPopUpRequestSize (phandle p)) (Port.moveResizeControl (phandle p))
instance Commanding Popup where
--- 318,322 ----
instance Control Popup where
! pack = stdPack pparent phandle Port.getPopUpRequestSize
instance Commanding Popup where
***************
*** 410,414 ****
instance Control ListBox where
! pack lb = stdPack (lbparent lb) (Port.getListBoxRequestSize (lbhandle lb)) (Port.moveResizeControl (lbhandle lb))
instance Commanding ListBox where
--- 407,411 ----
instance Control ListBox where
! pack = stdPack lbparent lbhandle Port.getListBoxRequestSize
instance Commanding ListBox where
***************
*** 451,455 ****
instance Control CheckBox where
! pack w = stdPack (cparent w) (Port.getCheckBoxRequestSize (chandle w)) (Port.moveResizeControl (chandle w))
--------------------------------------------------------------------
--- 448,452 ----
instance Control CheckBox where
! pack = stdPack cparent chandle Port.getCheckBoxRequestSize
--------------------------------------------------------------------
***************
*** 486,490 ****
instance Control RadioBox where
! pack w = stdPack (rparent w) (Port.getRadioBoxRequestSize (rhandle w)) (Port.moveResizeControl (rhandle w))
--- 483,487 ----
instance Control RadioBox where
! pack = stdPack rparent rhandle Port.getRadioBoxRequestSize
***************
*** 529,533 ****
instance Control Slider where
! pack w = stdPack (sparent w) (Port.getSliderRequestSize (shandle w)) (Port.moveResizeControl (shandle w))
--- 526,530 ----
instance Control Slider where
! pack = stdPack sparent shandle Port.getSliderRequestSize
***************
*** 581,585 ****
instance Control ProgressBar where
! pack w = stdPack (pbparent w) (Port.getProgressBarRequestSize (pbhandle w)) (Port.moveResizeControl (pbhandle w))
--- 578,582 ----
instance Control ProgressBar where
! pack = stdPack pbparent pbhandle Port.getProgressBarRequestSize
***************
*** 680,691 ****
layout
= writeAttr "layout" (\w c -> do
! let lay = pack c
domain <- get w domain
! needed <- getLayoutSize lay
let d = maxSize domain needed
Port.setWindowDomainSize (cchandle w) d
frame <- Port.getControlFrame (cchandle w)
! layoutInRect (rectOfSize (maxSize d (rectSize frame))) lay
! setVar (vlayout w) lay)
autosize = readAttr "autosize" (\c -> return False)
layoutSize = readAttr "layoutSize" (\c -> getVar (vlayout c) >>= getLayoutSize)
--- 677,690 ----
layout
= writeAttr "layout" (\w c -> do
! let new_lay = pack c
! old_lay <- getVar (vlayout w)
domain <- get w domain
! needed <- getLayoutSize new_lay
let d = maxSize domain needed
Port.setWindowDomainSize (cchandle w) d
frame <- Port.getControlFrame (cchandle w)
! updateControlsVisibility old_lay new_lay
! layoutInRect (rectOfSize (maxSize d (rectSize frame))) new_lay
! setVar (vlayout w) new_lay)
autosize = readAttr "autosize" (\c -> return False)
layoutSize = readAttr "layoutSize" (\c -> getVar (vlayout c) >>= getLayoutSize)
***************
*** 694,698 ****
instance Control CompoundControl where
! pack w = stdPack (ccparent w) (Port.getCompoundControlRequestSize (cchandle w)) (Port.moveResizeControl (cchandle w))
--- 693,697 ----
instance Control CompoundControl where
! pack = stdPack ccparent cchandle Port.getCompoundControlRequestSize
***************
*** 726,730 ****
instance Container GroupBox where
! layout = writeAttr "layout" (\w c -> setVar (gblayout w) (pack c))
autosize = readAttr "autosize" (\c -> return True)
layoutSize = readAttr "layoutSize" (\c -> getVar (gblayout c) >>= getLayoutSize)
--- 725,733 ----
instance Container GroupBox where
! layout = writeAttr "layout" (\w c -> do
! let new_lay = pack c
! old_lay <- getVar (gblayout w)
! updateControlsVisibility old_lay new_lay
! setVar (gblayout w) new_lay)
autosize = readAttr "autosize" (\c -> return True)
layoutSize = readAttr "layoutSize" (\c -> getVar (gblayout c) >>= getLayoutSize)
***************
*** 736,743 ****
instance Control GroupBox where
! pack c = stdPack (gbparent c) getGroupBoxRequestSize (Port.moveResizeControl (gbhandle c))
where
! getGroupBoxRequestSize = do
! (l,t,r,b) <- Port.getGroupBoxBordersSize (gbhandle c)
Size w h <- getVar (gblayout c) >>= getLayoutSize
return (Size (l+w+r) (t+h+b))
--- 739,746 ----
instance Control GroupBox where
! pack c = stdPack gbparent gbhandle getGroupBoxRequestSize c
where
! getGroupBoxRequestSize hwnd = do
! (l,t,r,b) <- Port.getGroupBoxBordersSize hwnd
Size w h <- getVar (gblayout c) >>= getLayoutSize
return (Size (l+w+r) (t+h+b))
***************
*** 765,772 ****
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
--- 768,775 ----
instance Control Notebook where
! pack w = stdPack nbparent nbhandle getNotebookRequestSize w
where
! getNotebookRequestSize hwnd = do
! outSize <- Port.getNotebookRequestSize hwnd
pages <- getVar (nbpages w)
pageSizes <- mapM (\page -> get page layoutSize) pages
***************
*** 826,830 ****
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)
--- 829,837 ----
instance Container NotebookPage where
! layout = writeAttr "layout" (\w c -> do
! let new_lay = pack c
! old_lay <- getVar (pglayout w)
! updateControlsVisibility old_lay new_lay
! setVar (pglayout w) new_lay)
autosize = readAttr "autosize" (\c -> return True)
layoutSize = readAttr "layoutSize" (\c -> getVar (pglayout c) >>= getLayoutSize)
Index: Layout.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Layout.hs,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Layout.hs 20 Aug 2003 21:37:26 -0000 1.7
--- Layout.hs 10 Oct 2003 14:21:52 -0000 1.8
***************
*** 119,128 ****
-- ** Functions
, stdPack
- , stdPackChangingLayout
, getLayoutSize
, layoutInRect
) where
! import Data.List( transpose, intersperse )
import qualified Graphics.UI.Port as Port
import Graphics.UI.GIO.Types
--- 119,128 ----
-- ** Functions
, stdPack
, getLayoutSize
, layoutInRect
+ , updateControlsVisibility
) where
! import Data.List( transpose, intersperse, (\\) )
import qualified Graphics.UI.Port as Port
import Graphics.UI.GIO.Types
***************
*** 208,224 ****
-- | Internal: creates a standard 'pack' function from a parent handle,
! -- a function that returns the preferred size and a function that repositions the control.
! stdPack :: WindowHandle -> IO Size -> (Rect -> IO ()) -> Layout
! stdPack parent getPrefferedSize moveResize
! = Control parent getPrefferedSize moveResize
!
! -- | Internal: creates a standard 'pack' function from a parent handle,
! -- and a changing layout. This function is only used when the layout can
! -- change, like a radio group that is layout horizontally or vertically.
! stdPackChangingLayout :: WindowHandle -> IO Layout -> Layout
! stdPackChangingLayout parent io
! = Control parent (do layout <- io; getLayoutSize layout)
! (\r -> do layout <- io; layoutInRect r layout; return ())
!
{--------------------------------------------------------------------
--- 208,215 ----
-- | Internal: creates a standard 'pack' function from a parent handle,
! -- control handle and a function that returns the preferred size.
! stdPack :: (w -> WindowHandle) -> (w -> WindowHandle) -> (WindowHandle -> IO Size) -> w -> Layout
! stdPack getParent getControl getPrefferedSize w
! = Control (getParent w) (getControl w) getPrefferedSize
{--------------------------------------------------------------------
***************
*** 229,233 ****
data Layout = Grid [[Layout]]
| Changer (Pack -> Pack) Layout
! | Control WindowHandle (IO Size) (Rect -> IO ()) -- parent, get request size, set new position/size
{--------------------------------------------------------------------
--- 220,224 ----
data Layout = Grid [[Layout]]
| Changer (Pack -> Pack) Layout
! | Control WindowHandle WindowHandle (WindowHandle -> IO Size) -- parent handle, control handle, get request size
{--------------------------------------------------------------------
***************
*** 238,242 ****
-- need to mimic a control instead of "Grid [[]]" or otherwise the calculation of
-- the initial dialog size fails to take outer padding into account.
! empty = Control nullHandle (return (Size 0 0)) (\r -> return ()) -- Grid [[]]
-- | Primitive: Create a grid of controls, gives precise control over alignment. (See also 'tabular').
--- 229,233 ----
-- need to mimic a control instead of "Grid [[]]" or otherwise the calculation of
-- the initial dialog size fails to take outer padding into account.
! empty = Control nullHandle nullHandle (\h -> return (Size 0 0)) -- Grid [[]]
-- | Primitive: Create a grid of controls, gives precise control over alignment. (See also 'tabular').
***************
*** 420,425 ****
parent = head parents
! moveResize rect (Control hwnd get setRect)
! = setRect rect
--- 411,427 ----
parent = head parents
! moveResize rect (Control hparent hcontrol get)
! = if hcontrol /= nullHandle then Port.moveResizeControl hcontrol rect else return ()
!
!
! updateControlsVisibility :: Layout -> Layout -> IO ()
! updateControlsVisibility old_lay new_lay = do
! mapM_ (\c -> Port.setControlVisible c False) (old_controls \\ new_controls)
! mapM_ (\c -> Port.setControlVisible c True ) (new_controls \\ old_controls)
! where
! old_controls = foldr collectHandles [] (extractControls old_lay)
! new_controls = foldr collectHandles [] (extractControls new_lay)
!
! collectHandles (Control _ h _) hs = if h /= nullHandle then h:hs else hs
***************
*** 429,434 ****
Grid lss -> concat (map (concat . map extractControls) lss)
Changer f l -> extractControls l
! Control _ _ _ -> [lay]
!
--- 431,435 ----
Grid lss -> concat (map (concat . map extractControls) lss)
Changer f l -> extractControls l
! Control _ h _ -> [lay]
***************
*** 457,462 ****
Grid lss -> do lss' <- mapM (mapM layoutToPack) lss
return (table lss')
! Control parent getPrefSize moveResize
! -> do (Size w h) <- getPrefSize
return (Item False False w h (\pos sz -> pos))
Changer f lay -> do p <- layoutToPack lay
--- 458,463 ----
Grid lss -> do lss' <- mapM (mapM layoutToPack) lss
return (table lss')
! Control hparent hcontrol getPrefSize
! -> do (Size w h) <- getPrefSize hcontrol
return (Item False False w h (\pos sz -> pos))
Changer f lay -> do p <- layoutToPack lay
Index: Window.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Window.hs,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** Window.hs 7 Oct 2003 21:39:31 -0000 1.28
--- Window.hs 10 Oct 2003 14:21:52 -0000 1.29
***************
*** 185,198 ****
layout
= writeAttr "layout" (\w c -> do
! let lay = pack c
autosize <- get w autosize
domain <- get w domain
! needed <- getLayoutSize lay
let d = maxSize domain needed
Lib.setWindowDomainSize (hwindow w) d
when autosize (set w [view =: d])
view <- get w view
! layoutInRect (rectOfSize (maxSize d view)) lay
! setVar (vlayout w) lay)
autosize = varAttr vautosize
layoutSize = readAttr "layoutSize" (\w -> getVar (vlayout w) >>= getLayoutSize)
--- 185,200 ----
layout
= writeAttr "layout" (\w c -> do
! let new_lay = pack c
! old_lay <- getVar (vlayout w)
autosize <- get w autosize
domain <- get w domain
! needed <- getLayoutSize new_lay
let d = maxSize domain needed
Lib.setWindowDomainSize (hwindow w) d
when autosize (set w [view =: d])
view <- get w view
! updateControlsVisibility old_lay new_lay
! layoutInRect (rectOfSize (maxSize d view)) new_lay
! setVar (vlayout w) new_lay)
autosize = varAttr vautosize
layoutSize = readAttr "layoutSize" (\w -> getVar (vlayout w) >>= getLayoutSize)
|
|
From: <kr_...@us...> - 2003-10-10 13:15:41
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32
In directory sc8-pr-cvs1:/tmp/cvs-serv19957/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.52
retrieving revision 1.53
diff -C2 -d -r1.52 -r1.53
*** Window.c 9 Oct 2003 07:56:45 -0000 1.52
--- Window.c 10 Oct 2003 13:15:30 -0000 1.53
***************
*** 40,48 ****
while (hCtrl)
{
! GetWindowRect(hCtrl,&rect);
! origin.x = rect.left;
! origin.y = rect.top;
! ScreenToClient(hWnd,&origin);
! SetWindowPos(hCtrl,NULL,origin.x+dx,origin.y+dy,0,0,SWP_NOSIZE|SWP_NOZORDER);
hCtrl = GetNextWindow(hCtrl,GW_HWNDNEXT);
}
--- 40,52 ----
while (hCtrl)
{
! if (GetWindowLong(hWnd,GWL_STYLE) & WS_VISIBLE)
! {
! GetWindowRect(hCtrl,&rect);
! origin.x = rect.left;
! origin.y = rect.top;
! ScreenToClient(hWnd,&origin);
! SetWindowPos(hCtrl,NULL,origin.x+dx,origin.y+dy,0,0,SWP_NOSIZE|SWP_NOZORDER);
! }
!
hCtrl = GetNextWindow(hCtrl,GW_HWNDNEXT);
}
***************
*** 64,68 ****
// fill background for all windows except GroupBox
! if (_stricmp(buffer, "HGROUPBOX") != 0)
{
GetWindowRect(hCtrl,&rect);
--- 68,72 ----
// fill background for all windows except GroupBox
! if (_stricmp(buffer, "HGROUPBOX") != 0 && (GetWindowLong(hWnd,GWL_STYLE) & WS_VISIBLE))
{
GetWindowRect(hCtrl,&rect);
***************
*** 1213,1217 ****
void osSetControlVisible(WindowHandle ctrl, BOOL visible)
{
! ShowWindow(ctrl, visible ? SW_SHOW : SW_HIDE);
}
--- 1217,1221 ----
void osSetControlVisible(WindowHandle ctrl, BOOL visible)
{
! SetWindowLong(ctrl, GWL_STYLE, GetWindowLong(ctrl, GWL_STYLE) | WS_VISIBLE);
}
|
|
From: <kr_...@us...> - 2003-10-09 19:05:52
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32
In directory sc8-pr-cvs1:/tmp/cvs-serv26724/src/cbits/Win32
Modified Files:
EditBox.c
Log Message:
bugfix
Index: EditBox.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/EditBox.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** EditBox.c 8 Oct 2003 22:21:57 -0000 1.11
--- EditBox.c 9 Oct 2003 19:05:48 -0000 1.12
***************
*** 61,65 ****
}
! void osSetEditPassword(WindowHandle editbox, BOOL visible)
{
LONG lStyle;
--- 61,65 ----
}
! void osSetEditPassword(WindowHandle editbox, BOOL password)
{
LONG lStyle;
***************
*** 67,71 ****
lStyle = GetWindowLong(editbox, GWL_STYLE);
! if (visible)
{
SetWindowLong(editbox, GWL_STYLE, lStyle & ~ES_PASSWORD);
--- 67,71 ----
lStyle = GetWindowLong(editbox, GWL_STYLE);
! if (!password)
{
SetWindowLong(editbox, GWL_STYLE, lStyle & ~ES_PASSWORD);
***************
*** 83,87 ****
BOOL osGetEditPassword(WindowHandle editbox)
{
! return (GetWindowLong(editbox, GWL_STYLE) & ES_PASSWORD) == 0;
}
--- 83,87 ----
BOOL osGetEditPassword(WindowHandle editbox)
{
! return (GetWindowLong(editbox, GWL_STYLE) & ES_PASSWORD) != 0;
}
|
|
From: <kr_...@us...> - 2003-10-09 19:05:51
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK
In directory sc8-pr-cvs1:/tmp/cvs-serv26724/src/cbits/GTK
Modified Files:
EditBox.c
Log Message:
bugfix
Index: EditBox.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/EditBox.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** EditBox.c 8 Oct 2003 22:21:57 -0000 1.14
--- EditBox.c 9 Oct 2003 19:05:48 -0000 1.15
***************
*** 44,55 ****
}
! void osSetEditPassword(WindowHandle entry, BOOL visible)
{
! gtk_entry_set_visibility(GTK_ENTRY(entry), visible);
}
BOOL osGetEditPassword(WindowHandle entry)
{
! return gtk_entry_get_visibility(GTK_ENTRY(entry));
}
--- 44,55 ----
}
! void osSetEditPassword(WindowHandle entry, BOOL password)
{
! gtk_entry_set_visibility(GTK_ENTRY(entry), !password);
}
BOOL osGetEditPassword(WindowHandle entry)
{
! return !gtk_entry_get_visibility(GTK_ENTRY(entry));
}
|
|
From: <kr_...@us...> - 2003-10-09 07:56:50
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32
In directory sc8-pr-cvs1:/tmp/cvs-serv26862/src/cbits/Win32
Modified Files:
Window.c
Log Message:
add getControlVisible function
Index: Window.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Window.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -d -r1.51 -r1.52
*** Window.c 7 Oct 2003 21:59:25 -0000 1.51
--- Window.c 9 Oct 2003 07:56:45 -0000 1.52
***************
*** 787,791 ****
// start to fill in the dlgtemplate information. Addressing by WORDs
! lStyle = WS_CAPTION | DS_SETFONT | WS_SYSMENU | WS_OVERLAPPEDWINDOW | WS_HSCROLL | WS_VSCROLL;
p = dlgtemplate;
--- 787,791 ----
// start to fill in the dlgtemplate information. Addressing by WORDs
! lStyle = WS_CAPTION | DS_SETFONT | WS_OVERLAPPEDWINDOW | WS_HSCROLL | WS_VSCROLL;
p = dlgtemplate;
***************
*** 1214,1217 ****
--- 1214,1222 ----
{
ShowWindow(ctrl, visible ? SW_SHOW : SW_HIDE);
+ }
+
+ BOOL osGetControlVisible(WindowHandle ctrl)
+ {
+ return (GetWindowLong(ctrl, GWL_STYLE) & WS_VISIBLE) != 0;
}
|
|
From: <kr_...@us...> - 2003-10-09 07:56:50
|
Update of /cvsroot/htoolkit/port/src/include In directory sc8-pr-cvs1:/tmp/cvs-serv26862/src/include Modified Files: Window.h Log Message: add getControlVisible function Index: Window.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/include/Window.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Window.h 7 Oct 2003 21:59:26 -0000 1.12 --- Window.h 9 Oct 2003 07:56:45 -0000 1.13 *************** *** 59,62 **** --- 59,63 ---- BOOL osGetControlEnabled(WindowHandle ctrl); void osSetControlVisible(WindowHandle ctrl, BOOL visible); + BOOL osGetControlVisible(WindowHandle ctrl); void osSetControlTip(WindowHandle ctrl, char *text); char *osGetControlTip(WindowHandle ctrl); |
|
From: <kr_...@us...> - 2003-10-09 07:56:50
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK
In directory sc8-pr-cvs1:/tmp/cvs-serv26862/src/cbits/GTK
Modified Files:
Window.c
Log Message:
add getControlVisible function
Index: Window.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Window.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** Window.c 7 Oct 2003 21:59:25 -0000 1.35
--- Window.c 9 Oct 2003 07:56:44 -0000 1.36
***************
*** 767,770 ****
--- 767,775 ----
}
+ BOOL osGetControlVisible(WindowHandle ctrl)
+ {
+ return GTK_WIDGET_VISIBLE(ctrl);
+ }
+
static GtkTooltips *gTooltips;
|
|
From: <kr_...@us...> - 2003-10-09 07:56:50
|
Update of /cvsroot/htoolkit/port/src/Port
In directory sc8-pr-cvs1:/tmp/cvs-serv26862/src/Port
Modified Files:
Controls.hs
Log Message:
add getControlVisible function
Index: Controls.hs
===================================================================
RCS file: /cvsroot/htoolkit/port/src/Port/Controls.hs,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** Controls.hs 7 Oct 2003 21:59:25 -0000 1.24
--- Controls.hs 9 Oct 2003 07:56:44 -0000 1.25
***************
*** 44,48 ****
, getControlFrame
, setControlEnabled, getControlEnabled
! , setControlVisible
, setControlTip, getControlTip
-- * Label
--- 44,48 ----
, getControlFrame
, setControlEnabled, getControlEnabled
! , setControlVisible, getControlVisible
, setControlTip, getControlTip
-- * Label
***************
*** 138,141 ****
--- 138,142 ----
foreign import ccall unsafe "osSetControlVisible" setControlVisible :: WindowHandle -> Bool -> IO ()
+ foreign import ccall unsafe "osGetControlVisible" getControlVisible :: WindowHandle -> IO Bool
getControlTip :: WindowHandle -> IO String
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32
In directory sc8-pr-cvs1:/tmp/cvs-serv10254/src/cbits/Win32
Modified Files:
Button.c CheckBox.c EditBox.c GroupBox.c Label.c ListBox.c
Notebook.c PopUp.c ProgressBar.c RadioBox.c Slider.c
Log Message:
Any control must be hidden by default. The control will be show if it is
contained in the window layout
Index: Button.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Button.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Button.c 24 Aug 2003 21:07:48 -0000 1.6
--- Button.c 8 Oct 2003 22:21:57 -0000 1.7
***************
*** 1,60 ****
! #include "Button.h"
! #include "Internals.h"
! #include "Handlers_stub.h"
!
! WindowHandle osCreateButton(WindowHandle form)
! {
! HWND hButton;
!
! hButton = CreateWindow(
! "BUTTON",
! NULL,
! WS_CHILD | WS_VISIBLE | WS_TABSTOP,
! 0,0,0,0,
! form,
! NULL,
! ghModule,
! NULL
! );
! return checkWindow(hButton, "BUTTON");
! };
!
! void osGetButtonReqSize(WindowHandle button, int *res)
! {
! SIZE sz;
! HDC hDC = GetDC(button);
! HFONT hFont = (HFONT) SendMessage(button,WM_GETFONT,0,0);
! int nLen = GetWindowTextLength(button);
! char *buffer = (char *) rmalloc(nLen+1);
! nLen = GetWindowText(button, buffer, nLen+1);
!
! if (hFont)
! SelectObject(hDC, hFont);
! GetTextExtentPoint32(hDC, buffer, nLen, &sz);
!
! rfree(buffer);
! ReleaseDC(button, hDC);
!
! res[0] = sz.cx + GetSystemMetrics(SM_CXBORDER)*2 + 6;
! res[1] = sz.cy + GetSystemMetrics(SM_CYBORDER)*2 + 6;
! }
!
! char *osGetButtonText(WindowHandle button)
! {
! int nLen = GetWindowTextLength(button);
! char *buffer = (char *) rmalloc(nLen+1);
! GetWindowText(button, buffer, nLen+1);
! return buffer;
! };
!
! void osSetButtonText(WindowHandle button, char *txt)
! {
! SetWindowText(button, txt);
! osForceContainerReLayout(button);
! };
!
! void osChangeButtonFont(WindowHandle button, FontHandle font)
! {
! SendMessage(button, WM_SETFONT, (WPARAM) font, MAKELPARAM (TRUE,0));
! osForceContainerReLayout(button);
! };
--- 1,60 ----
! #include "Button.h"
! #include "Internals.h"
! #include "Handlers_stub.h"
!
! WindowHandle osCreateButton(WindowHandle form)
! {
! HWND hButton;
!
! hButton = CreateWindow(
! "BUTTON",
! NULL,
! WS_CHILD | WS_TABSTOP,
! 0,0,0,0,
! form,
! NULL,
! ghModule,
! NULL
! );
! return checkWindow(hButton, "BUTTON");
! };
!
! void osGetButtonReqSize(WindowHandle button, int *res)
! {
! SIZE sz;
! HDC hDC = GetDC(button);
! HFONT hFont = (HFONT) SendMessage(button,WM_GETFONT,0,0);
! int nLen = GetWindowTextLength(button);
! char *buffer = (char *) rmalloc(nLen+1);
! nLen = GetWindowText(button, buffer, nLen+1);
!
! if (hFont)
! SelectObject(hDC, hFont);
! GetTextExtentPoint32(hDC, buffer, nLen, &sz);
!
! rfree(buffer);
! ReleaseDC(button, hDC);
!
! res[0] = sz.cx + GetSystemMetrics(SM_CXBORDER)*2 + 6;
! res[1] = sz.cy + GetSystemMetrics(SM_CYBORDER)*2 + 6;
! }
!
! char *osGetButtonText(WindowHandle button)
! {
! int nLen = GetWindowTextLength(button);
! char *buffer = (char *) rmalloc(nLen+1);
! GetWindowText(button, buffer, nLen+1);
! return buffer;
! };
!
! void osSetButtonText(WindowHandle button, char *txt)
! {
! SetWindowText(button, txt);
! osForceContainerReLayout(button);
! };
!
! void osChangeButtonFont(WindowHandle button, FontHandle font)
! {
! 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.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** CheckBox.c 24 Aug 2003 21:07:48 -0000 1.7
--- CheckBox.c 8 Oct 2003 22:21:57 -0000 1.8
***************
*** 1,68 ****
! #include "CheckBox.h"
! #include "Internals.h"
! #include "Handlers_stub.h"
!
! WindowHandle osCreateCheckBox(WindowHandle window)
! {
! HWND hCheckBox;
!
! hCheckBox = CreateWindow(
! "BUTTON",
! NULL,
! WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX | WS_TABSTOP,
! 0,0,0,0,
! window,
! NULL,
! ghModule,
! NULL
! );
! return checkWindow(hCheckBox, "CHECKBOX");
! };
!
! void osGetCheckBoxReqSize(WindowHandle checkbox, int *res)
! {
! SIZE sz;
! TEXTMETRIC tm;
! HFONT hOldFont;
! HDC hDC = GetDC(checkbox);
! int nLen = GetWindowTextLength(checkbox);
! char *buffer = (char *) rmalloc(nLen+1);
! 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;
! };
!
! char *osGetCheckBoxText(WindowHandle checkbox)
! {
! int nLen = GetWindowTextLength(checkbox);
! char *buffer = (char *) rmalloc(nLen+1);
! GetWindowText(checkbox, buffer, nLen+1);
! return buffer;
! };
!
! void osSetCheckBoxText(WindowHandle checkbox, char *txt)
! {
! SetWindowText(checkbox, txt);
! osForceContainerReLayout(checkbox);
! };
!
! BOOL osGetCheckBoxState(WindowHandle checkbox)
! {
! return SendMessage(checkbox,BM_GETCHECK,0,0) == BST_CHECKED;
! };
!
! void osSetCheckBoxState(WindowHandle checkbox, BOOL state)
! {
! SendMessage(checkbox,BM_SETCHECK,state ? BST_CHECKED : BST_UNCHECKED,0);
! };
--- 1,68 ----
! #include "CheckBox.h"
! #include "Internals.h"
! #include "Handlers_stub.h"
!
! WindowHandle osCreateCheckBox(WindowHandle window)
! {
! HWND hCheckBox;
!
! hCheckBox = CreateWindow(
! "BUTTON",
! NULL,
! WS_CHILD | BS_AUTOCHECKBOX | WS_TABSTOP,
! 0,0,0,0,
! window,
! NULL,
! ghModule,
! NULL
! );
! return checkWindow(hCheckBox, "CHECKBOX");
! };
!
! void osGetCheckBoxReqSize(WindowHandle checkbox, int *res)
! {
! SIZE sz;
! TEXTMETRIC tm;
! HFONT hOldFont;
! HDC hDC = GetDC(checkbox);
! int nLen = GetWindowTextLength(checkbox);
! char *buffer = (char *) rmalloc(nLen+1);
! 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;
! };
!
! char *osGetCheckBoxText(WindowHandle checkbox)
! {
! int nLen = GetWindowTextLength(checkbox);
! char *buffer = (char *) rmalloc(nLen+1);
! GetWindowText(checkbox, buffer, nLen+1);
! return buffer;
! };
!
! void osSetCheckBoxText(WindowHandle checkbox, char *txt)
! {
! SetWindowText(checkbox, txt);
! osForceContainerReLayout(checkbox);
! };
!
! BOOL osGetCheckBoxState(WindowHandle checkbox)
! {
! return SendMessage(checkbox,BM_GETCHECK,0,0) == BST_CHECKED;
! };
!
! void osSetCheckBoxState(WindowHandle checkbox, BOOL state)
! {
! SendMessage(checkbox,BM_SETCHECK,state ? BST_CHECKED : BST_UNCHECKED,0);
! };
Index: EditBox.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/EditBox.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** EditBox.c 7 Oct 2003 20:20:42 -0000 1.10
--- EditBox.c 8 Oct 2003 22:21:57 -0000 1.11
***************
*** 11,15 ****
"EDIT",
NULL,
! WS_CHILD | WS_VISIBLE | WS_BORDER | ES_AUTOHSCROLL | WS_TABSTOP,
0,0,0,0,
window,
--- 11,15 ----
"EDIT",
NULL,
! WS_CHILD | WS_BORDER | ES_AUTOHSCROLL | WS_TABSTOP,
0,0,0,0,
window,
Index: GroupBox.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/GroupBox.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** GroupBox.c 1 Sep 2003 20:27:49 -0000 1.1
--- GroupBox.c 8 Oct 2003 22:21:57 -0000 1.2
***************
*** 13,17 ****
return CallWindowProc(DefGroupBoxProc, hWnd, uMsg, wParam, lParam);
};
!
return HWindowSharedFunction(DefGroupBoxProc, hWnd, uMsg, wParam, lParam);
}
--- 13,17 ----
return CallWindowProc(DefGroupBoxProc, hWnd, uMsg, wParam, lParam);
};
!
return HWindowSharedFunction(DefGroupBoxProc, hWnd, uMsg, wParam, lParam);
}
***************
*** 24,28 ****
"HGROUPBOX",
NULL,
! WS_CHILD | WS_VISIBLE | BS_GROUPBOX,
0,0,0,0,
form,
--- 24,28 ----
"HGROUPBOX",
NULL,
! WS_CHILD | BS_GROUPBOX,
0,0,0,0,
form,
Index: Label.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Label.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Label.c 24 Aug 2003 21:07:48 -0000 1.7
--- Label.c 8 Oct 2003 22:21:57 -0000 1.8
***************
*** 1,60 ****
! #include "Label.h"
! #include "Internals.h"
! #include "Handlers_stub.h"
!
! WindowHandle osCreateLabel(WindowHandle window)
! {
! HWND hText;
!
! hText = CreateWindow(
! "STATIC",
! NULL,
! WS_CHILD | WS_VISIBLE,
! 0,0,0,0,
! window,
! NULL,
! ghModule,
! NULL
! );
! return checkWindow(hText, "TEXT");
! };
!
! void osGetLabelReqSize(WindowHandle label, int *res)
! {
! SIZE sz;
! HDC hDC = GetDC(label);
! HFONT hFont = (HFONT) SendMessage(label,WM_GETFONT,0,0);
! int nLen = GetWindowTextLength(label);
! char *buffer = (char *) rmalloc(nLen+1);
! nLen = GetWindowText(label, buffer, nLen+1);
!
! if (hFont)
! SelectObject(hDC, hFont);
! GetTextExtentPoint32(hDC, buffer, nLen, &sz);
!
! rfree(buffer);
! ReleaseDC(label, hDC);
!
! res[0] = sz.cx;
! res[1] = sz.cy;
! }
!
! char *osGetLabelText(WindowHandle label)
! {
! int nLen = GetWindowTextLength(label);
! char *buffer = (char *) rmalloc(nLen+1);
! GetWindowText(label, buffer, nLen+1);
! return buffer;
! };
!
! void osSetLabelText(WindowHandle label, char *txt)
! {
! SetWindowText(label, txt);
! osForceContainerReLayout(label);
! };
!
! void osChangeLabelFont(WindowHandle label, FontHandle font)
! {
! SendMessage(label, WM_SETFONT, (WPARAM) font, MAKELPARAM (TRUE,0));
! osForceContainerReLayout(label);
! };
--- 1,60 ----
! #include "Label.h"
! #include "Internals.h"
! #include "Handlers_stub.h"
!
! WindowHandle osCreateLabel(WindowHandle window)
! {
! HWND hText;
!
! hText = CreateWindow(
! "STATIC",
! NULL,
! WS_CHILD,
! 0,0,0,0,
! window,
! NULL,
! ghModule,
! NULL
! );
! return checkWindow(hText, "TEXT");
! };
!
! void osGetLabelReqSize(WindowHandle label, int *res)
! {
! SIZE sz;
! HDC hDC = GetDC(label);
! HFONT hFont = (HFONT) SendMessage(label,WM_GETFONT,0,0);
! int nLen = GetWindowTextLength(label);
! char *buffer = (char *) rmalloc(nLen+1);
! nLen = GetWindowText(label, buffer, nLen+1);
!
! if (hFont)
! SelectObject(hDC, hFont);
! GetTextExtentPoint32(hDC, buffer, nLen, &sz);
!
! rfree(buffer);
! ReleaseDC(label, hDC);
!
! res[0] = sz.cx;
! res[1] = sz.cy;
! }
!
! char *osGetLabelText(WindowHandle label)
! {
! int nLen = GetWindowTextLength(label);
! char *buffer = (char *) rmalloc(nLen+1);
! GetWindowText(label, buffer, nLen+1);
! return buffer;
! };
!
! void osSetLabelText(WindowHandle label, char *txt)
! {
! SetWindowText(label, txt);
! osForceContainerReLayout(label);
! };
!
! void osChangeLabelFont(WindowHandle label, FontHandle font)
! {
! 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.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ListBox.c 24 Aug 2003 21:07:48 -0000 1.6
--- ListBox.c 8 Oct 2003 22:21:57 -0000 1.7
***************
*** 1,105 ****
! #include "ListBox.h"
! #include "Internals.h"
! #include "Handlers_stub.h"
!
! WindowHandle osCreateListBox(WindowHandle window, BOOL multisel)
! {
! HWND hListBox;
!
! hListBox = CreateWindowEx(
! WS_EX_CLIENTEDGE,
! "LISTBOX",
! NULL,
! WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_BORDER | LBS_NOTIFY | WS_TABSTOP | (multisel ? LBS_EXTENDEDSEL : 0),
! 0,0,0,0,
! window,
! NULL,
! ghModule,
! NULL
! );
! return checkWindow(hListBox, "LISTBOX");
! };
!
! void osAppendListBoxItem(WindowHandle listbox, char *title)
! {
! SendMessage(listbox, LB_ADDSTRING, 0, (LPARAM) title);
! osForceContainerReLayout(listbox);
! };
!
! void osInsertListBoxItem(WindowHandle listbox, int index, char *title)
! {
! SendMessage(listbox, LB_INSERTSTRING, index, (LPARAM) title);
! osForceContainerReLayout(listbox);
! };
!
! void osRemoveListBoxItem(WindowHandle listbox, int index)
! {
! SendMessage(listbox, LB_DELETESTRING, index, 0);
! osForceContainerReLayout(listbox);
! };
!
! void osRemoveAllListBoxItems(WindowHandle listbox)
! {
! SendMessage(listbox, LB_RESETCONTENT,0,0);
! osForceContainerReLayout(listbox);
! };
!
! void osGetListBoxReqSize(WindowHandle listbox, int *res)
! {
! SIZE sz;
! int i,nCount, nLen, width, height;
! char *buffer;
! HDC hDC = GetDC(listbox);
! HFONT hFont = (HFONT) SendMessage(listbox,WM_GETFONT,0,0);
!
! if (hFont)
! SelectObject(hDC, hFont);
!
! width = 10;
! height = 2;
! nCount = SendMessage(listbox,LB_GETCOUNT,0,0);
! for (i = 0; i < nCount; i++)
! {
! nLen = SendMessage(listbox,LB_GETTEXTLEN,i,0);
! buffer = (char *) rmalloc(nLen+1);
! nLen = SendMessage(listbox,LB_GETTEXT,i,(LPARAM)buffer);
!
! GetTextExtentPoint32(hDC, buffer, nLen, &sz);
!
! rfree(buffer);
!
! if (width < sz.cx) width = sz.cx;
! height += sz.cy;
! }
!
! ReleaseDC(listbox, hDC);
!
! res[0] = width + GetSystemMetrics(SM_CXBORDER)*2 + GetSystemMetrics(SM_CXVSCROLL);
! res[1] = height+ GetSystemMetrics(SM_CYBORDER)*2;
! };
!
! int osGetListBoxSingleSelection(WindowHandle listbox)
! {
! return SendMessage(listbox, LB_GETCURSEL, 0, 0);
! };
!
! BOOL osGetListBoxItemSelectState(WindowHandle listbox, int index)
! {
! return SendMessage(listbox, LB_GETSEL, index, 0) > 0;
! }
!
! void osSetListBoxSingleSelection(WindowHandle listbox, int index)
! {
! SendMessage(listbox, LB_SETCURSEL, index, 0);
! handleControlCommand(listbox);
! };
!
! void osSetListBoxItemSelectState(WindowHandle listbox, int index, BOOL state)
! {
! SendMessage(listbox, LB_SETSEL, state, index);
! };
!
! int osGetListBoxCurrentItem(WindowHandle listbox)
! {
! return SendMessage(listbox, LB_GETCARETINDEX, 0, 0);
! }
--- 1,105 ----
! #include "ListBox.h"
! #include "Internals.h"
! #include "Handlers_stub.h"
!
! WindowHandle osCreateListBox(WindowHandle window, BOOL multisel)
! {
! HWND hListBox;
!
! hListBox = CreateWindowEx(
! WS_EX_CLIENTEDGE,
! "LISTBOX",
! NULL,
! WS_CHILD | WS_VSCROLL | WS_BORDER | LBS_NOTIFY | WS_TABSTOP | (multisel ? LBS_EXTENDEDSEL : 0),
! 0,0,0,0,
! window,
! NULL,
! ghModule,
! NULL
! );
! return checkWindow(hListBox, "LISTBOX");
! };
!
! void osAppendListBoxItem(WindowHandle listbox, char *title)
! {
! SendMessage(listbox, LB_ADDSTRING, 0, (LPARAM) title);
! osForceContainerReLayout(listbox);
! };
!
! void osInsertListBoxItem(WindowHandle listbox, int index, char *title)
! {
! SendMessage(listbox, LB_INSERTSTRING, index, (LPARAM) title);
! osForceContainerReLayout(listbox);
! };
!
! void osRemoveListBoxItem(WindowHandle listbox, int index)
! {
! SendMessage(listbox, LB_DELETESTRING, index, 0);
! osForceContainerReLayout(listbox);
! };
!
! void osRemoveAllListBoxItems(WindowHandle listbox)
! {
! SendMessage(listbox, LB_RESETCONTENT,0,0);
! osForceContainerReLayout(listbox);
! };
!
! void osGetListBoxReqSize(WindowHandle listbox, int *res)
! {
! SIZE sz;
! int i,nCount, nLen, width, height;
! char *buffer;
! HDC hDC = GetDC(listbox);
! HFONT hFont = (HFONT) SendMessage(listbox,WM_GETFONT,0,0);
!
! if (hFont)
! SelectObject(hDC, hFont);
!
! width = 10;
! height = 2;
! nCount = SendMessage(listbox,LB_GETCOUNT,0,0);
! for (i = 0; i < nCount; i++)
! {
! nLen = SendMessage(listbox,LB_GETTEXTLEN,i,0);
! buffer = (char *) rmalloc(nLen+1);
! nLen = SendMessage(listbox,LB_GETTEXT,i,(LPARAM)buffer);
!
! GetTextExtentPoint32(hDC, buffer, nLen, &sz);
!
! rfree(buffer);
!
! if (width < sz.cx) width = sz.cx;
! height += sz.cy;
! }
!
! ReleaseDC(listbox, hDC);
!
! res[0] = width + GetSystemMetrics(SM_CXBORDER)*2 + GetSystemMetrics(SM_CXVSCROLL);
! res[1] = height+ GetSystemMetrics(SM_CYBORDER)*2;
! };
!
! int osGetListBoxSingleSelection(WindowHandle listbox)
! {
! return SendMessage(listbox, LB_GETCURSEL, 0, 0);
! };
!
! BOOL osGetListBoxItemSelectState(WindowHandle listbox, int index)
! {
! return SendMessage(listbox, LB_GETSEL, index, 0) > 0;
! }
!
! void osSetListBoxSingleSelection(WindowHandle listbox, int index)
! {
! SendMessage(listbox, LB_SETCURSEL, index, 0);
! handleControlCommand(listbox);
! };
!
! void osSetListBoxItemSelectState(WindowHandle listbox, int index, BOOL state)
! {
! SendMessage(listbox, LB_SETSEL, state, index);
! };
!
! int osGetListBoxCurrentItem(WindowHandle listbox)
! {
! return SendMessage(listbox, LB_GETCARETINDEX, 0, 0);
! }
Index: Notebook.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Notebook.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Notebook.c 31 Aug 2003 13:23:58 -0000 1.6
--- Notebook.c 8 Oct 2003 22:21:57 -0000 1.7
***************
*** 31,35 ****
{
LRESULT lResult;
!
switch (uMsg)
{
--- 31,35 ----
{
LRESULT lResult;
!
switch (uMsg)
{
***************
*** 43,47 ****
TCITEM item;
HWND hNotebookPage;
!
if (pNMHDR->hwndFrom == hWnd)
{
--- 43,47 ----
TCITEM item;
HWND hNotebookPage;
!
if (pNMHDR->hwndFrom == hWnd)
{
***************
*** 62,66 ****
break;
}
!
return 0;
}
--- 62,66 ----
break;
}
!
return 0;
}
***************
*** 70,74 ****
lResult = CallWindowProc(DefTabCtrlProc, hWnd, uMsg, wParam, lParam);
!
switch (uMsg)
{
--- 70,74 ----
lResult = CallWindowProc(DefTabCtrlProc, hWnd, uMsg, wParam, lParam);
!
switch (uMsg)
{
***************
*** 81,85 ****
break;
}
!
return lResult;
}
--- 81,85 ----
break;
}
!
return lResult;
}
***************
*** 117,121 ****
"HNOTEBOOK",
NULL,
! WS_CHILD | WS_VISIBLE | WS_TABSTOP,
0,0,0,0,
form,
--- 117,121 ----
"HNOTEBOOK",
NULL,
! WS_CHILD | WS_TABSTOP,
0,0,0,0,
form,
Index: PopUp.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/PopUp.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** PopUp.c 26 Aug 2003 21:23:52 -0000 1.6
--- PopUp.c 8 Oct 2003 22:21:57 -0000 1.7
***************
*** 10,14 ****
"COMBOBOX",
NULL,
! WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP,
0,0,0,0,
window,
--- 10,14 ----
"COMBOBOX",
NULL,
! WS_CHILD | CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP,
0,0,0,0,
window,
Index: ProgressBar.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/ProgressBar.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ProgressBar.c 27 Mar 2003 13:36:22 -0000 1.1
--- ProgressBar.c 8 Oct 2003 22:21:57 -0000 1.2
***************
*** 1,65 ****
! #include "ProgressBar.h"
! #include "Internals.h"
! #include "Handlers_stub.h"
!
! WindowHandle osCreateHorzProgressBar(WindowHandle form, BOOL bSmooth)
! {
! HWND hBar;
!
! hBar = CreateWindow(
! PROGRESS_CLASS,
! NULL,
! (bSmooth ? PBS_SMOOTH : 0) | WS_CHILD | WS_VISIBLE | WS_TABSTOP,
! 0,0,0,0,
! form,
! NULL,
! ghModule,
! NULL
! );
! return checkWindow(hBar, PROGRESS_CLASS);
! };
!
! WindowHandle osCreateVertProgressBar(WindowHandle form, BOOL bSmooth)
! {
! HWND hBar;
!
! hBar = CreateWindow(
! PROGRESS_CLASS,
! NULL,
! (bSmooth ? PBS_SMOOTH : 0) | PBS_VERTICAL | WS_CHILD | WS_VISIBLE | WS_TABSTOP,
! 0,0,0,0,
! form,
! NULL,
! ghModule,
! NULL
! );
! return checkWindow(hBar, PROGRESS_CLASS);
! };
!
! void osGetProgressBarReqSize(WindowHandle bar, int *res)
! {
! LONG lStyle = GetWindowLong(bar,GWL_STYLE);
!
! if (lStyle & PBS_VERTICAL)
! {
! res[0] = GetSystemMetrics(SM_CXVSCROLL);
! res[1] = GetSystemMetrics(SM_CYVSCROLL)*2;
! }
! else
! {
! res[0] = GetSystemMetrics(SM_CXHSCROLL)*2;
! res[1] = GetSystemMetrics(SM_CYHSCROLL);
! }
! }
!
! void osSetProgressBarFraction(WindowHandle bar, int minPos, int maxPos, int pos)
! {
! SendMessage(bar, PBM_SETRANGE32, minPos, maxPos);
! SendMessage(bar, PBM_SETPOS, pos, 0);
! }
!
! int osGetProgressBarFraction(WindowHandle bar, int minPos, int maxPos)
! {
! return SendMessage(bar, PBM_GETPOS, 0, 0);
! }
!
--- 1,65 ----
! #include "ProgressBar.h"
! #include "Internals.h"
! #include "Handlers_stub.h"
!
! WindowHandle osCreateHorzProgressBar(WindowHandle form, BOOL bSmooth)
! {
! HWND hBar;
!
! hBar = CreateWindow(
! PROGRESS_CLASS,
! NULL,
! (bSmooth ? PBS_SMOOTH : 0) | WS_CHILD | WS_TABSTOP,
! 0,0,0,0,
! form,
! NULL,
! ghModule,
! NULL
! );
! return checkWindow(hBar, PROGRESS_CLASS);
! };
!
! WindowHandle osCreateVertProgressBar(WindowHandle form, BOOL bSmooth)
! {
! HWND hBar;
!
! hBar = CreateWindow(
! PROGRESS_CLASS,
! NULL,
! (bSmooth ? PBS_SMOOTH : 0) | PBS_VERTICAL | WS_CHILD | WS_TABSTOP,
! 0,0,0,0,
! form,
! NULL,
! ghModule,
! NULL
! );
! return checkWindow(hBar, PROGRESS_CLASS);
! };
!
! void osGetProgressBarReqSize(WindowHandle bar, int *res)
! {
! LONG lStyle = GetWindowLong(bar,GWL_STYLE);
!
! if (lStyle & PBS_VERTICAL)
! {
! res[0] = GetSystemMetrics(SM_CXVSCROLL);
! res[1] = GetSystemMetrics(SM_CYVSCROLL)*2;
! }
! else
! {
! res[0] = GetSystemMetrics(SM_CXHSCROLL)*2;
! res[1] = GetSystemMetrics(SM_CYHSCROLL);
! }
! }
!
! void osSetProgressBarFraction(WindowHandle bar, int minPos, int maxPos, int pos)
! {
! SendMessage(bar, PBM_SETRANGE32, minPos, maxPos);
! SendMessage(bar, PBM_SETPOS, pos, 0);
! }
!
! int osGetProgressBarFraction(WindowHandle bar, int minPos, int maxPos)
! {
! return SendMessage(bar, PBM_GETPOS, 0, 0);
! }
!
Index: RadioBox.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/RadioBox.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** RadioBox.c 26 Aug 2003 20:00:55 -0000 1.9
--- RadioBox.c 8 Oct 2003 22:21:57 -0000 1.10
***************
*** 10,14 ****
"BUTTON",
NULL,
! WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON | WS_TABSTOP,
0,0,0,0,
window,
--- 10,14 ----
"BUTTON",
NULL,
! WS_CHILD | BS_AUTORADIOBUTTON | WS_TABSTOP,
0,0,0,0,
window,
Index: Slider.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Slider.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Slider.c 2 Jul 2003 20:11:16 -0000 1.2
--- Slider.c 8 Oct 2003 22:21:57 -0000 1.3
***************
*** 1,73 ****
! #include "Slider.h"
! #include "Internals.h"
! #include "Handlers_stub.h"
!
! WindowHandle osCreateHorzSlider(WindowHandle form)
! {
! HWND hSlider;
!
! hSlider = CreateWindow(
! TRACKBAR_CLASS,
! NULL,
! TBS_AUTOTICKS | TBS_HORZ | WS_CHILD | WS_VISIBLE | WS_TABSTOP,
! 0,0,0,0,
! form,
! NULL,
! ghModule,
! NULL
! );
! return checkWindow(hSlider, TRACKBAR_CLASS);
! };
!
! WindowHandle osCreateVertSlider(WindowHandle form)
! {
! HWND hSlider;
!
! hSlider = CreateWindow(
! TRACKBAR_CLASS,
! NULL,
! TBS_AUTOTICKS | TBS_VERT | WS_CHILD | WS_VISIBLE | WS_TABSTOP,
! 0,0,0,0,
! form,
! NULL,
! ghModule,
! NULL
! );
! return checkWindow(hSlider, TRACKBAR_CLASS);
! };
!
! void osGetSliderReqSize(WindowHandle slider, int *res)
! {
! if (GetWindowLong(slider,GWL_STYLE) & TBS_HORZ)
! {
! res[0] = 32;
! res[1] = GetSystemMetrics(SM_CYHSCROLL);
! }
! else
! {
! res[0] = GetSystemMetrics(SM_CXVSCROLL);
! res[1] = 32;
! }
! }
!
! void osSetSliderRange(WindowHandle slider, int minPos, int maxPos)
! {
! SendMessage(slider, TBM_SETRANGEMAX, FALSE, maxPos);
! SendMessage(slider, TBM_SETRANGEMIN, TRUE, minPos);
! }
!
! void osGetSliderRange(WindowHandle slider, int *minPos, int *maxPos)
! {
! *maxPos = SendMessage(slider, TBM_GETRANGEMAX, 0, 0);
! *minPos = SendMessage(slider, TBM_GETRANGEMIN, 0, 0);
! }
!
! int osGetSliderPosition(WindowHandle slider)
! {
! return SendMessage(slider, TBM_GETPOS, 0, 0);
! }
!
! void osSetSliderPosition(WindowHandle slider, int pos)
! {
! SendMessage(slider, TBM_SETPOS, TRUE, pos);
! }
--- 1,73 ----
! #include "Slider.h"
! #include "Internals.h"
! #include "Handlers_stub.h"
!
! WindowHandle osCreateHorzSlider(WindowHandle form)
! {
! HWND hSlider;
!
! hSlider = CreateWindow(
! TRACKBAR_CLASS,
! NULL,
! TBS_AUTOTICKS | TBS_HORZ | WS_CHILD | WS_TABSTOP,
! 0,0,0,0,
! form,
! NULL,
! ghModule,
! NULL
! );
! return checkWindow(hSlider, TRACKBAR_CLASS);
! };
!
! WindowHandle osCreateVertSlider(WindowHandle form)
! {
! HWND hSlider;
!
! hSlider = CreateWindow(
! TRACKBAR_CLASS,
! NULL,
! TBS_AUTOTICKS | TBS_VERT | WS_CHILD | WS_TABSTOP,
! 0,0,0,0,
! form,
! NULL,
! ghModule,
! NULL
! );
! return checkWindow(hSlider, TRACKBAR_CLASS);
! };
!
! void osGetSliderReqSize(WindowHandle slider, int *res)
! {
! if (GetWindowLong(slider,GWL_STYLE) & TBS_HORZ)
! {
! res[0] = 32;
! res[1] = GetSystemMetrics(SM_CYHSCROLL);
! }
! else
! {
! res[0] = GetSystemMetrics(SM_CXVSCROLL);
! res[1] = 32;
! }
! }
!
! void osSetSliderRange(WindowHandle slider, int minPos, int maxPos)
! {
! SendMessage(slider, TBM_SETRANGEMAX, FALSE, maxPos);
! SendMessage(slider, TBM_SETRANGEMIN, TRUE, minPos);
! }
!
! void osGetSliderRange(WindowHandle slider, int *minPos, int *maxPos)
! {
! *maxPos = SendMessage(slider, TBM_GETRANGEMAX, 0, 0);
! *minPos = SendMessage(slider, TBM_GETRANGEMIN, 0, 0);
! }
!
! int osGetSliderPosition(WindowHandle slider)
! {
! return SendMessage(slider, TBM_GETPOS, 0, 0);
! }
!
! void osSetSliderPosition(WindowHandle slider, int pos)
! {
! SendMessage(slider, TBM_SETPOS, TRUE, pos);
! }
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK
In directory sc8-pr-cvs1:/tmp/cvs-serv10254/src/cbits/GTK
Modified Files:
Button.c CheckBox.c EditBox.c GroupBox.c Label.c ListBox.c
Notebook.c PopUp.c ProgressBar.c RadioBox.c Slider.c
Log Message:
Any control must be hidden by default. The control will be show if it is
contained in the window layout
Index: Button.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Button.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** Button.c 2 Oct 2003 22:31:39 -0000 1.10
--- Button.c 8 Oct 2003 22:21:57 -0000 1.11
***************
*** 13,17 ****
NULL);
port_layout_put(PORT_LAYOUT(GTK_BIN(window)->child), button);
- gtk_widget_show(button);
return button;
--- 13,16 ----
Index: CheckBox.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/CheckBox.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** CheckBox.c 2 Oct 2003 22:31:39 -0000 1.9
--- CheckBox.c 8 Oct 2003 22:21:57 -0000 1.10
***************
*** 12,16 ****
GTK_SIGNAL_FUNC(handleControlCommand),
NULL);
- gtk_widget_show(check_btn);
return check_btn;
--- 12,15 ----
Index: EditBox.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/EditBox.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** EditBox.c 7 Oct 2003 20:20:42 -0000 1.13
--- EditBox.c 8 Oct 2003 22:21:57 -0000 1.14
***************
*** 10,14 ****
GTK_ENTRY(entry)->is_cell_renderer = TRUE;
port_layout_put(PORT_LAYOUT(GTK_BIN(window)->child), entry);
! gtk_widget_show(entry);
return entry;
};
--- 10,14 ----
GTK_ENTRY(entry)->is_cell_renderer = TRUE;
port_layout_put(PORT_LAYOUT(GTK_BIN(window)->child), entry);
!
return entry;
};
Index: GroupBox.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/GroupBox.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** GroupBox.c 4 Oct 2003 17:04:48 -0000 1.4
--- GroupBox.c 8 Oct 2003 22:21:57 -0000 1.5
***************
*** 6,15 ****
WindowHandle osCreateGroupBox(WindowHandle window)
{
! GtkWidget *groupbox;
groupbox = gtk_frame_new("");
! gtk_container_add(GTK_CONTAINER(groupbox), port_layout_new(NULL,NULL));
port_layout_put(PORT_LAYOUT(GTK_BIN(window)->child), groupbox);
- gtk_widget_show_all(groupbox);
return groupbox;
--- 6,16 ----
WindowHandle osCreateGroupBox(WindowHandle window)
{
! GtkWidget *groupbox, *layout;
+ layout = port_layout_new(NULL,NULL);
groupbox = gtk_frame_new("");
! gtk_container_add(GTK_CONTAINER(groupbox), layout);
! gtk_widget_show(layout);
port_layout_put(PORT_LAYOUT(GTK_BIN(window)->child), groupbox);
return groupbox;
Index: Label.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Label.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Label.c 2 Oct 2003 22:31:39 -0000 1.9
--- Label.c 8 Oct 2003 22:21:57 -0000 1.10
***************
*** 11,15 ****
gtk_label_set_line_wrap(GTK_LABEL(text), gtk_false());
port_layout_put(PORT_LAYOUT(GTK_BIN(window)->child), text);
! gtk_widget_show(text);
return text;
};
--- 11,15 ----
gtk_label_set_line_wrap(GTK_LABEL(text), gtk_false());
port_layout_put(PORT_LAYOUT(GTK_BIN(window)->child), text);
!
return text;
};
Index: ListBox.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/ListBox.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** ListBox.c 1 Oct 2003 21:47:15 -0000 1.9
--- ListBox.c 8 Oct 2003 22:21:57 -0000 1.10
***************
*** 41,44 ****
--- 41,45 ----
gtk_container_add(GTK_CONTAINER(sw), lbox);
+ gtk_widget_show(lbox);
g_signal_connect (G_OBJECT(gtk_tree_view_get_selection(GTK_TREE_VIEW(lbox))), "changed",
***************
*** 47,51 ****
port_layout_put(PORT_LAYOUT(GTK_BIN(window)->child), sw);
! gtk_widget_show_all(sw);
return sw;
};
--- 48,52 ----
port_layout_put(PORT_LAYOUT(GTK_BIN(window)->child), sw);
!
return sw;
};
Index: Notebook.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Notebook.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Notebook.c 4 Oct 2003 17:04:48 -0000 1.7
--- Notebook.c 8 Oct 2003 22:21:57 -0000 1.8
***************
*** 24,28 ****
gtk_notebook_popup_enable(GTK_NOTEBOOK(notebook));
port_layout_put(PORT_LAYOUT(GTK_BIN(window)->child), notebook);
- gtk_widget_show(notebook);
return notebook;
--- 24,27 ----
Index: PopUp.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/PopUp.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** PopUp.c 1 Oct 2003 21:47:15 -0000 1.7
--- PopUp.c 8 Oct 2003 22:21:57 -0000 1.8
***************
*** 20,24 ****
popup);
port_layout_put(PORT_LAYOUT(GTK_BIN(window)->child), popup);
! gtk_widget_show(popup);
return popup;
};
--- 20,24 ----
popup);
port_layout_put(PORT_LAYOUT(GTK_BIN(window)->child), popup);
!
return popup;
};
Index: ProgressBar.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/ProgressBar.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ProgressBar.c 1 Oct 2003 21:47:15 -0000 1.3
--- ProgressBar.c 8 Oct 2003 22:21:57 -0000 1.4
***************
*** 12,16 ****
port_layout_put(PORT_LAYOUT(GTK_BIN(window)->child), bar);
- gtk_widget_show(bar);
return bar;
--- 12,15 ----
***************
*** 26,30 ****
port_layout_put(PORT_LAYOUT(GTK_BIN(window)->child), bar);
- gtk_widget_show(bar);
return bar;
--- 25,28 ----
Index: RadioBox.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/RadioBox.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** RadioBox.c 2 Oct 2003 22:31:39 -0000 1.10
--- RadioBox.c 8 Oct 2003 22:21:57 -0000 1.11
***************
*** 14,18 ****
GTK_SIGNAL_FUNC(handleControlCommand),
NULL);
- gtk_widget_show(radio_btn);
return radio_btn;
--- 14,17 ----
Index: Slider.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Slider.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Slider.c 1 Oct 2003 21:47:15 -0000 1.3
--- Slider.c 8 Oct 2003 22:21:57 -0000 1.4
***************
*** 18,23 ****
port_layout_put(PORT_LAYOUT(GTK_BIN(window)->child), slider);
- gtk_widget_show(slider);
-
return slider;
};
--- 18,21 ----
***************
*** 32,36 ****
slider);
port_layout_put(PORT_LAYOUT(GTK_BIN(window)->child), slider);
- gtk_widget_show(slider);
return slider;
--- 30,33 ----
|
|
From: <kr_...@us...> - 2003-10-07 21:59:30
|
Update of /cvsroot/htoolkit/port/src/include In directory sc8-pr-cvs1:/tmp/cvs-serv21972/src/include Modified Files: Window.h Log Message: make possible to hide/show controls at any time Index: Window.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/include/Window.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Window.h 7 Oct 2003 21:31:34 -0000 1.11 --- Window.h 7 Oct 2003 21:59:26 -0000 1.12 *************** *** 58,61 **** --- 58,62 ---- void osSetControlEnabled(WindowHandle ctrl, BOOL enabled); BOOL osGetControlEnabled(WindowHandle ctrl); + void osSetControlVisible(WindowHandle ctrl, BOOL visible); void osSetControlTip(WindowHandle ctrl, char *text); char *osGetControlTip(WindowHandle ctrl); |
|
From: <kr_...@us...> - 2003-10-07 21:59:29
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32
In directory sc8-pr-cvs1:/tmp/cvs-serv21972/src/cbits/Win32
Modified Files:
Window.c
Log Message:
make possible to hide/show controls at any time
Index: Window.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Window.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -d -r1.50 -r1.51
*** Window.c 7 Oct 2003 21:31:34 -0000 1.50
--- Window.c 7 Oct 2003 21:59:25 -0000 1.51
***************
*** 993,997 ****
BOOL osGetWindowVisible(WindowHandle window)
{
! return (GetWindowLong(hCtrl, GWL_STYLE) & WS_VISIBLE) != 0;
}
--- 993,997 ----
BOOL osGetWindowVisible(WindowHandle window)
{
! return (GetWindowLong(window, GWL_STYLE) & WS_VISIBLE) != 0;
}
***************
*** 1209,1212 ****
--- 1209,1217 ----
return (i >= pData->disabledCtrlsCount);
}
+ }
+
+ void osSetControlVisible(WindowHandle ctrl, BOOL visible)
+ {
+ ShowWindow(ctrl, visible ? SW_SHOW : SW_HIDE);
}
|
|
From: <kr_...@us...> - 2003-10-07 21:59:29
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK
In directory sc8-pr-cvs1:/tmp/cvs-serv21972/src/cbits/GTK
Modified Files:
Window.c
Log Message:
make possible to hide/show controls at any time
Index: Window.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Window.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** Window.c 7 Oct 2003 21:31:33 -0000 1.34
--- Window.c 7 Oct 2003 21:59:25 -0000 1.35
***************
*** 759,762 ****
--- 759,770 ----
}
+ void osSetControlVisible(WindowHandle ctrl, BOOL visible)
+ {
+ if (visible)
+ gtk_widget_show(ctrl);
+ else
+ gtk_widget_hide(ctrl);
+ }
+
static GtkTooltips *gTooltips;
|
|
From: <kr_...@us...> - 2003-10-07 21:59:29
|
Update of /cvsroot/htoolkit/port/src/Port
In directory sc8-pr-cvs1:/tmp/cvs-serv21972/src/Port
Modified Files:
Controls.hs
Log Message:
make possible to hide/show controls at any time
Index: Controls.hs
===================================================================
RCS file: /cvsroot/htoolkit/port/src/Port/Controls.hs,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** Controls.hs 7 Oct 2003 20:20:42 -0000 1.23
--- Controls.hs 7 Oct 2003 21:59:25 -0000 1.24
***************
*** 44,47 ****
--- 44,48 ----
, getControlFrame
, setControlEnabled, getControlEnabled
+ , setControlVisible
, setControlTip, getControlTip
-- * Label
***************
*** 135,138 ****
--- 136,141 ----
foreign import ccall unsafe "osSetControlEnabled" setControlEnabled :: WindowHandle -> Bool -> IO ()
foreign import ccall unsafe "osGetControlEnabled" getControlEnabled :: WindowHandle -> IO Bool
+
+ foreign import ccall unsafe "osSetControlVisible" setControlVisible :: WindowHandle -> Bool -> IO ()
getControlTip :: WindowHandle -> IO String
|
|
From: <kr_...@us...> - 2003-10-07 21:43:52
|
Update of /cvsroot/htoolkit/gio/src/examples/worm
In directory sc8-pr-cvs1:/tmp/cvs-serv16778/src/examples/worm
Modified Files:
Main.hs
Log Message:
Make possible to hide/show a window at any time. The newly created window is always hidden.
Index: Main.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/examples/worm/Main.hs,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Main.hs 4 Oct 2003 08:34:24 -0000 1.9
--- Main.hs 7 Oct 2003 21:39:31 -0000 1.10
***************
*** 67,70 ****
--- 67,71 ----
, resizeable =: False
]
+ showWindow w
-- Timer
|
|
From: <kr_...@us...> - 2003-10-07 21:43:37
|
Update of /cvsroot/htoolkit/gio/src/examples/life In directory sc8-pr-cvs1:/tmp/cvs-serv16778/src/examples/life Modified Files: Main.hs Log Message: Make possible to hide/show a window at any time. The newly created window is always hidden. Index: Main.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/examples/life/Main.hs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Main.hs 3 Oct 2003 12:54:39 -0000 1.2 --- Main.hs 7 Oct 2003 21:39:31 -0000 1.3 *************** *** 23,28 **** myorigin = Point (dw `div` 2) (dh `div` 2) w <- window [domain =: mydomain, origin =: myorigin, bgcolor =: black] ! set w [on mouse =: onMouse w ref, on paint =: onPaint ref] ! set w [origin =: myorigin] mfile <- menu [title =: "File"] mainMenu --- 23,28 ---- myorigin = Point (dw `div` 2) (dh `div` 2) w <- window [domain =: mydomain, origin =: myorigin, bgcolor =: black] ! set w [on mouse =: onMouse w ref, on paint =: onPaint ref, origin =: myorigin] ! showWindow w mfile <- menu [title =: "File"] mainMenu |
|
From: <kr_...@us...> - 2003-10-07 21:41:10
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO
In directory sc8-pr-cvs1:/tmp/cvs-serv16778/src/Graphics/UI/GIO
Modified Files:
Window.hs
Log Message:
Make possible to hide/show a window at any time. The newly created window is always hidden.
Index: Window.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Window.hs,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** Window.hs 31 Aug 2003 11:48:26 -0000 1.27
--- Window.hs 7 Oct 2003 21:39:31 -0000 1.28
***************
*** 11,15 ****
-}
-----------------------------------------------------------------------------------------
! module Graphics.UI.GIO.Window (Window, window, dialog, view, runDialog) where
import qualified Graphics.UI.Port as Lib
--- 11,15 ----
-}
-----------------------------------------------------------------------------------------
! module Graphics.UI.GIO.Window (Window, window, dialog, view, visible, runDialog, showWindow, hideWindow) where
import qualified Graphics.UI.Port as Lib
***************
*** 40,52 ****
= do w <- Lib.createWindow >>= form windowPen
set w props
- Lib.showWindow (hwindow w)
return w
-- | Create a modeless dialog box. If you want to make the dialog modal use 'runDialog' function.
! dialog :: [Prop Window]
! -> Maybe Window -- ^ The owner window of the dialog being created.
-- If this parameter is Nothing or is a @Just handle@ of a window instead of dialog
! -- then the dialog owner is the process window. A dialog is always above its owner
! -- in the z-order and the system automatically destroys a dialog when its owner is
-- destroyed. The dialog is automatically hidded when its owner is minimized.
-> IO Window
--- 40,51 ----
= do w <- Lib.createWindow >>= form windowPen
set w props
return w
-- | Create a modeless dialog box. If you want to make the dialog modal use 'runDialog' function.
! dialog :: [Prop Window]
! -> Maybe Window -- ^ The owner window of the dialog being created.
-- If this parameter is Nothing or is a @Just handle@ of a window instead of dialog
! -- then the dialog owner is the process window. A dialog is always above its owner
! -- in the z-order and the system automatically destroys a dialog when its owner is
-- destroyed. The dialog is automatically hidded when its owner is minimized.
-> IO Window
***************
*** 55,59 ****
w <- Lib.createDialog hparent >>= form dialogPen
set w props
- Lib.showWindow (hwindow w)
return w
--- 54,57 ----
***************
*** 62,65 ****
--- 60,71 ----
runDialog w = Lib.runDialog (hwindow w)
+ -- | Activates the window and displays it in its current size and position.
+ showWindow :: Window -> IO ()
+ showWindow w = Lib.setWindowVisible (hwindow w) True
+
+ -- | Hides the window and activates another window.
+ hideWindow :: Window -> IO ()
+ hideWindow w = Lib.setWindowVisible (hwindow w) False
+
form :: Pen -> WindowHandle -> IO Window
form pen hwindow
***************
*** 69,75 ****
vdomain <- newVar (sz 0 0)
vresizeable<- newVar True
! vpen <- newVar pen
vbufferMode<- newVar UnBuffered
! return (Window hwindow vdomain vresizeable vautosize
vpen vbufferMode vpaint vlayout
)
--- 75,81 ----
vdomain <- newVar (sz 0 0)
vresizeable<- newVar True
! vpen <- newVar pen
vbufferMode<- newVar UnBuffered
! return (Window hwindow vdomain vresizeable vautosize
vpen vbufferMode vpaint vlayout
)
***************
*** 77,81 ****
set w [on relayout =: relayoutWindow w]
-- just by setting a dummy paint function, we will at least intialize the canvas properly on a repaint
! set w [on paint =: (\_ _ _ -> return ())]
return w
--- 83,87 ----
set w [on relayout =: relayoutWindow w]
-- just by setting a dummy paint function, we will at least intialize the canvas properly on a repaint
! set w [on paint =: (\_ _ _ -> return ())]
return w
***************
*** 114,117 ****
--- 120,127 ----
view = newStdAttr hwindow Lib.getWindowViewSize Lib.setWindowViewSize
+ -- | The attribute controls whether the window is visible
+ visible :: Attr Window Bool
+ visible = newStdAttr hwindow Lib.getWindowVisible Lib.setWindowVisible
+
instance Dismissible Window where
dismissWidget w = Lib.dismissWindow (hwindow w)
***************
*** 119,123 ****
instance Deadly Window where
! destroyWidget w = Lib.destroyWindow (hwindow w)
destroy = newStdEvent hwindow Lib.getWindowDestroyHandler Lib.setWindowDestroyHandler Lib.setWindowDestroyDefHandler
--- 129,133 ----
instance Deadly Window where
! destroyWidget w = Lib.destroyWindow (hwindow w)
destroy = newStdEvent hwindow Lib.getWindowDestroyHandler Lib.setWindowDestroyHandler Lib.setWindowDestroyDefHandler
|
|
From: <kr_...@us...> - 2003-10-07 21:41:03
|
Update of /cvsroot/htoolkit/gio/src/examples/picture In directory sc8-pr-cvs1:/tmp/cvs-serv16778/src/examples/picture Modified Files: Main.hs Log Message: Make possible to hide/show a window at any time. The newly created window is always hidden. Index: Main.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/examples/picture/Main.hs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Main.hs 4 Oct 2003 08:34:24 -0000 1.2 --- Main.hs 7 Oct 2003 21:39:31 -0000 1.3 *************** *** 125,128 **** --- 125,129 ---- , on paint =: onPaint w pic ref ] + showWindow w where onDestroyPicWindow mpic mclose = do |
Update of /cvsroot/htoolkit/gio/src/examples/simple
In directory sc8-pr-cvs1:/tmp/cvs-serv16778/src/examples/simple
Modified Files:
Able.hs BitmapViewer.hs BouncingBalls.hs ByeDemo.hs
Calculator.hs ConfigKey.hs ConfirmQuit.hs Counter.hs Fonts.hs
Hanoi.hs Progress.hs SimpleControls.hs SimpleDialog.hs
SimpleDrawing.hs SimpleHello.hs SimpleMenu.hs
SimpleQuitButton.hs
Log Message:
Make possible to hide/show a window at any time. The newly created window is always hidden.
Index: Able.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/examples/simple/Able.hs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Able.hs 1 Jul 2003 20:44:00 -0000 1.5
--- Able.hs 7 Oct 2003 21:39:31 -0000 1.6
***************
*** 16,19 ****
--- 16,21 ----
enable "Control" bctrl ent
enable "Window" bwnd w1
+ showWindow w1
+ showWindow w2
return ()
where
Index: BitmapViewer.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/examples/simple/BitmapViewer.hs,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** BitmapViewer.hs 30 May 2003 11:58:16 -0000 1.7
--- BitmapViewer.hs 7 Oct 2003 21:39:31 -0000 1.8
***************
*** 45,46 ****
--- 45,47 ----
, on deactivate =: set mclose [enabled =: False, off command]
]
+ showWindow w
Index: BouncingBalls.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/examples/simple/BouncingBalls.hs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** BouncingBalls.hs 3 Jul 2003 16:49:55 -0000 1.5
--- BouncingBalls.hs 7 Oct 2003 21:39:31 -0000 1.6
***************
*** 21,24 ****
--- 21,25 ----
]
+ showWindow w
where
nextBalls w vballs
Index: ByeDemo.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/examples/simple/ByeDemo.hs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ByeDemo.hs 1 Jul 2003 20:44:00 -0000 1.5
--- ByeDemo.hs 7 Oct 2003 21:39:31 -0000 1.6
***************
*** 24,28 ****
b <- button [title =: "Bye"] w
set w [layout =: pad 10 (center l ^^^^ center b)]
! set b [on command =: bye l b]
where
-- called on the first click, with the window, label, and button as arguments.
--- 24,29 ----
b <- button [title =: "Bye"] w
set w [layout =: pad 10 (center l ^^^^ center b)]
! set b [on command =: bye l b]
! showWindow w
where
-- called on the first click, with the window, label, and button as arguments.
Index: Calculator.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/examples/simple/Calculator.hs,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Calculator.hs 21 Jun 2003 10:14:47 -0000 1.6
--- Calculator.hs 7 Oct 2003 21:39:31 -0000 1.7
***************
*** 16,19 ****
--- 16,20 ----
"123+456-789*C0=/"
set w [layout =: (pad 10 (hglue <<< display)) ^^^ grid (matrix 4 (map (hfix 50) keys))]
+ showWindow w
where
matrix n [] = []
Index: ConfigKey.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/examples/simple/ConfigKey.hs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ConfigKey.hs 4 Jul 2003 17:41:04 -0000 1.1
--- ConfigKey.hs 7 Oct 2003 21:39:31 -0000 1.2
***************
*** 12,13 ****
--- 12,14 ----
l <- label [title =: prompt ++ show value] w
set w [layout =: l]
+ showWindow w
Index: ConfirmQuit.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/examples/simple/ConfirmQuit.hs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** ConfirmQuit.hs 1 Jul 2003 20:44:00 -0000 1.4
--- ConfirmQuit.hs 7 Oct 2003 21:39:31 -0000 1.5
***************
*** 8,11 ****
--- 8,12 ----
do w <- window [view =: sz 200 200]
set w [on dismiss =: confirmQuit w]
+ showWindow w
where
confirmQuit w
Index: Counter.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/examples/simple/Counter.hs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Counter.hs 13 Jul 2003 11:50:31 -0000 1.1
--- Counter.hs 7 Oct 2003 21:39:31 -0000 1.2
***************
*** 9,12 ****
--- 9,13 ----
bminus <- button [title =: "+", tooltip =: "Increment Value", on command =: upd (\x->x+1) ent] w
set w [layout =: hfill ent ^^^ hcenter (pad 5 (fill bplus <<< fill bminus))]
+ showWindow w
where
upd f ent = set ent [title ~: show . f . read]
Index: Fonts.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/examples/simple/Fonts.hs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Fonts.hs 13 Jul 2003 17:51:31 -0000 1.1
--- Fonts.hs 7 Oct 2003 21:39:31 -0000 1.2
***************
*** 1,63 ****
! module Main where
!
! import Data.FiniteMap
! import Graphics.UI.GIO
!
! main = start "Fonts" "1.0" SDI [] $ do
! w <- window []
! set w [on paint =: onPaint w, on resize =: \_ -> repaint w]
! names <- getFontNames
! styles <- popup [] w
! sizes <- popup [] w
! fonts <- popup [items =: map (\name -> (name, onSetFontName w styles sizes name)) names] w
! set w [layout =: hfill fonts <<< hfill styles <<< hfill sizes, size =: Size 400 200]
! where
! onSetFontName w styles popSizes name = do
! variants <- getFontVariants name 1 40
! set styles [items =: foldFM (\w_s sizes items -> styleToItem w_s sizes : items) [] variants]
! where
! styleToItem (weight,style) sizes =
! (variantToString weight style, onSetFontStyle popSizes w name weight style sizes)
!
! onSetFontStyle popSizes w name weight style sizes =
! set popSizes [items =: map sizeToItem sizes]
! where
! sizeToItem size =
! (show size, onSetFontSize w (FontDef { fontName=name
! , fontSize=size
! , fontWeight=weight
! , fontStyle=style
! , fontUnderline=False
! , fontStrikeOut=False
! }))
!
! onSetFontSize :: Window -> FontDef -> IO ()
! onSetFontSize w fontdef = do
! myfont <- createFont fontdef
! set w [font =: myfont]
! repaint w
!
! onPaint w can _ _ = do
! size <- get w view
! metrics <- get can canvasFontMetrics
! width <- get can (canvasFontStringWidth text)
! let Rect l t r b = centralRect (rectOfSize size) (Size width (fontLineHeight metrics))
! drawString (Point l (t+fontAscent metrics)) text can
! where
! text = "Hello, world!"
!
! variantToString weight style = weightToString weight ++ " " ++ styleToString style
! where
! weightToString 100 = "thin"
! weightToString 200 = "ultra light"
! weightToString 300 = "light"
! weightToString 400 = "regular"
! weightToString 500 = "medium"
! weightToString 600 = "demi bold"
! weightToString 700 = "bold"
! weightToString 800 = "ultra bold"
! weightToString 900 = "black"
!
! styleToString Roman = ""
! styleToString Italic = "italic"
! styleToString Oblique = "oblique"
--- 1,64 ----
! module Main where
!
! import Data.FiniteMap
! import Graphics.UI.GIO
!
! main = start "Fonts" "1.0" SDI [] $ do
! w <- window []
! set w [on paint =: onPaint w, on resize =: \_ -> repaint w]
! names <- getFontNames
! styles <- popup [] w
! sizes <- popup [] w
! fonts <- popup [items =: map (\name -> (name, onSetFontName w styles sizes name)) names] w
! set w [layout =: hfill fonts <<< hfill styles <<< hfill sizes, size =: Size 400 200]
! showWindow w
! where
! onSetFontName w styles popSizes name = do
! variants <- getFontVariants name 1 40
! set styles [items =: foldFM (\w_s sizes items -> styleToItem w_s sizes : items) [] variants]
! where
! styleToItem (weight,style) sizes =
! (variantToString weight style, onSetFontStyle popSizes w name weight style sizes)
!
! onSetFontStyle popSizes w name weight style sizes =
! set popSizes [items =: map sizeToItem sizes]
! where
! sizeToItem size =
! (show size, onSetFontSize w (FontDef { fontName=name
! , fontSize=size
! , fontWeight=weight
! , fontStyle=style
! , fontUnderline=False
! , fontStrikeOut=False
! }))
!
! onSetFontSize :: Window -> FontDef -> IO ()
! onSetFontSize w fontdef = do
! myfont <- createFont fontdef
! set w [font =: myfont]
! repaint w
!
! onPaint w can _ _ = do
! size <- get w view
! metrics <- get can canvasFontMetrics
! width <- get can (canvasFontStringWidth text)
! let Rect l t r b = centralRect (rectOfSize size) (Size width (fontLineHeight metrics))
! drawString (Point l (t+fontAscent metrics)) text can
! where
! text = "Hello, world!"
!
! variantToString weight style = weightToString weight ++ " " ++ styleToString style
! where
! weightToString 100 = "thin"
! weightToString 200 = "ultra light"
! weightToString 300 = "light"
! weightToString 400 = "regular"
! weightToString 500 = "medium"
! weightToString 600 = "demi bold"
! weightToString 700 = "bold"
! weightToString 800 = "ultra bold"
! weightToString 900 = "black"
!
! styleToString Roman = ""
! styleToString Italic = "italic"
! styleToString Oblique = "oblique"
Index: Hanoi.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/examples/simple/Hanoi.hs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Hanoi.hs 24 Aug 2003 15:35:56 -0000 1.4
--- Hanoi.hs 7 Oct 2003 21:39:31 -0000 1.5
***************
*** 29,35 ****
main = start "Hanoi" "1.0" SDI [] $ mdo
w <- window [domain =: Size 430 180, on paint =: onPaint ref]
!
ref <- newIORef (initTowers 0)
!
mhanoi <- menu [title =: "&Hanoi"] mainMenu
mrun <- menu [title =: "&Run (nr disks)"] mhanoi
--- 29,36 ----
main = start "Hanoi" "1.0" SDI [] $ mdo
w <- window [domain =: Size 430 180, on paint =: onPaint ref]
! showWindow w
!
ref <- newIORef (initTowers 0)
!
mhanoi <- menu [title =: "&Hanoi"] mainMenu
mrun <- menu [title =: "&Run (nr disks)"] mhanoi
***************
*** 38,42 ****
mhalt <- menuitem [title =: "Halt", accel =: KeyChar '.', enabled =: False, on command =: onHalt mrun mcont mhalt t] mhanoi
mcont <- menuitem [title =: "Continue", accel =: KeyChar ',', enabled =: False, on command =: onCont mrun mcont mhalt t] mhanoi
! mspeed <- menu [title =: "&Speed"] mhanoi
mVerySlow <- menuRadioItem [title =: "V&ery Slow", accel =: KeyChar '\^A', on command =: onSetSpeed speed1 t] mspeed
mSlow <- menuRadioItem [title =: "&Slow", accel =: KeyChar '\^S', on command =: onSetSpeed speed2 t] mspeed
--- 39,43 ----
mhalt <- menuitem [title =: "Halt", accel =: KeyChar '.', enabled =: False, on command =: onHalt mrun mcont mhalt t] mhanoi
mcont <- menuitem [title =: "Continue", accel =: KeyChar ',', enabled =: False, on command =: onCont mrun mcont mhalt t] mhanoi
! mspeed <- menu [title =: "&Speed"] mhanoi
mVerySlow <- menuRadioItem [title =: "V&ery Slow", accel =: KeyChar '\^A', on command =: onSetSpeed speed1 t] mspeed
mSlow <- menuRadioItem [title =: "&Slow", accel =: KeyChar '\^S', on command =: onSetSpeed speed2 t] mspeed
Index: Progress.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/examples/simple/Progress.hs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Progress.hs 21 Jun 2003 10:14:47 -0000 1.4
--- Progress.hs 7 Oct 2003 21:39:31 -0000 1.5
***************
*** 18,21 ****
--- 18,22 ----
set sld [on command =: changeSpeed tm sld]
set w [on destroy =: destroyWidget tm]
+ showWindow w
return ()
where
Index: SimpleControls.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/examples/simple/SimpleControls.hs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** SimpleControls.hs 1 Sep 2003 20:27:50 -0000 1.2
--- SimpleControls.hs 7 Oct 2003 21:39:31 -0000 1.3
***************
*** 4,12 ****
main = start "Controls" "1.0" SDI [] demo
!
demo :: IO ()
demo = do w <- window []
nb <- notebook [] w
!
-- Buttons page
pg1 <- notebookPage [title =: "Buttons"] nb
--- 4,12 ----
main = start "Controls" "1.0" SDI [] demo
!
demo :: IO ()
demo = do w <- window []
nb <- notebook [] w
!
-- Buttons page
pg1 <- notebookPage [title =: "Buttons"] nb
***************
*** 16,27 ****
set group [layout =: b1pg1 <<<< b2pg1]
set pg1 [layout =: group]
!
-- Edit page
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
group <- groupBox [title =: "Tabs"] w
--- 16,27 ----
set group [layout =: b1pg1 <<<< b2pg1]
set pg1 [layout =: group]
!
-- Edit page
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
group <- groupBox [title =: "Tabs"] w
***************
*** 35,37 ****
e <- entry [readOnly =: True, title =: "Hello, world!"] w
set w [layout =: (group <<< vfill (hfill nb)) ^^^ hfill e]
!
--- 35,37 ----
e <- entry [readOnly =: True, title =: "Hello, world!"] w
set w [layout =: (group <<< vfill (hfill nb)) ^^^ hfill e]
! showWindow w
Index: SimpleDialog.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/examples/simple/SimpleDialog.hs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** SimpleDialog.hs 1 Jul 2003 20:44:00 -0000 1.2
--- SimpleDialog.hs 7 Oct 2003 21:39:31 -0000 1.3
***************
*** 2,6 ****
import Graphics.UI.GIO
- import Control.Monad(when)
main
--- 2,5 ----
***************
*** 15,18 ****
b2 <- button [title =: "Open Modeless Dialog", on command =: showDialog False (Just d)] d
set d [layout =: pad 10 (center (b1 <<< b2))]
! when b (runDialog d)
--- 14,17 ----
b2 <- button [title =: "Open Modeless Dialog", on command =: showDialog False (Just d)] d
set d [layout =: pad 10 (center (b1 <<< b2))]
! (if b then runDialog else showWindow) d
Index: SimpleDrawing.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/examples/simple/SimpleDrawing.hs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** SimpleDrawing.hs 30 May 2003 11:58:16 -0000 1.5
--- SimpleDrawing.hs 7 Oct 2003 21:39:31 -0000 1.6
***************
*** 10,13 ****
--- 10,14 ----
]
set w [on motion =: \p -> set w [title =: ("mouse is at " ++ show p)]]
+ showWindow w
where
mypaint sserif14b c updFrame updArea
Index: SimpleHello.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/examples/simple/SimpleHello.hs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** SimpleHello.hs 1 Jul 2003 20:44:00 -0000 1.4
--- SimpleHello.hs 7 Oct 2003 21:39:31 -0000 1.5
***************
*** 3,7 ****
import Graphics.UI.GIO
! main
! = start "hello world" "1.0" SDI [] $
! do window [view =: sz 200 200]
--- 3,5 ----
import Graphics.UI.GIO
! main = start "hello world" "1.0" SDI [] (window [view =: sz 200 200] >>= showWindow)
Index: SimpleMenu.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/examples/simple/SimpleMenu.hs,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** SimpleMenu.hs 15 Aug 2003 21:24:54 -0000 1.9
--- SimpleMenu.hs 7 Oct 2003 21:39:31 -0000 1.10
***************
*** 6,9 ****
--- 6,10 ----
= start "SimpleMenu" "1.0" SDI [] $
do w <- window [view =: sz 200 200]
+ showWindow w
bmpNew <- readBitmap "res/new.bmp" []
Index: SimpleQuitButton.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/examples/simple/SimpleQuitButton.hs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** SimpleQuitButton.hs 1 Jul 2003 20:44:00 -0000 1.4
--- SimpleQuitButton.hs 7 Oct 2003 21:39:31 -0000 1.5
***************
*** 9,10 ****
--- 9,11 ----
q <- button [title =: "Quit", on command =: halt] w
set w [layout =: pad 10 (center q)]
+ showWindow w
|