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-20 22:03:50
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK
In directory sc8-pr-cvs1:/tmp/cvs-serv29266/src/cbits/GTK
Modified Files:
LayoutContainer.c LayoutContainer.h Window.c
Log Message:
Implementation for dialogs with minimal size
Index: LayoutContainer.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/LayoutContainer.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** LayoutContainer.c 1 Oct 2003 21:47:15 -0000 1.1
--- LayoutContainer.c 20 Oct 2003 18:19:22 -0000 1.2
***************
*** 456,459 ****
--- 456,461 ----
layout->scroll_y = 0;
layout->visibility = GDK_VISIBILITY_PARTIAL;
+ layout->requisition.width = 0;
+ layout->requisition.height = 0;
}
***************
*** 596,600 ****
{
GList *tmp_list;
! GtkLayout *layout;
g_return_if_fail (PORT_IS_LAYOUT (widget));
--- 598,602 ----
{
GList *tmp_list;
! PortLayout *layout;
g_return_if_fail (PORT_IS_LAYOUT (widget));
***************
*** 602,607 ****
layout = PORT_LAYOUT (widget);
! requisition->width = 0;
! requisition->height = 0;
tmp_list = layout->children;
--- 604,609 ----
layout = PORT_LAYOUT (widget);
! requisition->width = layout->requisition.width;
! requisition->height = layout->requisition.height;
tmp_list = layout->children;
Index: LayoutContainer.h
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/LayoutContainer.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** LayoutContainer.h 1 Oct 2003 21:47:15 -0000 1.1
--- LayoutContainer.h 20 Oct 2003 18:19:23 -0000 1.2
***************
*** 34,37 ****
--- 34,38 ----
gint scroll_x;
gint scroll_y;
+ GtkRequisition requisition;
};
Index: Window.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Window.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -d -r1.41 -r1.42
*** Window.c 20 Oct 2003 18:11:34 -0000 1.41
--- Window.c 20 Oct 2003 18:19:23 -0000 1.42
***************
*** 922,924 ****
--- 922,929 ----
void osSetDialogMinSize(WindowHandle dialog, int w, int h)
{
+ if (gtk_widget_get_toplevel(dialog) != gFrameWidget)
+ {
+ PORT_LAYOUT(GTK_BIN(dialog)->child)->requisition.width = w;
+ PORT_LAYOUT(GTK_BIN(dialog)->child)->requisition.height = h;
+ }
}
|
|
From: <kr_...@us...> - 2003-10-20 18:14:42
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK
In directory sc8-pr-cvs1:/tmp/cvs-serv28222/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.40
retrieving revision 1.41
diff -C2 -d -r1.40 -r1.41
*** Window.c 17 Oct 2003 23:22:55 -0000 1.40
--- Window.c 20 Oct 2003 18:11:34 -0000 1.41
***************
*** 879,891 ****
if (toplevel != gFrameWidget || gDocumentInterface == 1)
{
! GdkGeometry geometry;
! geometry.min_width = gFrameWidth;
! geometry.min_height = gFrameHeight;
! geometry.max_width = gFrameWidth;
! geometry.max_height = gFrameHeight;
! gtk_window_set_geometry_hints(GTK_WINDOW(toplevel), toplevel, &geometry,
GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE);
}
}
--- 879,898 ----
if (toplevel != gFrameWidget || gDocumentInterface == 1)
{
! GTK_WINDOW(toplevel)->allow_grow = (resizeable != FALSE);
! if (resizeable)
! gtk_window_set_geometry_hints(GTK_WINDOW(toplevel), toplevel, NULL, 0);
! else
! {
! GdkGeometry geometry;
! geometry.min_width = toplevel->allocation.width;
! geometry.min_height = toplevel->allocation.height;
! geometry.max_width = toplevel->allocation.width;
! geometry.max_height = toplevel->allocation.height;
!
! gtk_window_set_geometry_hints(GTK_WINDOW(toplevel), toplevel, &geometry,
GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE);
+ }
}
}
|
|
From: <kr_...@us...> - 2003-10-20 13:06:53
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO In directory sc8-pr-cvs1:/tmp/cvs-serv31855/src/Graphics/UI/GIO Modified Files: Process.hs Log Message: Be Haskell98 Index: Process.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Process.hs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Process.hs 4 Jul 2003 17:39:04 -0000 1.4 --- Process.hs 20 Oct 2003 10:17:20 -0000 1.5 *************** *** 27,34 **** import Graphics.UI.Port(ConfigKey(..)) ! data Process pc :: Process ! pc = error "The Process is an abstract object and cannot be evaluated" instance Dismissible Process where --- 27,34 ---- import Graphics.UI.Port(ConfigKey(..)) ! data Process = Process pc :: Process ! pc = Process instance Dismissible Process where |
|
From: <kr_...@us...> - 2003-10-19 11:15:21
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO
In directory sc8-pr-cvs1:/tmp/cvs-serv7625/src/Graphics/UI/GIO
Modified Files:
Layout.hs
Log Message:
More clever layout algorithm. Added support for stretch/hstretch/vstretch
Index: Layout.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Layout.hs,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** Layout.hs 10 Oct 2003 14:21:52 -0000 1.8
--- Layout.hs 19 Oct 2003 09:33:20 -0000 1.9
***************
*** 103,106 ****
--- 103,107 ----
-- * Stretch
, hfill, vfill, fill
+ , hstretch, vstretch, stretch
, hrigid, vrigid, rigid
, hfix, vfix
***************
*** 221,224 ****
--- 222,226 ----
| Changer (Pack -> Pack) Layout
| Control WindowHandle WindowHandle (WindowHandle -> IO Size) -- parent handle, control handle, get request size
+ | Empty
{--------------------------------------------------------------------
***************
*** 227,233 ****
-- | Primitive: An empty invisible control with a zero size.
empty :: Layout
! -- 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').
--- 229,233 ----
-- | Primitive: An empty invisible control with a zero size.
empty :: Layout
! empty = Empty
-- | Primitive: Create a grid of controls, gives precise control over alignment. (See also 'tabular').
***************
*** 257,282 ****
-- | Make a control rigid -- it won't stretch to fit the available space (default).
rigid :: Control w => w -> Layout
! rigid w = Changer (\l -> l{ stretchX = False, stretchY = False }) (pack w)
-- | Make a control vertically rigid -- it won't stretch to fit the available space (default).
vrigid :: Control w => w -> Layout
! vrigid w = Changer (\l -> l{ stretchY = False }) (pack w)
-- | Make a control horizontally rigid -- it won't stretch to fit the available space (default).
hrigid :: Control w => w -> Layout
! hrigid w = Changer (\l -> l{ stretchX = False }) (pack w)
-- | The control will stretch both horizontally and vertically to fill the available space.
fill :: Control w => w -> Layout
! fill w = Changer (\l -> l{ stretchX = True, stretchY = True }) (pack w)
-- | The control will stretch horizontally to fit in the available space.
hfill :: Control w => w -> Layout
! hfill w = Changer (\l -> l{ stretchX = True }) (pack w)
-- | The control stretches vertically to fit in the available space.
vfill :: Control w => w -> Layout
! vfill w = Changer (\l -> l{ stretchY = True }) (pack w)
-- | Set the preferred width of a control.
--- 257,309 ----
-- | Make a control rigid -- it won't stretch to fit the available space (default).
rigid :: Control w => w -> Layout
! rigid w = Changer (\l -> l{ stretchX = False, stretchY = False, fillX = False, fillY = False }) (pack w)
-- | Make a control vertically rigid -- it won't stretch to fit the available space (default).
vrigid :: Control w => w -> Layout
! vrigid w = Changer (\l -> l{ stretchY = False, fillY = False }) (pack w)
-- | Make a control horizontally rigid -- it won't stretch to fit the available space (default).
hrigid :: Control w => w -> Layout
! hrigid w = Changer (\l -> l{ stretchX = False, fillX = False }) (pack w)
-- | The control will stretch both horizontally and vertically to fill the available space.
+ -- Any grid with at least one filling item will also stretch to fill
+ -- the entire available space.
fill :: Control w => w -> Layout
! fill w = Changer (\l -> l{ stretchX = True, stretchY = True, fillX = True, fillY = True }) (pack w)
-- | The control will stretch horizontally to fit in the available space.
+ -- Any grid with at least one filling item will also stretch to fill
+ -- the entire available space.
hfill :: Control w => w -> Layout
! hfill w = Changer (\l -> l{ stretchX = True, fillX = True }) (pack w)
-- | The control stretches vertically to fit in the available space.
+ -- Any grid with at least one filling item will also stretch to fill
+ -- the entire available space.
vfill :: Control w => w -> Layout
! vfill w = Changer (\l -> l{ stretchY = True, fillY = True }) (pack w)
!
!
! -- | The control will stretch both horizontally and vertically to fill the available space.
! -- When the control is placed in grid then the available width is equal to maximal width
! -- of controls in the same column and the available height is equal to maximal height
! -- of controls in the same row.
! stretch :: Control w => w -> Layout
! stretch w = Changer (\l -> l{ stretchX = True, stretchY = True, fillX = False, fillY = False }) (pack w)
!
! -- | The control will stretch horizontally to fit in the available space.
! -- When the control is placed in grid then the available space is equal to maximal width
! -- of controls in the same column.
! hstretch :: Control w => w -> Layout
! hstretch w = Changer (\l -> l{ stretchX = True, fillX = False }) (pack w)
!
! -- | The control stretches vertically to fit in the available space.
! -- When the control is placed in grid then the available space is equal to maximal height
! -- of controls in the same row.
! vstretch :: Control w => w -> Layout
! vstretch w = Changer (\l -> l{ stretchY = True, fillY = False }) (pack w)
!
-- | Set the preferred width of a control.
***************
*** 354,362 ****
-- | A layout control of a certain width with no height. Used to implement padding.
hrod :: Int -> Layout
! hrod w = hfix w empty
-- | A layout control of a certain height with no width. Used to implement padding.
vrod :: Int -> Layout
! vrod h = vfix h empty
-- | Add a padding between each control in the layout, including a padding around
--- 381,389 ----
-- | A layout control of a certain width with no height. Used to implement padding.
hrod :: Int -> Layout
! hrod w = vstretch (hfix w empty)
-- | A layout control of a certain height with no width. Used to implement padding.
vrod :: Int -> Layout
! vrod h = hstretch (vfix h empty)
-- | Add a padding between each control in the layout, including a padding around
***************
*** 376,379 ****
--- 403,407 ----
Changer f l -> Changer f (inner l)
Control _ _ _ -> lay
+ Empty -> lay
Grid css -> Grid (intersperse vrods (map (intersperse (hrod m)) (map (map inner) css)))
where
***************
*** 388,394 ****
getLayoutSize c
= do p <- layoutToPack (pack c)
! let rs = layoutPack 0 0 0 0 p
! sz = rectSize $ foldr rectUnion (rectOfSize (Size 0 0)) rs
! return sz
-- | Positions a controls in a certain rectangle
--- 416,421 ----
getLayoutSize c
= do p <- layoutToPack (pack c)
! let (rs,needed) = layoutPack 0 0 0 0 p
! return needed
-- | Positions a controls in a certain rectangle
***************
*** 398,404 ****
| any (/= parent) parents = ioError (userError "Layout.layout: laying out controls from different windows")
| otherwise = do p <- layoutToPack layout
! let rs = layoutPack x y w h p
! needed = rectSize (foldr rectUnion (rectAt (pt x y) (sz 0 0)) rs)
! sequence_ (zipWith moveResize rs controls)
return needed
where
--- 425,430 ----
| any (/= parent) parents = ioError (userError "Layout.layout: laying out controls from different windows")
| otherwise = do p <- layoutToPack layout
! let (rs,needed) = layoutPack x y w h p
! mapM_ moveResize rs
return needed
where
***************
*** 407,416 ****
(Size w h) = rectSize r
! controls = extractControls layout
! parents = [hwnd | (Control hwnd _ _) <- controls, hwnd /= nullHandle]
parent = head parents
!
! moveResize rect (Control hparent hcontrol get)
! = if hcontrol /= nullHandle then Port.moveResizeControl hcontrol rect else return ()
--- 433,443 ----
(Size w h) = rectSize r
! parents = [hwnd | (Control hwnd _ _) <- extractControls layout]
parent = head parents
!
! moveResize (rect,layout) =
! case layout of
! Control hparent hcontrol get -> Port.moveResizeControl hcontrol rect
! Empty -> return ()
***************
*** 420,428 ****
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
-
extractControls :: Layout -> [Layout]
--- 447,453 ----
mapM_ (\c -> Port.setControlVisible c True ) (new_controls \\ old_controls)
where
! old_controls = [hwnd | (Control _ hwnd _) <- extractControls old_lay]
! new_controls = [hwnd | (Control _ hwnd _) <- extractControls new_lay]
extractControls :: Layout -> [Layout]
***************
*** 431,434 ****
--- 456,460 ----
Grid lss -> concat (map (concat . map extractControls) lss)
Changer f l -> extractControls l
+ Empty -> []
Control _ h _ -> [lay]
***************
*** 437,455 ****
The actual layout algorithm works on the (non-IO) Pack structure.
--------------------------------------------------------------------}
! data Pack = Table{ stretchX :: Bool, stretchY :: Bool
! , prefW :: Int, prefH :: Int
, translate :: Point -> Size -> Point
, rows :: [[Pack]]
}
! | Item { stretchX :: Bool, stretchY :: Bool
! , prefW :: Int, prefH :: Int
, translate :: Point -> Size -> Point
! }
table :: [[Pack]] -> Pack
! table rows = Table (any (any stretchX) rows) (any (any stretchY) rows)
! (sum (widths rows)) (sum (heights rows))
(\pos sz -> pos)
rows
layoutToPack :: Layout -> IO Pack
--- 463,487 ----
The actual layout algorithm works on the (non-IO) Pack structure.
--------------------------------------------------------------------}
! data Pack = Table{ fillX :: Bool, fillY :: Bool
! , stretchX :: Bool, stretchY :: Bool
! , prefW :: Int, prefH :: Int
, translate :: Point -> Size -> Point
, rows :: [[Pack]]
}
! | Item { fillX :: Bool, fillY :: Bool
! , stretchX :: Bool, stretchY :: Bool
! , prefW :: Int, prefH :: Int
, translate :: Point -> Size -> Point
! , control :: Layout
! }
table :: [[Pack]] -> Pack
! table rows = Table (any (any fillX) rows) (any (any fillY) rows)
! (any (all stretchX) cols) (any (all stretchY) rows)
! (sum (widths rows)) (sum (heights rows))
(\pos sz -> pos)
rows
+ where
+ cols = columns rows
layoutToPack :: Layout -> IO Pack
***************
*** 460,470 ****
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
! return (f p)
{--------------------------------------------------------------------
Daan's ultra simple power-layout algorithm :-)
--------------------------------------------------------------------}
maximal :: [Int] -> Int
--- 492,503 ----
Control hparent hcontrol getPrefSize
-> do (Size w h) <- getPrefSize hcontrol
! return (Item False False False False w h (\pos sz -> pos) layout)
! Empty -> return (Item False False False False 0 0 (\pos sz -> pos) layout)
! Changer f lay -> do fmap f (layoutToPack lay)
{--------------------------------------------------------------------
Daan's ultra simple power-layout algorithm :-)
+ ** Modified and extended by Krasimir Angelov **
--------------------------------------------------------------------}
maximal :: [Int] -> Int
***************
*** 482,494 ****
! layoutPack :: Int -> Int -> Int -> Int -> Pack -> [Rect]
! layoutPack x y w h (Item stretchX stretchY prefW prefH trans)
! = let wd = if stretchX then max w prefW else prefW
! ht = if stretchY then max h prefH else prefH
sz = Size wd ht
pos = trans (pt x y) sz
! in [rectAt pos sz]
! layoutPack x y w h (Table stretchx stretchy prefW prefH trans rows)
= let mws = widths rows
mhs = heights rows
--- 515,527 ----
! layoutPack :: Int -> Int -> Int -> Int -> Pack -> ([(Rect,Layout)],Size)
! layoutPack x y w h (Item fillx filly stretchx stretchy prefW prefH trans layout)
! = let wd = if stretchx then max w prefW else prefW
! ht = if stretchy then max h prefH else prefH
sz = Size wd ht
pos = trans (pt x y) sz
! in ([(rectAt pos sz,layout)],sz)
! layoutPack x y w h (Table fillx filly stretchx stretchy prefW prefH trans rows)
= let mws = widths rows
mhs = heights rows
***************
*** 496,527 ****
dw = max 0 (w - prefW)
dh = max 0 (h - prefH)
! wstretch = map (any stretchX) (columns rows)
! hstretch = map (any stretchY) rows
! dws = deltas dw wstretch
! dhs = deltas dh hstretch
!
! ws | stretchx = zipWith (+) dws mws
! | otherwise = mws
! hs | stretchy = zipWith (+) dhs mhs
! | otherwise = mhs
! pos = trans (pt x y) (sz (sum ws) (sum hs))
xs = scanl (+) (px pos) ws
ys = scanl (+) (py pos) hs
! in concat [concat [layoutPack x y w h item | (item,w,x) <- zip3 row ws xs ] | (row,h,y) <- zip3 rows hs ys]
where
deltas total stretches
| count == 0 = repeat 0
! | otherwise = loop (mod total count) stretches
where
count = length (filter id stretches)
! delta = div total count
loop n [] = []
loop n (stretch:xs) | stretch && n > 0 = (delta+1):loop (n-1) xs
| stretch = delta:loop 0 xs
! | otherwise = 0:loop (n-1) xs
--- 529,561 ----
dw = max 0 (w - prefW)
dh = max 0 (h - prefH)
! wfill = map (\col -> any fillX col || all stretchX col) (columns rows)
! hfill = map (\row -> any fillY row || all stretchY row) rows
! dws = deltas dw wfill
! dhs = deltas dh hfill
! ws | fillx || stretchx = zipWith (+) dws mws
! | otherwise = mws
+ hs | filly || stretchy = zipWith (+) dhs mhs
+ | otherwise = mhs
! needed = sz (sum ws) (sum hs)
!
! pos = trans (pt x y) needed
xs = scanl (+) (px pos) ws
ys = scanl (+) (py pos) hs
! in (concat [concat [fst (layoutPack x y w h item) | (item,w,x) <- zip3 row ws xs] | (row,h,y) <- zip3 rows hs ys],needed)
where
deltas total stretches
| count == 0 = repeat 0
! | otherwise = loop rest stretches
where
count = length (filter id stretches)
! (delta,rest) = divMod total count
loop n [] = []
loop n (stretch:xs) | stretch && n > 0 = (delta+1):loop (n-1) xs
| stretch = delta:loop 0 xs
! | otherwise = 0:loop n xs
|
|
From: <kr_...@us...> - 2003-10-19 11:14:45
|
Update of /cvsroot/htoolkit/gio/src/examples/simple
In directory sc8-pr-cvs1:/tmp/cvs-serv7625/src/examples/simple
Modified Files:
SimpleDialog.hs
Log Message:
More clever layout algorithm. Added support for stretch/hstretch/vstretch
Index: SimpleDialog.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/examples/simple/SimpleDialog.hs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** SimpleDialog.hs 17 Oct 2003 09:00:17 -0000 1.4
--- SimpleDialog.hs 19 Oct 2003 09:33:20 -0000 1.5
***************
*** 14,21 ****
b1 <- button [title =: "Modal", on command =: showDialog True (Just d)] grp
b2 <- button [title =: "Modeless", on command =: showDialog False (Just d)] grp
! set grp [layout =: pad 10 (b1 <<<< b2)]
chk <- checkBox [title =: "Resizeable", checked =: True, on command =: setResizeableOnOff d] d
! bclr <- button [title =: "Set Color", on command =: setColor d] d
! set d [layout =: pad 10 (center (grp ^^^^ (chk <<<< bclr)))]
(if b then runDialog else showWindow) d
where
--- 14,21 ----
b1 <- button [title =: "Modal", on command =: showDialog True (Just d)] grp
b2 <- button [title =: "Modeless", on command =: showDialog False (Just d)] grp
! set grp [layout =: pad 10 (hstretch b1 <<<< hstretch b2)]
chk <- checkBox [title =: "Resizeable", checked =: True, on command =: setResizeableOnOff d] d
! bclr <- button [title =: "Set Background", on command =: setColor d] d
! set d [layout =: pad 10 (center (hstretch grp ^^^^ (chk <<<< bclr)))]
(if b then runDialog else showWindow) d
where
|
|
From: <kr_...@us...> - 2003-10-19 10:13:26
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO
In directory sc8-pr-cvs1:/tmp/cvs-serv16025/src/Graphics/UI/GIO
Modified Files:
Layout.hs
Log Message:
Make *fill of high priority than *stretch
Index: Layout.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Layout.hs,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Layout.hs 19 Oct 2003 09:33:20 -0000 1.9
--- Layout.hs 19 Oct 2003 10:06:31 -0000 1.10
***************
*** 529,534 ****
dw = max 0 (w - prefW)
dh = max 0 (h - prefH)
! wfill = map (\col -> any fillX col || all stretchX col) (columns rows)
! hfill = map (\row -> any fillY row || all stretchY row) rows
dws = deltas dw wfill
dhs = deltas dh hfill
--- 529,534 ----
dw = max 0 (w - prefW)
dh = max 0 (h - prefH)
! wfill = map (\col -> any fillX col || (not fillx && all stretchX col)) (columns rows)
! hfill = map (\row -> any fillY row || (not filly && all stretchY row)) rows
dws = deltas dw wfill
dhs = deltas dh hfill
|
|
From: <kr_...@us...> - 2003-10-19 10:11:15
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv15692/src/cbits/Win32 Modified Files: Button.c Log Message: extend the required width of button with 6 pixels Index: Button.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Button.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Button.c 8 Oct 2003 22:21:57 -0000 1.7 --- Button.c 19 Oct 2003 10:04:50 -0000 1.8 *************** *** 36,40 **** ReleaseDC(button, hDC); ! res[0] = sz.cx + GetSystemMetrics(SM_CXBORDER)*2 + 6; res[1] = sz.cy + GetSystemMetrics(SM_CYBORDER)*2 + 6; } --- 36,40 ---- ReleaseDC(button, hDC); ! res[0] = sz.cx + GetSystemMetrics(SM_CXBORDER)*2 + 12; res[1] = sz.cy + GetSystemMetrics(SM_CYBORDER)*2 + 6; } |
|
From: <kr_...@us...> - 2003-10-17 23:29:48
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK
In directory sc8-pr-cvs1:/tmp/cvs-serv1289/src/cbits/GTK
Modified Files:
Window.c
Log Message:
Nonscrollable dialogs for Linux.
Index: Window.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Window.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** Window.c 12 Oct 2003 22:21:38 -0000 1.39
--- Window.c 17 Oct 2003 23:22:55 -0000 1.40
***************
*** 283,288 ****
int modifiers = 0;
- widget = GTK_BIN(widget)->child;
-
if (event->state & GDK_SHIFT_MASK) modifiers |= shiftBIT;
if (event->state & GDK_CONTROL_MASK) modifiers |= ctrlBIT;
--- 283,286 ----
***************
*** 299,303 ****
static void dialog_focus_in_handler(GtkWidget *widget, GdkEventFocus *event, gpointer user_data)
{
! handleWindowActivate(GTK_BIN(widget)->child);
}
--- 297,301 ----
static void dialog_focus_in_handler(GtkWidget *widget, GdkEventFocus *event, gpointer user_data)
{
! handleWindowActivate(widget);
}
***************
*** 306,310 ****
if (gInKey)
{
! handleWindowKeyboard(GTK_BIN(widget)->child, evKeyUp, gCurChar, 0);
gInKey = FALSE;
--- 304,308 ----
if (gInKey)
{
! handleWindowKeyboard(widget, evKeyUp, gCurChar, 0);
gInKey = FALSE;
***************
*** 312,316 ****
}
! handleWindowDeactivate(GTK_BIN(widget)->child);
}
--- 310,314 ----
}
! handleWindowDeactivate(widget);
}
***************
*** 319,323 ****
WindowHandle osCreateDialog(WindowHandle parent)
{
! GtkWidget *sw, *frame;
if (parent == NULL)
--- 317,321 ----
WindowHandle osCreateDialog(WindowHandle parent)
{
! GtkWidget *layout, *frame;
if (parent == NULL)
***************
*** 327,351 ****
frame = gtk_window_new (GTK_WINDOW_TOPLEVEL);
! gtk_window_set_transient_for(GTK_WINDOW(frame), GTK_WINDOW(gtk_widget_get_toplevel(parent)));
gtk_window_set_destroy_with_parent(GTK_WINDOW(frame), gtk_true());
-
gtk_signal_connect (GTK_OBJECT(frame), "key-press-event",
! GTK_SIGNAL_FUNC(dialog_key_press_handler),
! NULL);
gtk_signal_connect (GTK_OBJECT(frame), "key-release-event",
! GTK_SIGNAL_FUNC(dialog_key_release_handler),
! NULL);
gtk_signal_connect (GTK_OBJECT(frame), "focus-in-event",
! GTK_SIGNAL_FUNC(dialog_focus_in_handler),
! NULL);
gtk_signal_connect (GTK_OBJECT(frame), "focus-out-event",
! GTK_SIGNAL_FUNC(dialog_focus_out_handler),
! NULL);
! sw = create_generic_window();
! gtk_container_add(GTK_CONTAINER(frame), sw);
! return sw;
}
--- 325,369 ----
frame = gtk_window_new (GTK_WINDOW_TOPLEVEL);
! gtk_window_set_transient_for(GTK_WINDOW(frame), GTK_WINDOW(parent));
gtk_window_set_destroy_with_parent(GTK_WINDOW(frame), gtk_true());
gtk_signal_connect (GTK_OBJECT(frame), "key-press-event",
! GTK_SIGNAL_FUNC(dialog_key_press_handler),
! NULL);
gtk_signal_connect (GTK_OBJECT(frame), "key-release-event",
! GTK_SIGNAL_FUNC(dialog_key_release_handler),
! NULL);
gtk_signal_connect (GTK_OBJECT(frame), "focus-in-event",
! GTK_SIGNAL_FUNC(dialog_focus_in_handler),
! NULL);
gtk_signal_connect (GTK_OBJECT(frame), "focus-out-event",
! GTK_SIGNAL_FUNC(dialog_focus_out_handler),
! NULL);
! gtk_signal_connect (GTK_OBJECT(frame), "destroy",
! GTK_SIGNAL_FUNC(handleWindowDestroy),
! NULL);
! gtk_signal_connect (GTK_OBJECT(frame), "delete-event",
! GTK_SIGNAL_FUNC(window_delete_handler),
! NULL);
! layout = port_layout_new(NULL,NULL);
! gtk_container_add(GTK_CONTAINER(frame), layout);
! gtk_widget_show(layout);
! /* Signals */
! gtk_signal_connect (GTK_OBJECT(layout), "expose-event",
! GTK_SIGNAL_FUNC(window_expose_handler),
! frame);
! gtk_signal_connect (GTK_OBJECT(layout), "button-press-event",
! GTK_SIGNAL_FUNC(window_button_press_handler),
! frame);
! gtk_signal_connect (GTK_OBJECT(layout), "button-release-event",
! GTK_SIGNAL_FUNC(window_button_release_handler),
! frame);
! gtk_signal_connect (GTK_OBJECT(layout), "motion_notify_event",
! GTK_SIGNAL_FUNC(window_motion_notify_handler),
! frame);
!
! return frame;
}
***************
*** 525,547 ****
{
GtkRequisition req;
- GtkScrolledWindow *scroll_window = GTK_SCROLLED_WINDOW(window);
- GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS(GTK_OBJECT_GET_CLASS(window));
! if (scroll_window->vscrollbar_visible)
{
! req.width = 2;
! req.height = 2;
! (* GTK_WIDGET_CLASS( GTK_OBJECT_GET_CLASS(scroll_window->vscrollbar) )->size_request )
! (scroll_window->vscrollbar, &req );
! w += req.width + scroll_class->scrollbar_spacing;
! }
! if (scroll_window->hscrollbar_visible)
! {
! req.width = 2;
! req.height = 2;
! (* GTK_WIDGET_CLASS( GTK_OBJECT_GET_CLASS(scroll_window->hscrollbar) )->size_request )
(scroll_window->hscrollbar, &req );
! h += req.height + scroll_class->scrollbar_spacing;
}
--- 543,569 ----
{
GtkRequisition req;
! if (GTK_IS_SCROLLED_WINDOW(window))
{
! GtkScrolledWindow *scroll_window = GTK_SCROLLED_WINDOW(window);
! GtkScrolledWindowClass *scroll_class = GTK_SCROLLED_WINDOW_CLASS(GTK_OBJECT_GET_CLASS(window));
! if (scroll_window->vscrollbar_visible)
! {
! req.width = 2;
! req.height = 2;
! (* GTK_WIDGET_CLASS( GTK_OBJECT_GET_CLASS(scroll_window->vscrollbar) )->size_request )
! (scroll_window->vscrollbar, &req );
! w += req.width + scroll_class->scrollbar_spacing;
! }
!
! if (scroll_window->hscrollbar_visible)
! {
! req.width = 2;
! req.height = 2;
! (* GTK_WIDGET_CLASS( GTK_OBJECT_GET_CLASS(scroll_window->hscrollbar) )->size_request )
(scroll_window->hscrollbar, &req );
! h += req.height + scroll_class->scrollbar_spacing;
! }
}
***************
*** 576,610 ****
void osSetWindowScrollOrigin(WindowHandle window, int x, int y)
{
! gtk_adjustment_set_value(gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW(window)), x);
! gtk_adjustment_set_value(gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW(window)), y);
}
void osGetWindowScrollOrigin(WindowHandle window, int *res)
{
! res[0] = gtk_adjustment_get_value(gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW(window)));
! res[1] = gtk_adjustment_get_value(gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW(window)));
}
void osSetWindowLineSize(WindowHandle window, int cx, int cy)
{
! GtkAdjustment *adj;
! GtkScrolledWindow *sw = GTK_SCROLLED_WINDOW(window);
! adj = gtk_scrolled_window_get_hadjustment(sw); adj->step_increment = cx; gtk_adjustment_changed(adj);
! adj = gtk_scrolled_window_get_vadjustment(sw); adj->step_increment = cy; gtk_adjustment_changed(adj);
}
void osGetWindowLineSize(WindowHandle window, int *res)
{
! GtkScrolledWindow *sw = GTK_SCROLLED_WINDOW(window);
! res[0] = gtk_scrolled_window_get_hadjustment(sw)->step_increment;
! res[1] = gtk_scrolled_window_get_vadjustment(sw)->step_increment;
}
void osSetWindowPageSize(WindowHandle window, int cx, int cy)
{
! GtkAdjustment *adj;
! GtkScrolledWindow *sw = GTK_SCROLLED_WINDOW(window);
! adj = gtk_scrolled_window_get_hadjustment(sw); adj->page_increment = cx; gtk_adjustment_changed(adj);
! adj = gtk_scrolled_window_get_vadjustment(sw); adj->page_increment = cy; gtk_adjustment_changed(adj);
}
--- 598,652 ----
void osSetWindowScrollOrigin(WindowHandle window, int x, int y)
{
! if (GTK_IS_SCROLLED_WINDOW(window))
! {
! gtk_adjustment_set_value(gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW(window)), x);
! gtk_adjustment_set_value(gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW(window)), y);
! }
}
void osGetWindowScrollOrigin(WindowHandle window, int *res)
{
! if (GTK_IS_SCROLLED_WINDOW(window))
! {
! res[0] = gtk_adjustment_get_value(gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW(window)));
! res[1] = gtk_adjustment_get_value(gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW(window)));
! }
! else
! {
! res[0] = 0;
! res[1] = 0;
! }
}
void osSetWindowLineSize(WindowHandle window, int cx, int cy)
{
! if (GTK_IS_SCROLLED_WINDOW(window))
! {
! GtkAdjustment *adj;
! GtkScrolledWindow *sw = GTK_SCROLLED_WINDOW(window);
! adj = gtk_scrolled_window_get_hadjustment(sw); adj->step_increment = cx; gtk_adjustment_changed(adj);
! adj = gtk_scrolled_window_get_vadjustment(sw); adj->step_increment = cy; gtk_adjustment_changed(adj);
! }
}
void osGetWindowLineSize(WindowHandle window, int *res)
{
! if (GTK_IS_SCROLLED_WINDOW(window))
! {
! GtkScrolledWindow *sw = GTK_SCROLLED_WINDOW(window);
! res[0] = gtk_scrolled_window_get_hadjustment(sw)->step_increment;
! res[1] = gtk_scrolled_window_get_vadjustment(sw)->step_increment;
! }
}
void osSetWindowPageSize(WindowHandle window, int cx, int cy)
{
! if (GTK_IS_SCROLLED_WINDOW(window))
! {
! GtkAdjustment *adj;
! GtkScrolledWindow *sw = GTK_SCROLLED_WINDOW(window);
! adj = gtk_scrolled_window_get_hadjustment(sw); adj->page_increment = cx; gtk_adjustment_changed(adj);
! adj = gtk_scrolled_window_get_vadjustment(sw); adj->page_increment = cy; gtk_adjustment_changed(adj);
! }
}
***************
*** 612,634 ****
void osGetWindowPageSize(WindowHandle window, int *res)
{
! GtkScrolledWindow *sw = GTK_SCROLLED_WINDOW(window);
! res[0] = gtk_scrolled_window_get_hadjustment(sw)->page_increment;
! res[1] = gtk_scrolled_window_get_vadjustment(sw)->page_increment;
}
void osSetWindowVisible(WindowHandle window, BOOL visible)
{
- GtkWidget *toplevel = gtk_widget_get_toplevel(window);
-
if (visible)
- {
gtk_widget_show(window);
- if (toplevel != gFrameWidget) gtk_widget_show(toplevel);
- }
else
- {
gtk_widget_hide(window);
- if (toplevel != gFrameWidget) gtk_widget_hide(toplevel);
- }
};
--- 654,671 ----
void osGetWindowPageSize(WindowHandle window, int *res)
{
! if (GTK_IS_SCROLLED_WINDOW(window))
! {
! GtkScrolledWindow *sw = GTK_SCROLLED_WINDOW(window);
! res[0] = gtk_scrolled_window_get_hadjustment(sw)->page_increment;
! res[1] = gtk_scrolled_window_get_vadjustment(sw)->page_increment;
! }
}
void osSetWindowVisible(WindowHandle window, BOOL visible)
{
if (visible)
gtk_widget_show(window);
else
gtk_widget_hide(window);
};
***************
*** 640,650 ****
void osRunDialog(WindowHandle window)
{
- GtkWidget *toplevel = gtk_widget_get_toplevel(window);
-
gtk_widget_show(window);
- gtk_widget_show(toplevel);
! gtk_window_set_modal(GTK_WINDOW(toplevel), TRUE);
! gtk_signal_connect (GTK_OBJECT(toplevel), "destroy",
GTK_SIGNAL_FUNC(gtk_main_quit),
NULL);
--- 677,684 ----
void osRunDialog(WindowHandle window)
{
gtk_widget_show(window);
! gtk_window_set_modal(GTK_WINDOW(window), TRUE);
! gtk_signal_connect (GTK_OBJECT(window), "destroy",
GTK_SIGNAL_FUNC(gtk_main_quit),
NULL);
***************
*** 655,675 ****
BOOL osDismissWindow(WindowHandle window)
{
- GtkWidget *widget = window;
-
gtk_signal_connect (GTK_OBJECT(window), "destroy",
GTK_SIGNAL_FUNC(gtk_widget_destroyed),
! &widget);
! handleWindowDismiss(widget);
! return (widget == NULL);
}
void osDestroyWindow(WindowHandle window)
{
! GtkWidget *toplevel = gtk_widget_get_toplevel(window);
!
! if (toplevel != gFrameWidget)
! gtk_widget_destroy(toplevel);
! else
! gtk_widget_destroy(window);
}
--- 689,702 ----
BOOL osDismissWindow(WindowHandle window)
{
gtk_signal_connect (GTK_OBJECT(window), "destroy",
GTK_SIGNAL_FUNC(gtk_widget_destroyed),
! &window);
! handleWindowDismiss(window);
! return (window == NULL);
}
void osDestroyWindow(WindowHandle window)
{
! gtk_widget_destroy(window);
}
***************
*** 686,713 ****
CanvasHandle osGetWindowCanvas(WindowHandle window)
{
- int scrollbar_spacing;
GdkRectangle rectangle;
CanvasHandle canvas;
-
- GtkRequisition child_requisition, hscrollbar_requisition, vscrollbar_requisition;
GtkWidget *layout;
layout = GTK_BIN(window)->child;
! rectangle.x = gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW(window))->value;
! rectangle.y = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW(window))->value;
! rectangle.width = window->allocation.width;
! rectangle.height = window->allocation.height;
! gtk_widget_size_request(layout, &child_requisition);
! gtk_widget_size_request(GTK_SCROLLED_WINDOW(window)->hscrollbar, &hscrollbar_requisition);
! gtk_widget_size_request(GTK_SCROLLED_WINDOW(window)->vscrollbar, &vscrollbar_requisition);
! scrollbar_spacing = GTK_SCROLLED_WINDOW_GET_CLASS(window)->scrollbar_spacing;
! if (scrollbar_spacing < 0) scrollbar_spacing = 3;
! if (rectangle.width < child_requisition.width ) rectangle.width -= scrollbar_spacing + vscrollbar_requisition.width;
! if (rectangle.height < child_requisition.height) rectangle.height -= scrollbar_spacing + hscrollbar_requisition.height;
rectangle.width -= 2*GTK_CONTAINER(window)->border_width;
--- 713,750 ----
CanvasHandle osGetWindowCanvas(WindowHandle window)
{
GdkRectangle rectangle;
CanvasHandle canvas;
GtkWidget *layout;
layout = GTK_BIN(window)->child;
! if (GTK_IS_SCROLLED_WINDOW(window))
! {
! int scrollbar_spacing;
! GtkRequisition child_requisition, hscrollbar_requisition, vscrollbar_requisition;
! rectangle.x = gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW(window))->value;
! rectangle.y = gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW(window))->value;
! rectangle.width = window->allocation.width;
! rectangle.height = window->allocation.height;
! gtk_widget_size_request(layout, &child_requisition);
! gtk_widget_size_request(GTK_SCROLLED_WINDOW(window)->hscrollbar, &hscrollbar_requisition);
! gtk_widget_size_request(GTK_SCROLLED_WINDOW(window)->vscrollbar, &vscrollbar_requisition);
! scrollbar_spacing = GTK_SCROLLED_WINDOW_GET_CLASS(window)->scrollbar_spacing;
! if (scrollbar_spacing < 0) scrollbar_spacing = 3;
!
! if (rectangle.width < child_requisition.width ) rectangle.width -= scrollbar_spacing + vscrollbar_requisition.width;
! if (rectangle.height < child_requisition.height) rectangle.height -= scrollbar_spacing + hscrollbar_requisition.height;
! }
! else
! {
! rectangle.x = 0;
! rectangle.y = 0;
! rectangle.width = window->allocation.width;
! rectangle.height = window->allocation.height;
! }
rectangle.width -= 2*GTK_CONTAINER(window)->border_width;
***************
*** 874,876 ****
--- 911,917 ----
handleContainerReLayout(window);
+ }
+
+ void osSetDialogMinSize(WindowHandle dialog, int w, int h)
+ {
}
|
|
From: <kr_...@us...> - 2003-10-17 12:12:32
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32
In directory sc8-pr-cvs1:/tmp/cvs-serv17334/src/cbits/Win32
Modified Files:
Internals.h Window.c
Log Message:
Remove hGripWnd window and draw own gripper. This simplifies
implementation and makes better look and feel for colored dialogs
Index: Internals.h
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Internals.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** Internals.h 12 Oct 2003 23:14:57 -0000 1.11
--- Internals.h 17 Oct 2003 08:52:22 -0000 1.12
***************
*** 90,95 ****
HWND hTooltip;
! HWND hGripWnd;
!
SIZE MinTrackSize;
} WindowData;
--- 90,94 ----
HWND hTooltip;
!
SIZE MinTrackSize;
} WindowData;
Index: Window.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Window.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -C2 -d -r1.58 -r1.59
*** Window.c 12 Oct 2003 23:14:57 -0000 1.58
--- Window.c 17 Oct 2003 08:52:22 -0000 1.59
***************
*** 101,131 ****
}
! 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;
}
}
--- 101,133 ----
}
! static void DrawSizeGripLine(HDC hDC, int right, int bottom, COLORREF rgbColor, int nIndex)
{
! HPEN hPen, hOldPen;
! hPen = CreatePen(PS_SOLID, 1, rgbColor);
! hOldPen = SelectObject(hDC, hPen);
{
! MoveToEx(hDC,right-5+nIndex,bottom, NULL);
! LineTo(hDC,right,bottom-5+nIndex);
! MoveToEx(hDC,right-9+nIndex,bottom, NULL);
! LineTo(hDC,right,bottom-9+nIndex);
!
! MoveToEx(hDC,right-13+nIndex,bottom, NULL);
! LineTo(hDC,right,bottom-13+nIndex);
}
+ SelectObject(hDC, hOldPen);
+ DeleteObject(hPen);
+ }
+
+ static void DrawSizeGrip(HWND hWnd, HDC hDC)
+ {
+ RECT rect;
+ GetClientRect(hWnd, &rect);
+
+ DrawSizeGripLine(hDC,rect.right,rect.bottom,RGB(255,255,255),0);
+ DrawSizeGripLine(hDC,rect.right,rect.bottom,GetSysColor(COLOR_3DSHADOW),1);
+ DrawSizeGripLine(hDC,rect.right,rect.bottom,GetSysColor(COLOR_3DSHADOW),2);
+ DrawSizeGripLine(hDC,rect.right,rect.bottom,GetSysColor(COLOR_3DFACE),3);
}
***************
*** 157,161 ****
pData->disabledCtrls = NULL;
pData->hTooltip = NULL;
- pData->hGripWnd = NULL;
pData->MinTrackSize.cx = 0;
pData->MinTrackSize.cy = 0;
--- 159,162 ----
***************
*** 264,267 ****
--- 265,271 ----
rfree(canvas);
+ if (GetParent(hWnd) == NULL && (GetWindowLong(hWnd, GWL_STYLE) & WS_THICKFRAME))
+ DrawSizeGrip(hWnd, ps.hdc);
+
EndPaint(hWnd, &ps);
}
***************
*** 269,272 ****
--- 273,287 ----
case WM_ERASEBKGND:
return TRUE;
+ case WM_SIZING:
+ if (GetParent(hWnd) == NULL && (GetWindowLong(hWnd, GWL_STYLE) & WS_THICKFRAME))
+ {
+ RECT rect;
+ GetClientRect(hWnd,&rect);
+
+ rect.left = rect.right-14;
+ rect.top = rect.bottom-14;
+ InvalidateRect(hWnd,&rect,TRUE);
+ }
+ break;
case WM_SIZE:
{
***************
*** 676,680 ****
LRESULT CALLBACK HDialogFunction(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- LRESULT lResult;
WindowData *pData = (WindowData *) GetWindowLong(hWnd,GWL_USERDATA);
--- 691,694 ----
***************
*** 716,741 ****
}
! 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;
}
--- 730,734 ----
}
! return HWindowSharedFunction(DefDlgProc, hWnd, uMsg, wParam, lParam);
}
***************
*** 1422,1427 ****
SetWindowLong(hTargetWnd, GWL_STYLE, style);
- EnableGripWindow(hwnd, resizeable);
-
GetWindowRect(hTargetWnd,&rc);
SetWindowPos(hTargetWnd,NULL,rc.left,rc.top,rc.right-rc.left,rc.bottom-rc.top,SWP_NOZORDER | SWP_FRAMECHANGED);
--- 1415,1418 ----
***************
*** 1430,1433 ****
--- 1421,1431 ----
handleWindowResize(hwnd,rc.right-rc.left,rc.bottom-rc.top);
handleContainerReLayout(hwnd);
+
+ if (GetParent(hwnd) == NULL)
+ {
+ rc.left = rc.right-14;
+ rc.top = rc.bottom-14;
+ InvalidateRect(hwnd,&rc,TRUE);
+ }
}
|
|
From: <kr_...@us...> - 2003-10-17 09:06:31
|
Update of /cvsroot/htoolkit/gio/src/examples/simple
In directory sc8-pr-cvs1:/tmp/cvs-serv18788
Modified Files:
SimpleDialog.hs
Log Message:
More complicated example
Index: SimpleDialog.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/examples/simple/SimpleDialog.hs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** SimpleDialog.hs 7 Oct 2003 21:39:31 -0000 1.3
--- SimpleDialog.hs 17 Oct 2003 09:00:17 -0000 1.4
***************
*** 11,17 ****
showDialog b parent = do
d <- dialog [title =: "Dialog", frame =: Rect 100 100 500 500] parent
! b1 <- button [title =: "Open Modal Dialog", on command =: showDialog True (Just d)] d
! 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
!
--- 11,29 ----
showDialog b parent = do
d <- dialog [title =: "Dialog", frame =: Rect 100 100 500 500] parent
! grp <- groupBox [title =: "Open dialog"] d
! b1 <- button [title =: "Modal", on command =: showDialog True (Just d)] grp
! b2 <- button [title =: "Modeless", on command =: showDialog False (Just d)] grp
! set grp [layout =: pad 10 (b1 <<<< b2)]
! chk <- checkBox [title =: "Resizeable", checked =: True, on command =: setResizeableOnOff d] d
! bclr <- button [title =: "Set Color", on command =: setColor d] d
! set d [layout =: pad 10 (center (grp ^^^^ (chk <<<< bclr)))]
(if b then runDialog else showWindow) d
! where
! setResizeableOnOff d = do
! b <- get d resizeable
! set d [resizeable =: not b]
! setColor d = do
! mb_color <- runColorDialog (Just d)
! case mb_color of
! Just c -> set d [bgcolor =: c]
! Nothing -> return ()
|
|
From: <kr_...@us...> - 2003-10-15 18:14:37
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO
In directory sc8-pr-cvs1:/tmp/cvs-serv12760/src/Graphics/UI/GIO
Modified Files:
Window.hs
Log Message:
bugfix
Index: Window.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Window.hs,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** Window.hs 12 Oct 2003 23:14:57 -0000 1.30
--- Window.hs 15 Oct 2003 18:14:09 -0000 1.31
***************
*** 196,199 ****
--- 196,200 ----
view <- get w view
updateControlsVisibility old_lay new_lay
+ Lib.setDialogMinSize (hwindow w) d
layoutInRect (rectOfSize (maxSize d view)) new_lay
setVar (vlayout w) new_lay)
|
|
From: <kr_...@us...> - 2003-10-12 23:15:01
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32
In directory sc8-pr-cvs1:/tmp/cvs-serv17524/port/src/cbits/Win32
Modified Files:
Internals.h Window.c
Log Message:
Initial support for dialogs with restricted minimal size. Only Windows for now.
Index: Internals.h
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Internals.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** Internals.h 12 Oct 2003 21:33:46 -0000 1.10
--- Internals.h 12 Oct 2003 23:14:57 -0000 1.11
***************
*** 91,94 ****
--- 91,96 ----
HWND hTooltip;
HWND hGripWnd;
+
+ SIZE MinTrackSize;
} WindowData;
Index: Window.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Window.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -C2 -d -r1.57 -r1.58
*** Window.c 12 Oct 2003 21:33:46 -0000 1.57
--- Window.c 12 Oct 2003 23:14:57 -0000 1.58
***************
*** 158,161 ****
--- 158,163 ----
pData->hTooltip = NULL;
pData->hGripWnd = NULL;
+ pData->MinTrackSize.cx = 0;
+ pData->MinTrackSize.cy = 0;
SetWindowLong(hWnd,GWL_USERDATA,(LONG) pData);
***************
*** 703,706 ****
--- 705,717 ----
}
break;
+ case WM_GETMINMAXINFO:
+ if (pData)
+ {
+ MINMAXINFO *pInfo = (MINMAXINFO *) lParam;
+ pInfo->ptMinTrackSize.x = pData->MinTrackSize.cx;
+ pInfo->ptMinTrackSize.y = pData->MinTrackSize.cy;
+ return 0;
+ }
+ break;
}
***************
*** 1454,1455 ****
--- 1465,1481 ----
}
}
+
+ void osSetDialogMinSize(WindowHandle dialog, int w, int h)
+ {
+ RECT rect;
+ WindowData *pData = (WindowData *) GetWindowLong(dialog,GWL_USERDATA);
+
+ rect.left = 0;
+ rect.top = 0;
+ rect.right = w;
+ rect.bottom = h;
+ AdjustWindowRect(&rect, GetWindowLong(dialog, GWL_STYLE), FALSE);
+
+ pData->MinTrackSize.cx = rect.right-rect.left;
+ pData->MinTrackSize.cy = rect.bottom-rect.top;
+ }
|
|
From: <kr_...@us...> - 2003-10-12 23:15:01
|
Update of /cvsroot/htoolkit/port/src/Port
In directory sc8-pr-cvs1:/tmp/cvs-serv17524/port/src/Port
Modified Files:
Window.hs
Log Message:
Initial support for dialogs with restricted minimal size. Only Windows for now.
Index: Window.hs
===================================================================
RCS file: /cvsroot/htoolkit/port/src/Port/Window.hs,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** Window.hs 7 Oct 2003 21:31:29 -0000 1.16
--- Window.hs 12 Oct 2003 23:14:56 -0000 1.17
***************
*** 22,25 ****
--- 22,26 ----
, invalidateWindowFrame
, invalidateWindow
+ , setDialogMinSize
-- * Properties
, setWindowVisible, getWindowVisible
***************
*** 76,79 ****
--- 77,85 ----
osInvalidateWindowRect hwnd x0 y0 x1 y1
foreign import ccall osInvalidateWindowRect :: WindowHandle -> CInt -> CInt -> CInt -> CInt -> IO ()
+
+ -- | Set the minimal size of the dialog.
+ setDialogMinSize :: WindowHandle -> Size -> IO ()
+ setDialogMinSize hwnd size = withCSize size (osSetDialogMinSize hwnd)
+ foreign import ccall osSetDialogMinSize :: WindowHandle -> CInt -> CInt -> IO ()
-- | Create a new (invisible) window. If the function succeeds, the return value is a handle to the new window.
|
|
From: <kr_...@us...> - 2003-10-12 23:15:01
|
Update of /cvsroot/htoolkit/port/src/include In directory sc8-pr-cvs1:/tmp/cvs-serv17524/port/src/include Modified Files: Window.h Log Message: Initial support for dialogs with restricted minimal size. Only Windows for now. Index: Window.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/include/Window.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Window.h 12 Oct 2003 21:33:46 -0000 1.14 --- Window.h 12 Oct 2003 23:14:57 -0000 1.15 *************** *** 99,101 **** --- 99,103 ---- void osReLayoutContainer(WindowHandle window); + void osSetDialogMinSize(WindowHandle dialog, int w, int h); + #endif |
|
From: <kr_...@us...> - 2003-10-12 23:15:01
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO
In directory sc8-pr-cvs1:/tmp/cvs-serv17524/gio/src/Graphics/UI/GIO
Modified Files:
Window.hs
Log Message:
Initial support for dialogs with restricted minimal size. Only Windows for now.
Index: Window.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Window.hs,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** Window.hs 10 Oct 2003 14:21:52 -0000 1.29
--- Window.hs 12 Oct 2003 23:14:57 -0000 1.30
***************
*** 94,97 ****
--- 94,98 ----
let d1 = maxSize domain needed
d2 = maxSize d1 view
+ Lib.setDialogMinSize (hwindow w) d1
Lib.setWindowDomainSize (hwindow w) d1
layoutInRect (rectOfSize d2) lay
|
|
From: <kr_...@us...> - 2003-10-12 22:21:42
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK
In directory sc8-pr-cvs1:/tmp/cvs-serv9265/src/cbits/GTK
Modified Files:
Window.c
Log Message:
fix dynamic layout implementation
Index: Window.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Window.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -d -r1.38 -r1.39
*** Window.c 12 Oct 2003 21:33:46 -0000 1.38
--- Window.c 12 Oct 2003 22:21:38 -0000 1.39
***************
*** 868,876 ****
}
! void osReLayoutContainer(HWND window)
{
! if (GTK_IS_FRAME(widget) || GTK_IS_NOTEBOOK(gtk_widget_get_parent(widget)))
osForceContainerReLayout(window);
handleContainerReLayout(window);
! }
\ No newline at end of file
--- 868,876 ----
}
! void osReLayoutContainer(WindowHandle window)
{
! if (GTK_IS_FRAME(window) || GTK_IS_NOTEBOOK(gtk_widget_get_parent(window)))
osForceContainerReLayout(window);
handleContainerReLayout(window);
! }
|
|
From: <kr_...@us...> - 2003-10-12 22:20:27
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK
In directory sc8-pr-cvs1:/tmp/cvs-serv8933/src/cbits/GTK
Modified Files:
PopUp.c
Log Message:
fix required size for PopUp
Index: PopUp.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/PopUp.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** PopUp.c 8 Oct 2003 22:21:57 -0000 1.8
--- PopUp.c 12 Oct 2003 22:20:23 -0000 1.9
***************
*** 56,61 ****
void osGetPopUpReqSize(WindowHandle popup, int *res)
{
! res[0] = 100;
! res[1] = 100;
};
--- 56,65 ----
void osGetPopUpReqSize(WindowHandle popup, int *res)
{
! GtkRequisition requisition;
!
! gtk_widget_size_request(popup, &requisition);
!
! res[0] = requisition.width;
! res[1] = requisition.height;
};
|
|
From: <kr_...@us...> - 2003-10-12 21:33:55
|
Update of /cvsroot/htoolkit/port/src/include In directory sc8-pr-cvs1:/tmp/cvs-serv1230/port/src/include Modified Files: Window.h Log Message: Improved dynamic layout for GroupBox and Notebook Index: Window.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/include/Window.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Window.h 9 Oct 2003 07:56:45 -0000 1.13 --- Window.h 12 Oct 2003 21:33:46 -0000 1.14 *************** *** 97,99 **** --- 97,101 ---- void osSetWindowResizeable(WindowHandle window, int resizeable); + void osReLayoutContainer(WindowHandle window); + #endif |
|
From: <kr_...@us...> - 2003-10-12 21:33:55
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32
In directory sc8-pr-cvs1:/tmp/cvs-serv1230/port/src/cbits/Win32
Modified Files:
GroupBox.c Internals.h Util.c Window.c
Log Message:
Improved dynamic layout for GroupBox and Notebook
Index: GroupBox.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/GroupBox.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** GroupBox.c 12 Oct 2003 07:53:57 -0000 1.3
--- GroupBox.c 12 Oct 2003 21:33:46 -0000 1.4
***************
*** 8,27 ****
LRESULT CALLBACK HGroupBoxFunction(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_PAINT:
return CallWindowProc(DefGroupBoxProc, hWnd, uMsg, wParam, lParam);
! case WM_SIZE:
! {
! RECT rect;
! HWND hParent;
!
! hParent = GetParent(hWnd);
! GetWindowRect(hWnd, &rect);
! ScreenToClient(hParent, ((POINT *) &rect));
! ScreenToClient(hParent, ((POINT *) &rect)+1);
! InvalidateRect(hParent, &rect, FALSE);
}
! break;
};
--- 8,39 ----
LRESULT CALLBACK HGroupBoxFunction(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
+ WindowData *pData = (WindowData *) GetWindowLong(hWnd,GWL_USERDATA);
+
switch (uMsg)
{
case WM_PAINT:
return CallWindowProc(DefGroupBoxProc, hWnd, uMsg, wParam, lParam);
! case WM_ERASEBKGND:
! {
! HDC hDC = (HDC) wParam;
! RECT rect;
! HRGN hRgn;
! HWND hCtrl;
!
! hCtrl = hWnd;
! while (hCtrl && !pData->hBackBrush)
! {
! hCtrl = GetParent(hCtrl);
! pData = (WindowData *) GetWindowLong(hCtrl,GWL_USERDATA);
! }
!
! GetClipBox(hDC, &rect);
! hRgn = CreateRectRgn(rect.left, rect.top, rect.right, rect.bottom);
! GetClipRgn(hDC, hRgn);
! getWindowClipRgn(hWnd, hRgn);
! FillRgn(hDC, hRgn, pData->hBackBrush);
! DeleteObject(hRgn);
}
! return TRUE;
};
***************
*** 62,69 ****
ReleaseDC(box, hDC);
! res[0] = 10;
! res[1] = sz.cy+2;
! res[2] = 10;
! res[3] = 10;
}
--- 74,81 ----
ReleaseDC(box, hDC);
! res[0] = 5;
! res[1] = max(10,sz.cy+2);
! res[2] = 5;
! res[3] = 5;
}
Index: Internals.h
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Internals.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Internals.h 24 Aug 2003 21:07:48 -0000 1.9
--- Internals.h 12 Oct 2003 21:33:46 -0000 1.10
***************
*** 72,75 ****
--- 72,97 ----
} FrameData;
+ typedef struct
+ {
+ POINT Origin;
+ SIZE DomainSize;
+ SIZE LineSize, PageSize;
+ BOOL bInDragMode;
+
+ COLORREF foreColor;
+ COLORREF backColor;
+ HBRUSH hBackBrush;
+ int hatchStyle;
+ BitmapHandle patBmp;
+
+ BOOL enabled;
+ int disabledCtrlsCount;
+ HWND *disabledCtrls;
+
+ HWND hTooltip;
+ HWND hGripWnd;
+ } WindowData;
+
+
extern void rfree(void *ptr);
extern void *rmalloc(unsigned long bytes);
Index: Util.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Util.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** Util.c 10 Oct 2003 22:59:03 -0000 1.26
--- Util.c 12 Oct 2003 21:33:46 -0000 1.27
***************
*** 60,64 ****
wc.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor (NULL, IDC_ARROW);
! wc.hbrBackground = (HBRUSH) (COLOR_APPWORKSPACE+1); // For best results (Petzold)
wc.lpszMenuName = NULL;
wc.lpszClassName = "HSDIFRAME";
--- 60,64 ----
wc.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor (NULL, IDC_ARROW);
! wc.hbrBackground = GetSysColorBrush(COLOR_APPWORKSPACE);
wc.lpszMenuName = NULL;
wc.lpszClassName = "HSDIFRAME";
***************
*** 73,77 ****
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
! wc.hbrBackground = (HBRUSH) (COLOR_BTNFACE + 1);
wc.lpszMenuName = NULL;
wc.lpszClassName = "HSDIWINDOW";
--- 73,77 ----
wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
! wc.hbrBackground = GetSysColorBrush(COLOR_WINDOW);
wc.lpszMenuName = NULL;
wc.lpszClassName = "HSDIWINDOW";
***************
*** 86,90 ****
wc.hIcon = NULL;
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
! wc.hbrBackground = (HBRUSH) (COLOR_BTNFACE + 1);
wc.lpszMenuName = NULL;
wc.lpszClassName = "HDIALOG";
--- 86,90 ----
wc.hIcon = NULL;
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
! wc.hbrBackground = GetSysColorBrush(COLOR_3DFACE);
wc.lpszMenuName = NULL;
wc.lpszClassName = "HDIALOG";
***************
*** 99,103 ****
wc.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor (NULL, IDC_ARROW);
! wc.hbrBackground = (HBRUSH) (COLOR_APPWORKSPACE+1); // For best results (Petzold)
wc.lpszMenuName = NULL;
wc.lpszClassName = "HMDIFRAME";
--- 99,103 ----
wc.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor (NULL, IDC_ARROW);
! wc.hbrBackground = GetSysColorBrush(COLOR_APPWORKSPACE);
wc.lpszMenuName = NULL;
wc.lpszClassName = "HMDIFRAME";
***************
*** 112,116 ****
wc.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor (NULL, IDC_ARROW);
! wc.hbrBackground = (HBRUSH) (COLOR_BTNFACE+1); // For best results (Petzold)
wc.lpszMenuName = NULL;
wc.lpszClassName = "HMDIWINDOW";
--- 112,116 ----
wc.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wc.hCursor = LoadCursor (NULL, IDC_ARROW);
! wc.hbrBackground = GetSysColorBrush(COLOR_WINDOW);
wc.lpszMenuName = NULL;
wc.lpszClassName = "HMDIWINDOW";
***************
*** 125,129 ****
wc.hIcon = NULL;
wc.hCursor = LoadCursor (NULL, IDC_ARROW);
! wc.hbrBackground = (HBRUSH) (COLOR_BTNFACE+1); // For best results (Petzold)
wc.lpszMenuName = NULL;
wc.lpszClassName = "HCOMPOUND";
--- 125,129 ----
wc.hIcon = NULL;
wc.hCursor = LoadCursor (NULL, IDC_ARROW);
! wc.hbrBackground = GetSysColorBrush(COLOR_WINDOW);
wc.lpszMenuName = NULL;
wc.lpszClassName = "HCOMPOUND";
***************
*** 146,150 ****
wc.hIcon = NULL;
wc.hCursor = NULL;
! wc.hbrBackground = (HBRUSH) (COLOR_BTNFACE+1);
wc.lpszMenuName = NULL;
wc.lpszClassName = "HDOCKBAR";
--- 146,150 ----
wc.hIcon = NULL;
wc.hCursor = NULL;
! wc.hbrBackground = GetSysColorBrush(COLOR_BTNFACE);
wc.lpszMenuName = NULL;
wc.lpszClassName = "HDOCKBAR";
***************
*** 175,179 ****
wc.hIcon = NULL;
wc.hCursor = NULL;
! wc.hbrBackground = (HBRUSH) (COLOR_BTNFACE+1);
wc.lpszMenuName = NULL;
wc.lpszClassName = "HNOTEBOOKPAGE";
--- 175,179 ----
wc.hIcon = NULL;
wc.hCursor = NULL;
! wc.hbrBackground = GetSysColorBrush(COLOR_BTNFACE);
wc.lpszMenuName = NULL;
wc.lpszClassName = "HNOTEBOOKPAGE";
Index: Window.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Window.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -d -r1.56 -r1.57
*** Window.c 11 Oct 2003 08:50:54 -0000 1.56
--- Window.c 12 Oct 2003 21:33:46 -0000 1.57
***************
*** 5,29 ****
#include <windowsx.h>
- typedef struct
- {
- POINT Origin;
- SIZE DomainSize;
- SIZE LineSize, PageSize;
- BOOL bInDragMode;
-
- COLORREF foreColor;
- COLORREF backColor;
- HBRUSH hBackBrush;
- int hatchStyle;
- BitmapHandle patBmp;
-
- BOOL enabled;
- int disabledCtrlsCount;
- HWND *disabledCtrls;
-
- HWND hTooltip;
- HWND hGripWnd;
- } WindowData;
-
unsigned int GetModifiers()
{
--- 5,8 ----
***************
*** 54,58 ****
}
! static void getWindowClipRgn(HWND hWnd, HRGN hRgn)
{
RECT rect;
--- 33,37 ----
}
! void getWindowClipRgn(HWND hWnd, HRGN hRgn)
{
RECT rect;
***************
*** 64,73 ****
while (hCtrl)
{
! char buffer[20];
!
! GetClassName(hCtrl,buffer,sizeof(buffer));
!
! // fill background for all windows except GroupBox
! if (_stricmp(buffer, "HGROUPBOX") != 0 && (GetWindowLong(hCtrl,GWL_STYLE) & WS_VISIBLE))
{
GetWindowRect(hCtrl,&rect);
--- 43,47 ----
while (hCtrl)
{
! if (GetWindowLong(hCtrl,GWL_STYLE) & WS_VISIBLE)
{
GetWindowRect(hCtrl,&rect);
***************
*** 178,182 ****
pData->hatchStyle = 0;
pData->patBmp = NULL;
! pData->hBackBrush = CreateSolidBrush (pData->backColor);
pData->enabled = TRUE;
pData->disabledCtrlsCount = 0;
--- 152,156 ----
pData->hatchStyle = 0;
pData->patBmp = NULL;
! pData->hBackBrush = (HBRUSH) GetClassLong(hWnd, GCL_HBRBACKGROUND);
pData->enabled = TRUE;
pData->disabledCtrlsCount = 0;
***************
*** 627,630 ****
--- 601,611 ----
{
HDC hDC = (HDC) wParam;
+
+ while (hWnd && !pData->hBackBrush)
+ {
+ hWnd = GetParent(hWnd);
+ pData = (WindowData *) GetWindowLong(hWnd,GWL_USERDATA);
+ }
+
SelectObject(hDC, pData->hBackBrush);
SetBkColor(hDC, pData->backColor);
***************
*** 900,904 ****
void osSetWindowColor(WindowHandle window, int foreColor, int backColor, int hatchStyle, BitmapHandle patBmp)
{
! LOGBRUSH lb;
WindowData *pData = (WindowData *) GetWindowLong(window,GWL_USERDATA);
--- 881,885 ----
void osSetWindowColor(WindowHandle window, int foreColor, int backColor, int hatchStyle, BitmapHandle patBmp)
{
! LOGBRUSH lb;
WindowData *pData = (WindowData *) GetWindowLong(window,GWL_USERDATA);
***************
*** 1285,1289 ****
ScreenToClient(hParent, ((LPPOINT) &rect) );
ScreenToClient(hParent, ((LPPOINT) &rect)+1);
! InvalidateRect(GetParent(ctrl),&rect,FALSE);
}
--- 1266,1270 ----
ScreenToClient(hParent, ((LPPOINT) &rect) );
ScreenToClient(hParent, ((LPPOINT) &rect)+1);
! InvalidateRect(hParent,&rect,FALSE);
}
***************
*** 1439,1443 ****
handleContainerReLayout(hwnd);
}
!
void osForceContainerReLayout(HWND hCtrl)
{
--- 1420,1439 ----
handleContainerReLayout(hwnd);
}
!
! void osReLayoutContainer(WindowHandle window)
! {
! char buffer[20];
! GetClassName(window,buffer,sizeof(buffer));
!
! if (_stricmp(buffer, "HNOTEBOOK") == 0 ||
! _stricmp(buffer, "HNOTEBOOKPAGE") == 0 ||
! _stricmp(buffer, "HGROUPBOX") == 0)
! {
! osForceContainerReLayout(window);
! }
!
! handleContainerReLayout(window);
! }
!
void osForceContainerReLayout(HWND hCtrl)
{
|
|
From: <kr_...@us...> - 2003-10-12 21:33:55
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO
In directory sc8-pr-cvs1:/tmp/cvs-serv1230/gio/src/Graphics/UI/GIO
Modified Files:
Controls.hs
Log Message:
Improved dynamic layout for GroupBox and Notebook
Index: Controls.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Controls.hs,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** Controls.hs 12 Oct 2003 07:55:50 -0000 1.35
--- Controls.hs 12 Oct 2003 21:33:47 -0000 1.36
***************
*** 729,733 ****
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)
--- 729,734 ----
old_lay <- getVar (gblayout w)
updateControlsVisibility old_lay new_lay
! setVar (gblayout w) new_lay
! Port.relayoutContainer (gbhandle w))
autosize = readAttr "autosize" (\c -> return True)
layoutSize = readAttr "layoutSize" (\c -> getVar (gblayout c) >>= getLayoutSize)
***************
*** 832,837 ****
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)
--- 833,839 ----
let new_lay = pack c
old_lay <- getVar (pglayout w)
! updateControlsVisibility old_lay new_lay
! setVar (pglayout w) new_lay
! Port.relayoutContainer (pghandle w))
autosize = readAttr "autosize" (\c -> return True)
layoutSize = readAttr "layoutSize" (\c -> getVar (pglayout c) >>= getLayoutSize)
|
|
From: <kr_...@us...> - 2003-10-12 21:33:54
|
Update of /cvsroot/htoolkit/port/src/Port
In directory sc8-pr-cvs1:/tmp/cvs-serv1230/port/src/Port
Modified Files:
Controls.hs Handlers.hs
Log Message:
Improved dynamic layout for GroupBox and Notebook
Index: Controls.hs
===================================================================
RCS file: /cvsroot/htoolkit/port/src/Port/Controls.hs,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** Controls.hs 9 Oct 2003 07:56:44 -0000 1.25
--- Controls.hs 12 Oct 2003 21:33:46 -0000 1.26
***************
*** 46,49 ****
--- 46,50 ----
, setControlVisible, getControlVisible
, setControlTip, getControlTip
+ , relayoutContainer
-- * Label
, createLabel, getLabelRequestSize
***************
*** 149,152 ****
--- 150,155 ----
= withCString txt (osSetControlTip hwnd)
foreign import ccall osSetControlTip :: WindowHandle -> CString -> IO ()
+
+ foreign import ccall "osReLayoutContainer" relayoutContainer :: WindowHandle -> IO ()
-----------------------------------------------------------------------------------------
Index: Handlers.hs
===================================================================
RCS file: /cvsroot/htoolkit/port/src/Port/Handlers.hs,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** Handlers.hs 30 Aug 2003 22:57:46 -0000 1.29
--- Handlers.hs 12 Oct 2003 21:33:46 -0000 1.30
***************
*** 46,52 ****
,setWindowContextMenuHandler,setWindowContextMenuDefHandler,getWindowContextMenuHandler
! -- ** Fire events
! , fireContainerReLayout
!
-- * Process events
,setProcessDismissHandler, setProcessDismissDefHandler, getProcessDismissHandler
--- 46,50 ----
,setWindowContextMenuHandler,setWindowContextMenuDefHandler,getWindowContextMenuHandler
!
-- * Process events
,setProcessDismissHandler, setProcessDismissDefHandler, getProcessDismissHandler
***************
*** 219,226 ****
handleContainerReLayout :: WindowHandle -> IO ()
handleContainerReLayout hwnd
- = fireContainerReLayout hwnd
-
- fireContainerReLayout :: WindowHandle -> IO ()
- fireContainerReLayout hwnd
= invokeHandler hwnd handlersContainerReLayout id
--- 217,220 ----
|
|
From: <kr_...@us...> - 2003-10-12 21:33:54
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK
In directory sc8-pr-cvs1:/tmp/cvs-serv1230/port/src/cbits/GTK
Modified Files:
Window.c
Log Message:
Improved dynamic layout for GroupBox and Notebook
Index: Window.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Window.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** Window.c 10 Oct 2003 20:27:04 -0000 1.37
--- Window.c 12 Oct 2003 21:33:46 -0000 1.38
***************
*** 867,868 ****
--- 867,876 ----
}
}
+
+ void osReLayoutContainer(HWND window)
+ {
+ if (GTK_IS_FRAME(widget) || GTK_IS_NOTEBOOK(gtk_widget_get_parent(widget)))
+ osForceContainerReLayout(window);
+
+ handleContainerReLayout(window);
+ }
\ No newline at end of file
|
|
From: <kr_...@us...> - 2003-10-12 20:57:46
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv26803/src/cbits/Win32 Modified Files: CheckBox.c Log Message: fix the CheckBox size Index: CheckBox.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/CheckBox.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** CheckBox.c 8 Oct 2003 22:21:57 -0000 1.8 --- CheckBox.c 12 Oct 2003 20:57:42 -0000 1.9 *************** *** 40,44 **** ReleaseDC(checkbox, hDC); ! res[0] = sz.cx + 32; res[1] = tm.tmHeight+tm.tmDescent; }; --- 40,44 ---- ReleaseDC(checkbox, hDC); ! res[0] = sz.cx + 20; res[1] = tm.tmHeight+tm.tmDescent; }; |
|
From: <kr_...@us...> - 2003-10-12 07:55:53
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO
In directory sc8-pr-cvs1:/tmp/cvs-serv20415/src/Graphics/UI/GIO
Modified Files:
Controls.hs
Log Message:
bugfix
Index: Controls.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Controls.hs,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** Controls.hs 10 Oct 2003 14:21:52 -0000 1.34
--- Controls.hs 12 Oct 2003 07:55:50 -0000 1.35
***************
*** 721,725 ****
lay <- getVar (gblayout c)
(l,t,r,b) <- Port.getGroupBoxBordersSize (gbhandle c)
! layoutInRect (Rect l t (fr-r) (fb-b)) lay
return ()
--- 721,725 ----
lay <- getVar (gblayout c)
(l,t,r,b) <- Port.getGroupBoxBordersSize (gbhandle c)
! layoutInRect (Rect l t (fr-fl-r) (fb-ft-b)) lay
return ()
|
|
From: <kr_...@us...> - 2003-10-12 07:54:01
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32
In directory sc8-pr-cvs1:/tmp/cvs-serv20206/src/cbits/Win32
Modified Files:
GroupBox.c
Log Message:
bugfix: resizeable groupBox
Index: GroupBox.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/GroupBox.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** GroupBox.c 8 Oct 2003 22:21:57 -0000 1.2
--- GroupBox.c 12 Oct 2003 07:53:57 -0000 1.3
***************
*** 12,15 ****
--- 12,27 ----
case WM_PAINT:
return CallWindowProc(DefGroupBoxProc, hWnd, uMsg, wParam, lParam);
+ case WM_SIZE:
+ {
+ RECT rect;
+ HWND hParent;
+
+ hParent = GetParent(hWnd);
+ GetWindowRect(hWnd, &rect);
+ ScreenToClient(hParent, ((POINT *) &rect));
+ ScreenToClient(hParent, ((POINT *) &rect)+1);
+ InvalidateRect(hParent, &rect, FALSE);
+ }
+ break;
};
|