<widget class="GtkNotebook" id="scriptNotebook">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="tab_pos">bottom</property>
+ <property name="scrollable">True</property>
<child>
<widget class="GtkScrolledWindow" id="ScriptScrolledWin">
<property name="visible">True</property>
</packing>
</child>
<child>
- <widget class="GtkScrolledWindow" id="scrolledwindow8">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
- <child>
- <widget class="GtkViewport" id="viewport1">
- <property name="visible">True</property>
- <child>
- <widget class="GtkLabel" id="label25">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Not implemented.</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
+ <placeholder/>
</child>
<child>
- <widget class="GtkLabel" id="label13">
- <property name="visible">True</property>
- <property name="label" translatable="yes">outline</property>
- </widget>
+ <placeholder/>
<packing>
- <property name="position">1</property>
- <property name="tab_fill">False</property>
<property name="type">tab</property>
</packing>
</child>
<widget class="GtkNotebook" id="sequentsNotebook">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="scrollable">True</property>
</widget>
<packing>
<property name="resize">False</property>
~copy_cb:(fun s -> gui#sourceView#buffer#insert ("\n"^s^"\n"))
() ~id:"boh?" uris
with MatitaTypes.Cancel -> [])
- ~set_star:gui#setStar
~ask_confirmation:
(fun ~title ~message ->
MatitaGtkMisc.ask_confirmation ~title ~message
"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 *)
let module Hr = Helm_registry in
MatitaGtkMisc.toggle_callback ~check:main#fullscreenMenuItem
~callback:(function
(s ())#reset ();
(s ())#template ();
source_view#source_buffer#end_not_undoable_action ();
- disableSave ();
- (s ())#assignFileName None
+ disableSave ()
in
let cursor () =
source_buffer#place_cursor
console#message ("'"^file^"' loaded.");
self#_enableSaveTo file
- method setStar b =
- let s = MatitaScript.current () in
- let w = main#toplevel in
- let set x = w#set_title x in
- let name =
- "Matita - " ^ Filename.basename s#filename ^
- (if b then "*" else "") ^
- " in " ^ s#buri_of_current_file
- in
- set name
-
method private _enableSaveTo file =
self#main#saveMenuItem#misc#set_sensitive true
method askText: ?title:string -> ?msg:string -> unit -> string option
method loadScript: string -> unit
- method setStar: bool -> unit
(** {3 Fonts} *)
method increaseFontSize: unit -> unit
fun () -> incr i; !i
class script ~(source_view: GSourceView2.source_view)
- ~set_star
~ask_confirmation
~urichooser
() =
ignore (GMain.Timeout.add ~ms:300000
~callback:(fun _ -> self#_saveToBackupFile ();true));
ignore (buffer#connect#modified_changed
- (fun _ -> set_star buffer#modified))
+ (fun _ -> self#set_star buffer#modified))
val mutable statements = [] (** executed statements *)
buffer#set_modified false
method assignFileName file =
- let file =
- match file with
- | Some f -> Some (Librarian.absolutize f)
- | None -> None
- in
- filename_ <- file;
- include_paths_ <-
- (match file with Some file -> read_include_paths file | None -> []);
- self#reset_buffer;
- Sys.chdir self#curdir;
- HLog.debug ("Moving to " ^ Sys.getcwd ())
+ match file with
+ None ->
+ (MatitaMisc.get_gui ())#main#scriptLabel#set_text default_fname;
+ filename_ <- None;
+ include_paths_ <- [];
+ self#reset_buffer
+ | Some file ->
+ let f = Librarian.absolutize file in
+ (MatitaMisc.get_gui ())#main#scriptLabel#set_text (Filename.basename f);
+ filename_ <- Some f;
+ include_paths_ <- read_include_paths f;
+ self#reset_buffer;
+ Sys.chdir self#curdir;
+ HLog.debug ("Moving to " ^ Sys.getcwd ())
+
+ method set_star b =
+ let label = (MatitaMisc.get_gui ())#main#scriptLabel in
+ label#set_text ((if b then "*" else "") ^ Filename.basename self#filename);
+ label#misc#set_tooltip_text
+ ("URI: " ^ self#buri_of_current_file ^ "\nPATH: " ^ self#filename)
method saveToFile () =
if self#has_name then
output_string oc (buffer#get_text ~start:buffer#start_iter
~stop:buffer#end_iter ());
close_out oc;
- set_star false;
+ self#set_star false;
buffer#set_modified false
else
HLog.error "Can't save, no filename selected"
let template = HExtlib.input_file BuildTimeConf.script_template in
buffer#insert ~iter:(buffer#get_iter `START) template;
buffer#set_modified false;
- set_star false
+ self#set_star false
method goto (pos: [`Top | `Bottom | `Cursor]) () =
try
let _script = ref None
-let script ~source_view ~urichooser ~ask_confirmation ~set_star ()
+let script ~source_view ~urichooser ~ask_confirmation ()
=
- let s = new script ~source_view ~ask_confirmation ~urichooser ~set_star () in
+ let s = new script ~source_view ~ask_confirmation ~urichooser () in
_script := Some s;
s
method loadFromFile : string -> unit
method loadFromString : string -> unit
method saveToFile : unit -> unit
- method filename : string
(** {2 Current proof} (if any) *)
(** misc *)
method clean_dirty_lock: unit
+ method set_star: bool -> unit
(* debug *)
method dump : unit -> unit
end
- (** @param set_star callback used to set the modified symbol (usually a star
- * "*") on the side of a script name *)
val script:
source_view:GSourceView2.source_view ->
urichooser: (NReference.reference list -> NReference.reference list) ->
ask_confirmation:
(title:string -> message:string -> [`YES | `NO | `CANCEL]) ->
- set_star: (bool -> unit) ->
unit ->
script