From 83f44ffec0422dbad242b56d651a6e56ce24ddd8 Mon Sep 17 00:00:00 2001 From: Claudio Sacerdoti Coen Date: Tue, 19 Jul 2005 16:00:06 +0000 Subject: [PATCH] New menus Undo/Redo (bugged), Cut/Copy/Paste/Delete. --- helm/matita/matita.glade | 159 +++++++++++++++++++++++++++++++++++++-- helm/matita/matita.txt | 2 +- helm/matita/matitaGui.ml | 21 ++++++ 3 files changed, 174 insertions(+), 8 deletions(-) diff --git a/helm/matita/matita.glade b/helm/matita/matita.glade index 68fecc5b5..2fb05862d 100644 --- a/helm/matita/matita.glade +++ b/helm/matita/matita.glade @@ -881,7 +881,7 @@ Copyright (C) 2005, True - + True gtk-new 1 @@ -902,7 +902,7 @@ Copyright (C) 2005, - + True gtk-open 1 @@ -923,7 +923,7 @@ Copyright (C) 2005, - + True gtk-save 1 @@ -943,7 +943,7 @@ Copyright (C) 2005, True - + True gtk-save-as 1 @@ -964,7 +964,7 @@ Copyright (C) 2005, - + True gtk-execute 1 @@ -991,7 +991,7 @@ Copyright (C) 2005, - + True gtk-quit 1 @@ -1017,6 +1017,145 @@ Copyright (C) 2005, + + + True + False + Undo + True + + + + + True + gtk-undo + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + False + Redo + True + + + + + True + gtk-redo + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + + + + + + True + Cut + True + + + + + True + gtk-cut + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + Copy + True + + + + + True + gtk-copy + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + Paste + True + + + + + True + gtk-paste + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + Delete + True + + + + True + gtk-delete + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + True + + + True @@ -1025,7 +1164,7 @@ Copyright (C) 2005, - + True gtk-find-and-replace 1 @@ -1071,6 +1210,12 @@ Copyright (C) 2005, + + + True + + + True diff --git a/helm/matita/matita.txt b/helm/matita/matita.txt index 92626557c..2af704645 100644 --- a/helm/matita/matita.txt +++ b/helm/matita/matita.txt @@ -60,7 +60,6 @@ TODO su bisognerebbe tornare su di un passo e non fare undo degli alias (Zack: nella history ci sono anche gli offset per sapere a che pezzo di script uno stato appartiene) - - Implementare menu edit: cut/copy/undo/etc. - keybinding globali: CTRL-{su,giu,...} devono fungere anche quando altre finestre hanno il focus (e.g. cicBrowser). C'e' gia' da qualche parte il codice che aggiunge i keybinding a tutte le eventBox, e' da ripristinare @@ -87,6 +86,7 @@ TODO - non chiudere transitivamente i moo ?? DONE +- Implementare menu edit: cut/copy/undo/etc. -> CSC - gestione dei path per include: il path deve essere assoluto? da decidere ... ( -I ?? o chiedere a matitamake la root e farci una find? ) -> Gares - freeze durante avanzamento -> Gares, CSC diff --git a/helm/matita/matitaGui.ml b/helm/matita/matitaGui.ml index ac69d2615..78fbf2f2f 100644 --- a/helm/matita/matitaGui.ml +++ b/helm/matita/matitaGui.ml @@ -197,6 +197,27 @@ class gui () = connect_button findRepl#cancelButton (fun _ -> hide_find_Repl ()); ignore(findRepl#toplevel#event#connect#delete ~callback:(fun _ -> hide_find_Repl ();true)); + ignore(self#main#undoMenuItem#connect#activate + ~callback:source_view#source_buffer#undo); + ignore(source_view#source_buffer#connect#can_undo + ~callback:self#main#undoMenuItem#misc#set_sensitive); + ignore(self#main#redoMenuItem#connect#activate + ~callback:source_view#source_buffer#redo); + ignore(source_view#source_buffer#connect#can_redo + ~callback:self#main#redoMenuItem#misc#set_sensitive); + let clipboard = + let atom = Gdk.Atom.clipboard in + GData.clipboard atom in + ignore(self#main#cutMenuItem#connect#activate + ~callback:(fun () -> source_view#buffer#cut_clipboard clipboard)); + ignore(self#main#copyMenuItem#connect#activate + ~callback:(fun () -> source_view#buffer#copy_clipboard clipboard)); + ignore(self#main#pasteMenuItem#connect#activate + ~callback:(fun () -> + source_view#buffer#paste_clipboard clipboard; + (MatitaScript.instance ())#clean_dirty_lock)); + ignore(self#main#deleteMenuItem#connect#activate + ~callback:(fun () -> ignore (source_view#buffer#delete_selection ()))); ignore(self#main#findReplMenuItem#connect#activate ~callback:show_find_Repl); ignore (findRepl#findEntry#connect#activate ~callback:find_forward); -- 2.39.2