(* Copyright (C) 2004, HELM Team. * * This file is part of HELM, an Hypertextual, Electronic * Library of Mathematics, developed at the Computer Science * Department, University of Bologna, Italy. * * HELM is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * HELM is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HELM; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, * MA 02111-1307, USA. * * For details, see the HELM World-Wide-Web page, * http://helm.cs.unibo.it/ *) open MathitaGeneratedGui open MathitaGtkMisc class gui file = (* creation order _is_ relevant for windows placement *) let toolbar = new toolBarWin ~file () in let main = new mainWin ~file () in let about = new aboutWin ~file () in let dialog = new genericDialog ~file () in let uriChoice = new uriChoiceDialog ~file () in let interpChoice = new interpChoiceDialog ~file () in let fileSel = new fileSelectionWin ~file () in let proof = new proofWin ~file () in let keyBindingBoxes = (* event boxes which should receive global key events *) [ toolbar#toolBarEventBox; proof#proofWinEventBox ] in object (self) initializer (* glade's check widgets *) List.iter (fun w -> w#check_widgets ()) (let c w = (w :> unit>) in [ c about; c dialog; c fileSel; c main; c proof; c toolbar; c uriChoice; c interpChoice ]); (* show/hide commands *) toggle_visibility toolbar#toolBarWin main#showToolBarMenuItem; toggle_visibility proof#proofWin main#showProofMenuItem; (* "global" key bindings *) List.iter (fun (key, callback) -> self#addKeyBinding key callback) [ GdkKeysyms._F3, toggle_win ~check:main#showProofMenuItem proof#proofWin; ]; (* about win *) ignore (about#aboutWin#event#connect#delete (fun _ -> true)); ignore (main#aboutMenuItem#connect#activate (fun _ -> about#aboutWin#show ())); ignore (about#aboutDismissButton#connect#clicked (fun _ -> about#aboutWin#misc#hide ())); (* menus *) List.iter (fun w -> w#misc#set_sensitive false) [ main#saveMenuItem; main#saveAsMenuItem ]; main#helpMenu#set_right_justified true; (* uri choice *) () method toolbar = toolbar method main = main method about = about method dialog = dialog method uriChoice = uriChoice method interpChoice = interpChoice method fileSel = fileSel method proof = proof method private addKeyBinding key callback = List.iter (fun evbox -> add_key_binding key callback evbox) keyBindingBoxes method setQuitCallback callback = ignore (main#toplevel#connect#destroy callback); ignore (main#quitMenuItem#connect#activate callback); self#addKeyBinding GdkKeysyms._q callback end