X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2FDEVEL%2Flablgtkmathview%2FgMathViewAux.ml;h=8880ee06cf12bdc96bed87ee8d32e87bbab0a80a;hb=8aaf525856e25bcd8f355e505fd00f45c62bc18f;hp=d59732cb25231dc13341890c894f589e7f6ee06f;hpb=e611c6ef7fc3cd7b2a240fcbe9b76c08634415dc;p=helm.git diff --git a/helm/DEVEL/lablgtkmathview/gMathViewAux.ml b/helm/DEVEL/lablgtkmathview/gMathViewAux.ml index d59732cb2..8880ee06c 100644 --- a/helm/DEVEL/lablgtkmathview/gMathViewAux.ml +++ b/helm/DEVEL/lablgtkmathview/gMathViewAux.ml @@ -120,8 +120,9 @@ class single_selection_math_view obj = method action_toggle (elem : Gdome.element) = match elem#get_namespaceURI, elem#get_localName with Some ns, Some ln - when ns#to_string = "http://www.w3.org/1998/Math/MathML" && - ln#to_string = "maction" + when + (ns#to_string = "http://www.w3.org/1998/Math/MathML" && ln#to_string = "maction") || + (ns#to_string = "http://helm.cs.unibo.it/2003/BoxML" && ln#to_string = "action") -> begin let selection_attr = Gdome.domString "selection" in @@ -156,13 +157,13 @@ class single_selection_math_view obj = ignore (self#connect#select_begin - (fun (elem : Gdome.element option) _ -> + (fun ((elem : Gdome.element option), _, _, _) -> if not (same_element root_selected elem) then selection_changed elem ; first_selected <- elem)) ; ignore (self#connect#select_over - (fun (elem : Gdome.element option) _ -> + (fun ((elem : Gdome.element option), _, _, _) -> let new_selected = match first_selected, elem with Some first', Some last' -> @@ -176,7 +177,7 @@ class single_selection_math_view obj = ignore (self#connect#select_end - (fun (elem : Gdome.element option) _ -> first_selected <- None)) ; + (fun ((elem : Gdome.element option), _, _, _) -> first_selected <- None)) ; ignore (self#connect#select_abort @@ -184,14 +185,15 @@ class single_selection_math_view obj = first_selected <- None ; selection_changed None)) ; - ignore (self#connect#click (fun _ _ -> self#set_selection None)) + ignore (self#connect#click (fun _ -> self#set_selection None)) end ;; let single_selection_math_view ?hadjustment ?vadjustment ?font_size ?log_verbosity = - GtkBase.Container.make_params ~cont:( + GtkBase.Widget.size_params ~cont:( OgtkMathViewProps.pack_return - (fun p -> OgtkMathViewProps.set_params (new single_selection_math_view (GtkMathViewProps.MathView.create p)) ~font_size ~log_verbosity)) [] + (fun p -> OgtkMathViewProps.set_params (new single_selection_math_view + (GtkMathViewProps.MathView_GMetaDOM.create p)) ~font_size ~log_verbosity)) [] ;; class multi_selection_math_view_signals obj @@ -225,8 +227,9 @@ class multi_selection_math_view obj = self#thaw method add_selection (elem : Gdome.element) = + List.iter self#unselect selected ; selected <- elem::(remove_descendants_of elem selected) ; - self#select elem + List.iter self#select selected method get_selections = selected @@ -248,28 +251,13 @@ class multi_selection_math_view obj = initializer ignore (self#connect#select_begin - (fun _ state -> + (fun (_,_,_,state) -> if not (List.mem `CONTROL (Gdk.Convert.modifier state)) then self#remove_selections)) ; - ignore - (self#connect#select_over - (fun _ state -> - let c = - function - `SHIFT -> "shift " - | `LOCK -> "lock " - | `CONTROL -> "control " - | `MOD1 -> "mod1 " - | _ -> "" - in - List.iter (fun x -> print_string (c x)) (Gdk.Convert.modifier state) ; - print_char '\n' ; - flush stdout)) ; - ignore (self#connect#select_end - (fun _ state -> + (fun (_,_,_,state) -> if not (List.mem `CONTROL (Gdk.Convert.modifier state)) then self#remove_selections ; match root_selected with @@ -278,12 +266,13 @@ class multi_selection_math_view obj = ignore (self#connect#click - (fun _ _ -> self#remove_selections)) + (fun _ -> self#remove_selections)) end ;; let multi_selection_math_view ?hadjustment ?vadjustment ?font_size ?log_verbosity = - GtkBase.Container.make_params ~cont:( + GtkBase.Widget.size_params ~cont:( OgtkMathViewProps.pack_return - (fun p -> OgtkMathViewProps.set_params (new multi_selection_math_view (GtkMathViewProps.MathView.create p)) ~font_size ~log_verbosity)) [] + (fun p -> OgtkMathViewProps.set_params (new multi_selection_math_view + (GtkMathViewProps.MathView_GMetaDOM.create p)) ~font_size ~log_verbosity)) [] ;;