-class theory_rendering_window rendering_window =
- let window =
- GWindow.window ~title:"MathML theory viewer" ~border_width:2 () in
- let vbox =
- GPack.vbox ~packing:window#add () in
- let label =
- GMisc.label ~text:"???"
- ~packing:(vbox#pack ~expand:false ~fill:false ~padding:5) () in
- let paned =
- GPack.paned `HORIZONTAL ~packing:(vbox#pack ~expand:true ~padding:5) () in
- let scrolled_window0 =
- GBin.scrolled_window ~border_width:10 ~packing:paned#add1 () in
- let output =
- ref (GMathView.math_view ~use_t1_lib:false ~width:400 ~height:380
- ~packing:scrolled_window0#add ()) in
- let scrolled_window =
- GBin.scrolled_window
- ~border_width:10 ~packing:paned#add2 ~width:240 ~height:100 () in
- let errors = GEdit.text ~packing:scrolled_window#add_with_viewport () in
- let hbox =
- GPack.hbox ~packing:(vbox#pack ~expand:false ~fill:false ~padding:5) () in
- let prevb =
- GButton.button ~label:"Prev"
- ~packing:(hbox#pack ~expand:false ~fill:false ~padding:5) () in
- let nextb =
- GButton.button ~label:"Next"
- ~packing:(hbox#pack ~expand:false ~fill:false ~padding:5) () in
- let checkb =
- GButton.button ~label:"Check"
- ~packing:(hbox#pack ~expand:false ~fill:false ~padding:5) () in
- let settingsb =
- GButton.button ~label:"Settings"
- ~packing:(hbox#pack ~expand:false ~fill:false ~padding:5) () in
- let button_export_to_postscript =
- GButton.button ~label:"export_to_postscript"
- ~packing:(hbox#pack ~expand:false ~fill:false ~padding:5) () in
- let closeb =
- GButton.button ~label:"Close"
- ~packing:(hbox#pack ~expand:false ~fill:false ~padding:5) () in
-object(self)
- method nextb = nextb
- method prevb = prevb
- method label = label
- method output = (output : GMathView.math_view ref)
- method errors = errors
- method show () = window#show ()
- initializer
- nextb#misc#set_sensitive false ;
- prevb#misc#set_sensitive false ;
- button_export_to_postscript#misc#set_sensitive false ;
-
- (* signal handlers here *)
- ignore(!output#connect#jump (jump rendering_window)) ;
- ignore(!output#connect#selection_changed (choose_selection self)) ;
- ignore(nextb#connect#clicked (theory_next self)) ;
- ignore(prevb#connect#clicked (theory_prev self)) ;
- ignore(checkb#connect#clicked (theory_check self)) ;
- let settings_window = new settings_window output scrolled_window0
- button_export_to_postscript (jump rendering_window) (choose_selection self)
- theory_loaded_uri in
- ignore(settingsb#connect#clicked settings_window#show) ;
- ignore(button_export_to_postscript#connect#clicked (export_to_postscript output)) ;
- ignore(closeb#connect#clicked window#misc#hide) ;
- ignore(window#event#connect#delete (fun _ -> window#misc#hide () ; true ))
-end;;
-
-(* CSC: fare in modo che i due alberi vengano svuotati invece che distrutti *)
-class selection_window theory_rendering_window rendering_window =
- let label = "cic:/" in
- let theorylabel = "theory:/" in
- let win = GWindow.window ~title:"Known uris" ~border_width:2 () in
- let vbox = GPack.vbox ~packing:win#add () in
- let hbox1 = GPack.hbox ~packing:(vbox#pack ~padding:5) () in
- let sw1 = GBin.scrolled_window ~width:250 ~height:600
- ~packing:(hbox1#pack ~padding:5) () in
- let tree1 =
- GTree.tree ~selection_mode:`BROWSE ~packing:sw1#add_with_viewport () in
- let tree_item1 =
- GTree.tree_item ~label:theorylabel ~packing:tree1#append () in
- let sw = GBin.scrolled_window ~width:250 ~height:600
- ~packing:(hbox1#pack ~padding:5) () in
- let tree =
- GTree.tree ~selection_mode:`BROWSE ~packing:sw#add_with_viewport () in
- let tree_item =
- GTree.tree_item ~label:label ~packing:tree#append () in
- let hbox =
- GPack.hbox ~packing:(vbox#pack ~expand:false ~fill:false ~padding:5) () in
- let updateb =
- GButton.button ~label:"Update"
- ~packing:(hbox#pack ~expand:false ~fill:false ~padding:5) () in
- let quitb =
- GButton.button ~label:"Quit"
- ~packing:(hbox#pack ~expand:false ~fill:false ~padding:5) () in
-object (self)
- method show () = win#show ()
- initializer
- mktree theory_selection_changed theory_rendering_window tree_item1
- (Dir ("theory:/",theoryuritree));
- mktree selection_changed rendering_window tree_item
- (Dir ("cic:/",uritree));
-
- (* signal handlers here *)
- ignore (tree_item1#connect#select
- ~callback:(theory_selection_changed theory_rendering_window None)) ;
- ignore (tree_item#connect#select
- ~callback:(selection_changed rendering_window None)) ;
- ignore (win#connect#destroy ~callback:GMain.Main.quit) ;
- ignore (quitb#connect#clicked GMain.Main.quit) ;
- ignore(updateb#connect#clicked (updateb_pressed
- theory_rendering_window rendering_window (ref sw1, ref sw, hbox1) mktree))
-end;;
-
-