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-07-13 09:09:22
|
Update of /cvsroot/htoolkit/port/src/Port
In directory sc8-pr-cvs1:/tmp/cvs-serv29827/src/Port
Modified Files:
Types.hs
Log Message:
withCPointResult
Index: Types.hs
===================================================================
RCS file: /cvsroot/htoolkit/port/src/Port/Types.hs,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** Types.hs 12 Jul 2003 19:50:04 -0000 1.23
--- Types.hs 13 Jul 2003 09:09:10 -0000 1.24
***************
*** 88,97 ****
, withCBitmap, fromCBitmap
!
! , withCFont, fromCFont
, withCFontDef, withCFontDefResult, fromCFontDef, fromCStyle, fromCWeight
, withCFontMetricsResult, fromCFontMetrics
! , withCPoint, fromCPoint
, withCSize, withCSizeResult, fromCSize
, withCRect, withCRectResult, fromCRect
--- 88,97 ----
, withCBitmap, fromCBitmap
!
! , withCFont, fromCFont
, withCFontDef, withCFontDefResult, fromCFontDef, fromCStyle, fromCWeight
, withCFontMetricsResult, fromCFontMetrics
! , withCPoint, withCPointResult, fromCPoint
, withCSize, withCSizeResult, fromCSize
, withCRect, withCRectResult, fromCRect
***************
*** 173,177 ****
pointMove (Size w h) (Point x y) = Point (x + w) (y + h)
! pointAdd :: Point -> Point -> Point
pointAdd (Point x1 y1) (Point x2 y2) = Point (x1+x2) (y1+y2)
--- 173,177 ----
pointMove (Size w h) (Point x y) = Point (x + w) (y + h)
! pointAdd :: Point -> Point -> Point
pointAdd (Point x1 y1) (Point x2 y2) = Point (x1+x2) (y1+y2)
***************
*** 182,186 ****
pointScale v (Point x y) = Point (v*x) (v*y)
!
-- marshalling
withCPoint :: Point -> (CInt -> CInt -> IO a) -> IO a
--- 182,186 ----
pointScale v (Point x y) = Point (v*x) (v*y)
!
-- marshalling
withCPoint :: Point -> (CInt -> CInt -> IO a) -> IO a
***************
*** 188,191 ****
--- 188,198 ----
= f (toCInt x) (toCInt y)
+ withCPointResult :: (Ptr CInt -> IO ()) -> IO Point
+ withCPointResult f
+ = allocaArray 2 $ \cpoint ->
+ do f cpoint
+ [x,y] <- peekArray 2 cpoint
+ return (fromCPoint x y)
+
fromCPoint :: CInt -> CInt -> Point
fromCPoint x y
***************
*** 196,200 ****
-----------------------------------------------------------------------------------------}
-- | A @Size@ has a width and height.
! data Size = Size
{ sw :: !Int -- ^ the width of a size
, sh :: !Int -- ^ the height of a size
--- 203,207 ----
-----------------------------------------------------------------------------------------}
-- | A @Size@ has a width and height.
! data Size = Size
{ sw :: !Int -- ^ the width of a size
, sh :: !Int -- ^ the height of a size
***************
*** 220,224 ****
sizeDistance :: Point -> Point -> Size
! sizeDistance (Point x1 y1) (Point x2 y2) =
Size (if x1 < x2 then x2-x1 else x1-x2) (if y1 < y2 then y2-y1 else y1-y2)
--- 227,231 ----
sizeDistance :: Point -> Point -> Size
! sizeDistance (Point x1 y1) (Point x2 y2) =
Size (if x1 < x2 then x2-x1 else x1-x2) (if y1 < y2 then y2-y1 else y1-y2)
***************
*** 234,238 ****
[w,h] <- peekArray 2 csize
return (fromCSize w h)
!
fromCSize :: CInt -> CInt -> Size
fromCSize w h
--- 241,245 ----
[w,h] <- peekArray 2 csize
return (fromCSize w h)
!
fromCSize :: CInt -> CInt -> Size
fromCSize w h
***************
*** 247,251 ****
-- (and not a single pixel). The pixel width of a rectangle is therefore simply the difference
-- between the right and left, or bottom and top coordinate.
! data Rect = Rect
{ left :: !Int
, top :: !Int
--- 254,258 ----
-- (and not a single pixel). The pixel width of a rectangle is therefore simply the difference
-- between the right and left, or bottom and top coordinate.
! data Rect = Rect
{ left :: !Int
, top :: !Int
|
|
From: <kr_...@us...> - 2003-07-13 08:15:46
|
Update of /cvsroot/htoolkit/gio/src/examples/images In directory sc8-pr-cvs1:/tmp/cvs-serv24200/images Added Files: logo.bmp Log Message: Create sepparate directory for images and move logo.bmp from worm directory to the new directory. --- NEW FILE: logo.bmp --- (This appears to be a binary file; contents omitted.) |
|
From: <kr_...@us...> - 2003-07-13 08:15:46
|
Update of /cvsroot/htoolkit/gio/src/examples/worm
In directory sc8-pr-cvs1:/tmp/cvs-serv24200/worm
Modified Files:
Main.hs
Removed Files:
logo.bmp
Log Message:
Create sepparate directory for images and move logo.bmp from worm directory
to the new directory.
Index: Main.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/examples/worm/Main.hs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Main.hs 1 Jul 2003 20:22:01 -0000 1.5
--- Main.hs 13 Jul 2003 08:15:41 -0000 1.6
***************
*** 62,66 ****
, on paint =: onPaint ref
, on dismiss =: halt
- , resizeable =: False
]
--- 62,65 ----
***************
*** 70,74 ****
set mplay [on command =: onPlay ref mnew mopts mplay mexit tm w]
! set mnew [on command =: onNew ref w]
onPaint ref can _ _ = do
--- 69,75 ----
set mplay [on command =: onPlay ref mnew mopts mplay mexit tm w]
! set mnew [on command =: onNew ref w >> set w [resizeable =: False]]
!
! --set w [resizeable =: False]
onPaint ref can _ _ = do
***************
*** 108,114 ****
onAbout = do
! logo <- readBitmap "logo.bmp" []
! runAboutDialog "Worm" "1.0"
! "(C) Krasimir Angelov, 2003"
"The Worm is an example program\nfreely distributed with HToolkit"
[] [] [] logo Nothing
--- 109,115 ----
onAbout = do
! logo <- readBitmap "../images/logo.bmp" []
! runAboutDialog "Worm" "1.0"
! "(C) Krasimir Angelov, 2003"
"The Worm is an example program\nfreely distributed with HToolkit"
[] [] [] logo Nothing
--- logo.bmp DELETED ---
|
|
From: <kr_...@us...> - 2003-07-13 08:11:39
|
Update of /cvsroot/htoolkit/gio/src/examples/images In directory sc8-pr-cvs1:/tmp/cvs-serv24008/images Log Message: Directory /cvsroot/htoolkit/gio/src/examples/images added to the repository |
|
From: <kr_...@us...> - 2003-07-12 19:50:09
|
Update of /cvsroot/htoolkit/port/src/Port
In directory sc8-pr-cvs1:/tmp/cvs-serv26523/src/Port
Modified Files:
Types.hs
Log Message:
bugfix
Index: Types.hs
===================================================================
RCS file: /cvsroot/htoolkit/port/src/Port/Types.hs,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** Types.hs 8 Jul 2003 20:31:29 -0000 1.22
--- Types.hs 12 Jul 2003 19:50:04 -0000 1.23
***************
*** 410,414 ****
where
i = fromCWord ci
! bitsSet x mask = x .&. 0x01 /= 0
toCModifiers :: Modifiers -> CWord
--- 410,414 ----
where
i = fromCWord ci
! bitsSet x mask = x .&. mask /= 0
toCModifiers :: Modifiers -> CWord
|
|
From: <kr_...@us...> - 2003-07-12 13:49:44
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32
In directory sc8-pr-cvs1:/tmp/cvs-serv7809a/src/cbits/Win32
Modified Files:
Menu.c Util.c Window.c
Log Message:
bugfix
Index: Menu.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Menu.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Menu.c 8 Jun 2003 11:10:02 -0000 1.9
--- Menu.c 12 Jul 2003 13:49:41 -0000 1.10
***************
*** 98,102 ****
GetClientRect(ghWndFrame, &rc);
! SetWindowPos(pFrameData->hClientWnd,NULL,rc.left,rc.top,rc.right,rc.bottom,SWP_NOZORDER);
DrawMenuBar(ghWndFrame);
}
--- 98,102 ----
GetClientRect(ghWndFrame, &rc);
! SetWindowPos(pFrameData->hClientWnd,NULL,rc.left,rc.top,rc.right-rc.left,rc.bottom-rc.top,SWP_NOZORDER);
DrawMenuBar(ghWndFrame);
}
Index: Util.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Util.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** Util.c 1 Jul 2003 20:08:18 -0000 1.14
--- Util.c 12 Jul 2003 13:49:41 -0000 1.15
***************
*** 1,4 ****
- #define _WIN32_IE 0x0400
-
#include "RtsAPI.h"
#include "Types.h"
--- 1,2 ----
Index: Window.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Window.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** Window.c 2 Jul 2003 18:09:47 -0000 1.32
--- Window.c 12 Jul 2003 13:49:41 -0000 1.33
***************
*** 1,4 ****
- #define _WIN32_IE 0x0400
-
#include "Window.h"
#include "Internals.h"
--- 1,2 ----
***************
*** 1382,1388 ****
}
! void osSetWindowResizeable(WindowHandle hwnd, int resizeable )
{
! RECT rect;
LONG style;
FrameData *pFrameData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA);
--- 1380,1386 ----
}
! void osSetWindowResizeable(WindowHandle hwnd, int resizeable)
{
! RECT rc;
LONG style;
FrameData *pFrameData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA);
***************
*** 1396,1401 ****
SetWindowLong(hwnd, GWL_STYLE, style );
! GetClientRect(hwnd,&rect);
! handleWindowResize(hwnd,rect.right-rect.left,rect.bottom-rect.top);
! handleWindowReLayout(hwnd);
}
--- 1394,1407 ----
SetWindowLong(hwnd, GWL_STYLE, style );
! if (hwnd == ghWndFrame)
! {
! GetWindowRect(hwnd,&rc);
! SetWindowPos(ghWndFrame,NULL,rc.left,rc.top,rc.right-rc.left,rc.bottom-rc.top,SWP_NOZORDER | SWP_FRAMECHANGED);
! }
! else
! {
! GetClientRect(hwnd,&rc);
! handleWindowResize(hwnd,rc.right-rc.left,rc.bottom-rc.top);
! handleWindowReLayout(hwnd);
! }
}
|
|
From: <kr_...@us...> - 2003-07-12 13:01:17
|
Update of /cvsroot/htoolkit/gio/src/examples/worm
In directory sc8-pr-cvs1:/tmp/cvs-serv1866
Modified Files:
WormShow.hs
Log Message:
bugfix
Index: WormShow.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/examples/worm/WormShow.hs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** WormShow.hs 21 Jun 2003 10:04:29 -0000 1.2
--- WormShow.hs 12 Jul 2003 13:01:10 -0000 1.3
***************
*** 111,115 ****
drawBorders can = do
setCanvasPen can [color=:black, thickness=:3]
! drawRect (Rect (cornerX-3) (cornerY-3)
(cornerX+sizeX*cellSize+11) (cornerY+sizeY*cellSize+11)) can
setCanvasPen can [thickness=:1]
--- 111,115 ----
drawBorders can = do
setCanvasPen can [color=:black, thickness=:3]
! drawRect (Rect (cornerX-3) (cornerY-3)
(cornerX+sizeX*cellSize+11) (cornerY+sizeY*cellSize+11)) can
setCanvasPen can [thickness=:1]
***************
*** 163,174 ****
| step<0 = do
setCanvasPen can [color=:wormBackGroundColour]
! fillRect (Rect l b x y) can
! fillRect (Rect r t x y) can
setCanvasPen can [color=:black, thickness=:3]
drawRect (Rect l t r b) can
| otherwise = do
setCanvasPen can [color=:wormBackGroundColour]
! fillRect (Rect l b x (y-4)) can
! fillRect (Rect r t (x-4) y ) can
setCanvasPen can [color=:black, thickness=:3]
drawRect (Rect l t r b) can
--- 163,174 ----
| step<0 = do
setCanvasPen can [color=:wormBackGroundColour]
! fillRect (Rect (l-1) b x y) can
! fillRect (Rect r (t-1) x y) can
setCanvasPen can [color=:black, thickness=:3]
drawRect (Rect l t r b) can
| otherwise = do
setCanvasPen can [color=:wormBackGroundColour]
! fillRect (Rect (l-1) y r b) can
! fillRect (Rect x (t-1) r b) can
setCanvasPen can [color=:black, thickness=:3]
drawRect (Rect l t r b) can
***************
*** 177,183 ****
t = cornerY-3
r = l+w*n
! b = t+h*n
! x = r-step*w
! y = b-step*h
w = (48+sizeX*cellSize) `div` nrAnimationSteps
h = (48+sizeY*cellSize) `div` nrAnimationSteps
--- 177,183 ----
t = cornerY-3
r = l+w*n
! b = t+h*n
! x = r-step*(w+1)
! y = b-step*(h+1)
w = (48+sizeX*cellSize) `div` nrAnimationSteps
h = (48+sizeY*cellSize) `div` nrAnimationSteps
|
|
From: <kr_...@us...> - 2003-07-12 12:00:49
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32
In directory sc8-pr-cvs1:/tmp/cvs-serv26957/src/cbits/Win32
Modified Files:
Canvas.c
Log Message:
Bugfix: the rectangles are drawn with correct sizes
Index: Canvas.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Canvas.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** Canvas.c 3 Feb 2003 16:53:41 -0000 1.6
--- Canvas.c 12 Jul 2003 12:00:47 -0000 1.7
***************
*** 292,296 ****
switch (lineStyle)
{
! case 0: penstyle |= (size == 1) ? PS_SOLID : PS_INSIDEFRAME; break;
case 1: penstyle |= PS_DASH; break;
case 2: penstyle |= PS_DOT; break;
--- 292,296 ----
switch (lineStyle)
{
! case 0: penstyle |= PS_SOLID; break;
case 1: penstyle |= PS_DASH; break;
case 2: penstyle |= PS_DOT; break;
***************
*** 415,419 ****
{
SelectObject (canvas->hDC, GetStockObject (NULL_BRUSH));
! Rectangle (canvas->hDC, left, top, right+1, bot+1);
SelectObject (canvas->hDC, canvas->theBrush);
} /* osDrawRect */
--- 415,419 ----
{
SelectObject (canvas->hDC, GetStockObject (NULL_BRUSH));
! Rectangle (canvas->hDC, left, top, right, bot);
SelectObject (canvas->hDC, canvas->theBrush);
} /* osDrawRect */
***************
*** 422,426 ****
{
SelectObject (canvas->hDC, GetStockObject (NULL_PEN));
! Rectangle(canvas->hDC, left, top, right+2, bot+2);
SelectObject (canvas->hDC, canvas->thePen);
} /* osFillRect */
--- 422,426 ----
{
SelectObject (canvas->hDC, GetStockObject (NULL_PEN));
! Rectangle(canvas->hDC, left, top, right+1, bot+1);
SelectObject (canvas->hDC, canvas->thePen);
} /* osFillRect */
|
|
From: <kr_...@us...> - 2003-07-12 12:00:49
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK In directory sc8-pr-cvs1:/tmp/cvs-serv26957/src/cbits/GTK Modified Files: Canvas.c Log Message: Bugfix: the rectangles are drawn with correct sizes Index: Canvas.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Canvas.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Canvas.c 8 Jun 2003 21:11:48 -0000 1.10 --- Canvas.c 12 Jul 2003 12:00:47 -0000 1.11 *************** *** 608,613 **** gdk_draw_rectangle(canvas->drawable, canvas->theFillGC, TRUE, left, top, ! right-left, ! bot-top); } /* osFillRect */ --- 608,613 ---- gdk_draw_rectangle(canvas->drawable, canvas->theFillGC, TRUE, left, top, ! right-left+1, ! bot-top+1); } /* osFillRect */ |
|
From: <kr_...@us...> - 2003-07-12 08:41:41
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK
In directory sc8-pr-cvs1:/tmp/cvs-serv4984/src/cbits/GTK
Modified Files:
ListBox.c
Log Message:
Bugfix
Index: ListBox.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/ListBox.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** ListBox.c 10 Jul 2003 20:49:08 -0000 1.7
--- ListBox.c 12 Jul 2003 08:41:38 -0000 1.8
***************
*** 62,89 ****
void osInsertListBoxItem(WindowHandle listbox, int index, char *title)
{
! /* GtkWidget *li;
GtkWidget *lbox = GTK_BIN(listbox)->child;
!
! li = gtk_list_item_new_with_label(title);
! if (GTK_LIST(listbox)->selection_mode == GTK_SELECTION_MULTIPLE)
! {
! gtk_signal_connect (GTK_OBJECT(li), "select",
! GTK_SIGNAL_FUNC(hh),
! listbox);
! gtk_signal_connect (GTK_OBJECT(li), "deselect",
! GTK_SIGNAL_FUNC(hh),
! listbox);
! }
!
! gtk_list_insert_items(GTK_LIST(listbox), g_list_append(NULL,li), index);
! gtk_widget_show(li);
! */
! };
void osRemoveListBoxItem(WindowHandle listbox, int index)
{
! GList *tmp_list = g_list_append(NULL, g_list_nth(GTK_LIST(listbox)->children, index)->data);
! gtk_list_remove_items (GTK_LIST(listbox),tmp_list);
! g_list_free(tmp_list);
};
--- 62,84 ----
void osInsertListBoxItem(WindowHandle listbox, int index, char *title)
{
! GtkTreeIter iter;
GtkWidget *lbox = GTK_BIN(listbox)->child;
! GtkListStore *store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(lbox)));
! gtk_list_store_insert(store, &iter, index);
! gtk_list_store_set(store, &iter, 0, title, -1);};
void osRemoveListBoxItem(WindowHandle listbox, int index)
{
! GtkTreeIter iter;
! GtkWidget *lbox;
! GtkTreeModel *model;
! GtkTreePath *path;
!
! lbox = GTK_BIN(listbox)->child;
! model = gtk_tree_view_get_model(GTK_TREE_VIEW(lbox));
! path = gtk_tree_path_new_from_indices(index, -1);
! if (gtk_tree_model_get_iter(model,&iter,path))
! gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
! gtk_tree_path_free(path);
};
|
|
From: <kr_...@us...> - 2003-07-12 08:15:31
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO
In directory sc8-pr-cvs1:/tmp/cvs-serv2001/src/Graphics/UI/GIO
Modified Files:
Attributes.hs Controls.hs
Log Message:
The Select class is renamed to CommandItems. Added new class methods:
appendItem, insertItem, removeItem, removeAllItems
Index: Attributes.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Attributes.hs,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** Attributes.hs 8 Jul 2003 20:36:26 -0000 1.14
--- Attributes.hs 12 Jul 2003 08:15:29 -0000 1.15
***************
*** 74,78 ****
-- ** Selection
, Checked, checked
! , Select, items
, SingleSelect, selected
, MultiSelect, selection
--- 74,78 ----
-- ** Selection
, Checked, checked
! , CommandItems, items, appendItem, insertItem, removeItem, removeAllItems
, SingleSelect, selected
, MultiSelect, selection
***************
*** 301,306 ****
-- | Widgets that have selectable items, like popup controls.
! class Select w where
items :: Attr w [(String,IO ())]
-- | Widgets that have a single selection (like radio control groups).
--- 301,310 ----
-- | Widgets that have selectable items, like popup controls.
! class CommandItems w where
items :: Attr w [(String,IO ())]
+ appendItem :: w -> (String,IO ()) -> IO ()
+ insertItem :: w -> Int -> (String,IO ()) -> IO ()
+ removeItem :: w -> Int -> IO ()
+ removeAllItems :: w -> IO ()
-- | Widgets that have a single selection (like radio control groups).
Index: Controls.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Controls.hs,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** Controls.hs 10 Jul 2003 20:50:24 -0000 1.16
--- Controls.hs 12 Jul 2003 08:15:29 -0000 1.17
***************
*** 36,39 ****
--- 36,55 ----
--------------------------------------------------------------------
+ -- Helper functions
+ --------------------------------------------------------------------
+
+ insertAt :: Int -> a -> [a] -> [a]
+ insertAt pos v [] = []
+ insertAt pos v (x:xs)
+ | pos == 0 = v : xs
+ | otherwise = x : insertAt (pos-1) v xs
+
+ removeAt :: Int -> [a] -> [a]
+ removeAt pos [] = []
+ removeAt pos (x:xs)
+ | pos == 0 = xs
+ | otherwise = x : removeAt (pos-1) xs
+
+ --------------------------------------------------------------------
-- Label
--------------------------------------------------------------------
***************
*** 190,194 ****
! instance Select Popup where
items
= newAttr (\w -> getVar (pitems w))
--- 206,210 ----
! instance CommandItems Popup where
items
= newAttr (\w -> getVar (pitems w))
***************
*** 198,201 ****
--- 214,237 ----
set w [selected =: 0])
+ appendItem p item@(title,action) = do
+ items <- takeVar (pitems p)
+ Port.appendPopUpItem (phandle p) title
+ putVar (pitems p) (items++[item])
+
+ insertItem p pos item@(title,action) = do
+ items <- takeVar (pitems p)
+ Port.insertPopUpItem (phandle p) pos title
+ putVar (pitems p) (insertAt pos item items)
+
+ removeItem p pos = do
+ items <- takeVar (pitems p)
+ Port.removePopUpItem (phandle p) pos
+ putVar (pitems p) (removeAt pos items)
+
+ removeAllItems p = do
+ items <- takeVar (pitems p)
+ Port.removeAllPopUpItems (phandle p)
+ putVar (pitems p) []
+
instance SingleSelect Popup where
selected
***************
*** 250,254 ****
when (i>=0 && i < length xs) (snd (xs!!i)) -- invoke appropiate handler
! instance Select ListBox where
items
= newAttr (\w -> getVar (lbitems w))
--- 286,290 ----
when (i>=0 && i < length xs) (snd (xs!!i)) -- invoke appropiate handler
! instance CommandItems ListBox where
items
= newAttr (\w -> getVar (lbitems w))
***************
*** 256,259 ****
--- 292,316 ----
mapM_ (Port.appendListBoxItem (lbhandle w) . fst) xs
setVar (lbitems w) xs)
+
+ appendItem lb item@(title,action) = do
+ items <- takeVar (lbitems lb)
+ Port.appendListBoxItem (lbhandle lb) title
+ putVar (lbitems lb) (items++[item])
+
+ insertItem lb pos item@(title,action) = do
+ items <- takeVar (lbitems lb)
+ Port.insertListBoxItem (lbhandle lb) pos title
+ putVar (lbitems lb) (insertAt pos item items)
+
+ removeItem lb pos = do
+ items <- takeVar (lbitems lb)
+ Port.removeListBoxItem (lbhandle lb) pos
+ putVar (lbitems lb) (removeAt pos items)
+
+ removeAllItems lb = do
+ items <- takeVar (lbitems lb)
+ Port.removeAllListBoxItems (lbhandle lb)
+ putVar (lbitems lb) []
+
instance SingleSelect ListBox where
|
|
From: <kr_...@us...> - 2003-07-12 08:08:52
|
Update of /cvsroot/htoolkit/gio/src/examples/simple
In directory sc8-pr-cvs1:/tmp/cvs-serv1338/src/examples/simple
Modified Files:
SimpleMenu.hs
Log Message:
formatting
Index: SimpleMenu.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/examples/simple/SimpleMenu.hs,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** SimpleMenu.hs 21 Jun 2003 10:14:47 -0000 1.7
--- SimpleMenu.hs 12 Jul 2003 08:08:49 -0000 1.8
***************
*** 12,31 ****
fm <- menu [title =: "&File"] mainMenu
! menuitem [title =: "&New"
! ,accel =: KeyChar '\^N'
! ,on command =: messageAlert "NEW"
! ,menuicon =: Just bmpNew
] fm
menuitem [title =: "&Open"
! ,accel =: KeyChar '\^O'
, on command =: messageAlert "OPEN"
! , menuicon =: Just bmpOpen
] fm
menuitem [title =: "&Close"] fm
menuline fm
! menuitem [title =: "&Save"
! ,accel =: KeyChar '\^S'
! ,on command =: messageAlert "SAVE"
! , menuicon =: Just bmpSave
] fm
menuline fm
--- 12,31 ----
fm <- menu [title =: "&File"] mainMenu
! menuitem [ title =: "&New"
! , accel =: KeyChar '\^N'
! , on command =: messageAlert "NEW"
! , icon =: Just bmpNew
] fm
menuitem [title =: "&Open"
! , accel =: KeyChar '\^O'
, on command =: messageAlert "OPEN"
! , icon =: Just bmpOpen
] fm
menuitem [title =: "&Close"] fm
menuline fm
! menuitem [ title =: "&Save"
! , accel =: KeyChar '\^S'
! , on command =: messageAlert "SAVE"
! , icon =: Just bmpSave
] fm
menuline fm
|
|
From: <kr_...@us...> - 2003-07-10 21:51:04
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK
In directory sc8-pr-cvs1:/tmp/cvs-serv14931/src/cbits/GTK
Modified Files:
ListBox.c
Log Message:
bugfix
Index: ListBox.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/ListBox.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** ListBox.c 10 Jul 2003 19:39:56 -0000 1.6
--- ListBox.c 10 Jul 2003 20:49:08 -0000 1.7
***************
*** 132,140 ****
void osSetListBoxSingleSelection(WindowHandle listbox, int index)
{
! GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(GTK_BIN(listbox)->child));
if (index > 0)
{
GtkTreePath *path = gtk_tree_path_new_from_indices (index, -1);
gtk_tree_selection_select_path(selection, path);
gtk_tree_path_free(path);
--- 132,142 ----
void osSetListBoxSingleSelection(WindowHandle listbox, int index)
{
! GtkWidget *lbox = GTK_BIN(listbox)->child;
! GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(lbox));
if (index > 0)
{
GtkTreePath *path = gtk_tree_path_new_from_indices (index, -1);
+ gtk_tree_view_set_cursor(GTK_TREE_VIEW(lbox), path, NULL, TRUE);
gtk_tree_selection_select_path(selection, path);
gtk_tree_path_free(path);
***************
*** 170,172 ****
else
return -1;
! }
\ No newline at end of file
--- 172,174 ----
else
return -1;
! }
|
|
From: <kr_...@us...> - 2003-07-10 20:50:27
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO
In directory sc8-pr-cvs1:/tmp/cvs-serv15099/src/Graphics/UI/GIO
Modified Files:
Controls.hs
Log Message:
Remove trace message
Index: Controls.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Controls.hs,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** Controls.hs 10 Jul 2003 19:41:19 -0000 1.15
--- Controls.hs 10 Jul 2003 20:50:24 -0000 1.16
***************
*** 247,251 ****
listBoxCommand lb = do
i <- Port.getListBoxCurrentItem (lbhandle lb)
- print i
xs <- getVar (lbitems lb)
when (i>=0 && i < length xs) (snd (xs!!i)) -- invoke appropiate handler
--- 247,250 ----
|
|
From: <kr_...@us...> - 2003-07-10 20:14:28
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32
In directory sc8-pr-cvs1:/tmp/cvs-serv9006/src/cbits/Win32
Modified Files:
ListBox.c
Log Message:
bugfix
Index: ListBox.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/ListBox.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ListBox.c 10 Feb 2003 22:42:10 -0000 1.3
--- ListBox.c 10 Jul 2003 20:14:25 -0000 1.4
***************
*** 91,95 ****
void osSetListBoxSingleSelection(WindowHandle listbox, int index)
{
! SendMessage(listbox, CB_SETCURSEL, index, 0);
};
--- 91,96 ----
void osSetListBoxSingleSelection(WindowHandle listbox, int index)
{
! SendMessage(listbox, LB_SETCURSEL, index, 0);
! handleControlCommand(listbox);
};
***************
*** 98,99 ****
--- 99,105 ----
SendMessage(listbox, LB_SETSEL, state, index);
};
+
+ int osGetListBoxCurrentItem(WindowHandle listbox)
+ {
+ return SendMessage(listbox, LB_GETCARETINDEX, 0, 0);
+ }
|
|
From: <kr_...@us...> - 2003-07-10 19:54:43
|
Update of /cvsroot/htoolkit/port/src/Port
In directory sc8-pr-cvs1:/tmp/cvs-serv2409/src/Port
Modified Files:
Controls.hs
Log Message:
Complete implementation for ListBox for GTK/Gnome.
Index: Controls.hs
===================================================================
RCS file: /cvsroot/htoolkit/port/src/Port/Controls.hs,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** Controls.hs 27 Mar 2003 13:36:21 -0000 1.13
--- Controls.hs 10 Jul 2003 19:39:56 -0000 1.14
***************
*** 70,73 ****
--- 70,74 ----
, getListBoxSingleSelection, setListBoxSingleSelection
, getListBoxItemSelectState, setListBoxItemSelectState
+ , getListBoxCurrentItem
-- * Slider
, createHorzSlider, createVertSlider, getSliderRequestSize
***************
*** 296,301 ****
foreign import ccall osSetListBoxItemSelectState :: WindowHandle -> CInt -> CBool -> IO ()
-----------------------------------------------------------------------------------------
! -- Popup
-----------------------------------------------------------------------------------------
-- | Create a new popup box.
--- 297,304 ----
foreign import ccall osSetListBoxItemSelectState :: WindowHandle -> CInt -> CBool -> IO ()
+ foreign import ccall "osGetListBoxCurrentItem" getListBoxCurrentItem :: WindowHandle -> IO Int
+
-----------------------------------------------------------------------------------------
! -- Popup
-----------------------------------------------------------------------------------------
-- | Create a new popup box.
|
|
From: <kr_...@us...> - 2003-07-10 19:51:32
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK
In directory sc8-pr-cvs1:/tmp/cvs-serv2409/src/cbits/GTK
Modified Files:
ListBox.c
Log Message:
Complete implementation for ListBox for GTK/Gnome.
Index: ListBox.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/ListBox.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ListBox.c 29 Mar 2003 08:12:18 -0000 1.5
--- ListBox.c 10 Jul 2003 19:39:56 -0000 1.6
***************
*** 1,142 ****
! #include "ListBox.h"
! #include "Internals.h"
! #include "Handlers_stub.h"
!
! static void h1(GtkWidget *w)
! {
! printf("1\n");
! handleControlCommand(w);
! }
!
! static void h2(GtkWidget *w1, GtkWidget *w2)
! {
! printf("2 -> %08X %08X\n", w1, w2);
! handleControlCommand(w1);
! }
!
! static void h3(GtkWidget *w1, GtkWidget *w2)
! {
! printf("3 -> %08X %08X\n", w1, w2);
! handleControlCommand(w1);
! }
!
! WindowHandle osCreateListBox(WindowHandle window, BOOL multisel)
! {
! GtkWidget *lbox;
!
! lbox = gtk_list_new();
! if (!multisel)
! {
! gtk_signal_connect (GTK_OBJECT(lbox), "selection-changed",
! GTK_SIGNAL_FUNC(h1 /*handleListBoxClick*/),
! NULL);
! }
! else
! {
! #if 0
! gtk_signal_connect (GTK_OBJECT(lbox), "select-child",
! GTK_SIGNAL_FUNC(h2 /*handleListBoxClick*/),
! NULL);
! gtk_signal_connect (GTK_OBJECT(lbox), "unselect-child",
! GTK_SIGNAL_FUNC(h3 /*handleListBoxClick*/),
! NULL);
! #endif
! }
!
! gtk_fixed_put(GTK_FIXED(GTK_BIN(GTK_BIN(window)->child)->child), lbox, 0, 0);
! gtk_list_set_selection_mode (GTK_LIST(lbox), multisel ? GTK_SELECTION_MULTIPLE : GTK_SELECTION_SINGLE);
! gtk_widget_show(lbox);
! return lbox;
! };
!
! static void hh(GtkItem *item, gpointer user_data)
! {
! printf("hh\n");
! handleControlCommand((GtkWidget *) user_data);
! };
!
! void osAppendListBoxItem(WindowHandle listbox, char *title)
! {
! GtkWidget *li;
!
! li = gtk_list_item_new_with_label(title);
! if (GTK_LIST(listbox)->selection_mode == GTK_SELECTION_MULTIPLE)
! {
! gtk_signal_connect (GTK_OBJECT(li), "select",
! GTK_SIGNAL_FUNC(hh),
! listbox);
! gtk_signal_connect (GTK_OBJECT(li), "deselect",
! GTK_SIGNAL_FUNC(hh),
! listbox);
! }
!
! gtk_list_append_items(GTK_LIST(listbox), g_list_append(NULL,li));
! gtk_widget_show(li);
! };
!
! void osInsertListBoxItem(WindowHandle listbox, int index, char *title)
! {
! GtkWidget *li;
!
! li = gtk_list_item_new_with_label(title);
! if (GTK_LIST(listbox)->selection_mode == GTK_SELECTION_MULTIPLE)
! {
! gtk_signal_connect (GTK_OBJECT(li), "select",
! GTK_SIGNAL_FUNC(hh),
! listbox);
! gtk_signal_connect (GTK_OBJECT(li), "deselect",
! GTK_SIGNAL_FUNC(hh),
! listbox);
! }
!
! gtk_list_insert_items(GTK_LIST(listbox), g_list_append(NULL,li), index);
! gtk_widget_show(li);
! };
!
! void osRemoveListBoxItem(WindowHandle listbox, int index)
! {
! GList *tmp_list = g_list_append(NULL, g_list_nth(GTK_LIST(listbox)->children, index)->data);
! gtk_list_remove_items (GTK_LIST(listbox),tmp_list);
! g_list_free(tmp_list);
! };
!
! void osRemoveAllListBoxItems(WindowHandle listbox)
! {
! gtk_list_remove_items (GTK_LIST(listbox),GTK_LIST(listbox)->children);
! };
!
! void osGetListBoxReqSize(WindowHandle listbox, int *res)
! {
! res[0] = 100;
! res[1] = 100;
! };
!
! int osGetListBoxSingleSelection(WindowHandle listbox)
! {
! if (!GTK_LIST(listbox)->selection)
! return -1;
!
! return gtk_list_child_position(GTK_LIST(listbox), (GtkWidget *) GTK_LIST(listbox)->selection->data);
! };
!
! BOOL osGetListBoxItemSelectState(WindowHandle listbox, int index)
! {
! GtkWidget *item = (GtkWidget *) g_list_nth(GTK_LIST(listbox)->children, index)->data;
! return (item->state == GTK_STATE_SELECTED);
! }
!
! void osSetListBoxSingleSelection(WindowHandle listbox, int index)
! {
! if (index > 0)
! gtk_list_select_item(GTK_LIST(listbox),index);
! else
! gtk_list_unselect_all(GTK_LIST(listbox));
! };
!
! void osSetListBoxItemSelectState(WindowHandle listbox, int index, BOOL state)
! {
! if (state)
! gtk_list_select_item(GTK_LIST(listbox),index);
! else
! gtk_list_unselect_item(GTK_LIST(listbox),index);
! };
--- 1,172 ----
! #include "ListBox.h"
! #include "Internals.h"
! #include "Handlers_stub.h"
!
! static void tree_view_selection_chanded(GtkWidget *w, gpointer user_data)
! {
! handleControlCommand((WindowHandle) user_data);
! }
!
! WindowHandle osCreateListBox(WindowHandle window, BOOL multisel)
! {
! GtkListStore *store;
! GtkWidget *lbox, *sw;
! GtkTreeViewColumn *column;
!
! /* create scrolled window */
! sw = gtk_scrolled_window_new (NULL, NULL);
! gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), GTK_SHADOW_ETCHED_IN);
! gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
! GTK_POLICY_AUTOMATIC,
! GTK_POLICY_AUTOMATIC);
!
! /* create list store */
! store = gtk_list_store_new (1, G_TYPE_STRING);
!
! /* create tree view */
! lbox = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));
! gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(lbox), FALSE);
! gtk_tree_view_set_enable_search (GTK_TREE_VIEW(lbox), TRUE);
! gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(lbox)),
! multisel ? GTK_SELECTION_MULTIPLE : GTK_SELECTION_SINGLE);
! g_object_unref (store);
!
! /* add column to the tree view */
! column = gtk_tree_view_column_new_with_attributes ("",
! gtk_cell_renderer_text_new (),
! "text",
! 0,
! NULL);
! gtk_tree_view_append_column (GTK_TREE_VIEW(lbox), column);
!
! gtk_container_add(GTK_CONTAINER(sw), lbox);
!
! g_signal_connect (G_OBJECT(gtk_tree_view_get_selection(GTK_TREE_VIEW(lbox))), "changed",
! GTK_SIGNAL_FUNC(tree_view_selection_chanded),
! sw);
!
! gtk_fixed_put(GTK_FIXED(GTK_BIN(GTK_BIN(window)->child)->child), sw, 0, 0);
! gtk_widget_show_all(sw);
! return sw;
! };
!
! void osAppendListBoxItem(WindowHandle listbox, char *title)
! {
! GtkTreeIter iter;
! GtkWidget *lbox = GTK_BIN(listbox)->child;
! GtkListStore *store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(lbox)));
! gtk_list_store_append(store, &iter);
! gtk_list_store_set(store, &iter, 0, title, -1);
! };
!
! void osInsertListBoxItem(WindowHandle listbox, int index, char *title)
! {
! /* GtkWidget *li;
! GtkWidget *lbox = GTK_BIN(listbox)->child;
!
! li = gtk_list_item_new_with_label(title);
! if (GTK_LIST(listbox)->selection_mode == GTK_SELECTION_MULTIPLE)
! {
! gtk_signal_connect (GTK_OBJECT(li), "select",
! GTK_SIGNAL_FUNC(hh),
! listbox);
! gtk_signal_connect (GTK_OBJECT(li), "deselect",
! GTK_SIGNAL_FUNC(hh),
! listbox);
! }
!
! gtk_list_insert_items(GTK_LIST(listbox), g_list_append(NULL,li), index);
! gtk_widget_show(li);
! */
! };
!
! void osRemoveListBoxItem(WindowHandle listbox, int index)
! {
! GList *tmp_list = g_list_append(NULL, g_list_nth(GTK_LIST(listbox)->children, index)->data);
! gtk_list_remove_items (GTK_LIST(listbox),tmp_list);
! g_list_free(tmp_list);
! };
!
! void osRemoveAllListBoxItems(WindowHandle listbox)
! {
! gtk_list_store_clear(GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(GTK_BIN(listbox)->child))));
! };
!
! void osGetListBoxReqSize(WindowHandle listbox, int *res)
! {
! res[0] = 80;
! res[1] = 60;
! };
!
! int osGetListBoxSingleSelection(WindowHandle listbox)
! {
! GtkTreeIter iter;
! GtkTreePath *path;
! GtkTreeModel *model = NULL;
! GtkWidget *lbox = GTK_BIN(listbox)->child;
! int index = -1;
!
! if (gtk_tree_selection_get_selected (gtk_tree_view_get_selection(GTK_TREE_VIEW(lbox)), &model, &iter))
! {
! path = gtk_tree_model_get_path(model, &iter);
! if (gtk_tree_path_get_depth(path) >= 1)
! index = gtk_tree_path_get_indices(path)[0];
! gtk_tree_path_free(path);
! }
!
! return index;
! };
!
! BOOL osGetListBoxItemSelectState(WindowHandle listbox, int index)
! {
! BOOL result;
! GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(GTK_BIN(listbox)->child));
! GtkTreePath *path = gtk_tree_path_new_from_indices (index, -1);
!
! result = gtk_tree_selection_path_is_selected(selection, path);
!
! gtk_tree_path_free(path);
! return result;
! }
!
! void osSetListBoxSingleSelection(WindowHandle listbox, int index)
! {
! GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(GTK_BIN(listbox)->child));
!
! if (index > 0)
! {
! GtkTreePath *path = gtk_tree_path_new_from_indices (index, -1);
! gtk_tree_selection_select_path(selection, path);
! gtk_tree_path_free(path);
! }
! else
! gtk_tree_selection_unselect_all (selection);
! };
!
! void osSetListBoxItemSelectState(WindowHandle listbox, int index, BOOL state)
! {
! GtkTreeSelection *selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(GTK_BIN(listbox)->child));
!
! if (index > 0)
! {
! GtkTreePath *path = gtk_tree_path_new_from_indices (index, -1);
! if (state)
! gtk_tree_selection_select_path(selection, path);
! else
! gtk_tree_selection_unselect_path(selection, path);
!
! gtk_tree_path_free(path);
! }
! };
!
! int osGetListBoxCurrentItem(WindowHandle listbox)
! {
! GtkTreePath *path;
! GtkWidget *lbox = GTK_BIN(listbox)->child;
!
! gtk_tree_view_get_cursor(GTK_TREE_VIEW(lbox), &path, NULL);
! if (path != NULL && gtk_tree_path_get_depth(path) >= 1)
! return gtk_tree_path_get_indices(path)[0];
! else
! return -1;
! }
\ No newline at end of file
|
|
From: <kr_...@us...> - 2003-07-10 19:51:31
|
Update of /cvsroot/htoolkit/port/src/include In directory sc8-pr-cvs1:/tmp/cvs-serv2409/src/include Modified Files: ListBox.h Log Message: Complete implementation for ListBox for GTK/Gnome. Index: ListBox.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/include/ListBox.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ListBox.h 23 Jan 2003 20:19:32 -0000 1.2 --- ListBox.h 10 Jul 2003 19:39:56 -0000 1.3 *************** *** 1,17 **** ! #ifndef LISTBOX_H ! #define LISTBOX_H ! ! #include "Types.h" ! ! WindowHandle osCreateListBox(WindowHandle window, BOOL multisel); ! void osAppendListBoxItem(WindowHandle listbox, char *title); ! void osInsertListBoxItem(WindowHandle listbox, int index, char *title); ! void osRemoveListBoxItem(WindowHandle listbox, int index); ! void osRemoveAllListBoxItems(WindowHandle listbox); ! void osGetListBoxReqSize(WindowHandle listbox, int *res); ! int osGetListBoxSingleSelection(WindowHandle listbox); ! BOOL osGetListBoxItemSelectState(WindowHandle listbox, int index); ! void osSetListBoxSingleSelection(WindowHandle listbox, int index); ! void osSetListBoxItemSelectState(WindowHandle listbox, int index, BOOL state); ! ! #endif --- 1,18 ---- ! #ifndef LISTBOX_H ! #define LISTBOX_H ! ! #include "Types.h" ! ! WindowHandle osCreateListBox(WindowHandle window, BOOL multisel); ! void osAppendListBoxItem(WindowHandle listbox, char *title); ! void osInsertListBoxItem(WindowHandle listbox, int index, char *title); ! void osRemoveListBoxItem(WindowHandle listbox, int index); ! void osRemoveAllListBoxItems(WindowHandle listbox); ! void osGetListBoxReqSize(WindowHandle listbox, int *res); ! int osGetListBoxSingleSelection(WindowHandle listbox); ! BOOL osGetListBoxItemSelectState(WindowHandle listbox, int index); ! void osSetListBoxSingleSelection(WindowHandle listbox, int index); ! void osSetListBoxItemSelectState(WindowHandle listbox, int index, BOOL state); ! int osGetListBoxCurrentItem(WindowHandle listbox); ! ! #endif |
|
From: <kr_...@us...> - 2003-07-10 19:42:59
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO
In directory sc8-pr-cvs1:/tmp/cvs-serv2674/src/Graphics/UI/GIO
Modified Files:
Controls.hs
Log Message:
ListBox for GIO
Index: Controls.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Controls.hs,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** Controls.hs 9 Jul 2003 17:15:14 -0000 1.14
--- Controls.hs 10 Jul 2003 19:41:19 -0000 1.15
***************
*** 11,20 ****
-}
-----------------------------------------------------------------------------------------
! module Graphics.UI.GIO.Controls(
-- * Controls
Button, button
! , Label, label
, Entry, entry, readOnly, visible
, Popup, popup
, Slider, hslider, vslider
, ProgressBar, hProgressBar, vProgressBar
--- 11,21 ----
-}
-----------------------------------------------------------------------------------------
! module Graphics.UI.GIO.Controls(
-- * Controls
Button, button
! , Label, label
, Entry, entry, readOnly, visible
, Popup, popup
+ , ListBox, listBox
, Slider, hslider, vslider
, ProgressBar, hProgressBar, vProgressBar
***************
*** 32,36 ****
import Graphics.UI.GIO.Window
import Graphics.UI.GIO.Layout
! import Control.Monad(when)
--------------------------------------------------------------------
--- 33,37 ----
import Graphics.UI.GIO.Window
import Graphics.UI.GIO.Layout
! import Control.Monad(when, mapM_, filterM)
--------------------------------------------------------------------
***************
*** 209,213 ****
instance Able Popup where
enabled = newAttr (Port.getControlEnabled . phandle) (Port.setControlEnabled . phandle)
!
instance ToolTip Popup where
tooltip = newAttr (Port.getControlTip . phandle) (Port.setControlTip . phandle)
--- 210,214 ----
instance Able Popup where
enabled = newAttr (Port.getControlEnabled . phandle) (Port.setControlEnabled . phandle)
!
instance ToolTip Popup where
tooltip = newAttr (Port.getControlTip . phandle) (Port.setControlTip . phandle)
***************
*** 215,219 ****
instance Control Popup where
pack p = stdPack (pparent p) (Port.getPopUpRequestSize (phandle p)) (Port.moveResizeControl (phandle p))
!
instance Commanding Popup where
command
--- 216,220 ----
instance Control Popup where
pack p = stdPack (pparent p) (Port.getPopUpRequestSize (phandle p)) (Port.moveResizeControl (phandle p))
!
instance Commanding Popup where
command
***************
*** 221,227 ****
{--------------------------------------------------------------------
Check group
--------------------------------------------------------------------}
! -- | A check control group.
data CheckGroup = CheckGroup{ checks :: [Check]
, cgparent :: !WindowHandle
--- 222,295 ----
{--------------------------------------------------------------------
+ ListBox
+ --------------------------------------------------------------------}
+ -- | A list box. Allthough it is 'Commanding', the default
+ -- command handler automatically calls a handler associated with a
+ -- selected item.
+ data ListBox = ListBox { lbhandle :: !WindowHandle
+ , lbparent :: !WindowHandle
+ , lbitems :: Var [(String,IO ())]
+ }
+
+ -- | Create a list box.
+ listBox :: Bool -> [Prop ListBox] -> Window -> IO ListBox
+ listBox multi props w = do
+ lb <- do
+ hlist <- Port.createListBox (hwindow w) multi
+ lbitems <- newVar []
+ return (ListBox hlist (hwindow w) lbitems)
+ set lb [on command =: listBoxCommand lb]
+ set lb props
+ return lb
+
+ -- default command handler
+ listBoxCommand :: ListBox -> IO ()
+ listBoxCommand lb = do
+ i <- Port.getListBoxCurrentItem (lbhandle lb)
+ print i
+ xs <- getVar (lbitems lb)
+ when (i>=0 && i < length xs) (snd (xs!!i)) -- invoke appropiate handler
+
+ instance Select ListBox where
+ items
+ = newAttr (\w -> getVar (lbitems w))
+ (\w xs -> do Port.removeAllListBoxItems (lbhandle w)
+ mapM_ (Port.appendListBoxItem (lbhandle w) . fst) xs
+ setVar (lbitems w) xs)
+
+ instance SingleSelect ListBox where
+ selected = newAttr (Port.getListBoxSingleSelection . lbhandle) (Port.setListBoxSingleSelection . lbhandle)
+
+ instance MultiSelect ListBox where
+ selection = newAttr getter setter
+ where
+ getter w = do
+ items <- getVar (lbitems w)
+ filterM (\i -> Port.getListBoxItemSelectState (lbhandle w) i) [0..length items-1]
+
+ setter w xs = do
+ items <- getVar (lbitems w)
+ mapM_ (\x -> Port.setListBoxItemSelectState (lbhandle w) x (elem x xs)) [0..length items-1]
+
+ instance Dimensions ListBox where
+ frame = newAttr (Port.getControlFrame . lbhandle) (Port.moveResizeControl . lbhandle)
+
+ instance Able ListBox where
+ enabled = newAttr (Port.getControlEnabled . lbhandle) (Port.setControlEnabled . lbhandle)
+
+ instance ToolTip ListBox where
+ tooltip = newAttr (Port.getControlTip . lbhandle) (Port.setControlTip . lbhandle)
+
+ instance Control ListBox where
+ pack lb = stdPack (lbparent lb) (Port.getListBoxRequestSize (lbhandle lb)) (Port.moveResizeControl (lbhandle lb))
+
+ instance Commanding ListBox where
+ command
+ = newControlCommandEvent lbhandle
+
+ {--------------------------------------------------------------------
Check group
--------------------------------------------------------------------}
! -- | A check control group.
data CheckGroup = CheckGroup{ checks :: [Check]
, cgparent :: !WindowHandle
***************
*** 257,262 ****
instance MultiSelect CheckGroup where
! selection
! = newAttr getter setter
where
getter w
--- 325,330 ----
instance MultiSelect CheckGroup where
! selection
! = newAttr getter setter
where
getter w
|
|
From: <kr_...@us...> - 2003-07-09 17:17:03
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK
In directory sc8-pr-cvs1:/tmp/cvs-serv26039/src/cbits/GTK
Modified Files:
PopUp.c
Log Message:
bugfix: use "changed" signal from GtkEntry to determine whether the current
selection is changed.
Index: PopUp.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/PopUp.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** PopUp.c 29 Mar 2003 08:12:18 -0000 1.5
--- PopUp.c 9 Jul 2003 17:17:00 -0000 1.6
***************
*** 1,77 ****
! #include "PopUp.h"
! #include "Internals.h"
! #include "Handlers_stub.h"
!
! static void handleLBoxClick(GtkList *list, gpointer user_data)
! {
! handleControlCommand((GtkWidget *) user_data);
! };
!
! WindowHandle osCreatePopUp(WindowHandle window)
! {
! GtkWidget *popup;
!
! popup = gtk_combo_new();
! gtk_entry_set_editable (GTK_ENTRY(GTK_COMBO(popup)->entry), gtk_false());
! gtk_combo_set_use_arrows_always(GTK_COMBO(popup), gtk_true());
! gtk_signal_connect (GTK_OBJECT(GTK_COMBO(popup)->list), "selection-changed",
! GTK_SIGNAL_FUNC(handleLBoxClick),
! popup);
! gtk_fixed_put(GTK_FIXED(GTK_BIN(GTK_BIN(window)->child)->child), popup, 0, 0);
! gtk_widget_show(popup);
! return popup;
! };
!
! void osAppendPopUpItem(WindowHandle popup, char *title)
! {
! GtkWidget *lbox = GTK_COMBO(popup)->list;
! GtkWidget *li = gtk_list_item_new_with_label(title);
! gtk_list_append_items(GTK_LIST(lbox), g_list_append(NULL,li));
! gtk_widget_show(li);
! };
!
! void osInsertPopUpItem(WindowHandle popup, int index, char *title)
! {
! GtkWidget *lbox = GTK_COMBO(popup)->list;
! GtkWidget *li = gtk_list_item_new_with_label(title);
! gtk_list_insert_items(GTK_LIST(lbox), g_list_append(NULL,li), index);
! gtk_widget_show(li);
! };
!
! void osRemovePopUpItem(WindowHandle popup, int index)
! {
! GtkWidget *lbox = GTK_COMBO(popup)->list;
! GList *tmp_list = g_list_append(NULL, g_list_nth(GTK_LIST(lbox)->children, index)->data);
! gtk_list_remove_items (GTK_LIST(lbox),tmp_list);
! g_list_free(tmp_list);
! };
!
! void osRemoveAllPopUpItems(WindowHandle popup)
! {
! GtkWidget *lbox = GTK_COMBO(popup)->list;
! gtk_list_remove_items (GTK_LIST(lbox),GTK_LIST(lbox)->children);
! };
!
! void osGetPopUpReqSize(WindowHandle popup, int *res)
! {
! res[0] = 100;
! res[1] = 100;
! };
!
! int osGetPopUpSelection(WindowHandle popup)
! {
! GtkWidget *lbox = GTK_COMBO(popup)->list;
! if (!GTK_LIST(lbox)->selection)
! return -1;
!
! return gtk_list_child_position(GTK_LIST(lbox), (GtkWidget *) GTK_LIST(lbox)->selection->data);
! };
!
! void osSetPopUpSelection(WindowHandle popup, int index)
! {
! GtkWidget *lbox = GTK_COMBO(popup)->list;
! if (index > 0)
! gtk_list_select_item(GTK_LIST(lbox),index);
! else
! gtk_list_unselect_all(GTK_LIST(lbox));
! };
--- 1,78 ----
! #include "PopUp.h"
! #include "Internals.h"
! #include "Handlers_stub.h"
!
! static void handleLBoxClick(GtkList *list, gpointer user_data)
! {
! handleControlCommand((GtkWidget *) user_data);
! };
!
! WindowHandle osCreatePopUp(WindowHandle window)
! {
! GtkWidget *popup;
!
! popup = gtk_combo_new();
! gtk_entry_set_editable (GTK_ENTRY(GTK_COMBO(popup)->entry), gtk_false());
! gtk_combo_set_use_arrows_always(GTK_COMBO(popup), gtk_true());
! gtk_signal_connect(GTK_OBJECT(GTK_COMBO(popup)->entry),
! "changed",
! GTK_SIGNAL_FUNC(handleLBoxClick),
! popup);
! gtk_fixed_put(GTK_FIXED(GTK_BIN(GTK_BIN(window)->child)->child), popup, 0, 0);
! gtk_widget_show(popup);
! return popup;
! };
!
! void osAppendPopUpItem(WindowHandle popup, char *title)
! {
! GtkWidget *lbox = GTK_COMBO(popup)->list;
! GtkWidget *li = gtk_list_item_new_with_label(title);
! gtk_list_append_items(GTK_LIST(lbox), g_list_append(NULL,li));
! gtk_widget_show(li);
! };
!
! void osInsertPopUpItem(WindowHandle popup, int index, char *title)
! {
! GtkWidget *lbox = GTK_COMBO(popup)->list;
! GtkWidget *li = gtk_list_item_new_with_label(title);
! gtk_list_insert_items(GTK_LIST(lbox), g_list_append(NULL,li), index);
! gtk_widget_show(li);
! };
!
! void osRemovePopUpItem(WindowHandle popup, int index)
! {
! GtkWidget *lbox = GTK_COMBO(popup)->list;
! GList *tmp_list = g_list_append(NULL, g_list_nth(GTK_LIST(lbox)->children, index)->data);
! gtk_list_remove_items (GTK_LIST(lbox),tmp_list);
! g_list_free(tmp_list);
! };
!
! void osRemoveAllPopUpItems(WindowHandle popup)
! {
! GtkWidget *lbox = GTK_COMBO(popup)->list;
! gtk_list_remove_items (GTK_LIST(lbox),GTK_LIST(lbox)->children);
! };
!
! void osGetPopUpReqSize(WindowHandle popup, int *res)
! {
! res[0] = 100;
! res[1] = 100;
! };
!
! int osGetPopUpSelection(WindowHandle popup)
! {
! GtkWidget *lbox = GTK_COMBO(popup)->list;
! if (!GTK_LIST(lbox)->selection)
! return -1;
!
! return gtk_list_child_position(GTK_LIST(lbox), (GtkWidget *) GTK_LIST(lbox)->selection->data);
! };
!
! void osSetPopUpSelection(WindowHandle popup, int index)
! {
! GtkWidget *lbox = GTK_COMBO(popup)->list;
! if (index > 0)
! gtk_list_select_item(GTK_LIST(lbox),index);
! else
! gtk_list_unselect_all(GTK_LIST(lbox));
! };
|
|
From: <kr_...@us...> - 2003-07-09 17:15:19
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO
In directory sc8-pr-cvs1:/tmp/cvs-serv25798/src/Graphics/UI/GIO
Modified Files:
Controls.hs
Log Message:
bugfix: popupCommand handler should accept zero based index
Index: Controls.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Controls.hs,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** Controls.hs 9 Jul 2003 17:03:51 -0000 1.13
--- Controls.hs 9 Jul 2003 17:15:14 -0000 1.14
***************
*** 186,190 ****
= do i <- get p selected
xs <- getVar (pitems p)
! when (i>0 && i < length xs) (snd (xs!!i)) -- invoke appropiate handler
--- 186,190 ----
= do i <- get p selected
xs <- getVar (pitems p)
! when (i>=0 && i < length xs) (snd (xs!!i)) -- invoke appropiate handler
|
|
From: <kr_...@us...> - 2003-07-09 17:03:54
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO
In directory sc8-pr-cvs1:/tmp/cvs-serv24395/src/Graphics/UI/GIO
Modified Files:
Controls.hs
Log Message:
remove trace message
Index: Controls.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Controls.hs,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** Controls.hs 30 May 2003 13:07:05 -0000 1.12
--- Controls.hs 9 Jul 2003 17:03:51 -0000 1.13
***************
*** 32,35 ****
--- 32,36 ----
import Graphics.UI.GIO.Window
import Graphics.UI.GIO.Layout
+ import Control.Monad(when)
--------------------------------------------------------------------
***************
*** 175,179 ****
= do p <- do hpop <- Port.createPopUp (hwindow w)
pitems <- newVar []
! return (Popup hpop (hwindow w) pitems)
set p [on command =: popupCommand p]
set p props
--- 176,180 ----
= do p <- do hpop <- Port.createPopUp (hwindow w)
pitems <- newVar []
! return (Popup hpop (hwindow w) pitems)
set p [on command =: popupCommand p]
set p props
***************
*** 185,191 ****
= do i <- get p selected
xs <- getVar (pitems p)
! if (i<0 || i >= length xs)
! then print i
! else snd (xs!!i) -- invoke appropiate handler
--- 186,190 ----
= do i <- get p selected
xs <- getVar (pitems p)
! when (i>0 && i < length xs) (snd (xs!!i)) -- invoke appropiate handler
***************
*** 199,203 ****
instance SingleSelect Popup where
! selected
= newAttr (\w -> Port.getPopUpSelection (phandle w))
(\w i -> do Port.setPopUpSelection (phandle w) i
--- 198,202 ----
instance SingleSelect Popup where
! selected
= newAttr (\w -> Port.getPopUpSelection (phandle w))
(\w i -> do Port.setPopUpSelection (phandle w) i
***************
*** 205,209 ****
instance Dimensions Popup where
! frame = newAttr (\p -> Port.getControlFrame (phandle p))
(\p r -> Port.moveResizeControl (phandle p) r)
--- 204,208 ----
instance Dimensions Popup where
! frame = newAttr (\p -> Port.getControlFrame (phandle p))
(\p r -> Port.moveResizeControl (phandle p) r)
|
|
From: <kr_...@us...> - 2003-07-08 21:44:52
|
Update of /cvsroot/htoolkit/port/src/Port
In directory sc8-pr-cvs1:/tmp/cvs-serv26496/src/Port
Modified Files:
Handlers.hs Menu.hs ToolBar.hs
Log Message:
fix: The bitmaps associated with Tool and Menu items needs to be freed when the item is destroied
Index: Handlers.hs
===================================================================
RCS file: /cvsroot/htoolkit/port/src/Port/Handlers.hs,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** Handlers.hs 8 Jul 2003 20:31:29 -0000 1.24
--- Handlers.hs 8 Jul 2003 21:44:49 -0000 1.25
***************
*** 68,75 ****
--- 68,79 ----
,setMenuUpdateHandler, setMenuUpdateDefHandler, getMenuUpdateHandler
,setMenuDestroyHandler, setMenuDestroyDefHandler, getMenuDestroyHandler
+ -- ** Internals
+ ,menuBitmaps
-- * ToolBar events
,setToolCommandHandler, setToolCommandDefHandler, getToolCommandHandler
,setToolDestroyHandler, setToolDestroyDefHandler, getToolDestroyHandler
+ -- ** Internals
+ ,toolBitmaps
) where
***************
*** 543,546 ****
--- 547,554 ----
-----------------------------------------------------------------------------------------
+ {-# NOINLINE menuBitmaps #-}
+ menuBitmaps :: MVar (PtrMap MenuHandle Bitmap)
+ menuBitmaps = unsafePerformIO (newMVar empty)
+
{-# NOINLINE handlersMenuDestroy #-}
handlersMenuDestroy :: MVar (PtrMap MenuHandle (IO ()))
***************
*** 563,566 ****
--- 571,576 ----
handleMenuDestroy hmenu
= do map <- takeMVar handlersMenuDestroy
+ bmps <- takeMVar toolBitmaps
+ putMVar toolBitmaps (delete hmenu bmps)
setMenuCommandDefHandler hmenu
setMenuUpdateDefHandler hmenu
***************
*** 728,731 ****
--- 738,745 ----
-----------------------------------------------------------------------------------------
+ {-# NOINLINE toolBitmaps #-}
+ toolBitmaps :: MVar (PtrMap WindowHandle Bitmap)
+ toolBitmaps = unsafePerformIO (newMVar empty)
+
{-# NOINLINE handlersToolDestroy #-}
handlersToolDestroy :: MVar (PtrMap ToolHandle (IO ()))
***************
*** 748,751 ****
--- 762,767 ----
handleToolDestroy htool
= do map <- takeMVar handlersToolDestroy
+ bmps <- takeMVar toolBitmaps
+ putMVar toolBitmaps (delete htool bmps)
setToolCommandDefHandler htool
putMVar handlersToolDestroy (delete htool map)
Index: Menu.hs
===================================================================
RCS file: /cvsroot/htoolkit/port/src/Port/Menu.hs,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Menu.hs 23 Apr 2003 21:48:49 -0000 1.7
--- Menu.hs 8 Jul 2003 21:44:49 -0000 1.8
***************
*** 42,46 ****
import Control.Concurrent.MVar
import Graphics.UI.Port.Types
! import Graphics.UI.Port.Handlers -- just for haddock
import Graphics.UI.Port.PtrMap as PtrMap
import System.IO.Unsafe( unsafePerformIO )
--- 42,46 ----
import Control.Concurrent.MVar
import Graphics.UI.Port.Types
! import Graphics.UI.Port.Handlers
import Graphics.UI.Port.PtrMap as PtrMap
import System.IO.Unsafe( unsafePerformIO )
***************
*** 115,122 ****
-- | returns True if the menu item is checked.
foreign import ccall "osGetMenuItemChecked" getMenuItemChecked :: MenuHandle -> IO Bool
-
- {-# NOINLINE menuBitmaps #-}
- menuBitmaps :: MVar (PtrMap MenuHandle Bitmap)
- menuBitmaps = unsafePerformIO (newMVar empty)
setMenuItemBitmap :: MenuHandle -> Maybe Bitmap -> IO ()
--- 115,118 ----
Index: ToolBar.hs
===================================================================
RCS file: /cvsroot/htoolkit/port/src/Port/ToolBar.hs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ToolBar.hs 8 Jul 2003 20:31:29 -0000 1.1
--- ToolBar.hs 8 Jul 2003 21:44:49 -0000 1.2
***************
*** 32,35 ****
--- 32,36 ----
import Graphics.UI.Port.Types
+ import Graphics.UI.Port.Handlers
import Graphics.UI.Port.PtrMap as PtrMap
import Foreign.Ptr
***************
*** 65,72 ****
insertToolLine toolBar pos = osInsertToolLine toolBar (fromMaybe (-1) pos)
foreign import ccall osInsertToolLine :: WindowHandle -> Int -> IO ToolHandle
-
- {-# NOINLINE toolBitmaps #-}
- toolBitmaps :: MVar (PtrMap WindowHandle Bitmap)
- toolBitmaps = unsafePerformIO (newMVar empty)
setToolButtonBitmap :: ToolHandle -> Maybe Bitmap -> IO ()
--- 66,69 ----
|
|
From: <kr_...@us...> - 2003-07-08 21:36:42
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32
In directory sc8-pr-cvs1:/tmp/cvs-serv25326/src/cbits/Win32
Modified Files:
ToolBar.c
Log Message:
Add some functions with empty body
Index: ToolBar.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/ToolBar.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ToolBar.c 8 Jul 2003 21:18:06 -0000 1.2
--- ToolBar.c 8 Jul 2003 21:36:39 -0000 1.3
***************
*** 39,42 ****
--- 39,46 ----
}
+ void osDestroyToolBar(WindowHandle toolbar)
+ {
+ }
+
ToolHandle osInsertToolButton(WindowHandle toolBar, int pos)
{
***************
*** 200,203 ****
--- 204,216 ----
}
+ void osSetToolButtonText(ToolHandle toolButton, char *text)
+ {
+ }
+
+ char *osGetToolButtonText(ToolHandle toolButton)
+ {
+ return NULL;
+ }
+
void osSetToolButtonChecked(ToolHandle toolButton, BOOL bState)
{
***************
*** 209,214 ****
}
! int osGetToolItemPos(ToolHandle toolButton)
{
- return SendMessage(toolButton->hToolBar, TB_COMMANDTOINDEX, toolButton->nCommand, 0);
}
--- 222,231 ----
}
! int osGetToolItemPos(ToolHandle toolItem)
! {
! return SendMessage(toolItem->hToolBar, TB_COMMANDTOINDEX, toolItem->nCommand, 0);
! }
!
! void osDestroyToolItem(ToolHandle toolItem)
{
}
|
|
From: <kr_...@us...> - 2003-07-08 21:18:10
|
Update of /cvsroot/htoolkit/port/src/include In directory sc8-pr-cvs1:/tmp/cvs-serv22219/src/include Modified Files: ToolBar.h Types.h Log Message: Fix ToolBar for Win32 Index: ToolBar.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/include/ToolBar.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ToolBar.h 8 Jul 2003 20:31:29 -0000 1.1 --- ToolBar.h 8 Jul 2003 21:18:06 -0000 1.2 *************** *** 5,9 **** WindowHandle osCreateToolBar(char *name, int place, int band_num, int band_position, int offset); ! void osDestroyToolBar(GtkWidget *toolbar); ToolHandle osInsertToolButton(WindowHandle toolbar, int pos); --- 5,9 ---- WindowHandle osCreateToolBar(char *name, int place, int band_num, int band_position, int offset); ! void osDestroyToolBar(WindowHandle toolbar); ToolHandle osInsertToolButton(WindowHandle toolbar, int pos); Index: Types.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/include/Types.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Types.h 8 Jul 2003 20:31:29 -0000 1.13 --- Types.h 8 Jul 2003 21:18:07 -0000 1.14 *************** *** 12,19 **** --- 12,28 ---- #ifdef WIN32_TARGET + #define _WIN32_IE 0x0501 #include <windows.h> #include <mmsystem.h> #include <shlobj.h> + #ifndef TB_GETBUTTONINFO + #define TB_GETBUTTONINFO (WM_USER + 65) + #endif + + #ifndef I_IMAGENONE + #define I_IMAGENONE -2 + #endif + typedef HWND WindowHandle; *************** *** 35,39 **** typedef struct MenuHandle *MenuHandle; ! typedef struct _ToolHandle *ToolHandle; typedef struct --- 44,48 ---- typedef struct MenuHandle *MenuHandle; ! typedef struct ToolHandle *ToolHandle; typedef struct |