X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=inline;f=helm%2Fsoftware%2Fmatita%2FmatitaGui.ml;h=0cbf2d89ada81b5287a9bc4bba440315410e8146;hb=467648250620f63c4c6d1338167dc46ccbb92051;hp=a77800c1e05192395e141aa075a5e361dde61944;hpb=558224e07a053eb99eaba1aed56c686056840dec;p=helm.git
diff --git a/helm/software/matita/matitaGui.ml b/helm/software/matita/matitaGui.ml
index a77800c1e..0cbf2d89a 100644
--- a/helm/software/matita/matitaGui.ml
+++ b/helm/software/matita/matitaGui.ml
@@ -220,7 +220,7 @@ let rec interactive_error_interp ~all_passes
assert (List.flatten errorll <> []);
let errorll' =
let remove_non_significant =
- List.filter (fun (_env,_diff,_loc,_msg,significant) -> significant) in
+ List.filter (fun (_env,_diff,_loc_msg,significant) -> significant) in
let annotated_errorll () =
List.rev
(snd
@@ -264,7 +264,7 @@ let rec interactive_error_interp ~all_passes
let _,env,diff = List.hd envs_and_diffs in
notify_exn
(GrafiteDisambiguator.DisambiguationError
- (offset,[[env,diff,loffset,msg,significant]]));
+ (offset,[[env,diff,lazy (loffset,Lazy.force msg),significant]]));
| _::_ ->
let dialog = new disambiguationErrors () in
dialog#check_widgets ();
@@ -299,7 +299,7 @@ let rec interactive_error_interp ~all_passes
~stop:source_buffer#end_iter;
notify_exn
(GrafiteDisambiguator.DisambiguationError
- (offset,[[env,diff,loffset,msg,significant]]))
+ (offset,[[env,diff,lazy(loffset,Lazy.force msg),significant]]))
));
let return _ =
dialog#disambiguationErrors#destroy ();
@@ -433,10 +433,18 @@ class gui () =
in
ignore(about_dialog#connect#response (fun _ ->about_dialog#misc#hide ()));
connect_menu_item main#contentsMenuItem (fun () ->
- let cmd =
- sprintf "gnome-help ghelp://%s/C/matita.xml &" BuildTimeConf.help_dir
- in
- ignore (Sys.command cmd));
+ if 0 = Sys.command "which gnome-help" then
+ let cmd =
+ sprintf "gnome-help ghelp://%s/C/matita.xml &" BuildTimeConf.help_dir
+ in
+ ignore (Sys.command cmd)
+ else
+ MatitaGtkMisc.report_error ~title:"help system error"
+ ~message:(
+ "The program gnome-help is not installed\n\n"^
+ "To browse the user manal it is necessary to install "^
+ "the gnome help syste (also known as yelp)")
+ ~parent:main#toplevel ());
connect_menu_item main#aboutMenuItem about_dialog#present;
(* findRepl win *)
let show_find_Repl () =
@@ -754,9 +762,60 @@ class gui () =
ignore (adj#connect#changed
(fun _ -> adj#set_value (adj#upper -. adj#page_size)));
console#message (sprintf "\tMatita version %s\n" BuildTimeConf.version);
- (* TO BE REMOVED *)
+ (* natural deduction palette *)
main#tacticsButtonsHandlebox#misc#hide ();
- main#tacticsBarMenuItem#misc#hide ();
+ MatitaGtkMisc.toggle_callback
+ ~callback:(fun b ->
+ if b then main#tacticsButtonsHandlebox#misc#show ()
+ else main#tacticsButtonsHandlebox#misc#hide ())
+ ~check:main#menuitemPalette;
+ connect_button main#butImpl_intro
+ (fun () -> source_buffer#insert "apply rule (â_i [â¦] (â¦));\n");
+ connect_button main#butAnd_intro
+ (fun () -> source_buffer#insert
+ "apply rule (â§_i (â¦) (â¦));\n\t[\n\t|\n\t]\n");
+ connect_button main#butOr_intro_left
+ (fun () -> source_buffer#insert "apply rule (â¨_i_l (â¦));\n");
+ connect_button main#butOr_intro_right
+ (fun () -> source_buffer#insert "apply rule (â¨_i_r (â¦));\n");
+ connect_button main#butNot_intro
+ (fun () -> source_buffer#insert "apply rule (¬_i [â¦] (â¦));\n");
+ connect_button main#butTop_intro
+ (fun () -> source_buffer#insert "apply rule (â¤_i);\n");
+ connect_button main#butImpl_elim
+ (fun () -> source_buffer#insert
+ "apply rule (â_e (â¦) (â¦));\n\t[\n\t|\n\t]\n");
+ connect_button main#butAnd_elim_left
+ (fun () -> source_buffer#insert "apply rule (â§_e_l (â¦));\n");
+ connect_button main#butAnd_elim_right
+ (fun () -> source_buffer#insert "apply rule (â§_e_r (â¦));\n");
+ connect_button main#butOr_elim
+ (fun () -> source_buffer#insert
+ "apply rule (â¨_e (â¦) [â¦] (â¦) [â¦] (â¦));\n\t[\n\t|\n\t|\n\t]\n");
+ connect_button main#butNot_elim
+ (fun () -> source_buffer#insert
+ "apply rule (¬_e (â¦) (â¦));\n\t[\n\t|\n\t]\n");
+ connect_button main#butBot_elim
+ (fun () -> source_buffer#insert "apply rule (â¥_e (â¦));\n");
+ connect_button main#butRAA
+ (fun () -> source_buffer#insert "apply rule (RAA [â¦] (â¦));\n");
+ connect_button main#butUseLemma
+ (fun () -> source_buffer#insert "apply rule (lem â¦);\n");
+ connect_button main#butDischarge
+ (fun () -> source_buffer#insert "apply rule (discharge [â¦]);\n");
+
+ connect_button main#butForall_intro
+ (fun () -> source_buffer#insert "apply rule (â_i {â¦} (â¦));\n");
+ connect_button main#butForall_elim
+ (fun () -> source_buffer#insert "apply rule (â_e {â¦} (â¦));\n");
+ connect_button main#butExists_intro
+ (fun () -> source_buffer#insert "apply rule (â_i {â¦} (â¦));\n");
+ connect_button main#butExists_elim
+ (fun () -> source_buffer#insert
+ "apply rule (â_e (â¦) {â¦} [â¦] (â¦));\n\t[\n\t|\n\t]\n");
+
+
+ (* TO BE REMOVED *)
main#scriptNotebook#remove_page 1;
main#scriptNotebook#set_show_tabs false;
(* / TO BE REMOVED *)
@@ -843,6 +902,8 @@ class gui () =
source_view#source_buffer#begin_not_undoable_action ();
script#loadFromFile f;
source_view#source_buffer#end_not_undoable_action ();
+ source_view#buffer#move_mark `INSERT source_view#buffer#start_iter;
+ source_view#buffer#place_cursor source_view#buffer#start_iter;
console#message ("'"^f^"' loaded.\n");
self#_enableSaveTo f
| None -> ()
@@ -1134,6 +1195,8 @@ class gui () =
source_view#source_buffer#begin_not_undoable_action ();
script#loadFromFile content;
source_view#source_buffer#end_not_undoable_action ();
+ source_view#buffer#move_mark `INSERT source_view#buffer#start_iter;
+ source_view#buffer#place_cursor source_view#buffer#start_iter;
console#message ("'"^file^"' loaded.");
self#_enableSaveTo file
@@ -1166,7 +1229,6 @@ class gui () =
self#check_widgets ();
let combo_widget = combo#coerce in
uriHBox#pack ~from:`END ~fill:true ~expand:true combo_widget;
- self#toplevel#set_transient_for main#toplevel#as_window;
combo#misc#grab_focus ()
method browserUri = combo
end
@@ -1232,7 +1294,8 @@ class gui () =
method private updateFontSize () =
self#sourceView#misc#modify_font_by_name
- (sprintf "%s %d" BuildTimeConf.script_font font_size)
+ (sprintf "%s %d" BuildTimeConf.script_font font_size);
+ MatitaAutoGui.set_font_size font_size
method increaseFontSize () =
font_size <- font_size + 1;
@@ -1376,9 +1439,10 @@ class interpModel =
tree_store#get ~row:iter ~column:interp_no_col
end
+
let interactive_string_choice
text prefix_len ?(title = "") ?(msg = "") () ~id locs uris
-=
+=
let gui = instance () in
let dialog = gui#newUriDialog () in
dialog#uriEntryHBox#misc#hide ();
@@ -1394,13 +1458,15 @@ let interactive_string_choice
let rec colorize acc_len = function
| [] ->
let floc = HExtlib.floc_of_loc (acc_len,hack_len) in
- fst(MatitaGtkMisc.utf8_parsed_text text floc)
+ escape_pango_markup (fst(MatitaGtkMisc.utf8_parsed_text text floc))
| he::tl ->
let start, stop = HExtlib.loc_of_floc he in
let floc1 = HExtlib.floc_of_loc (acc_len,start) in
let str1,_=MatitaGtkMisc.utf8_parsed_text text floc1 in
let str2,_ = MatitaGtkMisc.utf8_parsed_text text he in
- str1 ^ "" ^ str2 ^ "" ^ colorize stop tl
+ escape_pango_markup str1 ^ "" ^
+ escape_pango_markup str2 ^ "" ^
+ colorize stop tl
in
(* List.iter (fun l -> let start, stop = HExtlib.loc_of_floc l in
Printf.eprintf "(%d,%d)" start stop) locs; *)
@@ -1419,6 +1485,7 @@ let interactive_string_choice
let txt,_ = MatitaGtkMisc.utf8_parsed_text txt
(HExtlib.floc_of_loc (prefix_len,MatitaGtkMisc.utf8_string_length txt))
in
+ prerr_endline ("txt:" ^ txt);
dialog#uriChoiceLabel#set_label txt;
List.iter model#easy_append uris;
let return v =