let outputhtml = ((rendering_window ())#outputhtml : GHtml.xmhtml) in
let savedproof = !ProofEngine.proof in
let savedgoal = !ProofEngine.goal in
- match notebook#proofw#get_selection with
- Some node ->
+ match notebook#proofw#get_selections with
+ [node] ->
let xpath =
((node : Gdome.element)#getAttributeNS
~namespaceURI:helmns
ProofEngine.proof := savedproof ;
ProofEngine.goal := savedgoal ;
end
- | None ->
+ | [] ->
output_html outputhtml
("<h1 color=\"red\">No term selected</h1>")
+ | _ ->
+ output_html outputhtml
+ ("<h1 color=\"red\">Many terms selected</h1>")
;;
let call_tactic_with_input_and_goal_input tactic () =
let inputt = ((rendering_window ())#inputt : term_editor) in
let savedproof = !ProofEngine.proof in
let savedgoal = !ProofEngine.goal in
- match notebook#proofw#get_selection with
- Some node ->
+ match notebook#proofw#get_selections with
+ [node] ->
let xpath =
((node : Gdome.element)#getAttributeNS
~namespaceURI:helmns
ProofEngine.proof := savedproof ;
ProofEngine.goal := savedgoal ;
end
- | None ->
+ | [] ->
output_html outputhtml
("<h1 color=\"red\">No term selected</h1>")
+ | _ ->
+ output_html outputhtml
+ ("<h1 color=\"red\">Many terms selected</h1>")
;;
let call_tactic_with_goal_input_in_scratch tactic scratch_window () =
let module L = LogicalOperations in
let module G = Gdome in
- let mmlwidget = (scratch_window#mmlwidget : GMathViewAux.single_selection_math_view) in
+ let mmlwidget =
+ (scratch_window#mmlwidget : GMathViewAux.multi_selection_math_view) in
let outputhtml = ((rendering_window ())#outputhtml : GHtml.xmhtml) in
let savedproof = !ProofEngine.proof in
let savedgoal = !ProofEngine.goal in
- match mmlwidget#get_selection with
- Some node ->
+ match mmlwidget#get_selections with
+ [node] ->
let xpath =
((node : Gdome.element)#getAttributeNS
~namespaceURI:helmns
output_html outputhtml
("<h1 color=\"red\">" ^ Printexc.to_string e ^ "</h1>")
end
- | None ->
+ | [] ->
output_html outputhtml
("<h1 color=\"red\">No term selected</h1>")
+ | _ ->
+ output_html outputhtml
+ ("<h1 color=\"red\">Many terms selected</h1>")
;;
let call_tactic_with_hypothesis_input tactic () =
let outputhtml = ((rendering_window ())#outputhtml : GHtml.xmhtml) in
let savedproof = !ProofEngine.proof in
let savedgoal = !ProofEngine.goal in
- match notebook#proofw#get_selection with
- Some node ->
+ match notebook#proofw#get_selections with
+ [node] ->
let xpath =
((node : Gdome.element)#getAttributeNS
~namespaceURI:helmns
ProofEngine.proof := savedproof ;
ProofEngine.goal := savedgoal ;
end
- | None ->
+ | [] ->
output_html outputhtml
("<h1 color=\"red\">No term selected</h1>")
+ | _ ->
+ output_html outputhtml
+ ("<h1 color=\"red\">Many terms selected</h1>")
;;
("<h1 color=\"red\">" ^ Printexc.to_string e ^ "</h1>")
;;
-let choose_selection
- (mmlwidget : GMathViewAux.single_selection_math_view) (element : Gdome.element option)
-=
+let choose_selection mmlwidget (element : Gdome.element option) =
let module G = Gdome in
let rec aux element =
if element#hasAttributeNS
| Some p -> aux (new Gdome.element_of_node p)
with
GdomeInit.DOMCastException _ ->
- Printf.printf "******* trying to select above the document root ********\n" ; flush stdout
-
+ prerr_endline
+ "******* trying to select above the document root ********"
in
match element with
Some x -> aux x
GBin.scrolled_window ~border_width:10
~packing:(vbox#pack ~expand:true ~padding:5) () in
let mmlwidget =
- GMathViewAux.single_selection_math_view
+ GMathViewAux.multi_selection_math_view
~packing:(scrolled_window#add) ~width:400 ~height:280 () in
object(self)
method mmlwidget = mmlwidget
GBin.scrolled_window ~border_width:10
~packing:(vbox1#pack ~expand:true ~padding:5) () in
let proofw =
- GMathViewAux.single_selection_math_view ~width:400 ~height:275
+ GMathViewAux.multi_selection_math_view ~width:400 ~height:275
~packing:(scrolled_window1#add) () in
let _ = proofw_ref <- Some proofw in
let hbox3 =