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-04-02 21:34:12
|
Update of /cvsroot/htoolkit/gio/src/examples/simple In directory sc8-pr-cvs1:/tmp/cvs-serv16652 Modified Files: Able.hs BouncingBalls.hs ByeDemo.hs Calculator.hs ConfirmQuit.hs Progress.hs SimpleDrawing.hs SimpleHello.hs SimpleMenu.hs SimpleQuitButton.hs Log Message: Update examples after last changes in the GIO Index: Able.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/examples/simple/Able.hs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Able.hs 26 Mar 2003 18:35:42 -0000 1.3 --- Able.hs 2 Apr 2003 21:33:55 -0000 1.4 *************** *** 1,26 **** ! module Main where ! ! import Graphics.UI.GIO ! ! main = start "Able" SDI [] demo ! ! demo = do ! w1 <- window [title =: "Slave", view =: sz 200 100, domain =: sz 200 80] ! ent <- entry [text =: "Test!"] w1 ! btn <- button [text =: "Button"] w1 ! set w1 [layout =: (hfix 80 ent <<< btn)] ! w2 <- window [title =: "Master", view =: sz 200 80, domain =: sz 200 80] ! bctrl <- button [] w2 ! bwnd <- button [] w2 ! set w2 [layout =: (hfill bctrl ^^^ hfill bwnd)] ! enable "Control" bctrl ent ! enable "Window" bwnd w1 ! return () ! where ! enable title b w = do ! set w [enabled =: True] ! set b [text =: "Disable " ++ title, on command =: disable title b w] ! ! disable title b w = do ! set w [enabled =: False] ! set b [text =: "Enable " ++ title, on command =: enable title b w] \ No newline at end of file --- 1,26 ---- ! module Main where ! ! import Graphics.UI.GIO ! ! main = start MDI [title =: "Able"] demo ! ! demo = do ! w1 <- window [title =: "Slave", view =: sz 200 100, domain =: sz 200 80] ! ent <- entry [text =: "Test!"] w1 ! btn <- button [text =: "Button"] w1 ! set w1 [layout =: (hfix 80 ent <<< btn)] ! w2 <- window [title =: "Master", view =: sz 200 80, domain =: sz 200 80] ! bctrl <- button [] w2 ! bwnd <- button [] w2 ! set w2 [layout =: (hfill bctrl ^^^ hfill bwnd)] ! enable "Control" bctrl ent ! enable "Window" bwnd w1 ! return () ! where ! enable title b w = do ! set w [enabled =: True] ! set b [text =: "Disable " ++ title, on command =: disable title b w] ! ! disable title b w = do ! set w [enabled =: False] ! set b [text =: "Enable " ++ title, on command =: enable title b w] Index: BouncingBalls.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/examples/simple/BouncingBalls.hs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BouncingBalls.hs 24 Mar 2003 17:19:51 -0000 1.2 --- BouncingBalls.hs 2 Apr 2003 21:33:55 -0000 1.3 *************** *** 4,13 **** main ! = start SDI balls balls = do vballs <- newVar [] ! w <- window [title =: "Bouncing balls", resizeable =: False, view =: sz maxX maxY] set w [ on paint =: paintBalls vballs , on click =: dropBall w vballs --- 4,13 ---- main ! = start SDI [] balls balls = do vballs <- newVar [] ! w <- window [title =: "Bouncing balls", resizeable =: True, view =: sz maxX maxY] set w [ on paint =: paintBalls vballs , on click =: dropBall w vballs *************** *** 19,23 **** , on (charKey '+') =: set t [interval ~: \i -> max 1 (i `div` 2)] , on (charKey 'p') =: set t [enabled ~: not] - , on clickRight =: \p -> balls ] --- 19,22 ---- *************** *** 41,45 **** paintBalls vballs can updframe updareas ! = do box updframe [color =: lightgrey] can balls <- getVar vballs mapM_ (drawBall can) (map head (filter (not.null) balls)) --- 40,44 ---- paintBalls vballs can updframe updareas ! = do box updframe [color =: lightgray] can balls <- getVar vballs mapM_ (drawBall can) (map head (filter (not.null) balls)) Index: ByeDemo.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/examples/simple/ByeDemo.hs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ByeDemo.hs 24 Mar 2003 17:19:51 -0000 1.3 --- ByeDemo.hs 2 Apr 2003 21:33:55 -0000 1.4 *************** *** 17,21 **** import Graphics.UI.GIO ! main = start SDI demo -- "start" initializes the GUI. demo :: IO () --- 17,21 ---- import Graphics.UI.GIO ! main = start SDI [] demo -- "start" initializes the GUI. demo :: IO () *************** *** 24,31 **** b <- button [text =: "Bye"] w set w [layout =: pad 10 (center l ^^^^ center b)] ! set b [on command =: bye w l b] where -- called on the first click, with the window, label, and button as arguments. ! bye w l b = do set l [text =: "Goodbye"] ! set b [on command =: close w] \ No newline at end of file --- 24,31 ---- b <- button [text =: "Bye"] w set w [layout =: pad 10 (center l ^^^^ center b)] ! set b [on command =: bye l b] where -- called on the first click, with the window, label, and button as arguments. ! bye l b = do set l [text =: "Goodbye"] ! set b [on command =: halt] Index: Calculator.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/examples/simple/Calculator.hs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Calculator.hs 24 Mar 2003 17:19:51 -0000 1.3 --- Calculator.hs 2 Apr 2003 21:33:55 -0000 1.4 *************** *** 6,10 **** main ! = start SDI calculator calculator --- 6,10 ---- main ! = start SDI [] calculator calculator Index: ConfirmQuit.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/examples/simple/ConfirmQuit.hs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ConfirmQuit.hs 24 Mar 2003 17:19:51 -0000 1.2 --- ConfirmQuit.hs 2 Apr 2003 21:33:55 -0000 1.3 *************** *** 2,8 **** import Graphics.UI.GIO main ! = start SDI $ do w <- window [title =: "hello world" ,view =: sz 200 200] --- 2,9 ---- import Graphics.UI.GIO + import Control.Monad(when) main ! = start SDI [] $ do w <- window [title =: "hello world" ,view =: sz 200 200] *************** *** 10,27 **** where confirmQuit w ! = do yes <- confirmDialog ["Invoked dismiss!","Do you really want to quit?"] w ! if (yes) then close w else return () ! ! ! confirmDialog :: [String] -> Window -> IO Bool ! confirmDialog msgs w ! = do vok <- newVar False ! modalDialog [title =: "Confirm"] w (configure vok) ! getVar vok ! where ! configure vok d ! = do ls <- mapM (\msg -> label [text =: msg] d) msgs ! ok <- button [text =: "Ok", on command =: do setVar vok True; close d] d ! can <- button [text =: "Cancel", on command =: do close d] d ! set d [layout =: pad 10 $ (vertical ls) ^^^^ hcenter (hfix 80 ok <<<< hfix 80 can)] ! -- rigid (hcenter ok ^^^ hfix 100 can)] --- 11,14 ---- where confirmQuit w ! = do yes <- messageQuestion "Invoked dismiss!\nDo you really want to quit?" ! when (yes) (destroyWidget w) Index: Progress.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/examples/simple/Progress.hs,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Progress.hs 27 Mar 2003 13:36:20 -0000 1.1 --- Progress.hs 2 Apr 2003 21:33:55 -0000 1.2 *************** *** 3,7 **** import Graphics.UI.GIO ! main = start "Progress" SDI [] demo maxSpeed = 200 :: Int --- 3,7 ---- import Graphics.UI.GIO ! main = start SDI [] demo maxSpeed = 200 :: Int *************** *** 9,14 **** demo = do ! myfont <- createFont defaultFontDef{fontSize=50} ! w <- window [view =: sz 800 100, domain =: sz 800 80] tm <- timer [interval =: maxSpeed `div` 2] prg <- hProgressBar True [progressRange =: (0,maxProgress)] w --- 9,13 ---- demo = do ! w <- window [title =: "Progress", view =: sz 800 100, domain =: sz 800 80] tm <- timer [interval =: maxSpeed `div` 2] prg <- hProgressBar True [progressRange =: (0,maxProgress)] w Index: SimpleDrawing.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/examples/simple/SimpleDrawing.hs,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SimpleDrawing.hs 24 Mar 2003 17:19:51 -0000 1.3 --- SimpleDrawing.hs 2 Apr 2003 21:33:55 -0000 1.4 *************** *** 4,8 **** main ! = start SDI $ do w <- window [title =: "Hello world", width =: 600, height =: 600 ,on paint =: mypaint --- 4,8 ---- main ! = start SDI [] $ do w <- window [title =: "Hello world", width =: 600, height =: 600 ,on paint =: mypaint Index: SimpleHello.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/examples/simple/SimpleHello.hs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SimpleHello.hs 24 Mar 2003 17:19:51 -0000 1.2 --- SimpleHello.hs 2 Apr 2003 21:33:55 -0000 1.3 *************** *** 4,7 **** main ! = start SDI $ do window [title =: "hello world", view =: sz 200 200] --- 4,7 ---- main ! = start SDI [] $ do window [title =: "hello world", view =: sz 200 200] Index: SimpleMenu.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/examples/simple/SimpleMenu.hs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SimpleMenu.hs 24 Mar 2003 17:19:51 -0000 1.2 --- SimpleMenu.hs 2 Apr 2003 21:33:55 -0000 1.3 *************** *** 4,17 **** main ! = start SDI $ do w <- window [title =: "Hello world", view =: sz 200 200] ! ! bar <- menubar [] w ! fm <- submenu "&File" [] bar ! menuitem "&Open" [menukey =: KeyChar 'o', menumod =: justControl] fm menuitem "&Close" [enabled =: False] fm ! menuline fm ! menuitem "&Exit" [on command =: close w] fm ! ! set w [layout =: bar] --- 4,15 ---- main ! = start SDI [] $ do w <- window [title =: "Hello world", view =: sz 200 200] ! ! fm <- menu "&File" [] mainMenu ! menuitem "&Open" [menukey =: KeyChar 'o'] fm menuitem "&Close" [enabled =: False] fm ! menuline mainMenu ! menuitem "&Exit" [on command =: halt] fm ! Index: SimpleQuitButton.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/examples/simple/SimpleQuitButton.hs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SimpleQuitButton.hs 24 Mar 2003 17:19:51 -0000 1.2 --- SimpleQuitButton.hs 2 Apr 2003 21:33:55 -0000 1.3 *************** *** 3,10 **** import Graphics.UI.GIO ! main = start SDI demo demo :: IO () demo = do w <- window [title =: "Quit demo"] ! q <- button [text =: "Quit", on command =: close w] w set w [layout =: pad 10 (center q)] --- 3,10 ---- import Graphics.UI.GIO ! main = start SDI [] demo demo :: IO () demo = do w <- window [title =: "Quit demo"] ! q <- button [text =: "Quit", on command =: halt] w set w [layout =: pad 10 (center q)] |
From: <kr_...@us...> - 2003-04-02 21:10:27
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK In directory sc8-pr-cvs1:/tmp/cvs-serv6624/src/cbits/GTK Modified Files: Button.c Label.c Log Message: bugfix Index: Button.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Button.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Button.c 29 Mar 2003 08:12:17 -0000 1.6 --- Button.c 2 Apr 2003 21:10:16 -0000 1.7 *************** *** 40,44 **** { gchar *szText = toMnemonicString(txt); ! GtkWidget *window = gtk_widget_get_toplevel(button); gtk_button_set_label(GTK_BUTTON(button), szText); handleWindowReLayout(window); --- 40,44 ---- { gchar *szText = toMnemonicString(txt); ! GtkWidget *window = gtk_widget_get_parent(gtk_widget_get_parent(gtk_widget_get_parent(button))); gtk_button_set_label(GTK_BUTTON(button), szText); handleWindowReLayout(window); *************** *** 48,52 **** void osChangeButtonFont(WindowHandle button, FontHandle font) { gtk_widget_modify_font(button, font->font_descr); ! handleWindowReLayout(gtk_widget_get_toplevel(button)); }; --- 48,53 ---- void osChangeButtonFont(WindowHandle button, FontHandle font) { + GtkWidget *window = gtk_widget_get_parent(gtk_widget_get_parent(gtk_widget_get_parent(button))); gtk_widget_modify_font(button, font->font_descr); ! handleWindowReLayout(window); }; Index: Label.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Label.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Label.c 29 Mar 2003 08:12:18 -0000 1.5 --- Label.c 2 Apr 2003 21:10:18 -0000 1.6 *************** *** 38,42 **** { gchar *szText = toMnemonicString(txt); ! GtkWidget *window = gtk_widget_get_toplevel(label); gtk_label_set_text_with_mnemonic(GTK_LABEL(label), szText); handleWindowReLayout(window); --- 38,42 ---- { gchar *szText = toMnemonicString(txt); ! GtkWidget *window = gtk_widget_get_parent(gtk_widget_get_parent(gtk_widget_get_parent(label))); gtk_label_set_text_with_mnemonic(GTK_LABEL(label), szText); handleWindowReLayout(window); *************** *** 46,51 **** void osChangeLabelFont(WindowHandle label, FontHandle font) { gtk_widget_modify_font(label, font->font_descr); //pango_layout_set_font_description(gtk_label_get_layout(GTK_LABEL(label)), font->font_descr); ! handleWindowReLayout(gtk_widget_get_toplevel(label)); }; --- 46,52 ---- void osChangeLabelFont(WindowHandle label, FontHandle font) { + GtkWidget *window = gtk_widget_get_parent(gtk_widget_get_parent(gtk_widget_get_parent(label))); gtk_widget_modify_font(label, font->font_descr); //pango_layout_set_font_description(gtk_label_get_layout(GTK_LABEL(label)), font->font_descr); ! handleWindowReLayout(window); }; |
From: <kr_...@us...> - 2003-04-02 20:00:31
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK In directory sc8-pr-cvs1:/tmp/cvs-serv5452/src/cbits/GTK Modified Files: Window.c Log Message: Check whether there is already opened window (SDI only) Index: Window.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Window.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Window.c 31 Mar 2003 00:12:06 -0000 1.13 --- Window.c 2 Apr 2003 20:00:24 -0000 1.14 *************** *** 241,244 **** --- 241,247 ---- GtkWidget *fixed, *sw, *viewport; + if (gDocumentInterface == 1 && gClientWidget != NULL) + return NULL; + /* Create a Scrolled Window */ sw = gtk_scrolled_window_new (NULL, NULL); *************** *** 298,302 **** gtk_box_pack_end(GTK_BOX(GTK_BIN(gFrameWidget)->child), sw, TRUE, TRUE, 0); } ! gtk_widget_realize(viewport); gdk_window_set_events(viewport->window, --- 301,305 ---- gtk_box_pack_end(GTK_BOX(GTK_BIN(gFrameWidget)->child), sw, TRUE, TRUE, 0); } ! gtk_widget_realize(viewport); gdk_window_set_events(viewport->window, |
From: <kr_...@us...> - 2003-04-02 19:32:12
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK In directory sc8-pr-cvs1:/tmp/cvs-serv22153/src/cbits/GTK Modified Files: FileDialog.c Log Message: The input file dialog should check whether the selected path is a directory Index: FileDialog.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/FileDialog.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** FileDialog.c 29 Mar 2003 08:12:18 -0000 1.3 --- FileDialog.c 2 Apr 2003 19:32:07 -0000 1.4 *************** *** 17,25 **** GtkWidget *dialog = gtk_message_dialog_new (GTK_WINDOW(file_selector), ! GTK_DIALOG_DESTROY_WITH_PARENT, ! GTK_MESSAGE_ERROR, ! GTK_BUTTONS_OK, ! "%s directory not found", ! fname); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); --- 17,25 ---- GtkWidget *dialog = gtk_message_dialog_new (GTK_WINDOW(file_selector), ! GTK_DIALOG_DESTROY_WITH_PARENT, ! GTK_MESSAGE_ERROR, ! GTK_BUTTONS_OK, ! "%s directory not found", ! fname); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); *************** *** 54,62 **** GtkWidget *dialog = gtk_message_dialog_new (GTK_WINDOW(file_selector), ! GTK_DIALOG_DESTROY_WITH_PARENT, ! GTK_MESSAGE_ERROR, ! GTK_BUTTONS_OK, ! "%s file not found", ! fname); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); --- 54,76 ---- GtkWidget *dialog = gtk_message_dialog_new (GTK_WINDOW(file_selector), ! GTK_DIALOG_DESTROY_WITH_PARENT, ! GTK_MESSAGE_ERROR, ! GTK_BUTTONS_OK, ! "%s file not found", ! fname); ! gtk_dialog_run (GTK_DIALOG (dialog)); ! gtk_widget_destroy (dialog); ! continue; ! } ! ! if (g_file_test(fname, G_FILE_TEST_IS_DIR)) ! { ! GtkWidget *dialog = ! gtk_message_dialog_new (GTK_WINDOW(file_selector), ! GTK_DIALOG_DESTROY_WITH_PARENT, ! GTK_MESSAGE_ERROR, ! GTK_BUTTONS_OK, ! "Path %s is a directory", ! fname); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); *************** *** 94,102 **** GtkWidget *dialog = gtk_message_dialog_new (GTK_WINDOW(file_selector), ! GTK_DIALOG_DESTROY_WITH_PARENT, ! GTK_MESSAGE_WARNING, ! GTK_BUTTONS_YES_NO, ! "%s already exists. Do you want to replace id?", ! fname); res = gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); --- 108,116 ---- GtkWidget *dialog = gtk_message_dialog_new (GTK_WINDOW(file_selector), ! GTK_DIALOG_DESTROY_WITH_PARENT, ! GTK_MESSAGE_WARNING, ! GTK_BUTTONS_YES_NO, ! "%s already exists. Do you want to replace id?", ! fname); res = gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); |
From: <kr_...@us...> - 2003-04-02 19:19:23
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK In directory sc8-pr-cvs1:/tmp/cvs-serv14318/src/cbits/GTK Modified Files: Util.c Log Message: bugfix Index: Util.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Util.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Util.c 30 Mar 2003 18:49:07 -0000 1.11 --- Util.c 2 Apr 2003 19:19:15 -0000 1.12 *************** *** 116,125 **** if (gDocumentInterface == 2) { GtkWidget *label; ! ! label = gtk_notebook_get_tab_label(GTK_NOTEBOOK(gClientWidget),gtk_notebook_get_nth_page(GTK_NOTEBOOK(gClientWidget),gtk_notebook_get_current_page(GTK_NOTEBOOK(gClientWidget)))); ! gWindowName = gtk_label_get_text(GTK_LABEL(label)); } ! if (gWindowName && *gWindowName) { --- 116,135 ---- if (gDocumentInterface == 2) { + int index; GtkWidget *label; ! ! index = gtk_notebook_get_current_page(GTK_NOTEBOOK(gClientWidget)); ! ! if (index > 0) ! { ! label = gtk_notebook_get_tab_label(GTK_NOTEBOOK(gClientWidget),gtk_notebook_get_nth_page(GTK_NOTEBOOK(gClientWidget),index)); ! gWindowName = gtk_label_get_text(GTK_LABEL(label)); ! } ! else ! { ! gWindowName = NULL; ! } } ! if (gWindowName && *gWindowName) { |
From: <kr_...@us...> - 2003-04-02 19:12:19
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK In directory sc8-pr-cvs1:/tmp/cvs-serv10416/src/cbits/GTK Modified Files: Frame.c Menu.c Log Message: Fix the MDI menu Index: Frame.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Frame.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Frame.c 30 Mar 2003 18:49:07 -0000 1.4 --- Frame.c 2 Apr 2003 19:12:10 -0000 1.5 *************** *** 8,11 **** --- 8,12 ---- GtkWidget *gFrameWidget = NULL; GtkWidget *gClientWidget = NULL; + GtkWidget *gMenuBar = NULL; static void frame_close_page_handler(GtkWidget *client) *************** *** 188,192 **** void createMDIFrame() { ! GtkWidget *menuBar, *box; GtkWidget *notebook_menu, *menu_item, *pages_menu; GtkAccelGroup *accel_group; --- 189,193 ---- void createMDIFrame() { ! GtkWidget *box; GtkWidget *notebook_menu, *menu_item, *pages_menu; GtkAccelGroup *accel_group; *************** *** 213,218 **** /* Create the menubar. */ ! menuBar = gtk_menu_bar_new(); ! gtk_box_pack_start(GTK_BOX(box), menuBar, FALSE, FALSE, 0); /* Create client(notebook) */ --- 214,219 ---- /* Create the menubar. */ ! gMenuBar = gtk_menu_bar_new(); ! gtk_box_pack_start(GTK_BOX(box), gMenuBar, FALSE, FALSE, 0); /* Create client(notebook) */ *************** *** 236,240 **** gtk_widget_show_all(menu_item); ! gtk_menu_bar_insert(GTK_MENU_BAR(menuBar), menu_item, 0); notebook_menu = gtk_menu_new(); --- 237,241 ---- gtk_widget_show_all(menu_item); ! gtk_menu_bar_insert(GTK_MENU_BAR(gMenuBar), menu_item, 0); notebook_menu = gtk_menu_new(); Index: Menu.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Menu.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Menu.c 1 Apr 2003 23:54:20 -0000 1.5 --- Menu.c 2 Apr 2003 19:12:11 -0000 1.6 *************** *** 1,118 **** ! #include "Menu.h" ! #include "Window.h" ! #include "Internals.h" ! #include "Handlers_stub.h" ! ! GtkWidget *gMenuBar = NULL; ! ! static MenuHandle getMenu(MenuHandle parent) ! { ! if (!parent) ! { ! if (!gMenuBar) ! { ! gMenuBar = gtk_menu_bar_new(); ! gtk_box_pack_start(GTK_BOX(GTK_BIN(gFrameWidget)->child), gMenuBar, FALSE, TRUE, 0); ! gtk_widget_show(gMenuBar); ! } ! ! parent = gMenuBar; ! } ! ! return parent; ! }; ! ! MenuHandle osAddMenu(MenuHandle parent, char *title) ! { ! gchar *szText = toMnemonicString(title); ! GtkWidget *menuItem = gtk_menu_item_new_with_mnemonic(szText); ! GtkWidget *popUpMenu = gtk_menu_new(); ! gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuItem), popUpMenu); ! rfree(szText); ! ! gtk_menu_shell_append(GTK_MENU_SHELL(getMenu(parent)), menuItem); ! gtk_widget_show(menuItem); ! return popUpMenu; ! }; ! ! MenuHandle osAddMenuItem(MenuHandle parent, int nKeyCode, unsigned int mods, char *title) ! { ! gchar *szText = toMnemonicString(title); ! GtkWidget *menuItem = gtk_menu_item_new_with_mnemonic(szText); ! rfree(szText); ! ! gtk_signal_connect (GTK_OBJECT(menuItem), "activate", ! GTK_SIGNAL_FUNC(handleMenuCommand), ! NULL); ! ! gtk_menu_shell_append(GTK_MENU_SHELL(getMenu(parent)), menuItem); ! gtk_widget_show(menuItem); ! return menuItem; ! }; ! ! static int in_handler_flag = 0; ! ! static void handleCheckMenuCommand(GtkMenuItem *menuitem) ! { ! if (!in_handler_flag) ! { ! in_handler_flag++; ! gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), !(GTK_CHECK_MENU_ITEM(menuitem)->active)); ! handleMenuCommand(menuitem) ; ! in_handler_flag--; ! } ! } ! ! MenuHandle osAddMenuCheckItem(MenuHandle parent, int nKeyCode, unsigned int mods, char *title) ! { ! gchar *szText = toMnemonicString(title); ! GtkWidget *menuItem = gtk_check_menu_item_new_with_mnemonic(szText); ! rfree(szText); ! ! gtk_signal_connect (GTK_OBJECT(menuItem), "activate", ! GTK_SIGNAL_FUNC(handleCheckMenuCommand), ! NULL); ! ! gtk_menu_shell_append(GTK_MENU_SHELL(getMenu(parent)), menuItem); ! gtk_widget_show(menuItem); ! return menuItem; ! }; ! ! void osAddMenuSeparatorItem(MenuHandle parent) ! { ! GtkWidget *item = gtk_separator_menu_item_new(); ! gtk_menu_shell_append(GTK_MENU_SHELL(getMenu(parent)), item); ! gtk_widget_show(item); ! } ! ! void osSetMenuItemEnabled(MenuHandle parent, MenuHandle item, BOOL bState) ! { ! gtk_widget_set_sensitive(item,bState); ! }; ! ! BOOL osGetMenuItemEnabled(MenuHandle parent, MenuHandle item) ! { ! return GTK_WIDGET_SENSITIVE(item); ! }; ! ! void osSetMenuItemChecked(MenuHandle parent, MenuHandle item, BOOL bState) ! { ! in_handler_flag++; ! gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM(item), bState); ! in_handler_flag--; ! }; ! ! BOOL osGetMenuItemChecked(MenuHandle parent, MenuHandle item) ! { ! return gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(item)); ! }; ! ! void osDrawMenuBar(WindowHandle window) ! { ! /* TODO: nothing yet */ ! } ! ! void osSetMenuItemLabel(MenuHandle menu, MenuHandle item, int nKeyCode, unsigned int mods, char* title ) ! { ! /* TODO: nothing yet */ ! } --- 1,123 ---- ! #include "Menu.h" ! #include "Window.h" ! #include "Internals.h" ! #include "Handlers_stub.h" ! ! ! static MenuHandle getMenu(MenuHandle parent) ! { ! if (!parent) ! { ! if (!gMenuBar) ! { ! gMenuBar = gtk_menu_bar_new(); ! gtk_box_pack_start(GTK_BOX(GTK_BIN(gFrameWidget)->child), gMenuBar, FALSE, TRUE, 0); ! gtk_widget_show(gMenuBar); ! } ! ! parent = gMenuBar; ! } ! ! return parent; ! }; ! ! MenuHandle osAddMenu(MenuHandle parent, char *title) ! { ! GtkMenuShell *menu_shell; ! gchar *szText = toMnemonicString(title); ! GtkWidget *menuItem = gtk_menu_item_new_with_mnemonic(szText); ! GtkWidget *popUpMenu = gtk_menu_new(); ! gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuItem), popUpMenu); ! rfree(szText); ! ! menu_shell = GTK_MENU_SHELL(getMenu(parent)); ! ! if (gDocumentInterface == 1) ! gtk_menu_shell_append(menu_shell, menuItem); ! else ! gtk_menu_shell_insert(menu_shell, menuItem, g_list_length(menu_shell->children)-1); ! gtk_widget_show(menuItem); ! return popUpMenu; ! }; ! ! MenuHandle osAddMenuItem(MenuHandle parent, int nKeyCode, unsigned int mods, char *title) ! { ! gchar *szText = toMnemonicString(title); ! GtkWidget *menuItem = gtk_menu_item_new_with_mnemonic(szText); ! rfree(szText); ! ! gtk_signal_connect (GTK_OBJECT(menuItem), "activate", ! GTK_SIGNAL_FUNC(handleMenuCommand), ! NULL); ! ! gtk_menu_shell_append(GTK_MENU_SHELL(getMenu(parent)), menuItem); ! gtk_widget_show(menuItem); ! return menuItem; ! }; ! ! static int in_handler_flag = 0; ! ! static void handleCheckMenuCommand(GtkMenuItem *menuitem) ! { ! if (!in_handler_flag) ! { ! in_handler_flag++; ! gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(menuitem), !(GTK_CHECK_MENU_ITEM(menuitem)->active)); ! handleMenuCommand(menuitem) ; ! in_handler_flag--; ! } ! } ! ! MenuHandle osAddMenuCheckItem(MenuHandle parent, int nKeyCode, unsigned int mods, char *title) ! { ! gchar *szText = toMnemonicString(title); ! GtkWidget *menuItem = gtk_check_menu_item_new_with_mnemonic(szText); ! rfree(szText); ! ! gtk_signal_connect (GTK_OBJECT(menuItem), "activate", ! GTK_SIGNAL_FUNC(handleCheckMenuCommand), ! NULL); ! ! gtk_menu_shell_append(GTK_MENU_SHELL(getMenu(parent)), menuItem); ! gtk_widget_show(menuItem); ! return menuItem; ! }; ! ! void osAddMenuSeparatorItem(MenuHandle parent) ! { ! GtkWidget *item = gtk_separator_menu_item_new(); ! gtk_menu_shell_append(GTK_MENU_SHELL(getMenu(parent)), item); ! gtk_widget_show(item); ! } ! ! void osSetMenuItemEnabled(MenuHandle parent, MenuHandle item, BOOL bState) ! { ! gtk_widget_set_sensitive(item,bState); ! }; ! ! BOOL osGetMenuItemEnabled(MenuHandle parent, MenuHandle item) ! { ! return GTK_WIDGET_SENSITIVE(item); ! }; ! ! void osSetMenuItemChecked(MenuHandle parent, MenuHandle item, BOOL bState) ! { ! in_handler_flag++; ! gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM(item), bState); ! in_handler_flag--; ! }; ! ! BOOL osGetMenuItemChecked(MenuHandle parent, MenuHandle item) ! { ! return gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(item)); ! }; ! ! void osDrawMenuBar(WindowHandle window) ! { ! /* TODO: nothing yet */ ! } ! ! void osSetMenuItemLabel(MenuHandle menu, MenuHandle item, int nKeyCode, unsigned int mods, char* title ) ! { ! /* TODO: nothing yet */ ! } |
From: <kr_...@us...> - 2003-04-02 19:12:19
|
Update of /cvsroot/htoolkit/port/src/include In directory sc8-pr-cvs1:/tmp/cvs-serv10416/src/include Modified Files: Internals.h Log Message: Fix the MDI menu Index: Internals.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/include/Internals.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Internals.h 30 Mar 2003 18:49:08 -0000 1.8 --- Internals.h 2 Apr 2003 19:12:11 -0000 1.9 *************** *** 36,39 **** --- 36,40 ---- extern GtkWidget *gFrameWidget; extern GtkWidget *gClientWidget; + extern GtkWidget *gMenuBar; extern gchar *fromMnemonicString(const gchar *source); |
From: <kr_...@us...> - 2003-04-02 18:41:13
|
Update of /cvsroot/htoolkit/port In directory sc8-pr-cvs1:/tmp/cvs-serv24852 Modified Files: makefile Log Message: fix dependency order Index: makefile =================================================================== RCS file: /cvsroot/htoolkit/port/makefile,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** makefile 30 Mar 2003 18:49:07 -0000 1.16 --- makefile 2 Apr 2003 18:41:10 -0000 1.17 *************** *** 39,44 **** Port/Controls.hs \ Port/FileDialog.hs Port/ColorDialog.hs Port/FontDialog.hs \ ! Port/Menu.hs Port/Window.hs Port/Process.hs \ ! Port/Timer.hs \ Port/Message.hs \ Port/Document.hs \ --- 39,44 ---- Port/Controls.hs \ Port/FileDialog.hs Port/ColorDialog.hs Port/FontDialog.hs \ ! Port/Menu.hs Port/Window.hs \ ! Port/Timer.hs Port/Process.hs \ Port/Message.hs \ Port/Document.hs \ |
From: <kr_...@us...> - 2003-04-02 17:43:41
|
Update of /cvsroot/htoolkit/port In directory sc8-pr-cvs1:/tmp/cvs-serv23684 Modified Files: configure Log Message: bugfix Index: configure =================================================================== RCS file: /cvsroot/htoolkit/port/configure,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** configure 15 Mar 2003 01:06:32 -0000 1.9 --- configure 2 Apr 2003 17:43:35 -0000 1.10 *************** *** 139,143 **** esac ! # find HsFFI.h if test -z "$ffidir"; then if test -f $hc; then --- 139,143 ---- esac ! # find HsFFI.h if test -z "$ffidir"; then if test -f $hc; then *************** *** 336,355 **** fi # create list of extra include directories needed, comma seperated and quoted. # expects $cincflags to be in the form: -Idir1 -Idir2 ... ! extraincdirs="" for flag in $cincflags; do case $flag in ! -I*) extraincdirs="$extraincdirs\" `echo $flag | sed -e 's|-I|,\"|'`" esac done - if test ! -z "$extraincdirs"; then - extraincdirs="$extraincdirs\"" - fi - - # Determine top-level directory - curdir="`pwd`" - # just for windows: ghc-pkg doesn't like /home case "$curdir" in --- 336,351 ---- fi + # Determine top-level directory + curdir="`pwd`" + # create list of extra include directories needed, comma seperated and quoted. # expects $cincflags to be in the form: -Idir1 -Idir2 ... ! incdirs=\"$curdir/src/include\" for flag in $cincflags; do case $flag in ! -I*) incdirs="$incdirs`echo $flag | sed -e 's|-I|, \"|'`\"" esac done # just for windows: ghc-pkg doesn't like /home case "$curdir" in *************** *** 429,436 **** echo " , extra_libraries=[$extralibs]" >> config/port.pkg echo " , package_deps=[]" >> config/port.pkg ! echo " , include_dirs = [\"$curdir/src/include\" $extraincdirs]" >> config/port.pkg echo " , c_includes = [\"HsPort.h\"]" >> config/port.pkg echo " }" >> config/port.pkg echo "done -- type 'make' to build the package." ! echo "" \ No newline at end of file --- 425,432 ---- echo " , extra_libraries=[$extralibs]" >> config/port.pkg echo " , package_deps=[]" >> config/port.pkg ! echo " , include_dirs = [$incdirs]" >> config/port.pkg echo " , c_includes = [\"HsPort.h\"]" >> config/port.pkg echo " }" >> config/port.pkg echo "done -- type 'make' to build the package." ! echo "" |
From: <kr_...@us...> - 2003-04-02 00:08:48
|
Update of /cvsroot/htoolkit/gio/src/examples/simple In directory sc8-pr-cvs1:/tmp/cvs-serv6061/gio/src/examples/simple Modified Files: BitmapViewer.hs Log Message: Update the sample after the last changes in the GIO. The new implementation uses MDI. Index: BitmapViewer.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/examples/simple/BitmapViewer.hs,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BitmapViewer.hs 24 Mar 2003 17:19:51 -0000 1.2 --- BitmapViewer.hs 2 Apr 2003 00:08:45 -0000 1.3 *************** *** 4,46 **** main ! = start SDI $ ! do image <- newVar Nothing ! w <- window [title =: "Bitmap viewer", view =: sz 300 300, on paint =: paintImage image] ! ! bar <- menubar [] w ! mfile <- submenu "&File" [] bar mopen <- menuitem "&Open" [] mfile mclose <- menuitem "&Close" [enabled =: False] mfile menuline mfile ! mexit <- menuitem "&Exit" [on command =: close w] mfile ! set w [layout =: bar] ! ! set mopen [on command =: cmdopen w image mclose] ! set mclose [on command =: cmdclose w image mclose] where ! cmdopen w image mclose = do mbfname <- runInputFileDialog case mbfname of Nothing -> return () ! Just fname -> do cmdclose w image mclose ! bitmap <- readBitmap fname [] ! setVar image (Just bitmap) ! set mclose [enabled =: True] ! sz <- get bitmap size ! set w [domain =: sz] ! repaint w ! cmdclose w image mclose ! = do mbbitmap <- getVar image ! case mbbitmap of ! Nothing -> return () ! Just bmp -> do setVar image Nothing ! set mclose [enabled =: False] ! repaint w ! return () paintImage image can updFrame updAreas ! = do mbbitmap <- getVar image ! case mbbitmap of ! Nothing -> rectangle updFrame [color =: white] can ! Just bm -> bitmap (pt 0 0) bm can \ No newline at end of file --- 4,39 ---- main ! = start MDI [title =: "Bitmap Viewer"] $ ! do mfile <- menu "&File" [] mainMenu mopen <- menuitem "&Open" [] mfile mclose <- menuitem "&Close" [enabled =: False] mfile menuline mfile ! mexit <- menuitem "&Exit" [on command =: quit >> return ()] mfile ! ! set mopen [on command =: cmdopen mclose] ! return () where ! cmdopen mclose = do mbfname <- runInputFileDialog case mbfname of Nothing -> return () ! Just fname -> do bitmap <- readBitmap fname [] ! bmpSize <- get bitmap size ! w <- window [ title =: fname ! , domain =: bmpSize ! , view =: sz 300 300 ! , on paint =: paintImage bitmap ! ] ! set mclose [enabled =: True, on command =: cmdclose w mclose] ! set w [ on activate =: set mclose [enabled =: True, on command =: cmdclose w mclose] ! , on deactivate =: set mclose [enabled =: False, off command] ! ] ! return () ! cmdclose w mclose ! = do set mclose [enabled =: False, off command] ! dismissWidget w ! return () paintImage image can updFrame updAreas ! = do bitmap (pt 0 0) image can \ No newline at end of file |
From: <kr_...@us...> - 2003-04-02 00:06:55
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv5156/src/cbits/Win32 Modified Files: Window.c Log Message: Repair Activate/Deactivate events handling for MDI windows Index: Window.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Window.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Window.c 1 Apr 2003 23:57:00 -0000 1.23 --- Window.c 2 Apr 2003 00:06:52 -0000 1.24 *************** *** 788,791 **** --- 788,797 ---- switch (uMsg) { + case WM_MDIACTIVATE: + if (hWnd == (HWND) wParam) + handleWindowDeactivate(hWnd); + if (hWnd == (HWND) lParam) + handleWindowActivate(hWnd); + break; case WM_LBUTTONDOWN: SendMessage(pFrameData->hClientWnd,WM_MDIACTIVATE,(WPARAM) hWnd,0); |
From: <kr_...@us...> - 2003-04-01 23:57:05
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv1465/port/src/cbits/Win32 Modified Files: Window.c Log Message: Add an appropriate cast to avoid warning message. Index: Window.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Window.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Window.c 31 Mar 2003 00:12:07 -0000 1.22 --- Window.c 1 Apr 2003 23:57:00 -0000 1.23 *************** *** 1063,1067 **** } else ! SendMessage(pFrameData->hClientWnd,WM_MDIDESTROY,window,0); } --- 1063,1067 ---- } else ! SendMessage(pFrameData->hClientWnd,WM_MDIDESTROY,(WPARAM) window,0); } |
From: <kr_...@us...> - 2003-04-01 23:54:24
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO In directory sc8-pr-cvs1:/tmp/cvs-serv606/gio/src/Graphics/UI/GIO Modified Files: Menu.hs Log Message: Implementation for SDI/MDI menu Index: Menu.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Menu.hs,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Menu.hs 26 Mar 2003 12:59:24 -0000 1.4 --- Menu.hs 1 Apr 2003 23:54:20 -0000 1.5 *************** *** 13,17 **** module Graphics.UI.GIO.Menu ( -- * Menus ! Menu, menubar, submenu -- * Menu items -- ** Menu item --- 13,17 ---- module Graphics.UI.GIO.Menu ( -- * Menus ! Menu, mainMenu, menu -- * Menu items -- ** Menu item *************** *** 33,72 **** --------------------------------------------------------------------} -- | A menu is a widget that contains menu items or other (sub) menus. ! -- The top level menu is always a 'menubar'. ! data Menu = Menu{ hmenu :: MenuHandle ! , hwindow :: WindowHandle -- associated window } ! -- | Create a menu bar on a window. ! -- ! -- Menu bars can be shown using the 'Graphics.UI.GIO.Window.layout' attribute of the window. ! -- ! -- > do w <- window [] ! -- > mbar <- menubar [] w ! -- > set w [layout =: mbar] ! -- ! -- They are always layed out as controls without any size, and are always rendered ! -- on top of the window view area, stretching horizontally. ! menubar :: [Prop Menu] -> Window -> IO Menu ! menubar props w ! = do mbar <- do hwnd <- get w windowHandle ! Lib.unregisterWindowMenus hwnd -- unregister previous menu handlers ! hbar <- Lib.createMenuBar hwnd -- set a fresh menu bar ! return (Menu hbar hwnd) ! set mbar props ! return mbar ! ! -- | Add a sub menu. ! submenu :: String -> [Prop Menu] -> Menu -> IO Menu ! submenu title props parent ! = do m <- do hmenu <- Lib.addSubMenu (hmenu parent) title ! return (Menu hmenu (hwindow parent)) set m props return m - instance Control Menu where - pack m - = stdPack (hwindow m) (return (Size 0 0)) (\r -> Lib.drawMenuBar (hwindow m)) - {-------------------------------------------------------------------- Menu items --- 33,51 ---- --------------------------------------------------------------------} -- | A menu is a widget that contains menu items or other (sub) menus. ! -- The top level menu is always a 'mainMenu'. ! data Menu = Menu{ hmenu :: !MenuHandle } + -- | The main application menu + mainMenu :: Menu + mainMenu = Menu Lib.mainMenu ! -- | Add a menu. ! menu :: String -> [Prop Menu] -> Menu -> IO Menu ! menu title props parent ! = do m <- do hmenu <- Lib.addMenu (hmenu parent) title ! return (Menu hmenu) set m props return m {-------------------------------------------------------------------- Menu items *************** *** 83,87 **** menuitem title props menu = do mitem <- do hitem <- Lib.addMenuItem (hmenu menu) Lib.KeyNull title - Lib.registerWindowMenu (hwindow menu) hitem vkey <- newVar Lib.KeyNull return (MenuItem hitem menu title vkey) --- 62,65 ---- |
From: <kr_...@us...> - 2003-04-01 23:54:24
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv606/port/src/cbits/Win32 Modified Files: Frame.c Menu.c Log Message: Implementation for SDI/MDI menu Index: Frame.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Frame.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Frame.c 30 Mar 2003 22:50:00 -0000 1.5 --- Frame.c 1 Apr 2003 23:54:20 -0000 1.6 *************** *** 83,86 **** --- 83,90 ---- } break; + case WM_COMMAND: + if (lParam == 0) + handleMenuCommand((MenuHandle) (UINT) LOWORD(wParam)); + break; } *************** *** 132,135 **** --- 136,141 ---- if (!pData->hClientWnd) return -1; + + DrawMenuBar(hWnd); } break; *************** *** 167,170 **** --- 173,179 ---- switch (uMsg) { + case WM_CREATE: + SetMenu(hWnd, CreateMenu()); + break; case WM_ACTIVATE: if (pFrameData->hClientWnd) Index: Menu.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Menu.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Menu.c 26 Mar 2003 12:59:24 -0000 1.4 --- Menu.c 1 Apr 2003 23:54:20 -0000 1.5 *************** *** 2,5 **** --- 2,6 ---- #include "Window.h" #include "Internals.h" + #include "Handlers_stub.h" static UINT gMenuItemID = 0; *************** *** 81,98 **** } ! MenuHandle osCreateMenuBar(WindowHandle window) { ! HMENU hMenu = CreateMenu(); ! HMENU hPrev = GetMenu(window); ! SetMenu(window, hMenu); ! if (hPrev != NULL) DestroyMenu(hPrev); ! return hMenu; ! }; ! MenuHandle osAddSubMenu(MenuHandle parent, char *title) { ! MenuHandle menu = CreateMenu(); ! InsertMenu(parent,-1,MF_BYPOSITION | MF_POPUP,(UINT)menu,title); ! return menu; }; --- 82,123 ---- } ! static HMENU getHMENU(HMENU hMenu) { ! return (hMenu) ? hMenu : GetMenu(ghWndFrame); ! } ! static void updateMenuBar(MenuHandle parent) { ! if (!parent) ! { ! RECT rc; ! FrameData *pFrameData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); ! ! GetClientRect(ghWndFrame, &rc); ! SetWindowPos(pFrameData->hClientWnd,NULL,rc.left,rc.top,rc.right,rc.bottom,SWP_NOZORDER); ! DrawMenuBar(ghWndFrame); ! ! if (pFrameData->DocumentInterface == 1) ! { ! handleWindowResize(pFrameData->hClientWnd,rc.right-rc.left,rc.bottom-rc.top); ! handleWindowReLayout(pFrameData->hClientWnd); ! } ! } ! } ! ! MenuHandle osAddMenu(MenuHandle parent, char *title) ! { ! HMENU hMenu, hParent; ! FrameData *pFrameData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); ! ! hMenu = CreateMenu(); ! hParent = getHMENU(parent); ! if (pFrameData->DocumentInterface == 1) ! InsertMenu(hParent,-1,MF_BYPOSITION | MF_POPUP,(UINT)hMenu,title); ! else ! InsertMenu(hParent,GetMenuItemCount(hParent)-1,MF_BYPOSITION | MF_POPUP,(UINT)hMenu,title); ! updateMenuBar(parent); ! ! return hMenu; }; *************** *** 103,108 **** strcpy(temp, title); AddAccelString(key, mods, temp); ! InsertMenu(parent,-1,MF_BYPOSITION | MF_STRING,nMenuItemID,temp); free(temp); return (MenuHandle) nMenuItemID; }; --- 128,134 ---- strcpy(temp, title); AddAccelString(key, mods, temp); ! InsertMenu(getHMENU(parent),-1,MF_BYPOSITION | MF_STRING,nMenuItemID,temp); free(temp); + updateMenuBar(parent); return (MenuHandle) nMenuItemID; }; *************** *** 114,119 **** strcpy(temp, title); AddAccelString(key, mods, temp); ! InsertMenu(parent,-1,MF_BYPOSITION | MF_STRING,nMenuItemID,title); free(temp); return (MenuHandle) nMenuItemID; }; --- 140,146 ---- strcpy(temp, title); AddAccelString(key, mods, temp); ! InsertMenu(getHMENU(parent),-1,MF_BYPOSITION | MF_STRING,nMenuItemID,title); free(temp); + updateMenuBar(parent); return (MenuHandle) nMenuItemID; }; *************** *** 121,130 **** void osAddMenuSeparatorItem(MenuHandle parent) { ! InsertMenu(parent,-1,MF_BYPOSITION | MF_SEPARATOR,0,NULL); } void osSetMenuItemEnabled(MenuHandle parent, MenuHandle item, BOOL bState) { ! EnableMenuItem(parent, (UINT) item, (bState ? MF_ENABLED : MF_GRAYED) | MF_BYCOMMAND); }; --- 148,158 ---- void osAddMenuSeparatorItem(MenuHandle parent) { ! InsertMenu(getHMENU(parent),-1,MF_BYPOSITION | MF_SEPARATOR,0,NULL); ! updateMenuBar(parent); } void osSetMenuItemEnabled(MenuHandle parent, MenuHandle item, BOOL bState) { ! EnableMenuItem(getHMENU(parent), (UINT) item, (bState ? MF_ENABLED : MF_GRAYED) | MF_BYCOMMAND); }; *************** *** 134,138 **** mii.cbSize = sizeof(mii); mii.fMask = MIIM_STATE; ! GetMenuItemInfo(parent, item, FALSE, &mii); return (mii.fState & MFS_ENABLED) != 0; }; --- 162,166 ---- mii.cbSize = sizeof(mii); mii.fMask = MIIM_STATE; ! GetMenuItemInfo(getHMENU(parent), (UINT) item, FALSE, &mii); return (mii.fState & MFS_ENABLED) != 0; }; *************** *** 140,144 **** void osSetMenuItemChecked(MenuHandle parent, MenuHandle item, BOOL bState) { ! CheckMenuItem(parent, (UINT) item, (bState ? MF_CHECKED : MF_UNCHECKED) | MF_BYCOMMAND); }; --- 168,172 ---- void osSetMenuItemChecked(MenuHandle parent, MenuHandle item, BOOL bState) { ! CheckMenuItem(getHMENU(parent), (UINT) item, (bState ? MF_CHECKED : MF_UNCHECKED) | MF_BYCOMMAND); }; *************** *** 148,152 **** mii.cbSize = sizeof(mii); mii.fMask = MIIM_STATE; ! GetMenuItemInfo(parent, item, FALSE, &mii); return (mii.fState & MFS_CHECKED) != 0; } --- 176,180 ---- mii.cbSize = sizeof(mii); mii.fMask = MIIM_STATE; ! GetMenuItemInfo(getHMENU(parent), (UINT) item, FALSE, &mii); return (mii.fState & MFS_CHECKED) != 0; } *************** *** 165,169 **** menuItemInfo.dwTypeData = temp; menuItemInfo.cch = strlen(temp); ! SetMenuItemInfo(parent, (UINT) item, FALSE, &menuItemInfo); free(temp); } --- 193,197 ---- menuItemInfo.dwTypeData = temp; menuItemInfo.cch = strlen(temp); ! SetMenuItemInfo(getHMENU(parent), (UINT) item, FALSE, &menuItemInfo); free(temp); } |
From: <kr_...@us...> - 2003-04-01 23:54:24
|
Update of /cvsroot/htoolkit/port/src/include In directory sc8-pr-cvs1:/tmp/cvs-serv606/port/src/include Modified Files: Menu.h Log Message: Implementation for SDI/MDI menu Index: Menu.h =================================================================== RCS file: /cvsroot/htoolkit/port/src/include/Menu.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Menu.h 26 Mar 2003 12:59:24 -0000 1.4 --- Menu.h 1 Apr 2003 23:54:20 -0000 1.5 *************** *** 4,9 **** #include "Types.h" ! MenuHandle osCreateMenuBar(WindowHandle window); ! MenuHandle osAddSubMenu(MenuHandle parent, char *title); MenuHandle osAddMenuItem(MenuHandle parent, int keyCode, unsigned int mods, char *title); MenuHandle osAddMenuCheckItem(MenuHandle parent, int keyCode, unsigned int mods, char *title); --- 4,8 ---- #include "Types.h" ! MenuHandle osAddMenu(MenuHandle parent, char *title); MenuHandle osAddMenuItem(MenuHandle parent, int keyCode, unsigned int mods, char *title); MenuHandle osAddMenuCheckItem(MenuHandle parent, int keyCode, unsigned int mods, char *title); |
From: <kr_...@us...> - 2003-04-01 23:54:23
|
Update of /cvsroot/htoolkit/port/src/Port In directory sc8-pr-cvs1:/tmp/cvs-serv606/port/src/Port Modified Files: Handlers.hs Menu.hs Log Message: Implementation for SDI/MDI menu Index: Handlers.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/Handlers.hs,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Handlers.hs 31 Mar 2003 00:12:06 -0000 1.17 --- Handlers.hs 1 Apr 2003 23:54:20 -0000 1.18 *************** *** 59,67 **** -- * Control commands ,setControlCommandHandler, setControlCommandDefHandler, getControlCommandHandler ! ! -- * Menus ! ,registerWindowMenu ! ,unregisterWindowMenus ! -- ** Register commands ,setMenuCommandHandler, setMenuCommandDefHandler, getMenuCommandHandler --- 59,63 ---- -- * Control commands ,setControlCommandHandler, setControlCommandDefHandler, getControlCommandHandler ! -- ** Register commands ,setMenuCommandHandler, setMenuCommandDefHandler, getMenuCommandHandler *************** *** 132,160 **** setWindowActivateDefHandler hwnd setControlCommandDefHandler hwnd - unregisterWindowMenus hwnd -- unregister all menu command handlers return () - - {----------------------------------------------------------------------------------------- - Keep track of menu event handlers associated with a window - -----------------------------------------------------------------------------------------} - {-# NOINLINE windowMenus #-} - windowMenus :: MVar (PtrMap WindowHandle [MenuHandle]) - windowMenus - = unsafePerformIO (newMVar empty) - - -- | 'registerWindowMenu' should be called for each menu item associated with some window. This - -- will automatically unregister any menu command handlers when the window is destroyed. - registerWindowMenu :: WindowHandle -> MenuHandle -> IO () - registerWindowMenu hwnd hmenu - = do map <- takeMVar windowMenus - putMVar windowMenus (insertWith (++) hwnd [hmenu] map) - - unregisterWindowMenus :: WindowHandle -> IO () - unregisterWindowMenus hwnd - = do map <- takeMVar windowMenus - case lookup hwnd map of - Nothing -> putMVar windowMenus map - Just menus -> do putMVar windowMenus (delete hwnd map) - mapM_ setMenuCommandDefHandler menus {----------------------------------------------------------------------------------------- --- 128,132 ---- Index: Menu.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/Menu.hs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Menu.hs 26 Mar 2003 13:03:49 -0000 1.5 --- Menu.hs 1 Apr 2003 23:54:20 -0000 1.6 *************** *** 15,22 **** ( -- * Menu bar ! createMenuBar , drawMenuBar -- * Sub menus ! , addSubMenu -- * Menu items , addMenuItem --- 15,22 ---- ( -- * Menu bar ! mainMenu , drawMenuBar -- * Sub menus ! , addMenu -- * Menu items , addMenuItem *************** *** 39,54 **** foreign import ccall "osDrawMenuBar" drawMenuBar :: WindowHandle -> IO () ! -- | Create a (top level) menu bar. ! createMenuBar :: WindowHandle -> IO MenuHandle ! createMenuBar hwnd ! = osCreateMenuBar hwnd ! foreign import ccall osCreateMenuBar :: WindowHandle -> IO MenuHandle -- | Add a sub menu. ! addSubMenu :: MenuHandle -> String -> IO MenuHandle ! addSubMenu hmenu title ! = withCString title $ \ctitle -> ! osAddSubMenu hmenu ctitle ! foreign import ccall osAddSubMenu :: MenuHandle -> CString -> IO MenuHandle -- | Add a menu item. Use a null character ('keyNull') if no --- 39,50 ---- foreign import ccall "osDrawMenuBar" drawMenuBar :: WindowHandle -> IO () ! -- | The handle of the main application menu ! mainMenu :: MenuHandle ! mainMenu = nullHandle -- | Add a sub menu. ! addMenu :: MenuHandle -> String -> IO MenuHandle ! addMenu hmenu title = withCString title (osAddMenu hmenu) ! foreign import ccall osAddMenu :: MenuHandle -> CString -> IO MenuHandle -- | Add a menu item. Use a null character ('keyNull') if no |
From: <kr_...@us...> - 2003-04-01 23:54:23
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK In directory sc8-pr-cvs1:/tmp/cvs-serv606/port/src/cbits/GTK Modified Files: Menu.c Log Message: Implementation for SDI/MDI menu Index: Menu.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Menu.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Menu.c 26 Mar 2003 12:59:24 -0000 1.4 --- Menu.c 1 Apr 2003 23:54:20 -0000 1.5 *************** *** 4,16 **** #include "Handlers_stub.h" ! MenuHandle osCreateMenuBar(WindowHandle window) { ! GtkWidget *menuBar = gtk_menu_bar_new(); ! gtk_box_pack_start(GTK_BOX(GTK_BIN(window)->child), menuBar,FALSE, TRUE, 0); ! gtk_widget_show(menuBar); ! return menuBar; }; ! MenuHandle osAddSubMenu(MenuHandle parent, char *title) { gchar *szText = toMnemonicString(title); --- 4,27 ---- #include "Handlers_stub.h" ! GtkWidget *gMenuBar = NULL; ! ! static MenuHandle getMenu(MenuHandle parent) { ! if (!parent) ! { ! if (!gMenuBar) ! { ! gMenuBar = gtk_menu_bar_new(); ! gtk_box_pack_start(GTK_BOX(GTK_BIN(gFrameWidget)->child), gMenuBar, FALSE, TRUE, 0); ! gtk_widget_show(gMenuBar); ! } ! ! parent = gMenuBar; ! } ! ! return parent; }; ! MenuHandle osAddMenu(MenuHandle parent, char *title) { gchar *szText = toMnemonicString(title); *************** *** 20,24 **** rfree(szText); ! gtk_menu_shell_append(GTK_MENU_SHELL(parent), menuItem); gtk_widget_show(menuItem); return popUpMenu; --- 31,35 ---- rfree(szText); ! gtk_menu_shell_append(GTK_MENU_SHELL(getMenu(parent)), menuItem); gtk_widget_show(menuItem); return popUpMenu; *************** *** 35,39 **** NULL); ! gtk_menu_shell_append(GTK_MENU_SHELL(parent), menuItem); gtk_widget_show(menuItem); return menuItem; --- 46,50 ---- NULL); ! gtk_menu_shell_append(GTK_MENU_SHELL(getMenu(parent)), menuItem); gtk_widget_show(menuItem); return menuItem; *************** *** 63,67 **** NULL); ! gtk_menu_shell_append(GTK_MENU_SHELL(parent), menuItem); gtk_widget_show(menuItem); return menuItem; --- 74,78 ---- NULL); ! gtk_menu_shell_append(GTK_MENU_SHELL(getMenu(parent)), menuItem); gtk_widget_show(menuItem); return menuItem; *************** *** 71,75 **** { GtkWidget *item = gtk_separator_menu_item_new(); ! gtk_menu_shell_append(GTK_MENU_SHELL(parent), item); gtk_widget_show(item); } --- 82,86 ---- { GtkWidget *item = gtk_separator_menu_item_new(); ! gtk_menu_shell_append(GTK_MENU_SHELL(getMenu(parent)), item); gtk_widget_show(item); } |
From: <kr_...@us...> - 2003-04-01 22:46:41
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO In directory sc8-pr-cvs1:/tmp/cvs-serv6946/src/Graphics/UI/GIO Modified Files: Events.hs Log Message: Add "off" event to export list Index: Events.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Events.hs,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Events.hs 31 Mar 2003 00:12:06 -0000 1.8 --- Events.hs 1 Apr 2003 22:46:36 -0000 1.9 *************** *** 58,62 **** -- * Event Event ! , on , mapEvent --- 58,62 ---- -- * Event Event ! , on, off , mapEvent |
From: <kr_...@us...> - 2003-03-31 00:12:10
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv21987/port/src/cbits/Win32 Modified Files: Window.c Log Message: implementation for contextMenu event Index: Window.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Window.c,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Window.c 30 Mar 2003 23:13:19 -0000 1.21 --- Window.c 31 Mar 2003 00:12:07 -0000 1.22 *************** *** 627,630 **** --- 627,641 ---- } break; + case WM_CONTEXTMENU: + if (pData->enabled) + { + POINT pos; + + pos.x = pData->Origin.x+GET_X_LPARAM(lParam); + pos.y = pData->Origin.y+GET_Y_LPARAM(lParam); + + handleWindowContextMenu(hWnd,pos.x,pos.y,GetModifiers()); + } + break; case WM_SYSKEYDOWN: case WM_KEYDOWN: *************** *** 746,749 **** --- 757,761 ---- case WM_LBUTTONDOWN: SetActiveWindow(hWnd); + SetFocus(hWnd); break; case WM_DESTROY: *************** *** 751,754 **** --- 763,768 ---- SetWindowText(ghWndFrame, pFrameData->lpszAppName ? pFrameData->lpszAppName : ""); break; + case WM_GETDLGCODE: + return DLGC_WANTMESSAGE; } *************** *** 806,809 **** --- 820,826 ---- { case 1: // SDI + if (pFrameData->hClientWnd) // There is already created window and SDI does't allow + return NULL; //more that one window at the same time. + GetClientRect(ghWndFrame, &rect); hWnd = CreateWindow( |
From: <kr_...@us...> - 2003-03-31 00:12:10
|
Update of /cvsroot/htoolkit/port/src/Port In directory sc8-pr-cvs1:/tmp/cvs-serv21987/port/src/Port Modified Files: Handlers.hs Types.hs Window.hs Log Message: implementation for contextMenu event Index: Handlers.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/Handlers.hs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Handlers.hs 26 Mar 2003 08:45:52 -0000 1.16 --- Handlers.hs 31 Mar 2003 00:12:06 -0000 1.17 *************** *** 38,51 **** -- ** Events ! ,setWindowReLayoutHandler, setWindowReLayoutDefHandler, getWindowReLayoutHandler ! ,setWindowDismissHandler, setWindowDismissDefHandler, getWindowDismissHandler ! ,setWindowDestroyHandler, setWindowDestroyDefHandler, getWindowDestroyHandler ! ,setWindowPaintHandler, setWindowPaintDefHandler, getWindowPaintHandler ! ,setWindowResizeHandler, setWindowResizeDefHandler, getWindowResizeHandler ! ,setWindowScrollHandler, setWindowScrollDefHandler, getWindowScrollHandler ! ,setWindowMouseHandler, setWindowMouseDefHandler, getWindowMouseHandler ! ,setWindowKeyboardHandler, setWindowKeyboardDefHandler, getWindowKeyboardHandler ! ,setWindowActivateHandler, setWindowActivateDefHandler, getWindowActivateHandler ! ,setWindowDeactivateHandler,setWindowDeactivateDefHandler,getWindowDeactivateHandler -- ** Fire events --- 38,52 ---- -- ** Events ! ,setWindowReLayoutHandler, setWindowReLayoutDefHandler, getWindowReLayoutHandler ! ,setWindowDismissHandler, setWindowDismissDefHandler, getWindowDismissHandler ! ,setWindowDestroyHandler, setWindowDestroyDefHandler, getWindowDestroyHandler ! ,setWindowPaintHandler, setWindowPaintDefHandler, getWindowPaintHandler ! ,setWindowResizeHandler, setWindowResizeDefHandler, getWindowResizeHandler ! ,setWindowScrollHandler, setWindowScrollDefHandler, getWindowScrollHandler ! ,setWindowMouseHandler, setWindowMouseDefHandler, getWindowMouseHandler ! ,setWindowKeyboardHandler, setWindowKeyboardDefHandler, getWindowKeyboardHandler ! ,setWindowActivateHandler, setWindowActivateDefHandler, getWindowActivateHandler ! ,setWindowDeactivateHandler, setWindowDeactivateDefHandler, getWindowDeactivateHandler ! ,setWindowContextMenuHandler,setWindowContextMenuDefHandler,getWindowContextMenuHandler -- ** Fire events *************** *** 475,478 **** --- 476,504 ---- ----------------------------------------------------------------------------------------- + -- WindowContextMenu + ----------------------------------------------------------------------------------------- + + {-# NOINLINE handlersWindowContextMenu #-} + handlersWindowContextMenu :: MVar (PtrMap WindowHandle (Point -> Modifiers -> IO ())) + handlersWindowContextMenu + = unsafePerformIO (newMVar empty) + + setWindowContextMenuHandler :: WindowHandle -> (Point -> Modifiers -> IO ()) -> IO () + setWindowContextMenuHandler hwnd handler + = setHandler hwnd handler handlersWindowContextMenu + + setWindowContextMenuDefHandler :: WindowHandle -> IO () + setWindowContextMenuDefHandler hwnd + = setDefHandler hwnd handlersWindowContextMenu + + getWindowContextMenuHandler :: WindowHandle -> IO (Point -> Modifiers -> IO ()) + getWindowContextMenuHandler hwnd + = getHandler hwnd (\p m -> return ()) handlersWindowContextMenu + + handleWindowContextMenu :: WindowHandle -> CInt -> CInt -> CWord -> IO () + handleWindowContextMenu hwnd cx cy cmods + = invokeHandler hwnd handlersWindowContextMenu (\f -> f (fromCPoint cx cy) (fromCModifiers cmods)) + + ----------------------------------------------------------------------------------------- -- MenuUpdate ----------------------------------------------------------------------------------------- *************** *** 617,620 **** --- 643,647 ---- foreign export ccall handleWindowDeactivate :: WindowHandle -> IO () foreign export ccall handleWindowActivate :: WindowHandle -> IO () + foreign export ccall handleWindowContextMenu :: WindowHandle -> CInt -> CInt -> CWord -> IO () foreign export ccall handleControlCommand :: WindowHandle -> IO () foreign export ccall handleMenuCommand :: MenuHandle -> IO () Index: Types.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/Types.hs,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Types.hs 26 Mar 2003 18:20:35 -0000 1.16 --- Types.hs 31 Mar 2003 00:12:06 -0000 1.17 *************** *** 98,102 **** , withCSize, withCSizeResult, fromCSize , withCRect, withCRectResult, fromCRect ! , fromCKey, toCKey , fromCMouseEvent --- 98,103 ---- , withCSize, withCSizeResult, fromCSize , withCRect, withCRectResult, fromCRect ! ! , fromCModifiers, toCModifiers , fromCKey, toCKey , fromCMouseEvent Index: Window.hs =================================================================== RCS file: /cvsroot/htoolkit/port/src/Port/Window.hs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Window.hs 26 Mar 2003 15:39:48 -0000 1.7 --- Window.hs 31 Mar 2003 00:12:06 -0000 1.8 *************** *** 43,46 **** --- 43,47 ---- import System.IO.Unsafe( unsafePerformIO ) import Control.Concurrent.MVar + import Control.Monad(when) import Graphics.UI.Port.PtrMap import Graphics.UI.Port.Types *************** *** 79,82 **** --- 80,84 ---- createWindow = do hwnd <- osCreateWindow + when (hwnd == nullHandle) (ioError (userError "Window.createWindow can't create more windows.")) registerWindow hwnd setWindowPaintHandler hwnd onpaint |
From: <kr_...@us...> - 2003-03-31 00:12:10
|
Update of /cvsroot/htoolkit/port/src/cbits/GTK In directory sc8-pr-cvs1:/tmp/cvs-serv21987/port/src/cbits/GTK Modified Files: Window.c Log Message: implementation for contextMenu event Index: Window.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/GTK/Window.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Window.c 30 Mar 2003 18:49:07 -0000 1.12 --- Window.c 31 Mar 2003 00:12:06 -0000 1.13 *************** *** 98,101 **** --- 98,102 ---- case 3: handleWindowMouse(window,evMouseRightDown,x,y,modifiers); + handleWindowContextMenu(window,x,y,modifiers); break; } |
From: <kr_...@us...> - 2003-03-31 00:12:09
|
Update of /cvsroot/htoolkit/gio/src/Graphics/UI/GIO In directory sc8-pr-cvs1:/tmp/cvs-serv21987/gio/src/Graphics/UI/GIO Modified Files: Events.hs Window.hs Log Message: implementation for contextMenu event Index: Events.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Events.hs,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Events.hs 30 Mar 2003 18:49:07 -0000 1.7 --- Events.hs 31 Mar 2003 00:12:06 -0000 1.8 *************** *** 94,97 **** --- 94,100 ---- , pgupKey,pgdownKey , downKey,upKey,leftKey,rightKey + + -- * Context menu + , contextMenu -- * Internal *************** *** 105,108 **** --- 108,113 ---- , newMouseEvent , newKeyboardEvent + , newContextMenuEvent + -- *** Deadly , newDismissEvent , newDestroyEvent *************** *** 177,182 **** -- | Reactive widgets react to mouse and keyboard events class Reactive w where ! mouse :: Event w (MouseEvent -> IO ()) ! keyboard :: Event w (KeyboardEvent -> IO ()) -- | Widgets that can be repainted. --- 182,188 ---- -- | Reactive widgets react to mouse and keyboard events class Reactive w where ! mouse :: Event w (MouseEvent -> IO ()) ! keyboard :: Event w (KeyboardEvent -> IO ()) ! contextMenu :: Event w (Point -> Modifiers -> IO ()) -- | Widgets that can be repainted. *************** *** 336,367 **** -- Forms newActivateEvent :: StdWindowEvent w (IO ()) ! newActivateEvent = stdWindowEvent Lib.getWindowActivateHandler Lib.setWindowActivateHandler Lib.setWindowActivateDefHandler newDeactivateEvent:: StdWindowEvent w (IO ()) ! newDeactivateEvent= stdWindowEvent Lib.getWindowDeactivateHandler Lib.setWindowDeactivateHandler Lib.setWindowDeactivateDefHandler newResizeEvent :: StdWindowEvent w (Size -> IO ()) ! newResizeEvent = stdWindowEvent Lib.getWindowResizeHandler Lib.setWindowResizeHandler Lib.setWindowResizeDefHandler newScrollEvent :: StdWindowEvent w (Point -> IO ()) ! newScrollEvent = stdWindowEvent Lib.getWindowScrollHandler Lib.setWindowScrollHandler Lib.setWindowScrollDefHandler -- Reactive newMouseEvent :: StdWindowEvent w (MouseEvent -> IO ()) ! newMouseEvent = stdWindowEvent Lib.getWindowMouseHandler Lib.setWindowMouseHandler Lib.setWindowMouseDefHandler newKeyboardEvent :: StdWindowEvent w (KeyboardEvent -> IO ()) ! newKeyboardEvent = stdWindowEvent Lib.getWindowKeyboardHandler Lib.setWindowKeyboardHandler Lib.setWindowKeyboardDefHandler -- Deadly newDismissEvent :: StdWindowEvent w (IO ()) ! newDismissEvent = stdWindowEvent Lib.getWindowDismissHandler Lib.setWindowDismissHandler Lib.setWindowDismissDefHandler newDestroyEvent :: StdWindowEvent w (IO ()) ! newDestroyEvent = stdWindowEvent Lib.getWindowDestroyHandler Lib.setWindowDestroyHandler Lib.setWindowDestroyDefHandler -- commands newControlCommandEvent :: StdWindowEvent w (IO ()) ! newControlCommandEvent = stdWindowEvent Lib.getControlCommandHandler Lib.setControlCommandHandler Lib.setControlCommandDefHandler {-------------------------------------------------------------------- --- 342,376 ---- -- Forms newActivateEvent :: StdWindowEvent w (IO ()) ! newActivateEvent = stdWindowEvent Lib.getWindowActivateHandler Lib.setWindowActivateHandler Lib.setWindowActivateDefHandler newDeactivateEvent:: StdWindowEvent w (IO ()) ! newDeactivateEvent= stdWindowEvent Lib.getWindowDeactivateHandler Lib.setWindowDeactivateHandler Lib.setWindowDeactivateDefHandler newResizeEvent :: StdWindowEvent w (Size -> IO ()) ! newResizeEvent = stdWindowEvent Lib.getWindowResizeHandler Lib.setWindowResizeHandler Lib.setWindowResizeDefHandler newScrollEvent :: StdWindowEvent w (Point -> IO ()) ! newScrollEvent = stdWindowEvent Lib.getWindowScrollHandler Lib.setWindowScrollHandler Lib.setWindowScrollDefHandler -- Reactive newMouseEvent :: StdWindowEvent w (MouseEvent -> IO ()) ! newMouseEvent = stdWindowEvent Lib.getWindowMouseHandler Lib.setWindowMouseHandler Lib.setWindowMouseDefHandler newKeyboardEvent :: StdWindowEvent w (KeyboardEvent -> IO ()) ! newKeyboardEvent = stdWindowEvent Lib.getWindowKeyboardHandler Lib.setWindowKeyboardHandler Lib.setWindowKeyboardDefHandler ! ! newContextMenuEvent :: StdWindowEvent w (Point -> Modifiers -> IO ()) ! newContextMenuEvent = stdWindowEvent Lib.getWindowContextMenuHandler Lib.setWindowContextMenuHandler Lib.setWindowContextMenuDefHandler -- Deadly newDismissEvent :: StdWindowEvent w (IO ()) ! newDismissEvent = stdWindowEvent Lib.getWindowDismissHandler Lib.setWindowDismissHandler Lib.setWindowDismissDefHandler newDestroyEvent :: StdWindowEvent w (IO ()) ! newDestroyEvent = stdWindowEvent Lib.getWindowDestroyHandler Lib.setWindowDestroyHandler Lib.setWindowDestroyDefHandler -- commands newControlCommandEvent :: StdWindowEvent w (IO ()) ! newControlCommandEvent = stdWindowEvent Lib.getControlCommandHandler Lib.setControlCommandHandler Lib.setControlCommandDefHandler {-------------------------------------------------------------------- Index: Window.hs =================================================================== RCS file: /cvsroot/htoolkit/gio/src/Graphics/UI/GIO/Window.hs,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Window.hs 30 Mar 2003 18:49:07 -0000 1.9 --- Window.hs 31 Mar 2003 00:12:06 -0000 1.10 *************** *** 173,178 **** instance Reactive Window where ! mouse = newMouseEvent hwindow ! keyboard = newKeyboardEvent hwindow instance Form Window where --- 173,179 ---- instance Reactive Window where ! mouse = newMouseEvent hwindow ! keyboard = newKeyboardEvent hwindow ! contextMenu = newContextMenuEvent hwindow instance Form Window where |
From: <kr_...@us...> - 2003-03-30 23:13:23
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv30554/src/cbits/Win32 Modified Files: Window.c Log Message: Remove custom title format for the MDIFrame because the standard MDIClient has its own format. Index: Window.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Window.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Window.c 30 Mar 2003 22:54:54 -0000 1.20 --- Window.c 30 Mar 2003 23:13:19 -0000 1.21 *************** *** 774,858 **** switch (uMsg) { - case WM_SETTEXT: - { - char *s = (char *) lParam; - - if (pFrameData->lpszAppName && *pFrameData->lpszAppName) - { - if (s && *s) - { - char *title; - int nTextLen; - - nTextLen = strlen(s); - title = malloc(strlen(pFrameData->lpszAppName)+nTextLen+6); - - if (title) - { - strcpy(title, pFrameData->lpszAppName); - strcat(title, " - ["); - strcat(title, s); - strcat(title, "]"); - SetWindowText(ghWndFrame, title); - } - - free(title); - } - else - SetWindowText(ghWndFrame, pFrameData->lpszAppName); - } - else - SetWindowText(ghWndFrame, s ? s : ""); - } - break; - case WM_MDIACTIVATE: - { - char *title; - int nTextLen; - - nTextLen = GetWindowTextLength(hWnd); - if (pFrameData->lpszAppName && *pFrameData->lpszAppName) - { - if (nTextLen > 0) - { - title = malloc(strlen(pFrameData->lpszAppName)+nTextLen+6); - - if (title) - { - strcpy(title, pFrameData->lpszAppName); - strcat(title, " - ["); - GetWindowText(hWnd, title+strlen(title), nTextLen+1); - strcat(title, "]"); - SetWindowText(ghWndFrame, title); - } - - free(title); - } - else - SetWindowText(ghWndFrame, pFrameData->lpszAppName); - } - else - { - title = malloc(nTextLen+1); - if (title) - { - GetWindowText(hWnd, title, nTextLen+1); - SetWindowText(ghWndFrame, title); - } - free(title); - } - - if (hWnd == (HWND) lParam) - handleWindowActivate(hWnd); - else - if (hWnd == (HWND) wParam) - handleWindowDeactivate(hWnd); - } - break; - case WM_DESTROY: - SetWindowText(ghWndFrame, pFrameData->lpszAppName ? pFrameData->lpszAppName : ""); - SendMessage(pFrameData->hClientWnd, WM_MDIREFRESHMENU, 0, 0); - DrawMenuBar(ghWndFrame); - break; case WM_LBUTTONDOWN: SendMessage(pFrameData->hClientWnd,WM_MDIACTIVATE,(WPARAM) hWnd,0); --- 774,777 ---- *************** *** 1121,1125 **** void osDestroyWindow(WindowHandle window) { ! DestroyWindow(window); } --- 1040,1050 ---- void osDestroyWindow(WindowHandle window) { ! FrameData *pFrameData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); ! if (pFrameData->DocumentInterface == 1) ! { ! DestroyWindow(window); ! } ! else ! SendMessage(pFrameData->hClientWnd,WM_MDIDESTROY,window,0); } |
From: <kr_...@us...> - 2003-03-30 22:54:58
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv23063/src/cbits/Win32 Modified Files: Window.c Log Message: uncommit SetCapture/ReleaseCapture Index: Window.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Window.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** Window.c 30 Mar 2003 22:50:00 -0000 1.19 --- Window.c 30 Mar 2003 22:54:54 -0000 1.20 *************** *** 482,486 **** handleWindowMouse(hWnd,evMouseLeave,pData->Origin.x+cx,pData->Origin.y+cy,GetModifiers()); pData->bInMouseMoveMode = FALSE; ! //ReleaseCapture(); } else --- 482,486 ---- handleWindowMouse(hWnd,evMouseLeave,pData->Origin.x+cx,pData->Origin.y+cy,GetModifiers()); pData->bInMouseMoveMode = FALSE; ! ReleaseCapture(); } else *************** *** 490,494 **** { pData->bInMouseMoveMode = TRUE; ! //SetCapture(hWnd); handleWindowMouse(hWnd,evMouseEnter,pData->Origin.x+cx,pData->Origin.y+cy,GetModifiers()); } --- 490,494 ---- { pData->bInMouseMoveMode = TRUE; ! SetCapture(hWnd); handleWindowMouse(hWnd,evMouseEnter,pData->Origin.x+cx,pData->Origin.y+cy,GetModifiers()); } *************** *** 516,520 **** { pData->bInDragMode = TRUE; ! //if (!pData->bInMouseMoveMode) SetCapture(hWnd); handleWindowMouse(hWnd,evMouseLeftDown,pos.x,pos.y,GetModifiers()); } --- 516,520 ---- { pData->bInDragMode = TRUE; ! if (!pData->bInMouseMoveMode) SetCapture(hWnd); handleWindowMouse(hWnd,evMouseLeftDown,pos.x,pos.y,GetModifiers()); } *************** *** 567,575 **** handleWindowMouse(hWnd,evMouseLeave,pData->Origin.x+cx,pData->Origin.y+cy,GetModifiers()); pData->bInMouseMoveMode = FALSE; ! //ReleaseCapture(); } } ! //else ! // ReleaseCapture(); hCtrl = checkMousePosition(hWnd, &pos); --- 567,575 ---- handleWindowMouse(hWnd,evMouseLeave,pData->Origin.x+cx,pData->Origin.y+cy,GetModifiers()); pData->bInMouseMoveMode = FALSE; ! ReleaseCapture(); } } ! else ! ReleaseCapture(); hCtrl = checkMousePosition(hWnd, &pos); |
From: <kr_...@us...> - 2003-03-30 22:50:06
|
Update of /cvsroot/htoolkit/port/src/cbits/Win32 In directory sc8-pr-cvs1:/tmp/cvs-serv21313/src/cbits/Win32 Modified Files: Frame.c Window.c Log Message: bugfixes Index: Frame.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Frame.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Frame.c 30 Mar 2003 18:49:07 -0000 1.4 --- Frame.c 30 Mar 2003 22:50:00 -0000 1.5 *************** *** 88,92 **** return DefWindowProc (hWnd, uMsg, wParam, lParam); else ! return DefFrameProc (hWnd, pData->hClientWnd, uMsg, wParam, lParam); }; --- 88,92 ---- return DefWindowProc (hWnd, uMsg, wParam, lParam); else ! return DefFrameProc (hWnd, pData ? pData->hClientWnd : NULL, uMsg, wParam, lParam); }; *************** *** 94,98 **** { LRESULT result = HFrameSharedFunction(2, hWnd, uMsg, wParam, lParam); ! FrameData *pData = (FrameData *) GetWindowLong(ghWndFrame,GWL_USERDATA); switch (uMsg) --- 94,98 ---- { LRESULT result = HFrameSharedFunction(2, hWnd, uMsg, wParam, lParam); ! FrameData *pData = (FrameData *) GetWindowLong(hWnd,GWL_USERDATA); switch (uMsg) *************** *** 220,224 **** if (s && *s) { ! title = rmalloc(strlen(pFrameData->lpszAppName)+nTextLen+6); if (title) --- 220,224 ---- if (s && *s) { ! title = malloc(strlen(pFrameData->lpszAppName)+nTextLen+6); if (title) *************** *** 237,241 **** } else ! SetWindowText(ghWndFrame, s); free(s); --- 237,241 ---- } else ! SetWindowText(ghWndFrame, s ? s : ""); free(s); Index: Window.c =================================================================== RCS file: /cvsroot/htoolkit/port/src/cbits/Win32/Window.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Window.c 30 Mar 2003 18:49:07 -0000 1.18 --- Window.c 30 Mar 2003 22:50:00 -0000 1.19 *************** *** 724,728 **** nTextLen = strlen(s); ! title = rmalloc(strlen(pFrameData->lpszAppName)+nTextLen+6); if (title) --- 724,728 ---- nTextLen = strlen(s); ! title = malloc(strlen(pFrameData->lpszAppName)+nTextLen+6); if (title) *************** *** 741,745 **** } else ! SetWindowText(ghWndFrame, s); } break; --- 741,745 ---- } else ! SetWindowText(ghWndFrame, s ? s : ""); } break; *************** *** 749,753 **** case WM_DESTROY: pFrameData->hClientWnd = NULL; ! SetWindowText(ghWndFrame, pFrameData->lpszAppName); break; } --- 749,753 ---- case WM_DESTROY: pFrameData->hClientWnd = NULL; ! SetWindowText(ghWndFrame, pFrameData->lpszAppName ? pFrameData->lpszAppName : ""); break; } *************** *** 786,790 **** nTextLen = strlen(s); ! title = rmalloc(strlen(pFrameData->lpszAppName)+nTextLen+6); if (title) --- 786,790 ---- nTextLen = strlen(s); ! title = malloc(strlen(pFrameData->lpszAppName)+nTextLen+6); if (title) *************** *** 803,807 **** } else ! SetWindowText(ghWndFrame, s); } break; --- 803,807 ---- } else ! SetWindowText(ghWndFrame, s ? s : ""); } break; *************** *** 812,824 **** nTextLen = GetWindowTextLength(hWnd); ! title = rmalloc(strlen(pFrameData->lpszAppName)+nTextLen+6); ! strcpy(title, pFrameData->lpszAppName); ! strcat(title, " - ["); ! GetWindowText(hWnd, title+strlen(title), nTextLen+1); ! strcat(title, "]"); ! SetWindowText(ghWndFrame, title); ! ! free(title); if (hWnd == (HWND) lParam) --- 812,845 ---- nTextLen = GetWindowTextLength(hWnd); ! if (pFrameData->lpszAppName && *pFrameData->lpszAppName) ! { ! if (nTextLen > 0) ! { ! title = malloc(strlen(pFrameData->lpszAppName)+nTextLen+6); ! if (title) ! { ! strcpy(title, pFrameData->lpszAppName); ! strcat(title, " - ["); ! GetWindowText(hWnd, title+strlen(title), nTextLen+1); ! strcat(title, "]"); ! SetWindowText(ghWndFrame, title); ! } ! ! free(title); ! } ! else ! SetWindowText(ghWndFrame, pFrameData->lpszAppName); ! } ! else ! { ! title = malloc(nTextLen+1); ! if (title) ! { ! GetWindowText(hWnd, title, nTextLen+1); ! SetWindowText(ghWndFrame, title); ! } ! free(title); ! } if (hWnd == (HWND) lParam) *************** *** 830,834 **** break; case WM_DESTROY: ! SetWindowText(ghWndFrame, pFrameData->lpszAppName); SendMessage(pFrameData->hClientWnd, WM_MDIREFRESHMENU, 0, 0); DrawMenuBar(ghWndFrame); --- 851,855 ---- break; case WM_DESTROY: ! SetWindowText(ghWndFrame, pFrameData->lpszAppName ? pFrameData->lpszAppName : ""); SendMessage(pFrameData->hClientWnd, WM_MDIREFRESHMENU, 0, 0); DrawMenuBar(ghWndFrame); |