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-08 21:18:10
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32
In directory sc8-pr-cvs1:/tmp/cvs-serv22219/src/cbits/Win32
Modified Files:
Internals.h ToolBar.c
Log Message:
Fix ToolBar for Win32
Index: Internals.h
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Internals.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Internals.h 1 May 2003 20:38:26 -0000 1.2
--- Internals.h 8 Jul 2003 21:18:06 -0000 1.3
***************
*** 30,33 ****
--- 30,35 ----
LPSTR lpszAppVersion;
MenuHandlesMap *pMenuHandlesMap;
+
+ HWND hLeftBar, hTopBar, hRightBar, hBottomBar;
} FrameData;
Index: ToolBar.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/ToolBar.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ToolBar.c 8 Jul 2003 20:31:29 -0000 1.1
--- ToolBar.c 8 Jul 2003 21:18:06 -0000 1.2
***************
*** 3,7 ****
#include "Internals.h"
! typedef struct _ToolHandle
{
int nCommand;
--- 3,7 ----
#include "Internals.h"
! struct ToolHandle
{
int nCommand;
***************
*** 11,20 ****
static int nNextToolButtonID = 0;
! WindowHandle osCreateToolBar(int nPlace)
{
HWND hControlBar, hWnd;
FrameData *pFrameData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA);
! switch (nPlace)
{
case 0: hControlBar = pFrameData->hLeftBar; break;
--- 11,20 ----
static int nNextToolButtonID = 0;
! WindowHandle osCreateToolBar(char *name, int place, int band_num, int band_position, int offset)
{
HWND hControlBar, hWnd;
FrameData *pFrameData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA);
! switch (place)
{
case 0: hControlBar = pFrameData->hLeftBar; break;
***************
*** 44,48 ****
ToolHandle btn;
! btn = malloc(sizeof(struct _ToolHandle));
if (!btn) return NULL;
--- 44,48 ----
ToolHandle btn;
! btn = malloc(sizeof(struct ToolHandle));
if (!btn) return NULL;
***************
*** 78,82 ****
ToolHandle btn;
! btn = malloc(sizeof(struct _ToolHandle));
if (!btn) return NULL;
--- 78,82 ----
ToolHandle btn;
! btn = malloc(sizeof(struct ToolHandle));
if (!btn) return NULL;
|
|
From: <kr_...@us...> - 2003-07-08 20:36:29
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO
In directory sc8-pr-cvs1:/tmp/cvs-serv15400/src/Graphics/UI/GIO
Modified Files:
Attributes.hs Menu.hs Types.hs
Added Files:
ToolBar.hs
Log Message:
Implementation for ToolBar
--- NEW FILE: ToolBar.hs ---
-----------------------------------------------------------------------------------------
{-| Module : ToolBar
Copyright : (c) Krasimir Angelov 2003
License : BSD-style
Maintainer : ka2...@ya...
Stability : provisional
Portability : portable
ToolBar.
-}
-----------------------------------------------------------------------------------------
module Graphics.UI.GIO.ToolBar
(
-- * Creation
ToolBar, toolBar
, ToolButton, toolButtonAt, toolButton
, ToolCheckButton, toolCheckButtonAt, toolCheckButton
, ToolLine, toolLineAt, toolLine
, DockPlace(..)
) where
import Graphics.UI.GIO.Attributes
import Graphics.UI.GIO.Events
import Graphics.UI.GIO.Types
import qualified Graphics.UI.Port as Lib
import Graphics.UI.Port(DockPlace(..))
--------------------------------------------------------------------
-- ToolBar
--------------------------------------------------------------------
data ToolBar = ToolBar {htoolbar :: WindowHandle}
toolBar :: String -> DockPlace -> Int -> Int -> Int -> [Prop ToolBar] -> IO ToolBar
toolBar name place band_num band_position offset props = do
bar <- do hwnd <- Lib.createToolBar name place band_num band_position offset
return (ToolBar hwnd)
set bar props
return bar
instance Deadly ToolBar where
destroyWidget t = Lib.destroyToolBar (htoolbar t)
destroy = newEvent (Lib.getWindowDestroyHandler . htoolbar) (Lib.setWindowDestroyHandler . htoolbar) (Lib.setWindowDestroyDefHandler . htoolbar)
--------------------------------------------------------------------
-- ToolButton
--------------------------------------------------------------------
data ToolButton = ToolButton {hbutton :: ToolHandle}
toolButtonAt :: Maybe Int -> [Prop ToolButton] -> ToolBar -> IO ToolButton
toolButtonAt pos props (ToolBar hwnd) = do
btn <- do hbtn <- Lib.insertToolButton hwnd pos
return (ToolButton hbtn)
set btn props
return btn
toolButton :: [Prop ToolButton] -> ToolBar -> IO ToolButton
toolButton = toolButtonAt Nothing
instance Able ToolButton where
enabled = newAttr (Lib.getToolButtonEnabled . hbutton) (Lib.setToolButtonEnabled . hbutton)
instance Commanding ToolButton where
command =
newEvent (Lib.getToolCommandHandler . hbutton) (Lib.setToolCommandHandler . hbutton) (Lib.setToolCommandDefHandler . hbutton)
instance HasIcon ToolButton where
icon = newAttr (Lib.getToolButtonBitmap . hbutton) (Lib.setToolButtonBitmap . hbutton)
instance Positioned ToolButton where
pos = readAttr "pos" (Lib.getToolItemPos . hbutton)
instance ToolTip ToolButton where
tooltip = newAttr (Lib.getToolButtonTip . hbutton) (Lib.setToolButtonTip . hbutton)
instance Titled ToolButton where
title = newAttr (Lib.getToolButtonText . hbutton) (Lib.setToolButtonText . hbutton)
instance Deadly ToolButton where
destroyWidget t = Lib.destroyToolItem (hbutton t)
destroy = newEvent (Lib.getToolDestroyHandler . hbutton) (Lib.setToolDestroyHandler . hbutton) (Lib.setToolDestroyDefHandler . hbutton)
--------------------------------------------------------------------
-- ToolCheckButton
--------------------------------------------------------------------
data ToolCheckButton = ToolCheckButton {hcheck :: ToolHandle}
toolCheckButtonAt :: Maybe Int -> [Prop ToolCheckButton] -> ToolBar -> IO ToolCheckButton
toolCheckButtonAt pos props (ToolBar hwnd) = do
btn <- do hbtn <- Lib.insertToolCheckButton hwnd pos
return (ToolCheckButton hbtn)
set btn props
return btn
toolCheckButton :: [Prop ToolCheckButton] -> ToolBar -> IO ToolCheckButton
toolCheckButton = toolCheckButtonAt Nothing
instance Able ToolCheckButton where
enabled = newAttr (Lib.getToolButtonEnabled . hcheck) (Lib.setToolButtonEnabled . hcheck)
instance Commanding ToolCheckButton where
command =
newEvent (Lib.getToolCommandHandler . hcheck) (Lib.setToolCommandHandler . hcheck) (Lib.setToolCommandDefHandler . hcheck)
instance HasIcon ToolCheckButton where
icon = newAttr (Lib.getToolButtonBitmap . hcheck) (Lib.setToolButtonBitmap . hcheck)
instance Positioned ToolCheckButton where
pos = readAttr "pos" (Lib.getToolItemPos . hcheck)
instance ToolTip ToolCheckButton where
tooltip = newAttr (Lib.getToolButtonTip . hcheck) (Lib.setToolButtonTip . hcheck)
instance Titled ToolCheckButton where
title = newAttr (Lib.getToolButtonText . hcheck) (Lib.setToolButtonText . hcheck)
instance Checked ToolCheckButton where
checked = newAttr (Lib.getToolButtonChecked . hcheck) (Lib.setToolButtonChecked . hcheck)
instance Deadly ToolCheckButton where
destroyWidget t = Lib.destroyToolItem (hcheck t)
destroy = newEvent (Lib.getToolDestroyHandler . hcheck) (Lib.setToolDestroyHandler . hcheck) (Lib.setToolDestroyDefHandler . hcheck)
--------------------------------------------------------------------
-- ToolLine
--------------------------------------------------------------------
data ToolLine = ToolLine {hline :: ToolHandle}
toolLineAt :: Maybe Int -> [Prop ToolLine] -> ToolBar -> IO ToolLine
toolLineAt pos props (ToolBar hwnd) = do
line <- do hline <- Lib.insertToolLine hwnd pos
return (ToolLine hline)
set line props
return line
toolLine :: [Prop ToolLine] -> ToolBar -> IO ToolLine
toolLine = toolLineAt Nothing
instance Positioned ToolLine where
pos = readAttr "pos" (Lib.getToolItemPos . hline)
instance Deadly ToolLine where
destroyWidget t = Lib.destroyToolItem (hline t)
destroy = newEvent (Lib.getToolDestroyHandler . hline) (Lib.setToolDestroyHandler . hline) (Lib.setToolDestroyDefHandler . hline)
Index: Attributes.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Attributes.hs,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** Attributes.hs 8 Jun 2003 11:18:00 -0000 1.13
--- Attributes.hs 8 Jul 2003 20:36:26 -0000 1.14
***************
*** 78,81 ****
--- 78,84 ----
, MultiSelect, selection
, RangedSelect, range, selectedPos
+
+ -- ** Icon
+ , HasIcon, icon
-- * Internal
***************
*** 316,317 ****
--- 319,324 ----
-- | The selected position
selectedPos :: Attr w Int
+
+ -- | Widgets which displays an icon.
+ class HasIcon w where
+ icon :: Attr w (Maybe Bitmap)
Index: Menu.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Menu.hs,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Menu.hs 8 Jun 2003 11:27:42 -0000 1.7
--- Menu.hs 8 Jul 2003 20:36:26 -0000 1.8
***************
*** 17,21 ****
-- ** Menu item
, MenuItem, menuitem, menuitemAt
- , menuicon
-- ** Checked menu items
, MenuCheck, menucheck, menucheckAt
--- 17,20 ----
***************
*** 109,115 ****
accel = newAttr (Lib.getMenuItemAccel . hitem) (Lib.setMenuItemAccel . hitem)
! menuicon :: Attr MenuItem (Maybe Bitmap)
! menuicon = newAttr (Lib.getMenuItemBitmap . hitem)
! (Lib.setMenuItemBitmap . hitem)
instance Positioned MenuItem where
--- 108,113 ----
accel = newAttr (Lib.getMenuItemAccel . hitem) (Lib.setMenuItemAccel . hitem)
! instance HasIcon MenuItem where
! icon = newAttr (Lib.getMenuItemBitmap . hitem) (Lib.setMenuItemBitmap . hitem)
instance Positioned MenuItem where
Index: Types.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Types.hs,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** Types.hs 2 Jul 2003 17:50:47 -0000 1.13
--- Types.hs 8 Jul 2003 20:36:26 -0000 1.14
***************
*** 104,107 ****
--- 104,108 ----
, CanvasHandle
, MenuHandle
+ , ToolHandle
, FontHandle
, BitmapHandle
|
|
From: <kr_...@us...> - 2003-07-08 20:36:29
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI
In directory sc8-pr-cvs1:/tmp/cvs-serv15400/src/Graphics/UI
Modified Files:
GIO.hs
Log Message:
Implementation for ToolBar
Index: GIO.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO.hs,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** GIO.hs 30 Mar 2003 18:49:07 -0000 1.9
--- GIO.hs 8 Jul 2003 20:36:26 -0000 1.10
***************
*** 23,26 ****
--- 23,27 ----
, module Graphics.UI.GIO.Messages
, module Graphics.UI.GIO.Window
+ , module Graphics.UI.GIO.ToolBar
, module Graphics.UI.GIO.Timer
, module Graphics.UI.GIO.Menu
***************
*** 39,42 ****
--- 40,44 ----
import Graphics.UI.GIO.Messages
import Graphics.UI.GIO.Window
+ import Graphics.UI.GIO.ToolBar
import Graphics.UI.GIO.Timer
import Graphics.UI.GIO.Menu
|
|
From: <kr_...@us...> - 2003-07-08 20:36:29
|
Update of /cvsroot/htoolkit/gio In directory sc8-pr-cvs1:/tmp/cvs-serv15400 Modified Files: makefile Log Message: Implementation for ToolBar Index: makefile =================================================================== RCS file: /cvsroot/htoolkit/gio/makefile,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** makefile 8 Jun 2003 19:42:12 -0000 1.9 --- makefile 8 Jul 2003 20:36:26 -0000 1.10 *************** *** 37,40 **** --- 37,41 ---- GIO/CommonDialogs.hs GIO/Controls.hs \ GIO/Messages.hs GIO/Process.hs \ + GIO/ToolBar.hs \ GIO.hs \ |
|
From: <kr_...@us...> - 2003-07-08 20:31:32
|
Update of /cvsroot/htoolkit/port/src/include
In directory sc8-pr-cvs1:/tmp/cvs-serv14568/src/include
Modified Files:
Types.h
Added Files:
ToolBar.h
Log Message:
Added implementation for ToolBar. The Windows version is still in very basic
state.
--- NEW FILE: ToolBar.h ---
#ifndef TOOLBAR_H
#define TOOLBAR_H
#include "Types.h"
WindowHandle osCreateToolBar(char *name, int place, int band_num, int band_position, int offset);
void osDestroyToolBar(GtkWidget *toolbar);
ToolHandle osInsertToolButton(WindowHandle toolbar, int pos);
ToolHandle osInsertToolCheckButton(WindowHandle toolbar, int pos);
ToolHandle osInsertToolLine(WindowHandle toolbar, int pos);
void osSetToolButtonBitmap(ToolHandle toolButton, BitmapHandle bitmap);
void osSetToolButtonEnabled(ToolHandle toolButton, BOOL bEnabled);
BOOL osGetToolButtonEnabled(ToolHandle toolButton);
void osSetToolButtonTip(ToolHandle toolButton, char *text);
char *osGetToolButtonTip(ToolHandle toolButton);
void osSetToolButtonText(ToolHandle toolButton, char *text);
char *osGetToolButtonText(ToolHandle toolButton);
void osDestroyToolItem(ToolHandle toolItem);
int osGetToolItemPos(ToolHandle toolItem);
#endif
Index: Types.h
===================================================================
RCS file: /cvsroot/htoolkit/port/src/include/Types.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** Types.h 4 Jul 2003 17:39:05 -0000 1.12
--- Types.h 8 Jul 2003 20:31:29 -0000 1.13
***************
*** 35,38 ****
--- 35,40 ----
typedef struct MenuHandle *MenuHandle;
+ typedef struct _ToolHandle *ToolHandle;
+
typedef struct
{
***************
*** 96,99 ****
--- 98,103 ----
typedef GtkWidget *MenuHandle;
typedef GtkWidget *MenuItemHandle;
+
+ typedef GtkWidget *ToolHandle;
typedef struct
|
|
From: <kr_...@us...> - 2003-07-08 20:31:32
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK
In directory sc8-pr-cvs1:/tmp/cvs-serv14568/src/cbits/GTK
Modified Files:
Frame.c
Added Files:
ToolBar.c
Log Message:
Added implementation for ToolBar. The Windows version is still in very basic
state.
--- NEW FILE: ToolBar.c ---
#include "ToolBar.h"
#include "Internals.h"
#include "Handlers_stub.h"
WindowHandle osCreateToolBar(char *name, int place, int band_num, int band_position, int offset)
{
GtkWidget *toolbar;
BonoboDockPlacement placement;
toolbar = gtk_toolbar_new();
gtk_signal_connect (GTK_OBJECT(toolbar), "destroy",
GTK_SIGNAL_FUNC(handleWindowDestroy),
NULL);
switch (place)
{
case 0: placement = BONOBO_DOCK_LEFT; break;
case 1: placement = BONOBO_DOCK_TOP; break;
case 2: placement = BONOBO_DOCK_RIGHT; break;
case 3: placement = BONOBO_DOCK_BOTTOM; break;
default:
placement = BONOBO_DOCK_TOP;
break;
}
gnome_app_add_toolbar(GNOME_APP(gFrameWidget),
GTK_TOOLBAR(toolbar),
name,
BONOBO_DOCK_ITEM_BEH_NORMAL,
placement,
band_num,
band_position,
offset);
return toolbar;
}
void osDestroyToolBar(GtkWidget *toolbar)
{
gtk_widget_destroy(toolbar);
}
void tool_button_clicked(GtkWidget *widget, gpointer user_data)
{
handleToolCommand((ToolHandle) user_data);
}
ToolHandle osInsertToolButton(WindowHandle toolbar, int pos)
{
GtkToolItem *item = gtk_tool_button_new("", gtk_image_new());
gtk_signal_connect (GTK_OBJECT(GTK_TOOL_BUTTON(item)->button), "clicked",
GTK_SIGNAL_FUNC(tool_button_clicked),
item);
gtk_signal_connect (GTK_OBJECT(item), "destroy",
GTK_SIGNAL_FUNC(handleToolDestroy),
NULL);
gtk_tool_button_set_label_widget(GTK_TOOL_BUTTON(item), gtk_label_new(""));
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, pos);
gtk_widget_show_all(GTK_WIDGET(item));
return GTK_WIDGET(item);
}
ToolHandle osInsertToolCheckButton(WindowHandle toolbar, int pos)
{
GtkToolItem *item = gtk_toggle_tool_button_new();
gtk_signal_connect (GTK_OBJECT(GTK_TOOL_BUTTON(item)->button), "clicked",
GTK_SIGNAL_FUNC(tool_button_clicked),
item);
gtk_signal_connect (GTK_OBJECT(item), "destroy",
GTK_SIGNAL_FUNC(handleToolDestroy),
NULL);
gtk_tool_button_set_label_widget(GTK_TOOL_BUTTON(item), gtk_label_new(""));
gtk_tool_button_set_icon_widget(GTK_TOOL_BUTTON(item), gtk_image_new());
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, pos);
gtk_widget_show_all(GTK_WIDGET(item));
return GTK_WIDGET(item);
}
ToolHandle osInsertToolLine(WindowHandle toolbar, int pos)
{
GtkToolItem *item = gtk_separator_tool_item_new();
gtk_signal_connect (GTK_OBJECT(item), "destroy",
GTK_SIGNAL_FUNC(handleToolDestroy),
NULL);
gtk_toolbar_insert(GTK_TOOLBAR(toolbar), item, pos);
gtk_widget_show_all(GTK_WIDGET(item));
return GTK_WIDGET(item);
}
void osSetToolButtonBitmap(ToolHandle toolButton, BitmapHandle bitmap)
{
gtk_image_set_from_pixbuf(gtk_tool_button_get_icon_widget (GTK_TOOL_BUTTON(toolButton)), bitmap->pixbuf);
}
void osSetToolButtonEnabled(ToolHandle toolButton, BOOL enabled)
{
gtk_widget_set_sensitive(toolButton,enabled);
}
BOOL osGetToolButtonEnabled(ToolHandle toolButton)
{
return GTK_WIDGET_SENSITIVE(toolButton);
}
void osSetToolButtonTip(ToolHandle toolButton, char *text)
{
GtkWidget *toolbar = gtk_widget_get_parent(toolButton);
gtk_tool_item_set_tooltip(GTK_TOOL_ITEM(toolButton), GTK_TOOLBAR(toolbar)->tooltips, text, NULL);
}
char *osGetToolButtonTip(ToolHandle toolButton)
{
GtkTooltipsData *tips_data = gtk_tooltips_data_get(GTK_BIN (toolButton)->child);
return strdup(tips_data->tip_text);
}
void osSetToolButtonText(ToolHandle toolButton, char *text)
{
GtkWidget *label = gtk_tool_button_get_label_widget (GTK_TOOL_BUTTON(toolButton));
gtk_label_set_text(GTK_LABEL(label), text);
}
char *osGetToolButtonText(ToolHandle toolButton)
{
GtkWidget *label = gtk_tool_button_get_label_widget (GTK_TOOL_BUTTON(toolButton));
char *text = gtk_label_get_text(GTK_LABEL(label));
return strdup(text);
}
void osSetToolButtonChecked(ToolHandle toolButton, BOOL bState)
{
gtk_toggle_tool_button_set_active (GTK_TOGGLE_TOOL_BUTTON(toolButton), bState);
};
BOOL osGetToolButtonChecked(ToolHandle toolButton)
{
return gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(toolButton));
};
void osDestroyToolItem(ToolHandle toolItem)
{
gtk_widget_destroy(toolItem);
}
int osGetToolItemPos(ToolHandle toolItem)
{
GtkWidget *toolbar = gtk_widget_get_parent(toolItem);
return gtk_toolbar_get_item_index(GTK_TOOLBAR(toolbar), GTK_TOOL_ITEM(toolItem));
}
Index: Frame.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Frame.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** Frame.c 5 Jul 2003 11:01:16 -0000 1.10
--- Frame.c 8 Jul 2003 20:31:29 -0000 1.11
***************
*** 238,241 ****
--- 238,243 ----
gtk_widget_show_all(gFrameWidget);
+ gnome_app_enable_layout_config (GNOME_APP(gFrameWidget), TRUE);
+
/* Create "Pages" menu */
pages_menu = gtk_menu_new();
***************
*** 329,331 ****
--- 331,335 ----
gtk_widget_show_all(gFrameWidget);
+
+ gnome_app_enable_layout_config (GNOME_APP(gFrameWidget), TRUE);
}
|
|
From: <kr_...@us...> - 2003-07-08 20:31:32
|
Update of /cvsroot/htoolkit/port/src/Port
In directory sc8-pr-cvs1:/tmp/cvs-serv14568/src/Port
Modified Files:
Handlers.hs Types.hs
Added Files:
ToolBar.hs
Log Message:
Added implementation for ToolBar. The Windows version is still in very basic
state.
--- NEW FILE: ToolBar.hs ---
{-# OPTIONS -fffi -#include ToolBar.h #-}
-----------------------------------------------------------------------------------------
{-| Module : ToolBar
Copyright : (c) Krasimir Angelov 2003
License : BSD-style
Maintainer : ka2...@ya...
Stability : provisional
Portability : portable
ToolBar.
-}
-----------------------------------------------------------------------------------------
module Graphics.UI.Port.ToolBar
(
-- * Creation
createToolBar
, destroyToolBar
, DockPlace(..)
, insertToolButton
, insertToolCheckButton
, insertToolLine
, setToolButtonBitmap, getToolButtonBitmap
, setToolButtonEnabled, getToolButtonEnabled
, setToolButtonTip, getToolButtonTip
, setToolButtonText, getToolButtonText
, setToolButtonChecked,getToolButtonChecked
, getToolItemPos
, destroyToolItem
) where
import Graphics.UI.Port.Types
import Graphics.UI.Port.PtrMap as PtrMap
import Foreign.Ptr
import Foreign.C
import Control.Concurrent.MVar
import Data.Maybe
import System.IO.Unsafe( unsafePerformIO )
data DockPlace = DockLeft | DockTop | DockRight | DockBottom
toCDockPlace :: DockPlace -> Int
toCDockPlace DockLeft = 0
toCDockPlace DockTop = 1
toCDockPlace DockRight = 2
toCDockPlace DockBottom = 3
createToolBar :: String -> DockPlace -> Int -> Int -> Int -> IO WindowHandle
createToolBar name place band_num band_position offset =
withCString name (\cname -> osCreateToolBar cname (toCDockPlace place) band_num band_position offset)
foreign import ccall osCreateToolBar :: CString -> Int -> Int -> Int -> Int -> IO WindowHandle
foreign import ccall "osDestroyToolBar" destroyToolBar :: WindowHandle -> IO ()
insertToolButton :: WindowHandle -> Maybe Int -> IO ToolHandle
insertToolButton toolBar pos = osInsertToolButton toolBar (fromMaybe (-1) pos)
foreign import ccall osInsertToolButton :: WindowHandle -> Int -> IO ToolHandle
insertToolCheckButton :: WindowHandle -> Maybe Int -> IO ToolHandle
insertToolCheckButton toolBar pos = osInsertToolCheckButton toolBar (fromMaybe (-1) pos)
foreign import ccall osInsertToolCheckButton :: WindowHandle -> Int -> IO ToolHandle
insertToolLine :: WindowHandle -> Maybe Int -> IO ToolHandle
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 ()
setToolButtonBitmap htool (Just bmp) = do
map <- takeMVar toolBitmaps
withCBitmap bmp (osSetToolButtonBitmap htool)
putMVar toolBitmaps (insert htool bmp map)
setToolButtonBitmap htool Nothing = do
map <- takeMVar toolBitmaps
osSetToolButtonBitmap htool nullPtr
putMVar toolBitmaps (delete htool map)
foreign import ccall osSetToolButtonBitmap :: ToolHandle -> BitmapHandle -> IO ()
getToolButtonBitmap :: ToolHandle -> IO (Maybe Bitmap)
getToolButtonBitmap htool = do
map <- readMVar toolBitmaps
return (PtrMap.lookup htool map)
foreign import ccall "osSetToolButtonEnabled" setToolButtonEnabled :: ToolHandle -> Bool -> IO ()
foreign import ccall "osGetToolButtonEnabled" getToolButtonEnabled :: ToolHandle -> IO Bool
setToolButtonTip :: ToolHandle -> String -> IO ()
setToolButtonTip htool tip = withCString tip (osSetToolButtonTip htool)
foreign import ccall osSetToolButtonTip :: ToolHandle -> CString -> IO ()
getToolButtonTip :: ToolHandle -> IO String
getToolButtonTip htool = resultCString (osGetToolButtonTip htool)
foreign import ccall osGetToolButtonTip :: ToolHandle -> IO CString
setToolButtonText :: ToolHandle -> String -> IO ()
setToolButtonText htool tip = withCString tip (osSetToolButtonText htool)
foreign import ccall osSetToolButtonText :: ToolHandle -> CString -> IO ()
getToolButtonText :: ToolHandle -> IO String
getToolButtonText htool = resultCString (osGetToolButtonText htool)
foreign import ccall osGetToolButtonText :: ToolHandle -> IO CString
foreign import ccall "osSetToolButtonChecked" setToolButtonChecked :: ToolHandle -> Bool -> IO ()
foreign import ccall "osGetToolButtonChecked" getToolButtonChecked :: ToolHandle -> IO Bool
foreign import ccall "osGetToolItemPos" getToolItemPos :: ToolHandle -> IO Int
foreign import ccall "osDestroyToolItem" destroyToolItem :: ToolHandle -> IO ()
Index: Handlers.hs
===================================================================
RCS file: /cvsroot/htoolkit/port/src/Port/Handlers.hs,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** Handlers.hs 8 Jun 2003 19:42:14 -0000 1.23
--- Handlers.hs 8 Jul 2003 20:31:29 -0000 1.24
***************
*** 64,71 ****
,setControlCommandHandler, setControlCommandDefHandler, getControlCommandHandler
! -- ** Register commands
,setMenuCommandHandler, setMenuCommandDefHandler, getMenuCommandHandler
,setMenuUpdateHandler, setMenuUpdateDefHandler, getMenuUpdateHandler
,setMenuDestroyHandler, setMenuDestroyDefHandler, getMenuDestroyHandler
) where
--- 64,75 ----
,setControlCommandHandler, setControlCommandDefHandler, getControlCommandHandler
! -- * Menu events
,setMenuCommandHandler, setMenuCommandDefHandler, getMenuCommandHandler
,setMenuUpdateHandler, setMenuUpdateDefHandler, getMenuUpdateHandler
,setMenuDestroyHandler, setMenuDestroyDefHandler, getMenuDestroyHandler
+
+ -- * ToolBar events
+ ,setToolCommandHandler, setToolCommandDefHandler, getToolCommandHandler
+ ,setToolDestroyHandler, setToolDestroyDefHandler, getToolDestroyHandler
) where
***************
*** 551,555 ****
setMenuDestroyDefHandler hmenu
= setDefHandler hmenu handlersMenuDestroy
!
getMenuDestroyHandler :: MenuHandle -> IO (IO ())
getMenuDestroyHandler hmenu
--- 555,559 ----
setMenuDestroyDefHandler hmenu
= setDefHandler hmenu handlersMenuDestroy
!
getMenuDestroyHandler :: MenuHandle -> IO (IO ())
getMenuDestroyHandler hmenu
***************
*** 695,698 ****
--- 699,757 ----
= getHandler htimer (return ()) handlersTimerDestroy
+ -----------------------------------------------------------------------------------------
+ -- ToolCommand
+ -----------------------------------------------------------------------------------------
+
+ {-# NOINLINE handlersToolCommand #-}
+ handlersToolCommand :: MVar (PtrMap ToolHandle (IO ()))
+ handlersToolCommand
+ = unsafePerformIO (newMVar empty)
+
+ handleToolCommand :: ToolHandle -> IO ()
+ handleToolCommand htool
+ = invokeHandler htool handlersToolCommand id
+
+ setToolCommandHandler :: ToolHandle -> IO () -> IO ()
+ setToolCommandHandler htool handler
+ = setHandler htool handler handlersToolCommand
+
+ setToolCommandDefHandler :: ToolHandle -> IO ()
+ setToolCommandDefHandler htool
+ = setDefHandler htool handlersToolCommand
+
+ getToolCommandHandler :: ToolHandle -> IO (IO ())
+ getToolCommandHandler htool
+ = getHandler htool (return ()) handlersToolCommand
+
+ -----------------------------------------------------------------------------------------
+ -- ToolDestroy
+ -----------------------------------------------------------------------------------------
+
+ {-# NOINLINE handlersToolDestroy #-}
+ handlersToolDestroy :: MVar (PtrMap ToolHandle (IO ()))
+ handlersToolDestroy
+ = unsafePerformIO (newMVar empty)
+
+ setToolDestroyHandler :: ToolHandle -> IO () -> IO ()
+ setToolDestroyHandler htool handler
+ = setHandler htool handler handlersToolDestroy
+
+ setToolDestroyDefHandler :: ToolHandle -> IO ()
+ setToolDestroyDefHandler htool
+ = setDefHandler htool handlersToolDestroy
+
+ getToolDestroyHandler :: ToolHandle -> IO (IO ())
+ getToolDestroyHandler htool
+ = getHandler htool (return ()) handlersToolDestroy
+
+ handleToolDestroy :: ToolHandle -> IO ()
+ handleToolDestroy htool
+ = do map <- takeMVar handlersToolDestroy
+ setToolCommandDefHandler htool
+ putMVar handlersToolDestroy (delete htool map)
+ case lookup htool map of
+ Nothing -> return ()
+ Just io -> safeio io
+
{-----------------------------------------------------------------------------------------
foreign exports
***************
*** 700,704 ****
foreign export ccall handleWindowDismiss :: WindowHandle -> IO ()
foreign export ccall handleWindowReLayout :: WindowHandle -> IO ()
! foreign export ccall handleWindowDestroy :: WindowHandle -> IO ()
foreign export ccall handleWindowPaint :: WindowHandle -> CanvasHandle -> CInt -> CInt -> CInt -> CInt -> IO ()
foreign export ccall handleWindowResize :: WindowHandle -> CInt -> CInt -> IO ()
--- 759,763 ----
foreign export ccall handleWindowDismiss :: WindowHandle -> IO ()
foreign export ccall handleWindowReLayout :: WindowHandle -> IO ()
! foreign export ccall handleWindowDestroy :: WindowHandle -> IO ()
foreign export ccall handleWindowPaint :: WindowHandle -> CanvasHandle -> CInt -> CInt -> CInt -> CInt -> IO ()
foreign export ccall handleWindowResize :: WindowHandle -> CInt -> CInt -> IO ()
***************
*** 711,715 ****
foreign export ccall handleDialogActivate :: WindowHandle -> IO ()
foreign export ccall handleWindowContextMenu :: WindowHandle -> CInt -> CInt -> CWord -> IO ()
! foreign export ccall handleControlCommand :: WindowHandle -> IO ()
foreign export ccall handleMenuCommand :: MenuHandle -> IO ()
foreign export ccall handleMenuUpdate :: MenuHandle -> IO ()
--- 770,774 ----
foreign export ccall handleDialogActivate :: WindowHandle -> IO ()
foreign export ccall handleWindowContextMenu :: WindowHandle -> CInt -> CInt -> CWord -> IO ()
! foreign export ccall handleControlCommand :: WindowHandle -> IO ()
foreign export ccall handleMenuCommand :: MenuHandle -> IO ()
foreign export ccall handleMenuUpdate :: MenuHandle -> IO ()
***************
*** 719,720 ****
--- 778,781 ----
foreign export ccall handleProcessDismiss :: IO ()
foreign export ccall handleProcessDestroy :: IO ()
+ foreign export ccall handleToolCommand :: ToolHandle -> IO ()
+ foreign export ccall handleToolDestroy :: ToolHandle -> IO ()
\ No newline at end of file
Index: Types.hs
===================================================================
RCS file: /cvsroot/htoolkit/port/src/Port/Types.hs,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** Types.hs 2 Jul 2003 17:48:03 -0000 1.21
--- Types.hs 8 Jul 2003 20:31:29 -0000 1.22
***************
*** 1,5 ****
{-# OPTIONS -fglasgow-exts -#include Font.h -#include Bitmap.h #-}
-- the previous line is just needed for "osDeleteFont" and "osDeleteBitmap" :-(
! -- #hide
-----------------------------------------------------------------------------------------
{-| Module : Types
--- 1,5 ----
{-# OPTIONS -fglasgow-exts -#include Font.h -#include Bitmap.h #-}
-- the previous line is just needed for "osDeleteFont" and "osDeleteBitmap" :-(
! -- #hide
-----------------------------------------------------------------------------------------
{-| Module : Types
***************
*** 15,35 ****
-----------------------------------------------------------------------------------------
module Graphics.UI.Port.Types
! (
-- * Geometry
!
-- ** Points
Point(..), pt, pointMove, pointAdd, pointSub, pointScale
!
-- ** Sizes
, Size(..), sz, sizeEncloses, maxSize, addh, addv, sizeDistance
!
-- ** Rectangles
, Rect(..), topLeft, topRight, bottomLeft, bottomRight
, rect, rectAt, rectSize, rectOfSize, rectIsEmpty
! , pointInRect, rectMove, rectMoveTo, pointToRect, centralPoint, centralRect, rectStretchTo
, disjointRects, rectsDiff, rectUnion, rectSect
!
-- * Render
!
-- ** Colors
, module Graphics.UI.Port.Colors
--- 15,35 ----
-----------------------------------------------------------------------------------------
module Graphics.UI.Port.Types
! (
-- * Geometry
!
-- ** Points
Point(..), pt, pointMove, pointAdd, pointSub, pointScale
!
-- ** Sizes
, Size(..), sz, sizeEncloses, maxSize, addh, addv, sizeDistance
!
-- ** Rectangles
, Rect(..), topLeft, topRight, bottomLeft, bottomRight
, rect, rectAt, rectSize, rectOfSize, rectIsEmpty
! , pointInRect, rectMove, rectMoveTo, pointToRect, centralPoint, centralRect, rectStretchTo
, disjointRects, rectsDiff, rectUnion, rectSect
!
-- * Render
!
-- ** Colors
, module Graphics.UI.Port.Colors
***************
*** 39,43 ****
, Codec(..)
! -- ** Canvas
, DrawMode(..)
, BufferMode(..)
--- 39,43 ----
, Codec(..)
! -- ** Canvas
, DrawMode(..)
, BufferMode(..)
***************
*** 48,52 ****
-- ** Fonts
! , Font
, fontDef
, FontDef(..), FontName, FontSize, FontWeight, FontStyle(..)
--- 48,52 ----
-- ** Fonts
! , Font
, fontDef
, FontDef(..), FontName, FontSize, FontWeight, FontStyle(..)
***************
*** 60,64 ****
, Modifiers(..)
, noneDown, justShift, justAlt, justControl, noModifiers
!
-- ** Mouse events
, MouseEvent(..)
--- 60,64 ----
, Modifiers(..)
, noneDown, justShift, justAlt, justControl, noModifiers
!
-- ** Mouse events
, MouseEvent(..)
***************
*** 68,72 ****
, KeyboardEvent(..), Key(..), keyModifiers
, keyboardKey, keyboardRepeat
!
-- * Document interface
, DocumentInterface(..)
--- 68,72 ----
, KeyboardEvent(..), Key(..), keyModifiers
, keyboardKey, keyboardRepeat
!
-- * Document interface
, DocumentInterface(..)
***************
*** 79,84 ****
, BitmapHandle
, TimerHandle
, nullHandle
!
-- * Marshalling to C
, toCDrawMode, toCBufferMode
--- 79,85 ----
, BitmapHandle
, TimerHandle
+ , ToolHandle
, nullHandle
!
-- * Marshalling to C
, toCDrawMode, toCBufferMode
***************
*** 143,146 ****
--- 144,151 ----
type TimerHandle = Ptr TH
data TH = TH
+
+ -- | Abstract handle to a tool
+ type ToolHandle = Ptr TLH
+ data TLH = TLH
-- | A null handle. Use with care.
|
|
From: <kr_...@us...> - 2003-07-08 20:31:32
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32
In directory sc8-pr-cvs1:/tmp/cvs-serv14568/src/cbits/Win32
Added Files:
ControlBar.c ControlBar.h ToolBar.c
Log Message:
Added implementation for ToolBar. The Windows version is still in very basic
state.
--- NEW FILE: ControlBar.c ---
#include "Types.h"
#include "Internals.h"
#include "ControlBar.h"
#include "Handlers_stub.h"
int GetControlBarSize(HWND hControlBar)
{
HWND hCtrl;
LONG lStyle;
int nSize;
RECT rect;
lStyle = GetWindowLong(hControlBar, GWL_STYLE);
nSize = 0;
hCtrl = GetTopWindow(hControlBar);
while (hCtrl)
{
GetClientRect(hCtrl,&rect);
nSize = max(nSize, (lStyle & CCS_VERT) ? rect.right : rect.bottom);
hCtrl = GetNextWindow(hCtrl,GW_HWNDNEXT);
}
return nSize;
}
void RelayoutFrameBars()
{
RECT rect;
FrameData *pData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA);
int nWidth, nHeight, nLeft, nTop, nRight, nBottom;
GetClientRect(ghWndFrame, &rect);
nWidth = rect.right-rect.left;
nHeight = rect.bottom-rect.top;
nLeft = GetControlBarSize(pData->hLeftBar);
nTop = GetControlBarSize(pData->hTopBar);
nRight = GetControlBarSize(pData->hRightBar);
nBottom = GetControlBarSize(pData->hBottomBar);
SetWindowPos(pData->hLeftBar, NULL,0,nTop,nLeft,nHeight-(nBottom+nTop),SWP_NOZORDER);
SetWindowPos(pData->hTopBar, NULL,0,0,nWidth,nTop,SWP_NOZORDER);
SetWindowPos(pData->hRightBar, NULL,nWidth-nRight,nTop,nRight,nHeight-(nBottom+nTop),SWP_NOZORDER);
SetWindowPos(pData->hBottomBar,NULL,0,nHeight-nBottom,nWidth,nBottom,SWP_NOZORDER);
SetWindowPos(pData->hClientWnd,NULL,nLeft,nTop,nWidth-(nRight+nLeft),nHeight-(nBottom+nTop),SWP_NOZORDER);
}
LRESULT CALLBACK HControlBarFunction(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
HWND hToolBar;
TBBUTTONINFO tbbi;
tbbi.cbSize = sizeof(tbbi);
tbbi.dwMask = TBIF_LPARAM;
tbbi.lParam = NULL;
switch (uMsg)
{
case WM_COMMAND:
{
hToolBar = (HWND) lParam;
SendMessage(hToolBar, TB_GETBUTTONINFO, LOWORD(wParam), (LPARAM) &tbbi);
handleToolCommand((WindowHandle) tbbi.lParam);
}
break;
case WM_NOTIFY:
{
LPNMTTDISPINFO lpnmtdi = (LPNMTTDISPINFO) lParam;
if (lpnmtdi->hdr.code == TTN_NEEDTEXT)
{
hToolBar = lpnmtdi->lParam;
printf("2> hToolBar=%p\n", hToolBar);
printf("2> lpnmtdi->hdr.idFrom=%p\n", lpnmtdi->hdr.idFrom);
SendMessage(hToolBar, TB_GETBUTTONINFO, lpnmtdi->hdr.idFrom, (LPARAM) &tbbi);
printf("2> tbbi.lParam=%p\n", tbbi.lParam);
printf("2> lpnmtdi->lParam=%p\n", lpnmtdi->lParam);
//lpnmtdi->lpszText = ((ToolButton) tbbi.lParam)->lpszToolTip;
}
}
break;
}
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
--- NEW FILE: ControlBar.h ---
#ifndef CONTROLBAR_H
#define CONTROLBAR_H
int GetControlBarSize(HWND hControlBar);
void RelayoutFrameBars();
#endif
--- NEW FILE: ToolBar.c ---
#include "ToolBar.h"
#include "ControlBar.h"
#include "Internals.h"
typedef struct _ToolHandle
{
int nCommand;
HWND hToolBar;
BitmapHandle bitmap;
};
static int nNextToolButtonID = 0;
WindowHandle osCreateToolBar(int nPlace)
{
HWND hControlBar, hWnd;
FrameData *pFrameData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA);
switch (nPlace)
{
case 0: hControlBar = pFrameData->hLeftBar; break;
case 1: hControlBar = pFrameData->hTopBar; break;
case 2: hControlBar = pFrameData->hRightBar; break;
case 3: hControlBar = pFrameData->hBottomBar; break;
}
hWnd = CreateWindow (TOOLBARCLASSNAME,
NULL,
WS_CHILD | WS_VISIBLE | WS_BORDER | WS_CLIPSIBLINGS | CCS_TOP | TBSTYLE_TOOLTIPS | TBSTYLE_AUTOSIZE | TBSTYLE_FLAT,
0,0,0,0,
hControlBar,
(HMENU) NULL,
(HANDLE) ghModule,
0
);
SendMessage (hWnd, TB_AUTOSIZE, (WPARAM)0, (LPARAM)0);
SendMessage (hWnd, TB_BUTTONSTRUCTSIZE, (WPARAM) sizeof(TBBUTTON), (LPARAM) 0);
return hWnd;
}
ToolHandle osInsertToolButton(WindowHandle toolBar, int pos)
{
TBBUTTON tbb;
ToolHandle btn;
btn = malloc(sizeof(struct _ToolHandle));
if (!btn) return NULL;
btn->nCommand = ++nNextToolButtonID;
btn->hToolBar = toolBar;
btn->bitmap = NULL;
tbb.iBitmap = I_IMAGENONE;
tbb.idCommand = btn->nCommand;
tbb.fsState = (BYTE)TBSTATE_ENABLED;
tbb.fsStyle = (BYTE)TBSTYLE_BUTTON;
tbb.dwData = (DWORD)btn;
tbb.iString = 0;
if (pos > 0)
SendMessage(toolBar,TB_INSERTBUTTON,pos,(LPARAM)&tbb);
else
SendMessage(toolBar, TB_ADDBUTTONS, 1, (LPARAM)&tbb);
RelayoutFrameBars();
return btn;
}
ToolHandle osInsertToolCheckButton(WindowHandle toolBar, int pos)
{
return NULL;
}
ToolHandle osInsertToolLine(WindowHandle toolBar, int pos)
{
TBBUTTON tbb;
ToolHandle btn;
btn = malloc(sizeof(struct _ToolHandle));
if (!btn) return NULL;
btn->nCommand = ++nNextToolButtonID;
btn->hToolBar = toolBar;
btn->bitmap = NULL;
tbb.iBitmap = 1;
tbb.idCommand = btn->nCommand;
tbb.fsState = (BYTE)TBSTATE_ENABLED;
tbb.fsStyle = (BYTE)TBSTYLE_SEP;
tbb.dwData = (DWORD)btn;
tbb.iString = 0;
if (pos > 0)
SendMessage(toolBar,TB_INSERTBUTTON,pos,(LPARAM)&tbb);
else
SendMessage(toolBar, TB_ADDBUTTONS, 1, (LPARAM)&tbb);
RelayoutFrameBars();
return btn;
}
void osSetToolButtonBitmap(ToolHandle toolButton, BitmapHandle bitmap)
{
TBBUTTONINFO tbbi;
tbbi.cbSize = sizeof(tbbi);
tbbi.dwMask = TBIF_IMAGE;
tbbi.iImage = I_IMAGENONE;
SendMessage(toolButton->hToolBar, TB_GETBUTTONINFO, toolButton->nCommand, (LPARAM) &tbbi);
if (tbbi.iImage == I_IMAGENONE)
{
TBADDBITMAP tbab;
tbab.hInst = NULL;
tbab.nID = (UINT) bitmap->hBitmap;
tbbi.iImage = SendMessage(toolButton->hToolBar, TB_ADDBITMAP, 1, (LPARAM) &tbab);
SendMessage(toolButton->hToolBar, TB_SETBUTTONINFO, toolButton->nCommand, (LPARAM) &tbbi);
}
else
{
TBREPLACEBITMAP tbrb;
tbrb.hInstOld = NULL;
tbrb.nIDOld = (UINT) toolButton->bitmap->hBitmap;
tbrb.hInstNew = NULL;
tbrb.nIDNew = (UINT) bitmap->hBitmap;
tbrb.nButtons = 1;
SendMessage(toolButton->hToolBar, TB_REPLACEBITMAP, 0, (LPARAM) &tbrb);
}
toolButton->bitmap = bitmap;
InvalidateRect(toolButton->hToolBar,NULL,TRUE);
}
void osSetToolButtonEnabled(ToolHandle toolButton, BOOL bEnabled)
{
SendMessage(toolButton->hToolBar, TB_ENABLEBUTTON, toolButton->nCommand, (LPARAM) bEnabled);
}
BOOL osGetToolButtonEnabled(ToolHandle toolButton)
{
TBBUTTONINFO tbbi;
tbbi.cbSize = sizeof(tbbi);
tbbi.dwMask = TBIF_STATE;
tbbi.fsState= 0;
SendMessage(toolButton->hToolBar, TB_GETBUTTONINFO, toolButton->nCommand, (LPARAM) &tbbi);
return (tbbi.fsState & TBSTATE_ENABLED);
}
void osSetToolButtonTip(ToolHandle toolButton, char *text)
{
TOOLINFO ti; /* The tool information that is sent to the tooltip control. */
if (strlen(text) > 256) // Truncate the tip text to 255 chars because the osGetToolButtonTip function
text[256] = 0; //uses 256 bytes long buffer
/* Fill the tooltip info with the appropriate information. */
ti.cbSize = sizeof(TOOLINFO);
ti.uFlags = TTF_SUBCLASS;
ti.hwnd = toolButton->hToolBar;
ti.uId = toolButton->nCommand;
ti.rect.left = 0;
ti.rect.top = 0;
ti.rect.right = 0;
ti.rect.bottom= 0;
ti.hinst = ghModule;
ti.lpszText = text;
SendMessage ((HWND) SendMessage(toolButton->hToolBar, TB_GETTOOLTIPS, 0, 0), TTM_SETTOOLINFO, 0, (LPARAM) (LPTOOLINFO)&ti);
}
char *osGetToolButtonTip(ToolHandle toolButton)
{
TOOLINFO ti; /* The tool information that is sent to the tooltip control. */
/* Fill the tooltip info with the appropriate information. */
ti.cbSize = sizeof(TOOLINFO);
ti.uFlags = TTF_SUBCLASS;
ti.hwnd = toolButton->hToolBar;
ti.uId = toolButton->nCommand;
ti.rect.left = 0;
ti.rect.top = 0;
ti.rect.right = 0;
ti.rect.bottom= 0;
ti.hinst = ghModule;
ti.lpszText = malloc(256);
SendMessage ((HWND) SendMessage(toolButton->hToolBar, TB_GETTOOLTIPS, 0, 0), TTM_GETTOOLINFO, 0, (LPARAM) (LPTOOLINFO)&ti);
return ti.lpszText;
}
void osSetToolButtonChecked(ToolHandle toolButton, BOOL bState)
{
};
BOOL osGetToolButtonChecked(ToolHandle toolButton)
{
return FALSE;
}
int osGetToolItemPos(ToolHandle toolButton)
{
return SendMessage(toolButton->hToolBar, TB_COMMANDTOINDEX, toolButton->nCommand, 0);
}
|
|
From: <kr_...@us...> - 2003-07-08 20:31:32
|
Update of /cvsroot/htoolkit/port/src
In directory sc8-pr-cvs1:/tmp/cvs-serv14568/src
Modified Files:
Port.hs
Log Message:
Added implementation for ToolBar. The Windows version is still in very basic
state.
Index: Port.hs
===================================================================
RCS file: /cvsroot/htoolkit/port/src/Port.hs,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** Port.hs 4 Jul 2003 17:39:04 -0000 1.16
--- Port.hs 8 Jul 2003 20:31:29 -0000 1.17
***************
*** 19,22 ****
--- 19,23 ----
, module Graphics.UI.Port.CommonDialogs
, module Graphics.UI.Port.Message
+ , module Graphics.UI.Port.ToolBar
-- ** Controls
***************
*** 46,49 ****
--- 47,51 ----
import Graphics.UI.Port.CommonDialogs
import Graphics.UI.Port.Message
+ import Graphics.UI.Port.ToolBar
import Graphics.UI.Port.Controls
|
|
From: <kr_...@us...> - 2003-07-08 20:31:32
|
Update of /cvsroot/htoolkit/port In directory sc8-pr-cvs1:/tmp/cvs-serv14568 Modified Files: makefile Log Message: Added implementation for ToolBar. The Windows version is still in very basic state. Index: makefile =================================================================== RCS file: /cvsroot/htoolkit/port/makefile,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** makefile 4 Jul 2003 17:39:04 -0000 1.22 --- makefile 8 Jul 2003 20:31:29 -0000 1.23 *************** *** 44,47 **** --- 44,48 ---- Port/Document.hs \ Port/ConfigKey.hs \ + Port/ToolBar.hs \ Port.hs *************** *** 50,57 **** CSRCS = Window.c Util.c Bitmap.c Button.c CheckBox.c EditBox.c \ FileDialog.c ColorDialog.c FontDialog.c AboutDialog.c PopUp.c Canvas.c Menu.c ListBox.c \ ! Label.c Font.c RadioBox.c Timer.c Frame.c Message.c Slider.c ProgressBar.c ConfigKey.c ifeq "$(GUILIB)" "WIN32" ! CSRCS += MenuHandlesMap.c endif --- 51,59 ---- CSRCS = Window.c Util.c Bitmap.c Button.c CheckBox.c EditBox.c \ FileDialog.c ColorDialog.c FontDialog.c AboutDialog.c PopUp.c Canvas.c Menu.c ListBox.c \ ! Label.c Font.c RadioBox.c Timer.c Frame.c Message.c Slider.c ProgressBar.c ConfigKey.c \ ! ToolBar.c ifeq "$(GUILIB)" "WIN32" ! CSRCS += MenuHandlesMap.c ControlBar.c endif |
|
From: <kr_...@us...> - 2003-07-05 11:01:23
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK
In directory sc8-pr-cvs1:/tmp/cvs-serv25229/src/cbits/GTK
Modified Files:
Frame.c Internals.h Window.c
Log Message:
bugfix
Index: Frame.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Frame.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Frame.c 5 Jul 2003 06:42:38 -0000 1.9
--- Frame.c 5 Jul 2003 11:01:16 -0000 1.10
***************
*** 10,13 ****
--- 10,14 ----
GtkWidget *gClientWidget = NULL;
GtkWidget *gMenuBar = NULL;
+ int gFrameWidth = 0, gFrameHeight = 0;
static void frame_close_page_handler(GtkWidget *client)
***************
*** 290,293 ****
--- 291,301 ----
}
+ static gboolean sdiframe_configure_event_handler(GtkWidget *widget, GdkEventConfigure *event, gpointer user_data)
+ {
+ gFrameWidth = event->width;
+ gFrameHeight = event->height;
+ return FALSE;
+ };
+
void createSDIFrame()
{
***************
*** 312,315 ****
--- 320,328 ----
GTK_SIGNAL_FUNC(sdiframe_focus_out_handler),
NULL);
+ gtk_signal_connect (GTK_OBJECT(gFrameWidget), "configure-event",
+ GTK_SIGNAL_FUNC(sdiframe_configure_event_handler),
+ NULL);
+
+ gtk_window_get_size(GTK_WINDOW(gFrameWidget), &gFrameWidth, &gFrameHeight);
gtk_window_add_accel_group (GTK_WINDOW (gFrameWidget), gtk_accel_group_new());
Index: Internals.h
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Internals.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Internals.h 4 Jul 2003 15:23:57 -0000 1.3
--- Internals.h 5 Jul 2003 11:01:16 -0000 1.4
***************
*** 9,12 ****
--- 9,14 ----
extern GnomeProgram *gProgram;
+ extern int gFrameWidth, gFrameHeight;
+
extern int gDocumentInterface;
extern char *gAppName, *gAppVersion, *gWindowName;
Index: Window.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Window.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** Window.c 5 Jul 2003 08:53:36 -0000 1.19
--- Window.c 5 Jul 2003 11:01:16 -0000 1.20
***************
*** 239,243 ****
last_allocation = *allocation;
last_widget = widget;
!
handleWindowResize(widget,allocation->width-4,allocation->height-4);
handleWindowReLayout(widget);
--- 239,243 ----
last_allocation = *allocation;
last_widget = widget;
!
handleWindowResize(widget,allocation->width-4,allocation->height-4);
handleWindowReLayout(widget);
***************
*** 248,252 ****
{
GtkWidget *fixed, *sw, *viewport;
!
/* Create a Scrolled Window */
sw = gtk_scrolled_window_new (NULL, NULL);
--- 248,252 ----
{
GtkWidget *fixed, *sw, *viewport;
!
/* Create a Scrolled Window */
sw = gtk_scrolled_window_new (NULL, NULL);
***************
*** 260,263 ****
--- 260,264 ----
GTK_SIGNAL_FUNC(window_size_allocate_handler),
NULL);
+
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_AUTOMATIC,
***************
*** 785,789 ****
{
gtk_window_move(GTK_WINDOW(toplevel), x0, y0);
! gtk_window_resize(GTK_WINDOW(toplevel), abs(x1 - x0), abs(y1 - y0));
}
}
--- 786,793 ----
{
gtk_window_move(GTK_WINDOW(toplevel), x0, y0);
!
! gFrameWidth = abs(x1 - x0);
! gFrameHeight = abs(y1 - y0);
! gtk_window_resize(GTK_WINDOW(toplevel), gFrameWidth, gFrameHeight);
}
}
***************
*** 802,817 ****
else
{
! int x = 0;
int y = 0;
- int w = 0;
- int h = 0;
gtk_window_get_position(GTK_WINDOW(toplevel), &x, &y);
- gtk_window_get_size(GTK_WINDOW(toplevel), &w, &h);
res[0] = x;
res[1] = y;
! res[2] = x+w;
! res[3] = y+h;
}
}
--- 806,818 ----
else
{
! int x = 0;
int y = 0;
gtk_window_get_position(GTK_WINDOW(toplevel), &x, &y);
res[0] = x;
res[1] = y;
! res[2] = x+gFrameWidth;
! res[3] = y+gFrameHeight;
}
}
|
|
From: <kr_...@us...> - 2003-07-05 08:53:39
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK
In directory sc8-pr-cvs1:/tmp/cvs-serv12347/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.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** Window.c 5 Jul 2003 06:42:38 -0000 1.18
--- Window.c 5 Jul 2003 08:53:36 -0000 1.19
***************
*** 233,238 ****
static void window_size_allocate_handler (GtkWidget *widget, GtkAllocation *allocation, gpointer user_data)
{
! handleWindowResize(widget,allocation->width-4,allocation->height-4);
! handleWindowReLayout(widget);
};
--- 233,246 ----
static void window_size_allocate_handler (GtkWidget *widget, GtkAllocation *allocation, gpointer user_data)
{
! static GtkWidget *last_widget = NULL;
! static GtkAllocation last_allocation = {0,0};
! if (last_widget != widget || last_allocation.width != allocation->width || last_allocation.height != allocation->height)
! {
! last_allocation = *allocation;
! last_widget = widget;
!
! handleWindowResize(widget,allocation->width-4,allocation->height-4);
! handleWindowReLayout(widget);
! }
};
***************
*** 583,587 ****
--- 591,597 ----
void osSetWindowDomainSize(WindowHandle window, int cx, int cy)
{
+ gtk_window_set_resizable(GTK_WINDOW(gFrameWidget), FALSE);
gtk_widget_set_size_request(GTK_BIN(GTK_BIN(window)->child)->child,cx,cy);
+ gtk_window_set_resizable(GTK_WINDOW(gFrameWidget), TRUE);
}
|
|
From: <kr_...@us...> - 2003-07-05 06:42:41
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK
In directory sc8-pr-cvs1:/tmp/cvs-serv32451/src/cbits/GTK
Modified Files:
Frame.c Menu.c Window.c
Log Message:
Use GnomeApp as toplevel widget instead of GtkWindow
Index: Frame.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Frame.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** Frame.c 1 May 2003 19:35:36 -0000 1.8
--- Frame.c 5 Jul 2003 06:42:38 -0000 1.9
***************
*** 109,113 ****
widget = gClientWidget;
else
! widget = gtk_notebook_get_nth_page(GTK_NOTEBOOK(gClientWidget), gtk_notebook_get_current_page(GTK_NOTEBOOK(gClientWidget)));
if (!widget)
--- 109,114 ----
widget = gClientWidget;
else
! widget = gtk_notebook_get_nth_page(GTK_NOTEBOOK(gClientWidget),
! gtk_notebook_get_current_page(GTK_NOTEBOOK(gClientWidget)));
if (!widget)
***************
*** 159,163 ****
widget = gClientWidget;
else
! widget = gtk_notebook_get_nth_page(GTK_NOTEBOOK(gClientWidget), gtk_notebook_get_current_page(GTK_NOTEBOOK(gClientWidget)));
if (!widget)
--- 160,165 ----
widget = gClientWidget;
else
! widget = gtk_notebook_get_nth_page(GTK_NOTEBOOK(gClientWidget),
! gtk_notebook_get_current_page(GTK_NOTEBOOK(gClientWidget)));
if (!widget)
***************
*** 201,211 ****
void createMDIFrame()
{
- GtkWidget *box;
GtkWidget *notebook_menu, *menu_item, *pages_menu;
GSList *group;
/* Create the window. */
! gFrameWidget = gtk_window_new (GTK_WINDOW_TOPLEVEL);
! gtk_window_set_title(GTK_WINDOW(gFrameWidget), gAppName);
gtk_signal_connect (GTK_OBJECT(gFrameWidget), "delete-event",
GTK_SIGNAL_FUNC(frame_delete_handler),
--- 203,211 ----
void createMDIFrame()
{
GtkWidget *notebook_menu, *menu_item, *pages_menu;
GSList *group;
/* Create the window. */
! gFrameWidget = gnome_app_new(gAppName, gAppName);
gtk_signal_connect (GTK_OBJECT(gFrameWidget), "delete-event",
GTK_SIGNAL_FUNC(frame_delete_handler),
***************
*** 221,230 ****
NULL);
- box = gtk_vbox_new(FALSE, 0);
- gtk_container_add(GTK_CONTAINER(gFrameWidget), box);
-
/* Create the menubar. */
gMenuBar = gtk_menu_bar_new();
! gtk_box_pack_start(GTK_BOX(box), gMenuBar, FALSE, FALSE, 0);
/* Create client(notebook) */
--- 221,227 ----
NULL);
/* Create the menubar. */
gMenuBar = gtk_menu_bar_new();
! gnome_app_set_menus(GNOME_APP(gFrameWidget), GTK_MENU_BAR(gMenuBar));
/* Create client(notebook) */
***************
*** 235,239 ****
GTK_SIGNAL_FUNC(frame_switch_page_handler),
NULL);
! gtk_box_pack_end(GTK_BOX(box), gClientWidget, TRUE, TRUE, 0);
gtk_window_maximize(GTK_WINDOW(gFrameWidget));
--- 232,236 ----
GTK_SIGNAL_FUNC(frame_switch_page_handler),
NULL);
! gnome_app_set_contents(GNOME_APP(gFrameWidget),gClientWidget);
gtk_window_maximize(GTK_WINDOW(gFrameWidget));
***************
*** 295,303 ****
void createSDIFrame()
{
- GtkWidget *box;
-
/* Create the window. */
! gFrameWidget = gtk_window_new (GTK_WINDOW_TOPLEVEL);
! gtk_window_set_title(GTK_WINDOW(gFrameWidget), gAppName);
gtk_signal_connect (GTK_OBJECT(gFrameWidget), "delete-event",
GTK_SIGNAL_FUNC(frame_delete_handler),
--- 292,297 ----
void createSDIFrame()
{
/* Create the window. */
! gFrameWidget = gnome_app_new(gAppName, gAppName);
gtk_signal_connect (GTK_OBJECT(gFrameWidget), "delete-event",
GTK_SIGNAL_FUNC(frame_delete_handler),
***************
*** 319,326 ****
NULL);
-
- box = gtk_vbox_new(FALSE, 0);
- gtk_container_add(GTK_CONTAINER(gFrameWidget), box);
-
gtk_window_add_accel_group (GTK_WINDOW (gFrameWidget), gtk_accel_group_new());
--- 313,316 ----
Index: Menu.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Menu.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** Menu.c 23 Apr 2003 21:48:52 -0000 1.7
--- Menu.c 5 Jul 2003 06:42:38 -0000 1.8
***************
*** 12,17 ****
{
gMenuBar = gtk_menu_bar_new();
- gtk_box_pack_start(GTK_BOX(GTK_BIN(gFrameWidget)->child), gMenuBar, FALSE, TRUE, 0);
gtk_widget_show(gMenuBar);
}
--- 12,17 ----
{
gMenuBar = gtk_menu_bar_new();
gtk_widget_show(gMenuBar);
+ gnome_app_set_menus(GNOME_APP(gFrameWidget), GTK_MENU_BAR(gMenuBar));
}
Index: Window.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Window.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** Window.c 1 May 2003 19:35:36 -0000 1.17
--- Window.c 5 Jul 2003 06:42:38 -0000 1.18
***************
*** 234,238 ****
{
handleWindowResize(widget,allocation->width-4,allocation->height-4);
! handleWindowReLayout(widget);
};
--- 234,238 ----
{
handleWindowResize(widget,allocation->width-4,allocation->height-4);
! handleWindowReLayout(widget);
};
***************
*** 309,319 ****
{
gClientWidget = sw;
! gtk_box_pack_end(GTK_BOX(GTK_BIN(gFrameWidget)->child), sw, TRUE, TRUE, 0);
}
gtk_widget_realize(viewport);
! gdk_window_set_events(viewport->window,
! gdk_window_get_events(viewport->window) | GDK_BUTTON_RELEASE_MASK | GDK_POINTER_MOTION_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK);
!
return sw;
--- 309,321 ----
{
gClientWidget = sw;
! gnome_app_set_contents(GNOME_APP(gFrameWidget),sw);
}
gtk_widget_realize(viewport);
! gdk_window_set_events(viewport->window, gdk_window_get_events(viewport->window)
! | GDK_BUTTON_RELEASE_MASK
! | GDK_POINTER_MOTION_MASK
! | GDK_ENTER_NOTIFY_MASK
! | GDK_LEAVE_NOTIFY_MASK);
return sw;
***************
*** 643,652 ****
GtkWidget *widget = window;
- printf("1 %p\n", window);
gtk_signal_connect (GTK_OBJECT(window), "destroy",
GTK_SIGNAL_FUNC(gtk_widget_destroyed),
&widget);
handleWindowDismiss(widget);
- printf("2\n");
return (widget == NULL);
}
--- 645,652 ----
|
|
From: <kr_...@us...> - 2003-07-04 17:41:06
|
Update of /cvsroot/htoolkit/gio/src/examples/simple
In directory sc8-pr-cvs1:/tmp/cvs-serv32308
Added Files:
ConfigKey.hs
Log Message:
Add example for configuration keys
--- NEW FILE: ConfigKey.hs ---
module Main where
import Graphics.UI.GIO
main =
start "Conf" "1.0" SDI [] $ do
(value :: Int) <- get pc (configKey "Counter.Value")
(delta :: Int) <- get pc (configKeyDef "Counter.Delta" 1)
set pc [configKey "Counter.Value" =: value+delta]
prompt <- get pc (configKeyDef "Prompt" "Counter.Value=")
w <- window []
l <- label [title =: prompt ++ show value] w
set w [layout =: l]
|
|
From: <kr_...@us...> - 2003-07-04 17:39:08
|
Update of /cvsroot/htoolkit/port/src/include In directory sc8-pr-cvs1:/tmp/cvs-serv31718/port/src/include Modified Files: HsPort.h Types.h Added Files: ConfigKey.h Log Message: Implementation for persistent configuration keys for both Windows and Linux. Under Windows they are stored in Windows Registry and under Linux they are stored in GConf configuration database --- NEW FILE: ConfigKey.h --- #ifndef CONFIGKEY_H #define CONFIGKEY_H #include "Types.h" char *osGetConfigStringKey(char *name, char *defvalue); void osSetConfigStringKey(char *name, char *value); int osGetConfigIntKey(char *szName, int defvalue); void osSetConfigIntKey(char *szName, int value); double osGetConfigDoubleKey(char *szName, double defvalue); void osSetConfigDoubleKey(char *szName, double value); BOOL osGetConfigBoolKey(char *szName, BOOL defvalue); void osSetConfigBoolKey(char *szName, BOOL value); #endif Index: HsPort.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/include/HsPort.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** HsPort.h 26 Apr 2003 21:02:17 -0000 1.4 --- HsPort.h 4 Jul 2003 17:39:05 -0000 1.5 *************** *** 17,18 **** --- 17,19 ---- #include "CommonDialogs.h" #include "Message.h" + #include "ConfigKey.h" Index: Types.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/include/Types.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Types.h 8 Jun 2003 21:11:48 -0000 1.11 --- Types.h 4 Jul 2003 17:39:05 -0000 1.12 *************** *** 66,69 **** --- 66,71 ---- #include <pango/pangox.h> #include <gnome.h> + #include <gconf/gconf.h> + #include <gconf/gconf-client.h> typedef GtkWidget *WindowHandle; |
|
From: <kr_...@us...> - 2003-07-04 17:39:08
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK
In directory sc8-pr-cvs1:/tmp/cvs-serv31718/port/src/cbits/GTK
Added Files:
ConfigKey.c
Log Message:
Implementation for persistent configuration keys for both Windows and Linux.
Under Windows they are stored in Windows Registry and under Linux they are
stored in GConf configuration database
--- NEW FILE: ConfigKey.c ---
#include "ConfigKey.h"
#include "Internals.h"
static char *getKeyPath(char *szName)
{
char *s;
s = szName;
while (*s)
{
if (*s == '.') *s = '/';
s++;
}
return gnome_gconf_get_app_settings_relative(gProgram,szName);
}
static GConfValue *getKeyValue(char *szName, int type)
{
char *key;
GConfValue* val;
key = getKeyPath(szName);
val = gconf_client_get(gconf_client_get_default(), key, NULL);
free(key);
return (val == NULL || val->type != type) ? NULL : val;
}
char *osGetConfigStringKey(char *szName, char *defvalue)
{
char *retval;
GConfValue *val = getKeyValue(szName, GCONF_VALUE_STRING);
if (val)
{
retval = strdup(gconf_value_get_string(val));
gconf_value_free (val);
}
else
retval = defvalue ? strdup(defvalue) : NULL;
return retval;
}
void osSetConfigStringKey(char *szName, char *value)
{
char *key = getKeyPath(szName);
gconf_client_set_string(gconf_client_get_default(), key, value, NULL);
free(key);
}
int osGetConfigIntKey(char *szName, int defvalue)
{
int retval;
GConfValue *val = getKeyValue(szName, GCONF_VALUE_INT);
if (val)
{
retval = gconf_value_get_int(val);
gconf_value_free (val);
}
else
retval = defvalue;
return retval;
}
void osSetConfigIntKey(char *szName, int value)
{
char *key = getKeyPath(szName);
gconf_client_set_int(gconf_client_get_default(), key, value, NULL);
free(key);
}
double osGetConfigDoubleKey(char *szName, double defvalue)
{
double retval;
GConfValue *val = getKeyValue(szName, GCONF_VALUE_FLOAT);
if (val)
{
retval = gconf_value_get_float(val);
gconf_value_free (val);
}
else
retval = defvalue;
return retval;
}
void osSetConfigDoubleKey(char *szName, double value)
{
char *key = getKeyPath(szName);
gconf_client_set_float(gconf_client_get_default(), key, value, NULL);
free(key);
}
BOOL osGetConfigBoolKey(char *szName, BOOL defvalue)
{
BOOL retval;
GConfValue *val = getKeyValue(szName, GCONF_VALUE_BOOL);
if (val)
{
retval = gconf_value_get_bool(val);
gconf_value_free (val);
}
else
retval = defvalue;
return retval;
}
void osSetConfigBoolKey(char *szName, BOOL value)
{
char *key = getKeyPath(szName);
gconf_client_set_bool(gconf_client_get_default(), key, value, NULL);
free(key);
}
|
|
From: <kr_...@us...> - 2003-07-04 17:39:08
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32
In directory sc8-pr-cvs1:/tmp/cvs-serv31718/port/src/cbits/Win32
Added Files:
ConfigKey.c
Log Message:
Implementation for persistent configuration keys for both Windows and Linux.
Under Windows they are stored in Windows Registry and under Linux they are
stored in GConf configuration database
--- NEW FILE: ConfigKey.c ---
#include "ConfigKey.h"
#include "Internals.h"
static HKEY openKey(char *szName, char **pszValueName)
{
char *s;
FrameData *pFrameData;
HKEY hSoftwareKey, hAppKey, hKey;
LONG lResult;
pFrameData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA);
s = szName;
*pszValueName = szName;
while (*s)
{
if (*s == '.')
{
*pszValueName = s+1;
*s = '\\';
}
s++;
}
if (RegOpenKeyEx(HKEY_CURRENT_USER, "Software", 0, KEY_READ, &hSoftwareKey) != ERROR_SUCCESS)
return NULL;
if (RegCreateKeyEx(hSoftwareKey, pFrameData->lpszAppName, 0, 0, REG_OPTION_NON_VOLATILE, KEY_READ | KEY_WRITE, NULL, &hAppKey, NULL)!= ERROR_SUCCESS)
return NULL;
if (*pszValueName == szName)
return hAppKey;
else
{
(*pszValueName)[-1] = 0;
if (RegCreateKeyEx(hAppKey, szName, 0, 0, REG_OPTION_NON_VOLATILE, KEY_READ | KEY_WRITE, NULL, &hKey, NULL) != ERROR_SUCCESS)
return NULL;
RegCloseKey(hAppKey);
}
RegCloseKey(hSoftwareKey);
return hKey;
}
char *osGetConfigStringKey(char *szName, char *defvalue)
{
HKEY hKey;
DWORD dwType, dwLength;
char *szValue, *szValueName;
hKey = openKey(szName, &szValueName);
if (!hKey)
return strdup(defvalue);
if (RegQueryValueEx(hKey, szValueName, NULL, &dwType, NULL, &dwLength) != ERROR_SUCCESS)
{
RegCloseKey(hKey);
return strdup(defvalue);
}
if (dwType != REG_SZ && dwType != REG_EXPAND_SZ)
{
RegCloseKey(hKey);
return strdup(defvalue);
}
szValue = malloc(dwLength);
if (RegQueryValueEx(hKey, szValueName, NULL, &dwType, szValue, &dwLength) != ERROR_SUCCESS)
{
RegCloseKey(hKey);
free(szValue);
return strdup(defvalue);
}
RegCloseKey(hKey);
return szValue;
}
void osSetConfigStringKey(char *szName, char *szValue)
{
HKEY hKey;
char *szValueName;
hKey = openKey(szName, &szValueName);
if (!hKey)
return;
RegSetValueEx(hKey, szValueName, 0, REG_SZ, szValue, strlen(szValue)+1);
RegCloseKey(hKey);
}
int osGetConfigIntKey(char *szName, int defvalue)
{
HKEY hKey;
DWORD dwType, dwLength, dwValue;
char *szValueName;
hKey = openKey(szName, &szValueName);
if (!hKey)
return defvalue;
dwLength = sizeof(DWORD);
if (RegQueryValueEx(hKey, szValueName, NULL, &dwType, (LPBYTE) &dwValue, &dwLength) != ERROR_SUCCESS)
{
RegCloseKey(hKey);
return defvalue;
}
if (dwType != REG_DWORD)
{
RegCloseKey(hKey);
return defvalue;
}
RegCloseKey(hKey);
return dwValue;
}
void osSetConfigIntKey(char *szName, int nValue)
{
HKEY hKey;
char *szValueName;
hKey = openKey(szName, &szValueName);
if (!hKey)
return;
RegSetValueEx(hKey, szValueName, 0, REG_DWORD, (LPBYTE) &nValue, sizeof(nValue));
RegCloseKey(hKey);
}
double osGetConfigDoubleKey(char *szName, double defvalue)
{
HKEY hKey;
DWORD dwType, dwLength;
char *szValueName;
char buffer[64];
hKey = openKey(szName, &szValueName);
if (!hKey)
return defvalue;
dwLength = sizeof(buffer);
if (RegQueryValueEx(hKey, szValueName, NULL, &dwType, buffer, &dwLength) != ERROR_SUCCESS)
{
RegCloseKey(hKey);
return defvalue;
}
if (dwType != REG_SZ && dwType != REG_EXPAND_SZ)
{
RegCloseKey(hKey);
return defvalue;
}
RegCloseKey(hKey);
return atof(buffer);
}
void osSetConfigDoubleKey(char *szName, double dValue)
{
HKEY hKey;
char *szValueName;
char buffer[64];
hKey = openKey(szName, &szValueName);
if (!hKey)
return;
sprintf(buffer, "%f", dValue);
RegSetValueEx(hKey, szValueName, 0, REG_SZ, buffer, strlen(buffer)+1);
RegCloseKey(hKey);
}
BOOL osGetConfigBoolKey(char *szName, BOOL defvalue)
{
HKEY hKey;
DWORD dwType, dwLength, dwValue;
char *szValueName;
hKey = openKey(szName, &szValueName);
if (!hKey)
return defvalue;
dwLength = sizeof(DWORD);
if (RegQueryValueEx(hKey, szValueName, NULL, &dwType, (LPBYTE) &dwValue, &dwLength) != ERROR_SUCCESS)
{
RegCloseKey(hKey);
return defvalue;
}
if (dwType != REG_DWORD)
{
RegCloseKey(hKey);
return defvalue;
}
RegCloseKey(hKey);
return (dwValue != 0);
}
void osSetConfigBoolKey(char *szName, BOOL bValue)
{
HKEY hKey;
char *szValueName;
DWORD dwValue;
hKey = openKey(szName, &szValueName);
if (!hKey)
return;
dwValue = bValue ? 1 : 0;
RegSetValueEx(hKey, szValueName, 0, REG_DWORD, (LPBYTE) &dwValue, sizeof(dwValue));
RegCloseKey(hKey);
}
|
|
From: <kr_...@us...> - 2003-07-04 17:39:07
|
Update of /cvsroot/htoolkit/port/src/Port
In directory sc8-pr-cvs1:/tmp/cvs-serv31718/port/src/Port
Added Files:
ConfigKey.hs
Log Message:
Implementation for persistent configuration keys for both Windows and Linux.
Under Windows they are stored in Windows Registry and under Linux they are
stored in GConf configuration database
--- NEW FILE: ConfigKey.hs ---
{-# OPTIONS -fglasgow-exts #-}
-----------------------------------------------------------------------------------------
{-| Module : ConfigKey
Copyright : (c) Krasimir Angelov 2003
License : BSD-style
Maintainer : ka2...@ya...
Stability : provisional
Portability : portable
-}
-----------------------------------------------------------------------------------------
module Graphics.UI.Port.ConfigKey
( ConfigKey
, setConfigKey, getConfigKey, getConfigKeyDef
) where
import Foreign
import Foreign.C
-----------------------------------------------------------------------------------------
-- ConfigKey class definition
-----------------------------------------------------------------------------------------
class ConfigKey a where
setConfigKey :: String -> a -> IO ()
getConfigKey :: String -> IO a
getConfigKeyDef :: String -> a -> IO a
-----------------------------------------------------------------------------------------
-- Class instance for String type
-----------------------------------------------------------------------------------------
instance ConfigKey String where
setConfigKey name value =
(withCString name $ \cname ->
withCString value $ \cvalue ->
osSetConfigStringKey cname cvalue)
getConfigKey name = getConfigKeyDef name ""
getConfigKeyDef name defvalue =
(withCString name $ \cname -> do
ptr <- osGetConfigStringKey cname nullPtr
(if ptr == nullPtr
then return defvalue
else do
value <- peekCString ptr
free ptr
return value))
foreign import ccall osGetConfigStringKey :: CString -> CString -> IO CString
foreign import ccall osSetConfigStringKey :: CString -> CString -> IO ()
-----------------------------------------------------------------------------------------
-- Class instance for Int type
-----------------------------------------------------------------------------------------
instance ConfigKey Int where
setConfigKey name value =
withCString name (\cname -> osSetConfigIntKey cname value)
getConfigKey name = getConfigKeyDef name 0
getConfigKeyDef name defvalue =
withCString name (\cname -> osGetConfigIntKey cname defvalue)
foreign import ccall osGetConfigIntKey :: CString -> Int -> IO Int
foreign import ccall osSetConfigIntKey :: CString -> Int -> IO ()
-----------------------------------------------------------------------------------------
-- Class instance for Double type
-----------------------------------------------------------------------------------------
instance ConfigKey Double where
setConfigKey name value =
withCString name (\cname -> osSetConfigDoubleKey cname value)
getConfigKey name = getConfigKeyDef name 0.0
getConfigKeyDef name defvalue =
withCString name (\cname -> osGetConfigDoubleKey cname defvalue)
foreign import ccall osGetConfigDoubleKey :: CString -> Double -> IO Double
foreign import ccall osSetConfigDoubleKey :: CString -> Double -> IO ()
-----------------------------------------------------------------------------------------
-- Class instance for Bool type
-----------------------------------------------------------------------------------------
instance ConfigKey Bool where
setConfigKey name value =
withCString name (\cname -> osSetConfigBoolKey cname value)
getConfigKey name = getConfigKeyDef name False
getConfigKeyDef name defvalue =
withCString name (\cname -> osGetConfigBoolKey cname defvalue)
foreign import ccall osGetConfigBoolKey :: CString -> Bool -> IO Bool
foreign import ccall osSetConfigBoolKey :: CString -> Bool -> IO ()
|
|
From: <kr_...@us...> - 2003-07-04 17:39:07
|
Update of /cvsroot/htoolkit/port/src
In directory sc8-pr-cvs1:/tmp/cvs-serv31718/port/src
Modified Files:
Port.hs
Log Message:
Implementation for persistent configuration keys for both Windows and Linux.
Under Windows they are stored in Windows Registry and under Linux they are
stored in GConf configuration database
Index: Port.hs
===================================================================
RCS file: /cvsroot/htoolkit/port/src/Port.hs,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** Port.hs 26 Apr 2003 20:56:33 -0000 1.15
--- Port.hs 4 Jul 2003 17:39:04 -0000 1.16
***************
*** 31,40 ****
, module Graphics.UI.Port.Timer
! -- * Process
, module Graphics.UI.Port.Process
-- ** Fundamental
, module Graphics.UI.Port.Handlers
! , module Graphics.UI.Port.Types
) where
--- 31,43 ----
, module Graphics.UI.Port.Timer
! -- ** Process
, module Graphics.UI.Port.Process
-- ** Fundamental
, module Graphics.UI.Port.Handlers
! , module Graphics.UI.Port.Types
!
! -- ** Configuration
! , module Graphics.UI.Port.ConfigKey
) where
***************
*** 72,73 ****
--- 75,78 ----
, CBool, fromCBool, toCBool
)
+
+ import Graphics.UI.Port.ConfigKey
|
|
From: <kr_...@us...> - 2003-07-04 17:39:07
|
Update of /cvsroot/htoolkit/port
In directory sc8-pr-cvs1:/tmp/cvs-serv31718/port
Modified Files:
configure makefile
Log Message:
Implementation for persistent configuration keys for both Windows and Linux.
Under Windows they are stored in Windows Registry and under Linux they are
stored in GConf configuration database
Index: configure
===================================================================
RCS file: /cvsroot/htoolkit/port/configure,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** configure 1 Jul 2003 21:38:56 -0000 1.13
--- configure 4 Jul 2003 17:39:04 -0000 1.14
***************
*** 285,289 ****
cincflags=""
case "$target" in
! WIN32*) clibs="-luser32 -lgdi32 -lkernel32 -lcomctl32 -lcomdlg32 -lshell32 -lwinmm -lwinspool -lole32";;
GTK*) if sh ./config.search pkg-config; then
echo "pkg-config found"
--- 285,289 ----
cincflags=""
case "$target" in
! WIN32*) clibs="-luser32 -lgdi32 -lkernel32 -lcomctl32 -lcomdlg32 -lshell32 -lwinmm -lwinspool -lole32 -ladvapi32";;
GTK*) if sh ./config.search pkg-config; then
echo "pkg-config found"
Index: makefile
===================================================================
RCS file: /cvsroot/htoolkit/port/makefile,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** makefile 8 Jun 2003 19:42:14 -0000 1.21
--- makefile 4 Jul 2003 17:39:04 -0000 1.22
***************
*** 43,46 ****
--- 43,47 ----
Port/Message.hs \
Port/Document.hs \
+ Port/ConfigKey.hs \
Port.hs
***************
*** 49,53 ****
CSRCS = Window.c Util.c Bitmap.c Button.c CheckBox.c EditBox.c \
FileDialog.c ColorDialog.c FontDialog.c AboutDialog.c PopUp.c Canvas.c Menu.c ListBox.c \
! Label.c Font.c RadioBox.c Timer.c Frame.c Message.c Slider.c ProgressBar.c
ifeq "$(GUILIB)" "WIN32"
--- 50,54 ----
CSRCS = Window.c Util.c Bitmap.c Button.c CheckBox.c EditBox.c \
FileDialog.c ColorDialog.c FontDialog.c AboutDialog.c PopUp.c Canvas.c Menu.c ListBox.c \
! Label.c Font.c RadioBox.c Timer.c Frame.c Message.c Slider.c ProgressBar.c ConfigKey.c
ifeq "$(GUILIB)" "WIN32"
|
|
From: <kr_...@us...> - 2003-07-04 17:39:07
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO In directory sc8-pr-cvs1:/tmp/cvs-serv31718/gio/src/Graphics/UI/GIO Modified Files: Process.hs Log Message: Implementation for persistent configuration keys for both Windows and Linux. Under Windows they are stored in Windows Registry and under Linux they are stored in GConf configuration database Index: Process.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Process.hs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Process.hs 1 May 2003 19:35:37 -0000 1.3 --- Process.hs 4 Jul 2003 17:39:04 -0000 1.4 *************** *** 17,20 **** --- 17,21 ---- ( Process, pc , start, quit, halt + , ConfigKey(..), configKey, configKeyDef ) where *************** *** 24,27 **** --- 25,29 ---- import Graphics.UI.GIO.Events import qualified Graphics.UI.Port as Lib + import Graphics.UI.Port(ConfigKey(..)) data Process *************** *** 57,58 **** --- 59,66 ---- halt :: IO () halt = Lib.halt + + configKey :: ConfigKey a => String -> Attr Process a + configKey name = newAttr (\p -> Lib.getConfigKey name) (\p v -> Lib.setConfigKey name v) + + configKeyDef :: ConfigKey a => String -> a -> Attr Process a + configKeyDef name defvalue = newAttr (\p -> Lib.getConfigKeyDef name defvalue) (\p v -> Lib.setConfigKey name v) |
|
From: <kr_...@us...> - 2003-07-04 15:24:00
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK
In directory sc8-pr-cvs1:/tmp/cvs-serv9885/src/cbits/GTK
Modified Files:
Internals.h Util.c
Log Message:
Store the GnomeProgram object returned from gnome_program_init function for future usage. The bInitialized variable from Util.c is removed. The condition gProgram is used to determine whether the program is initialized.
Index: Internals.h
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Internals.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Internals.h 1 May 2003 19:35:36 -0000 1.2
--- Internals.h 4 Jul 2003 15:23:57 -0000 1.3
***************
*** 7,10 ****
--- 7,12 ----
extern int gCurChar;
+ extern GnomeProgram *gProgram;
+
extern int gDocumentInterface;
extern char *gAppName, *gAppVersion, *gWindowName;
Index: Util.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Util.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** Util.c 1 May 2003 20:45:32 -0000 1.17
--- Util.c 4 Jul 2003 15:23:57 -0000 1.18
***************
*** 5,9 ****
#include "Handlers_stub.h"
! BOOL bInitialized = FALSE;
int gDocumentInterface;
--- 5,9 ----
#include "Handlers_stub.h"
! GnomeProgram *gProgram = NULL;
int gDocumentInterface;
***************
*** 28,32 ****
void osInit(char *appName, char *appVersion, int DocumentInterface)
{
! if (!bInitialized)
{
int margc;
--- 28,32 ----
void osInit(char *appName, char *appVersion, int DocumentInterface)
{
! if (!gProgram)
{
int margc;
***************
*** 35,41 ****
gtk_set_locale();
getProgArgv(&margc, &margv);
! gnome_program_init(appName, appVersion, LIBGNOMEUI_MODULE,
margc, margv, GNOME_PARAM_POPT_TABLE, GNOME_PARAM_NONE);
- bInitialized = TRUE;
gAppName = strdup(appName);
--- 35,40 ----
gtk_set_locale();
getProgArgv(&margc, &margv);
! gProgram = gnome_program_init(appName, appVersion, LIBGNOMEUI_MODULE,
margc, margv, GNOME_PARAM_POPT_TABLE, GNOME_PARAM_NONE);
gAppName = strdup(appName);
***************
*** 65,68 ****
--- 64,68 ----
gtk_widget_destroy(gFrameWidget);
gtk_main_quit();
+ gProgram = NULL;
}
|
|
From: <kr_...@us...> - 2003-07-03 17:46:03
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32
In directory sc8-pr-cvs1:/tmp/cvs-serv15815/src/cbits/Win32
Modified Files:
Frame.c
Log Message:
Better drawing for menu items with bitmaps
Index: Frame.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Frame.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** Frame.c 3 May 2003 09:15:08 -0000 1.10
--- Frame.c 3 Jul 2003 17:46:00 -0000 1.11
***************
*** 10,13 ****
--- 10,22 ----
#define Spacing 1
+ void DrawMenuText(HDC hdc, LPTSTR lpchText, LPRECT lpRect)
+ {
+ int n = 0;
+ while (lpchText[n] && lpchText[n] != '\t') n++;
+
+ DrawText(hdc, lpchText, n, lpRect, DT_SINGLELINE|DT_VCENTER|DT_LEFT);
+ DrawText(hdc, lpchText+n+1, -1, lpRect, DT_SINGLELINE|DT_VCENTER|DT_RIGHT);
+ }
+
LRESULT CALLBACK HFrameSharedFunction(int DocumentInterface, HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
***************
*** 174,178 ****
ZeroMemory(&rc,sizeof(rc));
! DrawText(hDC,mii.dwTypeData,mii.cch,&rc,DT_SINGLELINE|DT_VCENTER|DT_LEFT|DT_CALCRECT|DT_EXPANDTABS);
lDims = GetMenuCheckMarkDimensions();
--- 183,187 ----
ZeroMemory(&rc,sizeof(rc));
! DrawText(hDC,mii.dwTypeData,mii.cch,&rc,DT_SINGLELINE|DT_VCENTER|DT_LEFT|DT_CALCRECT);
lDims = GetMenuCheckMarkDimensions();
***************
*** 183,187 ****
wCheckHeight = (WORD)max(handle->bitmap->destsize.cy, wCheckHeight);
! lpMIS->itemWidth = (rc.right-rc.left) + wCheckWidth + (Spacing*2); // Text width
lpMIS->itemHeight = max((rc.bottom-rc.top),wCheckHeight) + (Spacing*2); // Text Height
}
--- 192,196 ----
wCheckHeight = (WORD)max(handle->bitmap->destsize.cy, wCheckHeight);
! lpMIS->itemWidth = (rc.right-rc.left) + wCheckWidth + (Spacing*3); // Text width
lpMIS->itemHeight = max((rc.bottom-rc.top),wCheckHeight) + (Spacing*2); // Text Height
}
***************
*** 214,218 ****
int nIndexDC;
HBRUSH hFillBrush;
- DWORD dwDrawFlags;
struct CanvasHandle canvas;
--- 223,226 ----
***************
*** 264,267 ****
--- 272,276 ----
rc = lpDIS->rcItem;
rc.left += wWidth+Spacing;
+ rc.right-= Spacing;
// Draw out the bitmap associated with the menu item.
***************
*** 295,300 ****
GetMenuItemInfo(hParent, pos, TRUE, &mii);
- dwDrawFlags = DT_SINGLELINE|DT_VCENTER|DT_LEFT|DT_EXPANDTABS;
-
if (lpDIS->itemState & ODS_GRAYED)
{
--- 304,307 ----
***************
*** 304,312 ****
SetTextColor(lpDIS->hDC, GetSysColor(COLOR_3DHILIGHT));
OffsetRect(&rc,1,1);
! DrawText(lpDIS->hDC,mii.dwTypeData,mii.cch,&rc,dwDrawFlags);
OffsetRect(&rc,-1,-1);
SetTextColor(lpDIS->hDC,GetSysColor(COLOR_GRAYTEXT));
! DrawText(lpDIS->hDC,mii.dwTypeData,mii.cch,&rc,dwDrawFlags);
}
else
--- 311,319 ----
SetTextColor(lpDIS->hDC, GetSysColor(COLOR_3DHILIGHT));
OffsetRect(&rc,1,1);
! DrawMenuText(lpDIS->hDC,mii.dwTypeData,&rc);
OffsetRect(&rc,-1,-1);
SetTextColor(lpDIS->hDC,GetSysColor(COLOR_GRAYTEXT));
! DrawMenuText(lpDIS->hDC,mii.dwTypeData,&rc);
}
else
***************
*** 314,322 ****
COLORREF crGray = (GetSysColor(COLOR_GRAYTEXT) + RGB(64,64,64));
SetTextColor(lpDIS->hDC,crGray);
! DrawText(lpDIS->hDC,mii.dwTypeData,mii.cch,&rc,dwDrawFlags);
}
}
else
! DrawText(lpDIS->hDC,mii.dwTypeData,mii.cch,&rc,dwDrawFlags);
}
--- 321,329 ----
COLORREF crGray = (GetSysColor(COLOR_GRAYTEXT) + RGB(64,64,64));
SetTextColor(lpDIS->hDC,crGray);
! DrawMenuText(lpDIS->hDC,mii.dwTypeData,&rc);
}
}
else
! DrawMenuText(lpDIS->hDC,mii.dwTypeData,&rc);
}
|
|
From: <kr_...@us...> - 2003-07-03 16:49:59
|
Update of /cvsroot/htoolkit/gio/src/examples/simple
In directory sc8-pr-cvs1:/tmp/cvs-serv6857
Modified Files:
BouncingBalls.hs
Log Message:
bugfix: The window background should be white. The bufferMode is set to Buffered
Index: BouncingBalls.hs
===================================================================
RCS file: /cvsroot/htoolkit/gio/src/examples/simple/BouncingBalls.hs,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** BouncingBalls.hs 30 May 2003 11:58:16 -0000 1.4
--- BouncingBalls.hs 3 Jul 2003 16:49:55 -0000 1.5
***************
*** 9,13 ****
= do vballs <- newVar []
! w <- window [resizeable =: True, view =: sz maxX maxY]
set w [ on paint =: paintBalls vballs
, on click =: dropBall w vballs
--- 9,13 ----
= do vballs <- newVar []
! w <- window [resizeable =: True, view =: sz maxX maxY, bufferMode =: Buffered]
set w [ on paint =: paintBalls vballs
, on click =: dropBall w vballs
***************
*** 40,44 ****
paintBalls vballs can updframe updareas
! = do setCanvasPen can [color =: lightgray]
fillRect updframe can
balls <- getVar vballs
--- 40,44 ----
paintBalls vballs can updframe updareas
! = do setCanvasPen can [color =: white]
fillRect updframe can
balls <- getVar vballs
|
|
From: <kr_...@us...> - 2003-07-02 20:11:19
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32
In directory sc8-pr-cvs1:/tmp/cvs-serv25614/src/cbits/Win32
Modified Files:
Slider.c
Log Message:
bugfix: better way to get required size for the slider
Index: Slider.c
===================================================================
RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Slider.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Slider.c 27 Mar 2003 13:36:23 -0000 1.1
--- Slider.c 2 Jul 2003 20:11:16 -0000 1.2
***************
*** 39,49 ****
void osGetSliderReqSize(WindowHandle slider, int *res)
{
! RECT rect;
! LONG lStyle = GetWindowLong(slider,GWL_STYLE);
!
! SendMessage(slider, TBM_GETTHUMBRECT, 0, (LPARAM) &rect);
!
! res[0] = rect.right - rect.left + ((lStyle & TBS_HORZ) ? 32 : GetSystemMetrics(SM_CXVSCROLL));
! res[1] = rect.bottom - rect.top + ((lStyle & TBS_VERT) ? 32 : GetSystemMetrics(SM_CYHSCROLL));
}
--- 39,52 ----
void osGetSliderReqSize(WindowHandle slider, int *res)
{
! if (GetWindowLong(slider,GWL_STYLE) & TBS_HORZ)
! {
! res[0] = 32;
! res[1] = GetSystemMetrics(SM_CYHSCROLL);
! }
! else
! {
! res[0] = GetSystemMetrics(SM_CXVSCROLL);
! res[1] = 32;
! }
}
|