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-11-23 10:25:51
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO In directory sc8-pr-cvs1:/tmp/cvs-serv4115/src/Graphics/UI/GIO Modified Files: Controls.hs Log Message: Add implementation for TrackBar control Index: Controls.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Controls.hs,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** Controls.hs 15 Nov 2003 10:52:30 -0000 1.37 --- Controls.hs 23 Nov 2003 10:25:47 -0000 1.38 *************** *** 55,58 **** --- 55,63 ---- , Slider, hslider, vslider + -- ** TrackBar + -- | An track bar control is a pair of arrow buttons that the user can click + -- to increment or decrement the value value displayed in another control. + , TrackBar, hTrackBar, vTrackBar, increment, decrement + -- ** ProgressBar -- | A progress bar control is a window that an application can use to *************** *** 528,531 **** --- 533,575 ---- pack = stdPack sparent shandle Port.getSliderRequestSize + + -------------------------------------------------------------------- + -- TrackBar + -------------------------------------------------------------------- + + -- | A track bar control. + data TrackBar = TrackBar + { tbhandle :: !WindowHandle + , tbparent :: !WindowHandle + } + + -- | Create a horizontal track bar control. + hTrackBar :: Container w => [Prop TrackBar] -> w -> IO TrackBar + hTrackBar props w + = do tb <- do tbhandle <- Port.createHorzTrackBar (hwindow w) + return (TrackBar tbhandle (hwindow w)) + set tb props + return tb + + -- | Create a vertical track bar control. + vTrackBar :: Container w => [Prop TrackBar] -> w -> IO TrackBar + vTrackBar props w + = do tb <- do tbhandle <- Port.createVertTrackBar (hwindow w) + return (TrackBar tbhandle (hwindow w)) + set tb props + return tb + + instance Control TrackBar where + pack = stdPack tbparent tbhandle Port.getTrackBarRequestSize + + -- | The vertical track bar control fires a 'increment' event when the up arrow is clicked. + -- The horizontal track bar control fires the same event when the right arrow is clicked. + increment :: Event TrackBar (IO ()) + increment = newStdEvent tbhandle Port.getTrackBarIncrementHandler Port.setTrackBarIncrementHandler Port.setTrackBarIncrementDefHandler + + -- | The vertical track bar control fires a 'decrement' event when the down arrow is clicked. + -- The horizontal track bar control fires the same event when the left arrow is clicked. + decrement :: Event TrackBar (IO ()) + decrement = newStdEvent tbhandle Port.getTrackBarDecrementHandler Port.setTrackBarDecrementHandler Port.setTrackBarDecrementDefHandler -------------------------------------------------------------------- |
From: <kr_...@us...> - 2003-11-23 10:23:19
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv3738/src/cbits/Win32 Modified Files: Window.c Added Files: TrackBar.c Log Message: Add implementation for TrackBar control --- NEW FILE: TrackBar.c --- #include "TrackBar.h" #include "Internals.h" #include "Handlers_stub.h" WindowHandle osCreateHorzTrackBar(WindowHandle form) { HWND hTrackBar; hTrackBar = CreateWindow( UPDOWN_CLASS, NULL, UDS_HORZ | WS_CHILD | WS_TABSTOP, 0,0,0,0, form, NULL, ghModule, NULL ); return checkWindow(hTrackBar, TRACKBAR_CLASS); }; WindowHandle osCreateVertTrackBar(WindowHandle form) { HWND hTrackBar; hTrackBar = CreateWindow( UPDOWN_CLASS, NULL, WS_CHILD | WS_TABSTOP, 0,0,0,0, form, NULL, ghModule, NULL ); return checkWindow(hTrackBar, TRACKBAR_CLASS); }; void osGetTrackBarReqSize(WindowHandle trackBar, int *res) { if (GetWindowLong(trackBar,GWL_STYLE) & UDS_HORZ) { res[0] = 20; res[1] = GetSystemMetrics(SM_CYHSCROLL); } else { res[0] = GetSystemMetrics(SM_CXVSCROLL); res[1] = 20; } } Index: Window.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Window.c,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** Window.c 14 Nov 2003 22:35:20 -0000 1.60 --- Window.c 23 Nov 2003 10:23:14 -0000 1.61 *************** *** 232,237 **** { NMHDR *pNMHDR = (NMHDR *) lParam; ! if (pNMHDR->hwndFrom != hWnd) ! SendMessage(pNMHDR->hwndFrom, uMsg, wParam, lParam); } break; --- 232,248 ---- { NMHDR *pNMHDR = (NMHDR *) lParam; ! ! if (pNMHDR->code == UDN_DELTAPOS) ! { ! if (((LPNM_UPDOWN)pNMHDR)->iDelta < 0) ! handleTrackBarIncrement(pNMHDR->hwndFrom); ! else ! handleTrackBarDecrement(pNMHDR->hwndFrom); ! } ! else ! { ! if (pNMHDR->hwndFrom != hWnd) ! SendMessage(pNMHDR->hwndFrom, uMsg, wParam, lParam); ! } } break; |
From: <kr_...@us...> - 2003-11-23 10:23:18
|
Update of /cvsroot/htoolkit/port/src/Port In directory sc8-pr-cvs1:/tmp/cvs-serv3738/src/Port Modified Files: Controls.hs Handlers.hs Log Message: Add implementation for TrackBar control Index: Controls.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/Controls.hs,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Controls.hs 12 Oct 2003 21:33:46 -0000 1.26 --- Controls.hs 23 Nov 2003 10:23:13 -0000 1.27 *************** *** 1,3 **** ! {-# OPTIONS -fglasgow-exts -#include Button.h -#include CheckBox.h -#include EditBox.h -#include Label.h -#include ListBox.h -#include PopUp.h -#include RadioBox.h -#include Window.h -#include ProgressBar.h -#include Slider.h -#include Notebook.h -#include GroupBox.h #-} ----------------------------------------------------------------------------------------- {-| Module : Controls --- 1,3 ---- ! {-# OPTIONS -fglasgow-exts -#include Button.h -#include CheckBox.h -#include EditBox.h -#include Label.h -#include ListBox.h -#include PopUp.h -#include RadioBox.h -#include Window.h -#include ProgressBar.h -#include Slider.h -#include Notebook.h -#include GroupBox.h -#include TrackBar.h #-} ----------------------------------------------------------------------------------------- {-| Module : Controls *************** *** 27,30 **** --- 27,32 ---- * Slider + * TrackBar + * ProgressBar *************** *** 88,91 **** --- 90,95 ---- , getSliderRange, setSliderRange , getSliderPosition, setSliderPosition + -- * TrackBar + , createHorzTrackBar, createVertTrackBar, getTrackBarRequestSize -- * ProgressBar , createHorzProgressBar, createVertProgressBar, getProgressBarRequestSize *************** *** 427,430 **** --- 431,448 ---- return (fromCInt pos) foreign import ccall osGetSliderPosition :: WindowHandle -> IO CInt + + ----------------------------------------------------------------------------------------- + -- TrackBar + ----------------------------------------------------------------------------------------- + + -- | Create a new horizontal track bar control. + foreign import ccall "osCreateHorzTrackBar" createHorzTrackBar :: WindowHandle -> IO WindowHandle + + -- | Create a new vertical track bar control. + foreign import ccall "osCreateVertTrackBar" createVertTrackBar :: WindowHandle -> IO WindowHandle + + getTrackBarRequestSize :: WindowHandle -> IO Size + getTrackBarRequestSize hwnd = withCSizeResult (osGetTrackBarReqSize hwnd) + foreign import ccall osGetTrackBarReqSize :: WindowHandle -> Ptr CInt -> IO () ----------------------------------------------------------------------------------------- Index: Handlers.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/Handlers.hs,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** Handlers.hs 16 Nov 2003 13:25:20 -0000 1.31 --- Handlers.hs 23 Nov 2003 10:23:13 -0000 1.32 *************** *** 53,56 **** --- 53,60 ---- -- * Control commands ,setControlCommandHandler, setControlCommandDefHandler, getControlCommandHandler + + -- * TrackBar Increment\/Decrement events + ,setTrackBarIncrementHandler, setTrackBarIncrementDefHandler, getTrackBarIncrementHandler + ,setTrackBarDecrementHandler, setTrackBarDecrementDefHandler, getTrackBarDecrementHandler -- * Menu events *************** *** 131,134 **** --- 135,140 ---- setWindowActivateDefHandler hwnd setControlCommandDefHandler hwnd + setTrackBarIncrementDefHandler hwnd + setTrackBarDecrementDefHandler hwnd return () *************** *** 274,277 **** --- 280,327 ---- ----------------------------------------------------------------------------------------- + -- TrackBar Increment/Decrement + ----------------------------------------------------------------------------------------- + + {-# NOINLINE handlersTrackBarIncrement #-} + handlersTrackBarIncrement :: MVar (PtrMap WindowHandle (IO ())) + handlersTrackBarIncrement = unsafePerformIO (newMVar empty) + + setTrackBarIncrementHandler :: WindowHandle -> IO () -> IO () + setTrackBarIncrementHandler hwnd handler + = setHandler hwnd handler handlersTrackBarIncrement + + setTrackBarIncrementDefHandler :: WindowHandle -> IO () + setTrackBarIncrementDefHandler hwnd + = setDefHandler hwnd handlersTrackBarIncrement + + getTrackBarIncrementHandler :: WindowHandle -> IO (IO ()) + getTrackBarIncrementHandler hwnd + = getHandler hwnd (return ()) handlersTrackBarIncrement + + handleTrackBarIncrement :: WindowHandle -> IO () + handleTrackBarIncrement hwnd + = invokeHandler hwnd handlersTrackBarIncrement id + + {-# NOINLINE handlersTrackBarDecrement #-} + handlersTrackBarDecrement :: MVar (PtrMap WindowHandle (IO ())) + handlersTrackBarDecrement = unsafePerformIO (newMVar empty) + + setTrackBarDecrementHandler :: WindowHandle -> IO () -> IO () + setTrackBarDecrementHandler hwnd handler + = setHandler hwnd handler handlersTrackBarDecrement + + setTrackBarDecrementDefHandler :: WindowHandle -> IO () + setTrackBarDecrementDefHandler hwnd + = setDefHandler hwnd handlersTrackBarDecrement + + getTrackBarDecrementHandler :: WindowHandle -> IO (IO ()) + getTrackBarDecrementHandler hwnd + = getHandler hwnd (return ()) handlersTrackBarDecrement + + handleTrackBarDecrement :: WindowHandle -> IO () + handleTrackBarDecrement hwnd + = invokeHandler hwnd handlersTrackBarDecrement id + + ----------------------------------------------------------------------------------------- -- WindowDeactivate ----------------------------------------------------------------------------------------- *************** *** 829,832 **** --- 879,884 ---- foreign export ccall handleWindowContextMenu :: WindowHandle -> CInt -> CInt -> CWord -> IO () foreign export ccall handleControlCommand :: WindowHandle -> IO () + foreign export ccall handleTrackBarIncrement :: WindowHandle -> IO () + foreign export ccall handleTrackBarDecrement :: WindowHandle -> IO () foreign export ccall handleMenuCommand :: MenuHandle -> IO () foreign export ccall handleMenuUpdate :: MenuHandle -> IO () |
From: <kr_...@us...> - 2003-11-23 10:23:18
|
Update of /cvsroot/htoolkit/port/src/include In directory sc8-pr-cvs1:/tmp/cvs-serv3738/src/include Modified Files: HsPort.h Added Files: TrackBar.h Log Message: Add implementation for TrackBar control --- NEW FILE: TrackBar.h --- #ifndef UPDOWN_H #define UPDOWN_H #include "Types.h" WindowHandle osCreateHorzTrackBar(WindowHandle form); WindowHandle osCreateVertTrackBar(WindowHandle form); void osGetTrackBarReqSize(WindowHandle trackBar, int *res); #endif Index: HsPort.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/include/HsPort.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** HsPort.h 15 Nov 2003 10:31:50 -0000 1.9 --- HsPort.h 23 Nov 2003 10:23:14 -0000 1.10 *************** *** 13,16 **** --- 13,17 ---- #include "port/ProgressBar.h" #include "port/Slider.h" + #include "port/TrackBar.h" #include "port/Menu.h" #include "port/ToolBar.h" |
From: <kr_...@us...> - 2003-11-23 10:23:17
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK In directory sc8-pr-cvs1:/tmp/cvs-serv3738/src/cbits/GTK Added Files: TrackBar.c Log Message: Add implementation for TrackBar control --- NEW FILE: TrackBar.c --- #include "TrackBar.h" #include "Internals.h" #include "Handlers_stub.h" WindowHandle osCreateHorzTrackBar(WindowHandle form) { GtkWidget *trackBar; GtkWidget *left_button, *right_button; left_button = gtk_button_new(); gtk_signal_connect (GTK_OBJECT(left_button), "clicked", GTK_SIGNAL_FUNC(handleTrackBarIncrement), NULL); gtk_container_add(GTK_CONTAINER(left_button), gtk_arrow_new(GTK_ARROW_LEFT,GTK_SHADOW_NONE)); gtk_widget_show_all(left_button); right_button = gtk_button_new(); gtk_signal_connect (GTK_OBJECT(right_button), "clicked", GTK_SIGNAL_FUNC(handleTrackBarDecrement), NULL); gtk_container_add(GTK_CONTAINER(right_button), gtk_arrow_new(GTK_ARROW_RIGHT,GTK_SHADOW_NONE)); gtk_widget_show_all(right_button); trackBar = gtk_hbox_new(TRUE, 0); gtk_box_pack_start(GTK_BOX(trackBar),left_button ,TRUE,TRUE,0); gtk_box_pack_end (GTK_BOX(trackBar),right_button,TRUE,TRUE,0); return trackBar; }; WindowHandle osCreateVertTrackBar(WindowHandle form) { GtkWidget *trackBar; GtkWidget *up_button, *down_button; up_button = gtk_button_new(); gtk_signal_connect (GTK_OBJECT(up_button), "clicked", GTK_SIGNAL_FUNC(handleTrackBarIncrement), NULL); gtk_container_add(GTK_CONTAINER(up_button), gtk_arrow_new(GTK_ARROW_UP,GTK_SHADOW_NONE)); gtk_widget_show_all(up_button); down_button = gtk_button_new(); gtk_signal_connect (GTK_OBJECT(down_button), "clicked", GTK_SIGNAL_FUNC(handleTrackBarDecrement), NULL); gtk_container_add(GTK_CONTAINER(down_button), gtk_arrow_new(GTK_ARROW_DOWN,GTK_SHADOW_NONE)); gtk_widget_show_all(down_button); trackBar = gtk_vbox_new(TRUE, 0); gtk_box_pack_start(GTK_BOX(trackBar),up_button, TRUE,TRUE,0); gtk_box_pack_end (GTK_BOX(trackBar),down_button,TRUE,TRUE,0); return trackBar; }; void osGetTrackBarReqSize(WindowHandle trackBar, int *res) { GtkRequisition requisition; gtk_widget_size_request(button, &requisition); res[0] = requisition.width; res[1] = requisition.height; } |
From: <kr_...@us...> - 2003-11-23 10:23:17
|
Update of /cvsroot/htoolkit/port In directory sc8-pr-cvs1:/tmp/cvs-serv3738 Modified Files: makefile Log Message: Add implementation for TrackBar control Index: makefile =================================================================== RCS file: /cvsroot/htoolkit/port/makefile,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** makefile 14 Nov 2003 22:35:20 -0000 1.43 --- makefile 23 Nov 2003 10:23:13 -0000 1.44 *************** *** 48,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 ConfigKey.c \ ! ToolBar.c StatusBar.c Notebook.c GroupBox.c ifeq "$(GUILIB)" "WIN32" --- 48,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 TrackBar.c ProgressBar.c \ ! ConfigKey.c ToolBar.c StatusBar.c Notebook.c GroupBox.c ifeq "$(GUILIB)" "WIN32" |
From: <kr_...@us...> - 2003-11-22 12:22:21
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK In directory sc8-pr-cvs1:/tmp/cvs-serv8851/src/cbits/GTK Modified Files: StatusBar.c Log Message: osGetStatusBarIndicatorsCount and osGetIndicatorPos functions for GNOME Index: StatusBar.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/StatusBar.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** StatusBar.c 16 Nov 2003 13:25:20 -0000 1.4 --- StatusBar.c 22 Nov 2003 12:21:37 -0000 1.5 *************** *** 37,40 **** --- 37,52 ---- } + int osGetStatusBarIndicatorsCount() + { + int count; + GList *children; + + children = gtk_container_get_children(GTK_CONTAINER(GNOME_APP(gFrameWidget)->statusbar)); + count = g_list_length(children); + g_list_free (children); + + return count-1; + } + static void calc_pack_end_count(GtkWidget *child, gpointer data) { *************** *** 113,115 **** --- 125,147 ---- { gtk_label_set_text(GTK_LABEL(GTK_BIN(GTK_BIN(indicator)->child)->child), title); + } + + int osGetIndicatorPos(IndicatorHandle indicator) + { + int pos; + GList *children; + + pos = 0; + for (children = gtk_container_get_children(GTK_CONTAINER(GNOME_APP(gFrameWidget)->statusbar)); + children != NULL; + children = g_list_delete_link(children, children)) + { + if ((IndicatorHandle) children->data == indicator) + break; + pos++; + } + + g_list_free (children); + + return pos-1; } |
From: <kr_...@us...> - 2003-11-22 10:50:44
|
Update of /cvsroot/htoolkit/gio/src/examples/simple In directory sc8-pr-cvs1:/tmp/cvs-serv30817/src/examples/simple Modified Files: SimpleMenu.hs Log Message: Updated example Index: SimpleMenu.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/examples/simple/SimpleMenu.hs,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** SimpleMenu.hs 15 Nov 2003 10:53:23 -0000 1.12 --- SimpleMenu.hs 22 Nov 2003 10:50:41 -0000 1.13 *************** *** 11,14 **** --- 11,19 ---- bmpOpen <- readBitmap "res/open.bmp" [] bmpSave <- readBitmap "res/save.bmp" [] + + set sb [visible =: True] + indicator [title =: "Click Me", on command =: messageAlert "CLICK!"] sb + icolor <- indicator [title =: "NONE"] sb + itrans <- indicator [title =: "NORM"] sb fm <- menu [title =: "&File"] mainMenu *************** *** 45,69 **** , tooltip =: "Set transparency on/off" , accel =: KeyChar '\^T' ! , on command =:: onToggleTransparent ] mColor menuline mColor mRed <- menuRadioItem [ title =: "&Red" , tooltip =: "Select red color" ! , on command =: messageAlert "RED COLOR" ] mColor mGreen <- menuRadioItem [ title =: "&Green" , tooltip =: "Select green color" ! , on command =: messageAlert "GREEN COLOR" ] mColor mBlue <- menuRadioItem [ title =: "&Blue" , tooltip =: "Select blue color" ! , on command =: messageAlert "BLUE COLOR" ] mColor setMenuRadioGroup [mRed, mGreen, mBlue] - - set sb [visible =: True] where ! onToggleTransparent tgl = do chk <- get tgl checked ! messageAlert (if chk then "TRANSPARENT ON" else "TRANSPARENT OFF") --- 50,72 ---- , tooltip =: "Set transparency on/off" , accel =: KeyChar '\^T' ! , on command =:: onToggleTransparent itrans ] mColor menuline mColor mRed <- menuRadioItem [ title =: "&Red" , tooltip =: "Select red color" ! , on command =: set icolor [title =: "RED"] ] mColor mGreen <- menuRadioItem [ title =: "&Green" , tooltip =: "Select green color" ! , on command =: set icolor [title =: "GREEN"] ] mColor mBlue <- menuRadioItem [ title =: "&Blue" , tooltip =: "Select blue color" ! , on command =: set icolor [title =: "BLUE"] ] mColor setMenuRadioGroup [mRed, mGreen, mBlue] where ! onToggleTransparent itrans tgl = do chk <- get tgl checked ! set itrans [title =: (if chk then "TRANSPARENT" else "NORM")] |
From: <kr_...@us...> - 2003-11-22 09:38:06
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO In directory sc8-pr-cvs1:/tmp/cvs-serv22710/gio/src/Graphics/UI/GIO Modified Files: StatusBar.hs Log Message: Add support for StatusBar(count) and Indicator(pos) attributes Index: StatusBar.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/StatusBar.hs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** StatusBar.hs 16 Nov 2003 13:26:55 -0000 1.3 --- StatusBar.hs 22 Nov 2003 09:38:03 -0000 1.4 *************** *** 40,43 **** --- 40,47 ---- instance Titled StatusBar where title = newAttr (\sb -> Lib.getStatusBarTitle) (\sb -> Lib.setStatusBarTitle) + + instance Countable StatusBar where + count = readAttr "count" (\sb -> Lib.getStatusBarIndicatorsCount) + -- | Push a new status message onto the status bar stack and display it. *************** *** 88,89 **** --- 92,96 ---- destroyWidget m = Lib.destroyIndicator (hindicator m) destroy = newStdEvent hindicator Lib.getIndicatorDestroyHandler Lib.setIndicatorDestroyHandler Lib.setIndicatorDestroyDefHandler + + instance Positioned Indicator where + pos = readAttr "pos" (Lib.getIndicatorPos . hindicator) |
From: <kr_...@us...> - 2003-11-22 09:35:46
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv22477/port/src/cbits/Win32 Modified Files: StatusBar.c Log Message: Add support for StatusBar(count) and Indicator(pos) attributes Index: StatusBar.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/StatusBar.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** StatusBar.c 18 Nov 2003 18:03:41 -0000 1.4 --- StatusBar.c 22 Nov 2003 09:35:42 -0000 1.5 *************** *** 61,64 **** --- 61,81 ---- }; + int osGetStatusBarIndicatorsCount() + { + int count; + FrameData *pData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); + IndicatorHandle indicator; + + count = 0; + indicator = pData->first_indicator; + while (indicator) + { + indicator = indicator->next; + count++; + } + + return count; + }; + void RefreshStatusBarIndicators() { *************** *** 211,213 **** --- 228,241 ---- RefreshStatusBarIndicators(); + } + + int osGetIndicatorPos(IndicatorHandle indicator) + { + int pos; + + pos = 0; + while ((indicator = indicator->prev) != NULL) + pos++; + + return pos; } |
From: <kr_...@us...> - 2003-11-22 09:35:46
|
Update of /cvsroot/htoolkit/port/src/include In directory sc8-pr-cvs1:/tmp/cvs-serv22477/port/src/include Modified Files: StatusBar.h Log Message: Add support for StatusBar(count) and Indicator(pos) attributes Index: StatusBar.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/include/StatusBar.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** StatusBar.h 16 Nov 2003 13:25:21 -0000 1.4 --- StatusBar.h 22 Nov 2003 09:35:42 -0000 1.5 *************** *** 13,16 **** --- 13,17 ---- void osSetStatusBarTitle(char *title); + int osGetStatusBarIndicatorsCount(); IndicatorHandle osCreateIndicator(int index); *************** *** 18,21 **** --- 19,23 ---- char *osGetIndicatorTitle(IndicatorHandle indicator); void osSetIndicatorTitle(IndicatorHandle indicator, char *title); + int osGetIndicatorPos(IndicatorHandle indicator); #endif |
From: <kr_...@us...> - 2003-11-22 09:35:45
|
Update of /cvsroot/htoolkit/port/src/Port In directory sc8-pr-cvs1:/tmp/cvs-serv22477/port/src/Port Modified Files: StatusBar.hs Log Message: Add support for StatusBar(count) and Indicator(pos) attributes Index: StatusBar.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/StatusBar.hs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** StatusBar.hs 16 Nov 2003 13:25:20 -0000 1.5 --- StatusBar.hs 22 Nov 2003 09:35:42 -0000 1.6 *************** *** 19,22 **** --- 19,23 ---- setStatusBarVisible, getStatusBarVisible , setStatusBarTitle, getStatusBarTitle + , getStatusBarIndicatorsCount , pushStatusBarContext, popStatusBarContext *************** *** 25,28 **** --- 26,30 ---- , destroyIndicator , setIndicatorTitle, getIndicatorTitle + , getIndicatorPos ) where *************** *** 46,49 **** --- 48,53 ---- foreign import ccall osGetStatusBarTitle :: IO CString + foreign import ccall "osGetStatusBarIndicatorsCount" getStatusBarIndicatorsCount :: IO Int + -- | Push a new status message onto the status bar stack and display it. pushStatusBarContext :: String -> IO () *************** *** 73,74 **** --- 77,80 ---- setIndicatorTitle hwnd title = withCString title (osSetIndicatorTitle hwnd) foreign import ccall osSetIndicatorTitle :: IndicatorHandle -> CString -> IO () + + foreign import ccall "osGetIndicatorPos" getIndicatorPos :: IndicatorHandle -> IO Int |
From: <kr_...@us...> - 2003-11-18 18:03:44
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv26058/src/cbits/Win32 Modified Files: Frame.c Internals.h StatusBar.c Log Message: Complete implementation for StatusBar indicators under Windows Index: Frame.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Frame.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Frame.c 16 Nov 2003 09:24:02 -0000 1.21 --- Frame.c 18 Nov 2003 18:03:41 -0000 1.22 *************** *** 48,51 **** --- 48,67 ---- free(context); } + + while (pData->first_indicator) + { + IndicatorHandle indicator; + + indicator = pData->first_indicator; + handleIndicatorDestroy(indicator); + pData->first_indicator = pData->first_indicator->next; + + if (pData->first_indicator) + pData->first_indicator->prev = NULL; + + free(indicator->title); + free(indicator); + } + pData->last_indicator = NULL; free(pData); *************** *** 118,122 **** (HANDLE) ghModule, NULL); ! pData->statusContexts = NULL; SetWindowLong(hWnd,GWL_USERDATA,(LONG) pData); --- 134,140 ---- (HANDLE) ghModule, NULL); ! pData->statusContexts = NULL; ! pData->first_indicator = NULL; ! pData->last_indicator = NULL; SetWindowLong(hWnd,GWL_USERDATA,(LONG) pData); *************** *** 125,128 **** --- 143,147 ---- case WM_SIZE: RelayoutFrameBars(); + RefreshStatusBarIndicators(); break; case WM_COMMAND: *************** *** 373,376 **** --- 392,416 ---- case WM_EXITMENULOOP: osPopStatusBarContext(); + break; + case WM_NOTIFY: + { + int i; + IndicatorHandle indicator; + LPNMMOUSE lpnm = (LPNMMOUSE) lParam; + + if (lpnm->hdr.code == NM_DBLCLK && lpnm->dwItemSpec > 0) + { + i = lpnm->dwItemSpec-1; + indicator = pData->first_indicator; + while (i > 0 && indicator != NULL) + { + indicator = indicator->next; + i--; + } + + if (indicator) + handleIndicatorCommand(indicator); + } + } break; } Index: Internals.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Internals.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Internals.h 15 Nov 2003 10:31:49 -0000 1.14 --- Internals.h 18 Nov 2003 18:03:41 -0000 1.15 *************** *** 52,55 **** --- 52,65 ---- #endif + #ifndef NMMOUSE + typedef struct tagNMMOUSE { + NMHDR hdr; + DWORD_PTR dwItemSpec; + DWORD_PTR dwItemData; + POINT pt; + LPARAM dwHitInfo; // any specifics about where on the item or control the mouse is + } NMMOUSE, FAR* LPNMMOUSE; + #endif + extern HMODULE ghModule; extern HWND ghWndFrame; *************** *** 78,81 **** --- 88,92 ---- HWND hStatusBar; StatusContext statusContexts; + IndicatorHandle first_indicator, last_indicator; } FrameData; *************** *** 107,110 **** --- 118,123 ---- void osForceContainerReLayout(HWND hCtrl); + + void RefreshStatusBarIndicators(); #endif Index: StatusBar.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/StatusBar.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** StatusBar.c 16 Nov 2003 09:02:00 -0000 1.3 --- StatusBar.c 18 Nov 2003 18:03:41 -0000 1.4 *************** *** 2,5 **** --- 2,6 ---- #include "DockBar.h" #include "Internals.h" + #include "Handlers_stub.h" void osSetStatusBarVisible(BOOL visible) *************** *** 59,60 **** --- 60,213 ---- SetWindowText(pData->hStatusBar, title); }; + + void RefreshStatusBarIndicators() + { + int i, x, count, *buffer; + FrameData *pData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); + IndicatorHandle indicator; + HDC hDC; + HFONT hFont; + RECT rect; + + GetClientRect(pData->hStatusBar, &rect); + + // get the actual count of indicators + count = 0; + indicator = pData->first_indicator; + while (indicator) + { + indicator = indicator->next; + count++; + } + + // allocate the "parts" buffer required from SB_SETPARTS message + buffer = rmalloc((count+1)*sizeof(int)); + + // get the device context and the font for the status bar + hDC = GetDC(pData->hStatusBar); + hFont = (HFONT) SendMessage(pData->hStatusBar,WM_GETFONT,0,0); + if (hFont) + SelectObject(hDC, hFont); + + // populate the "parts" buffer + i = count+1; + x = rect.right-rect.left-GetSystemMetrics(SM_CXVSCROLL); + indicator = pData->last_indicator; + while (indicator) + { + SIZE sz; + + buffer[--i] = x; + + sz.cx = 0; + sz.cy = 0; + if (indicator->title) + GetTextExtentPoint32(hDC, indicator->title, strlen(indicator->title), &sz); + x -= sz.cx+5; + + indicator = indicator->prev; + } + buffer[0] = x; + + // set parts + SendMessage(pData->hStatusBar, SB_SETPARTS, count+1, (LPARAM) buffer); + + // refresh the part titles + i = 1; + indicator = pData->first_indicator; + while (indicator) + { + if (indicator->title) + SendMessage(pData->hStatusBar, SB_SETTEXT, i, (LPARAM) indicator->title); + + indicator = indicator->next; + i++; + } + + // release the device context + ReleaseDC(pData->hStatusBar, hDC); + + // free parts buffer + free(buffer); + } + + IndicatorHandle osCreateIndicator(int index) + { + IndicatorHandle indicator, *link, last; + FrameData *pData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); + + indicator = rmalloc(sizeof(struct IndicatorHandle)); + indicator->title = NULL; + + if (index >= 0) + { + last = NULL; + link = &pData->first_indicator; + + while (index > 0 && *link != NULL) + { + last = *link; + link = &last->next; + index--; + } + } + else + { + if (pData->last_indicator) + { + last = pData->last_indicator; + link = &pData->last_indicator->next; + } + else + { + last = NULL; + link = &pData->first_indicator; + } + } + + indicator->next = *link; + indicator->prev = last; + if (*link) (*link)->prev = indicator; + *link = indicator; + + if (last == pData->last_indicator) + pData->last_indicator = indicator; + + RefreshStatusBarIndicators(); + + return indicator; + } + + void osDestroyIndicator(IndicatorHandle indicator) + { + FrameData *pData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); + + handleIndicatorDestroy(indicator); + + if (indicator->next) indicator->next->prev = indicator->prev; + if (indicator->prev) indicator->prev->next = indicator->next; + + if (indicator == pData->first_indicator) + pData->first_indicator = indicator->next; + if (indicator == pData->last_indicator) + pData->last_indicator = indicator->prev; + + free(indicator->title); + free(indicator); + + RefreshStatusBarIndicators(); + } + + char *osGetIndicatorTitle(IndicatorHandle indicator) + { + return strdup(indicator->title); + } + + void osSetIndicatorTitle(IndicatorHandle indicator, char *title) + { + if (indicator->title) + free(indicator->title); + indicator->title = strdup(title); + + RefreshStatusBarIndicators(); + } |
From: <kr_...@us...> - 2003-11-18 18:03:44
|
Update of /cvsroot/htoolkit/port/src/include In directory sc8-pr-cvs1:/tmp/cvs-serv26058/src/include Modified Files: Types.h Log Message: Complete implementation for StatusBar indicators under Windows Index: Types.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/include/Types.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Types.h 16 Nov 2003 13:25:21 -0000 1.19 --- Types.h 18 Nov 2003 18:03:41 -0000 1.20 *************** *** 48,51 **** --- 48,58 ---- typedef struct ToolHandle *ToolHandle; + typedef struct IndicatorHandle + { + struct IndicatorHandle *next; + struct IndicatorHandle *prev; + char *title; + } *IndicatorHandle; + typedef struct { |
From: <kr_...@us...> - 2003-11-16 13:27:35
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO In directory sc8-pr-cvs1:/tmp/cvs-serv14763/src/Graphics/UI/GIO Modified Files: StatusBar.hs Types.hs Log Message: Added support for status bar indicators (Linux only). Index: StatusBar.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/StatusBar.hs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** StatusBar.hs 16 Nov 2003 09:02:35 -0000 1.2 --- StatusBar.hs 16 Nov 2003 13:26:55 -0000 1.3 *************** *** 7,20 **** Stability : provisional Portability : portable ! Defines an API for status bar creation. A status bar is a horizontal band at the bottom of an application window ! in which the application can display various kinds of status information. -} ----------------------------------------------------------------------------------------- module Graphics.UI.GIO.StatusBar ! ( StatusBar, sb , pushStatusBarContext, popStatusBarContext, withStatus ) where --- 7,25 ---- Stability : provisional Portability : portable ! Defines an API for status bar creation. A status bar is a horizontal band at the bottom of an application window ! in which the application can display various kinds of status information. -} ----------------------------------------------------------------------------------------- module Graphics.UI.GIO.StatusBar ! ( -- * StatusBar ! StatusBar, sb , pushStatusBarContext, popStatusBarContext, withStatus + + -- * Indicator + , Indicator + , indicatorAt, indicator ) where *************** *** 22,25 **** --- 27,31 ---- import Graphics.UI.GIO.Types import Graphics.UI.GIO.Attributes + import Graphics.UI.GIO.Events import Control.Exception(bracket_) *************** *** 31,35 **** instance Visible StatusBar where visible = newAttr (\sb -> Lib.getStatusBarVisible) (\sb -> Lib.setStatusBarVisible) ! instance Titled StatusBar where title = newAttr (\sb -> Lib.getStatusBarTitle) (\sb -> Lib.setStatusBarTitle) --- 37,41 ---- instance Visible StatusBar where visible = newAttr (\sb -> Lib.getStatusBarVisible) (\sb -> Lib.setStatusBarVisible) ! instance Titled StatusBar where title = newAttr (\sb -> Lib.getStatusBarTitle) (\sb -> Lib.setStatusBarTitle) *************** *** 44,47 **** --- 50,54 ---- popStatusBarContext sb = Lib.popStatusBarContext + -- | Push a new status message onto the status bar stack and display it. withStatus :: StatusBar -> String -> IO a -> IO a withStatus sb title action = *************** *** 50,51 **** --- 57,89 ---- (popStatusBarContext sb) action + + + -------------------------------------------------------------------- + -- Status bar indicators + -------------------------------------------------------------------- + + newtype Indicator = Indicator IndicatorHandle + hindicator (Indicator h) = h + + indicatorAt :: Maybe Int -- ^ The position where to place the indicator or Nothing if you want to append it. + -> [Prop Indicator] -- ^ The setup of the indicator attributes + -> StatusBar -- ^ The statusbar (i.e. 'sb') + -> IO Indicator -- ^ The created indicator + indicatorAt pos props sb + = do ind <- do hindicator <- Lib.createIndicator pos + return (Indicator hindicator) + set ind props + return ind + + indicator :: [Prop Indicator] -> StatusBar -> IO Indicator + indicator = indicatorAt Nothing + + instance Titled Indicator where + title = newStdAttr hindicator Lib.getIndicatorTitle Lib.setIndicatorTitle + + instance Commanding Indicator where + command = newStdEvent hindicator Lib.getIndicatorCommandHandler Lib.setIndicatorCommandHandler Lib.setIndicatorCommandDefHandler + + instance Deadly Indicator where + destroyWidget m = Lib.destroyIndicator (hindicator m) + destroy = newStdEvent hindicator Lib.getIndicatorDestroyHandler Lib.setIndicatorDestroyHandler Lib.setIndicatorDestroyDefHandler Index: Types.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Types.hs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Types.hs 24 Aug 2003 19:02:45 -0000 1.17 --- Types.hs 16 Nov 2003 13:26:55 -0000 1.18 *************** *** 108,111 **** --- 108,112 ---- , MenuHandle , ToolHandle + , IndicatorHandle , FontHandle , BitmapHandle |
From: <kr_...@us...> - 2003-11-16 13:26:02
|
Update of /cvsroot/htoolkit/port/src/Port In directory sc8-pr-cvs1:/tmp/cvs-serv14422/src/Port Modified Files: Handlers.hs StatusBar.hs Types.hs Log Message: Added support for status bar indicators. (Linux only) Index: Handlers.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/Handlers.hs,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** Handlers.hs 12 Oct 2003 21:33:46 -0000 1.30 --- Handlers.hs 16 Nov 2003 13:25:20 -0000 1.31 *************** *** 18,22 **** -} ----------------------------------------------------------------------------------------- ! module Graphics.UI.Port.Handlers ( -- * Clean up --- 18,22 ---- -} ----------------------------------------------------------------------------------------- ! module Graphics.UI.Port.Handlers ( -- * Clean up *************** *** 63,66 **** --- 63,70 ---- ,setToolDestroyHandler, setToolDestroyDefHandler, getToolDestroyHandler + -- * Indicator events + ,setIndicatorCommandHandler, setIndicatorCommandDefHandler, getIndicatorCommandHandler + ,setIndicatorDestroyHandler, setIndicatorDestroyDefHandler, getIndicatorDestroyHandler + -- ** Internals ,toolBitmaps, menuBitmaps, windowBitmaps *************** *** 749,752 **** --- 753,817 ---- Just io -> safeio io + ----------------------------------------------------------------------------------------- + -- IndicatorCommand + ----------------------------------------------------------------------------------------- + + {-# NOINLINE handlersIndicatorCommand #-} + handlersIndicatorCommand :: MVar (PtrMap IndicatorHandle (IO ())) + handlersIndicatorCommand + = unsafePerformIO (newMVar empty) + + handleIndicatorCommand :: IndicatorHandle -> IO () + handleIndicatorCommand hindicator + = invokeHandler hindicator handlersIndicatorCommand id + + setIndicatorCommandHandler :: IndicatorHandle -> IO () -> IO () + setIndicatorCommandHandler hindicator handler + = setHandler hindicator handler handlersIndicatorCommand + + setIndicatorCommandDefHandler :: IndicatorHandle -> IO () + setIndicatorCommandDefHandler hindicator + = setDefHandler hindicator handlersIndicatorCommand + + getIndicatorCommandHandler :: IndicatorHandle -> IO (IO ()) + getIndicatorCommandHandler hindicator + = getHandler hindicator (return ()) handlersIndicatorCommand + + ----------------------------------------------------------------------------------------- + -- IndicatorDestroy + ----------------------------------------------------------------------------------------- + + {-# NOINLINE indicatorBitmaps #-} + indicatorBitmaps :: MVar (PtrMap IndicatorHandle Bitmap) + indicatorBitmaps = unsafePerformIO (newMVar empty) + + {-# NOINLINE handlersIndicatorDestroy #-} + handlersIndicatorDestroy :: MVar (PtrMap IndicatorHandle (IO ())) + handlersIndicatorDestroy + = unsafePerformIO (newMVar empty) + + setIndicatorDestroyHandler :: IndicatorHandle -> IO () -> IO () + setIndicatorDestroyHandler hindicator handler + = setHandler hindicator handler handlersIndicatorDestroy + + setIndicatorDestroyDefHandler :: IndicatorHandle -> IO () + setIndicatorDestroyDefHandler hindicator + = setDefHandler hindicator handlersIndicatorDestroy + + getIndicatorDestroyHandler :: IndicatorHandle -> IO (IO ()) + getIndicatorDestroyHandler hindicator + = getHandler hindicator (return ()) handlersIndicatorDestroy + + handleIndicatorDestroy :: IndicatorHandle -> IO () + handleIndicatorDestroy hindicator + = do map <- takeMVar handlersIndicatorDestroy + bmps <- takeMVar indicatorBitmaps + putMVar indicatorBitmaps (delete hindicator bmps) + setIndicatorCommandDefHandler hindicator + putMVar handlersIndicatorDestroy (delete hindicator map) + case lookup hindicator map of + Nothing -> return () + Just io -> safeio io + {----------------------------------------------------------------------------------------- foreign exports *************** *** 772,774 **** foreign export ccall handleProcessDestroy :: IO () foreign export ccall handleToolCommand :: ToolHandle -> IO () ! foreign export ccall handleToolDestroy :: ToolHandle -> IO () \ No newline at end of file --- 837,841 ---- foreign export ccall handleProcessDestroy :: IO () foreign export ccall handleToolCommand :: ToolHandle -> IO () ! foreign export ccall handleToolDestroy :: ToolHandle -> IO () ! foreign export ccall handleIndicatorCommand :: IndicatorHandle -> IO () ! foreign export ccall handleIndicatorDestroy :: IndicatorHandle -> IO () Index: StatusBar.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/StatusBar.hs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** StatusBar.hs 16 Nov 2003 09:01:58 -0000 1.4 --- StatusBar.hs 16 Nov 2003 13:25:20 -0000 1.5 *************** *** 8,26 **** Stability : provisional Portability : portable ! Defines an API for status bar creation. A status bar is a horizontal band at the bottom of an application window ! in which the application can display various kinds of status information. -} ----------------------------------------------------------------------------------------- module Graphics.UI.Port.StatusBar ! ( setStatusBarVisible, getStatusBarVisible ! , setStatusBarTitle, getStatusBarTitle , pushStatusBarContext, popStatusBarContext ) where import Foreign import Foreign.C import Graphics.UI.Port.Types --- 8,33 ---- Stability : provisional Portability : portable ! Defines an API for status bar creation. A status bar is a horizontal band at the bottom of an application window ! in which the application can display various kinds of status information. -} ----------------------------------------------------------------------------------------- module Graphics.UI.Port.StatusBar ! ( -- * StatusBar ! setStatusBarVisible, getStatusBarVisible ! , setStatusBarTitle, getStatusBarTitle , pushStatusBarContext, popStatusBarContext + + -- * Indicator + , createIndicator + , destroyIndicator + , setIndicatorTitle, getIndicatorTitle ) where import Foreign import Foreign.C + import Data.Maybe( fromMaybe ) import Graphics.UI.Port.Types *************** *** 47,48 **** --- 54,74 ---- -- message, if any. It is fine to call this with an empty stack. foreign import ccall "osPopStatusBarContext" popStatusBarContext :: IO () + + + -------------------------------------------------------------------- + -- Status bar indicators + -------------------------------------------------------------------- + + createIndicator :: Maybe Int -> IO IndicatorHandle + createIndicator pos = osCreateIndicator (fromMaybe (-1) pos) + foreign import ccall osCreateIndicator :: Int -> IO IndicatorHandle + + foreign import ccall "osDestroyIndicator" destroyIndicator :: IndicatorHandle -> IO () + + getIndicatorTitle :: IndicatorHandle -> IO String + getIndicatorTitle hwnd = resultCString (osGetIndicatorTitle hwnd) + foreign import ccall osGetIndicatorTitle :: IndicatorHandle -> IO CString + + setIndicatorTitle :: IndicatorHandle -> String -> IO () + setIndicatorTitle hwnd title = withCString title (osSetIndicatorTitle hwnd) + foreign import ccall osSetIndicatorTitle :: IndicatorHandle -> CString -> IO () Index: Types.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/Types.hs,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** Types.hs 25 Aug 2003 20:41:08 -0000 1.33 --- Types.hs 16 Nov 2003 13:25:20 -0000 1.34 *************** *** 82,86 **** , BitmapHandle , TimerHandle ! , ToolHandle , nullHandle --- 82,87 ---- , BitmapHandle , TimerHandle ! , ToolHandle ! , IndicatorHandle , nullHandle *************** *** 109,113 **** , toCPositionType, fromCPositionType ! , fromCInt, toCInt , CWord, fromCWord, toCWord , CBool, fromCBool, toCBool --- 110,114 ---- , toCPositionType, fromCPositionType ! , fromCInt, toCInt , CWord, fromCWord, toCWord , CBool, fromCBool, toCBool *************** *** 153,156 **** --- 154,161 ---- type ToolHandle = Ptr TLH data TLH = TLH + + -- | Abstract handle to a indicator in the status bar + type IndicatorHandle = Ptr IH + data IH = IH -- | A null handle. Use with care. |
From: <kr_...@us...> - 2003-11-16 13:26:02
|
Update of /cvsroot/htoolkit/port/src/include In directory sc8-pr-cvs1:/tmp/cvs-serv14422/src/include Modified Files: StatusBar.h Types.h Log Message: Added support for status bar indicators. (Linux only) Index: StatusBar.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/include/StatusBar.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** StatusBar.h 16 Nov 2003 09:02:00 -0000 1.3 --- StatusBar.h 16 Nov 2003 13:25:21 -0000 1.4 *************** *** 13,15 **** --- 13,21 ---- void osSetStatusBarTitle(char *title); + + IndicatorHandle osCreateIndicator(int index); + void osDestroyIndicator(IndicatorHandle indicator); + char *osGetIndicatorTitle(IndicatorHandle indicator); + void osSetIndicatorTitle(IndicatorHandle indicator, char *title); + #endif Index: Types.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/include/Types.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Types.h 7 Oct 2003 19:44:10 -0000 1.18 --- Types.h 16 Nov 2003 13:25:21 -0000 1.19 *************** *** 110,113 **** --- 110,115 ---- typedef GtkWidget *ToolHandle; + typedef GtkWidget *IndicatorHandle; + typedef struct { |
From: <kr_...@us...> - 2003-11-16 13:26:00
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK In directory sc8-pr-cvs1:/tmp/cvs-serv14422/src/cbits/GTK Modified Files: StatusBar.c Log Message: Added support for status bar indicators. (Linux only) Index: StatusBar.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/StatusBar.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** StatusBar.c 16 Nov 2003 09:01:59 -0000 1.3 --- StatusBar.c 16 Nov 2003 13:25:20 -0000 1.4 *************** *** 1,4 **** --- 1,5 ---- #include "StatusBar.h" #include "Internals.h" + #include "Handlers_stub.h" void osSetStatusBarVisible(BOOL visible) *************** *** 34,36 **** --- 35,115 ---- { gnome_appbar_set_status(GNOME_APPBAR(GNOME_APP(gFrameWidget)->statusbar), title); + } + + static void calc_pack_end_count(GtkWidget *child, gpointer data) + { + gboolean expand; + gboolean fill; + guint padding; + GtkPackType pack_type; + + gtk_box_query_child_packing(GTK_BOX(gtk_widget_get_parent(child)), child, + &expand, &fill, &padding, &pack_type); + + if (pack_type == GTK_PACK_END) + (*((int *) data))++; + } + + static gboolean indicator_button_press_handler(GtkWidget *widget, GdkEventButton *event, gpointer user_data) + { + if (event->type == GDK_2BUTTON_PRESS && event->button == 1) + handleIndicatorCommand((IndicatorHandle) user_data); + + return TRUE; + } + + + IndicatorHandle osCreateIndicator(int index) + { + GtkWidget *label, *frame, *ebox; + + if (index >= 0) + { + int count = 0; + gtk_container_foreach(GTK_CONTAINER(GNOME_APP(gFrameWidget)->statusbar), calc_pack_end_count, &count); + index = count-index; + } + else + index = 0; + + // create the frame for the indicator + frame = gtk_frame_new (NULL); + gtk_frame_set_shadow_type (GTK_FRAME(frame), GTK_SHADOW_IN); + gtk_signal_connect (GTK_OBJECT(frame), "destroy", + GTK_SIGNAL_FUNC(handleIndicatorDestroy), + NULL); + + // create the event box inside the frame + ebox = gtk_event_box_new(); + gtk_widget_set_events (ebox, GDK_BUTTON2_MOTION_MASK); + gtk_signal_connect (GTK_OBJECT(ebox), "button-press-event", + GTK_SIGNAL_FUNC(indicator_button_press_handler), + frame); + gtk_container_add (GTK_CONTAINER(frame), ebox); + + // create the label inside the event box + label = gtk_label_new(""); + gtk_misc_set_alignment (GTK_MISC(label), 0.0, 0.0); + gtk_container_add (GTK_CONTAINER(ebox), label); + + gtk_box_pack_end(GTK_BOX(GNOME_APP(gFrameWidget)->statusbar), frame, FALSE, TRUE, 0); + gtk_box_reorder_child(GTK_BOX(GNOME_APP(gFrameWidget)->statusbar), frame, index); + gtk_widget_show_all(frame); + + return frame; + } + + void osDestroyIndicator(IndicatorHandle indicator) + { + gtk_widget_destroy(indicator); + } + + char *osGetIndicatorTitle(IndicatorHandle indicator) + { + return strdup(gtk_label_get_text(GTK_LABEL(GTK_BIN(GTK_BIN(indicator)->child)->child))); + } + + void osSetIndicatorTitle(IndicatorHandle indicator, char *title) + { + gtk_label_set_text(GTK_LABEL(GTK_BIN(GTK_BIN(indicator)->child)->child), title); } |
From: <kr_...@us...> - 2003-11-16 09:25:03
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO In directory sc8-pr-cvs1:/tmp/cvs-serv13200/src/Graphics/UI/GIO Modified Files: Window.hs Log Message: bugfix Index: Window.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Window.hs,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** Window.hs 15 Nov 2003 10:34:14 -0000 1.32 --- Window.hs 16 Nov 2003 09:24:21 -0000 1.33 *************** *** 11,15 **** -} ----------------------------------------------------------------------------------------- ! module Graphics.UI.GIO.Window (Window, window, dialog, view, visible, runDialog, showWindow, hideWindow) where import qualified Graphics.UI.Port as Lib --- 11,15 ---- -} ----------------------------------------------------------------------------------------- ! module Graphics.UI.GIO.Window (Window, window, dialog, view, runDialog, showWindow, hideWindow) where import qualified Graphics.UI.Port as Lib |
From: <kr_...@us...> - 2003-11-16 09:24:45
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv13131/src/cbits/Win32 Modified Files: Frame.c Log Message: bugfix Index: Frame.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Frame.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Frame.c 15 Nov 2003 10:40:29 -0000 1.20 --- Frame.c 16 Nov 2003 09:24:02 -0000 1.21 *************** *** 369,373 **** break; case WM_ENTERMENULOOP: ! osPushStatusBarContext(); break; case WM_EXITMENULOOP: --- 369,373 ---- break; case WM_ENTERMENULOOP: ! osPushStatusBarContext(""); break; case WM_EXITMENULOOP: |
From: <kr_...@us...> - 2003-11-16 09:03:18
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO In directory sc8-pr-cvs1:/tmp/cvs-serv10600/src/Graphics/UI/GIO Modified Files: StatusBar.hs Log Message: A litle bit simplified push/pop API Index: StatusBar.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/StatusBar.hs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** StatusBar.hs 15 Nov 2003 10:34:14 -0000 1.1 --- StatusBar.hs 16 Nov 2003 09:02:35 -0000 1.2 *************** *** 22,25 **** --- 22,26 ---- import Graphics.UI.GIO.Types import Graphics.UI.GIO.Attributes + import Control.Exception(bracket_) data StatusBar = StatusBar *************** *** 33,48 **** instance Titled StatusBar where title = newAttr (\sb -> Lib.getStatusBarTitle) (\sb -> Lib.setStatusBarTitle) - - pushStatusBarContext :: StatusBar -> IO () - pushStatusBarContext sb = Lib.pushStatusBarContext popStatusBarContext :: StatusBar -> IO () popStatusBarContext sb = Lib.popStatusBarContext withStatus :: StatusBar -> String -> IO a -> IO a ! withStatus sb txt action = do ! pushStatusBarContext sb ! set sb [title =: txt] ! r <- action ! popStatusBarContext sb ! return r --- 34,51 ---- instance Titled StatusBar where title = newAttr (\sb -> Lib.getStatusBarTitle) (\sb -> Lib.setStatusBarTitle) + -- | Push a new status message onto the status bar stack and display it. + pushStatusBarContext :: StatusBar -> String -> IO () + pushStatusBarContext sb title = Lib.pushStatusBarContext title + + -- | Remove current status message, and display previous status + -- message, if any. It is fine to call this with an empty stack. popStatusBarContext :: StatusBar -> IO () popStatusBarContext sb = Lib.popStatusBarContext withStatus :: StatusBar -> String -> IO a -> IO a ! withStatus sb title action = ! bracket_ ! (pushStatusBarContext sb title) ! (popStatusBarContext sb) ! action |
From: <kr_...@us...> - 2003-11-16 09:02:47
|
Update of /cvsroot/htoolkit/port/src/include In directory sc8-pr-cvs1:/tmp/cvs-serv10410/src/include Modified Files: StatusBar.h Log Message: A litle bit simplified push/pop API Index: StatusBar.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/include/StatusBar.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** StatusBar.h 15 Nov 2003 10:31:50 -0000 1.2 --- StatusBar.h 16 Nov 2003 09:02:00 -0000 1.3 *************** *** 7,11 **** BOOL osGetStatusBarVisible(); ! void osPushStatusBarContext(); void osPopStatusBarContext(); --- 7,11 ---- BOOL osGetStatusBarVisible(); ! void osPushStatusBarContext(char *title); void osPopStatusBarContext(); |
From: <kr_...@us...> - 2003-11-16 09:02:42
|
Update of /cvsroot/htoolkit/port/src/Port In directory sc8-pr-cvs1:/tmp/cvs-serv10410/src/Port Modified Files: StatusBar.hs Log Message: A litle bit simplified push/pop API Index: StatusBar.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/StatusBar.hs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** StatusBar.hs 15 Nov 2003 13:33:10 -0000 1.3 --- StatusBar.hs 16 Nov 2003 09:01:58 -0000 1.4 *************** *** 28,41 **** foreign import ccall "osGetStatusBarVisible" getStatusBarVisible :: IO Bool ! -- | Change the title of the status bar. setStatusBarTitle :: String -> IO () setStatusBarTitle title = withCString title osSetStatusBarTitle foreign import ccall osSetStatusBarTitle :: CString -> IO () ! -- | Returns the title of the status bar. getStatusBarTitle :: IO String getStatusBarTitle = resultCString osGetStatusBarTitle foreign import ccall osGetStatusBarTitle :: IO CString ! foreign import ccall "osPushStatusBarContext" pushStatusBarContext :: IO () foreign import ccall "osPopStatusBarContext" popStatusBarContext :: IO () --- 28,48 ---- foreign import ccall "osGetStatusBarVisible" getStatusBarVisible :: IO Bool ! -- | Sets the status title without changing widget state; next call to ! -- 'setStatusBarTitle' or 'pushStatusBarContext' will destroy this permanently. setStatusBarTitle :: String -> IO () setStatusBarTitle title = withCString title osSetStatusBarTitle foreign import ccall osSetStatusBarTitle :: CString -> IO () ! -- | Returns the current title of the status bar. getStatusBarTitle :: IO String getStatusBarTitle = resultCString osGetStatusBarTitle foreign import ccall osGetStatusBarTitle :: IO CString ! -- | Push a new status message onto the status bar stack and display it. ! pushStatusBarContext :: String -> IO () ! pushStatusBarContext title = withCString title osPushStatusBarContext ! foreign import ccall osPushStatusBarContext :: CString -> IO () ! ! -- | Remove current status message, and display previous status ! -- message, if any. It is fine to call this with an empty stack. foreign import ccall "osPopStatusBarContext" popStatusBarContext :: IO () |
From: <kr_...@us...> - 2003-11-16 09:02:41
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK In directory sc8-pr-cvs1:/tmp/cvs-serv10410/src/cbits/GTK Modified Files: StatusBar.c Log Message: A litle bit simplified push/pop API Index: StatusBar.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/StatusBar.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** StatusBar.c 15 Nov 2003 13:33:11 -0000 1.2 --- StatusBar.c 16 Nov 2003 09:01:59 -0000 1.3 *************** *** 15,21 **** } ! void osPushStatusBarContext() { ! gnome_appbar_push(GNOME_APPBAR(GNOME_APP(gFrameWidget)->statusbar), ""); } --- 15,21 ---- } ! void osPushStatusBarContext(char *title) { ! gnome_appbar_push(GNOME_APPBAR(GNOME_APP(gFrameWidget)->statusbar), title); } |
From: <kr_...@us...> - 2003-11-16 09:02:41
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv10410/src/cbits/Win32 Modified Files: StatusBar.c Log Message: A litle bit simplified push/pop API Index: StatusBar.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/StatusBar.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** StatusBar.c 15 Nov 2003 10:31:49 -0000 1.2 --- StatusBar.c 16 Nov 2003 09:02:00 -0000 1.3 *************** *** 16,30 **** } ! void osPushStatusBarContext() { - int nLen; StatusContext context; FrameData *pData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); ! ! nLen = GetWindowTextLength(pData->hStatusBar); ! context = (StatusContext) rmalloc(sizeof(struct StatusContext) + nLen+1); ! GetWindowText(pData->hStatusBar, context->tip, nLen+1); context->next = pData->statusContexts; pData->statusContexts = context; } --- 16,30 ---- } ! void osPushStatusBarContext(char *title) { StatusContext context; FrameData *pData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); ! ! context = (StatusContext) rmalloc(sizeof(struct StatusContext) + strlen(title) + 1); context->next = pData->statusContexts; + strcpy(context->tip, title); pData->statusContexts = context; + + SetWindowText(pData->hStatusBar, title); } *************** *** 33,45 **** StatusContext context; FrameData *pData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); ! context = pData->statusContexts; if (!context) return; ! pData->statusContexts = context->next; ! SetWindowText(pData->hStatusBar, context->tip); ! free(context); } --- 33,45 ---- StatusContext context; FrameData *pData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); ! context = pData->statusContexts; if (!context) return; ! pData->statusContexts = context->next; ! SetWindowText(pData->hStatusBar, context->tip); ! free(context); } *************** *** 57,60 **** { FrameData *pData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); ! SetWindowText(pData->hStatusBar, title); }; --- 57,60 ---- { FrameData *pData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); ! SetWindowText(pData->hStatusBar, title); }; |