TRootGuiBuilder.h

Go to the documentation of this file.
00001 // @(#)root/guibuilder:$Id: TRootGuiBuilder.h 30063 2009-09-08 12:15:59Z bellenot $
00002 // Author: Valeriy Onuchin   12/09/04
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TRootGuiBuilder
00013 #define ROOT_TRootGuiBuilder
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TRootGuiBuilder                                                      //
00019 //                                                                      //
00020 //////////////////////////////////////////////////////////////////////////
00021 
00022 #ifndef ROOT_TGFrame
00023 #include "TGFrame.h"
00024 #endif
00025 #ifndef ROOT_TGuiBuilder
00026 #include "TGuiBuilder.h"
00027 #endif
00028 
00029 enum EGuiBuilderMenuIds {
00030    kGUIBLD_FILE_NEW,
00031    kGUIBLD_FILE_CLOSE,
00032    kGUIBLD_FILE_EXIT,
00033    kGUIBLD_FILE_START,
00034    kGUIBLD_FILE_STOP,
00035    kGUIBLD_FILE_SAVE,
00036 
00037    kGUIBLD_EDIT_PREF,
00038 
00039    kGUIBLD_WINDOW_HOR,
00040    kGUIBLD_WINDOW_VERT,
00041    kGUIBLD_WINDOW_CASCADE,
00042    kGUIBLD_WINDOW_OPAQUE,
00043    kGUIBLD_WINDOW_ARRANGE,
00044 
00045    kGUIBLD_HELP_CONTENTS,
00046    kGUIBLD_HELP_ABOUT,
00047    kGUIBLD_HELP_BUG,
00048 
00049    kGUIBLD_FILE_OPEN
00050 };
00051 
00052 
00053 class TGShutter;
00054 class TGMdiMainFrame;
00055 class TGDockableFrame;
00056 class TGMdiMenuBar;
00057 class TGPopupMenu;
00058 class TGStatusBar;
00059 class TGuiBldDragManager;
00060 class TGToolBar;
00061 class TGMdiFrame;
00062 class TGuiBldEditor;
00063 class TGButton;
00064 class TGPictureButton;
00065 class TImage;
00066 class TTimer;
00067 
00068 //////////////////////////////////////////////////////////////////////////
00069 class TRootGuiBuilder : public TGuiBuilder, public TGMainFrame {
00070 
00071 friend class TGuiBldDragManager;
00072 
00073 private:
00074    TGuiBldDragManager *fManager;    // drag and drop manager
00075    TGButton          *fActionButton;// action button
00076    TGToolBar         *fToolBar;     // guibuider toolbar
00077    TGShutter         *fShutter;     // widget palette
00078    TGMdiMainFrame    *fMain;        // main mdi frame
00079    TGDockableFrame   *fToolDock;    // dockable frame where toolbar is located
00080    TGDockableFrame   *fShutterDock; // dockable frame where widget palette is located
00081    TGMdiMenuBar      *fMenuBar;     // guibuilder menu bar
00082    TGPopupMenu       *fMenuFile;    // "File" popup menu
00083    TGPopupMenu       *fMenuWindow;  // "Window" popup menu
00084    TGPopupMenu       *fMenuEdit;    // "Edit" popup menu
00085    TGPopupMenu       *fMenuHelp;    // "Help" popup menu
00086    TGStatusBar       *fStatusBar;   // guibuilder status bar
00087    TGFrame           *fSelected;    // selected frame
00088    TGMdiFrame        *fEditable;    // mdi frame where editted frame is  located
00089    TGuiBldEditor     *fEditor;      // frame property editor
00090    const TGPicture   *fIconPic;     // icon picture
00091    TGPictureButton   *fStartButton; // start button
00092    Int_t              fClosing;
00093 
00094    static TGGC       *fgBgnd;
00095    static TGGC       *fgBgndPopup;
00096    static TGGC       *fgBgndPopupHlght;
00097 
00098    void InitMenu();
00099    void EnableLassoButtons(Bool_t on = kTRUE);
00100    void EnableSelectedButtons(Bool_t on = kTRUE);
00101    void EnableEditButtons(Bool_t on = kTRUE);
00102    void BindKeys();
00103    TGButton *FindActionButton(const char *name, const char *section);
00104 
00105 public:
00106    TRootGuiBuilder(const TGWindow *p = 0);
00107    virtual ~TRootGuiBuilder();
00108 
00109    virtual void      AddAction(TGuiBldAction *act, const char *sect);
00110    virtual void      AddMacro(const char *macro, TImage *img);
00111    virtual void      AddSection(const char *sect);
00112    virtual TGFrame  *ExecuteAction();
00113    virtual void      HandleButtons();
00114    virtual void      Show() { MapRaised(); }
00115    virtual void      Hide();
00116    virtual void      ChangeSelected(TGFrame *f);
00117    virtual void      Update();
00118    virtual Bool_t    IsSelectMode() const;
00119    virtual Bool_t    IsGrabButtonDown() const;
00120    virtual Bool_t    OpenProject(Event_t *event = 0);
00121    virtual Bool_t    SaveProject(Event_t *event = 0);
00122    virtual Bool_t    NewProject(TString type = "");
00123    virtual Bool_t    HandleKey(Event_t *event);
00124    virtual void      HandleMenu(Int_t id);
00125    virtual void      CloseWindow();
00126    virtual void      MaybeCloseWindow();
00127    virtual void      HandleWindowClosed(Int_t id);
00128    virtual void      UpdateStatusBar(const char *text = 0);
00129    virtual void      EraseStatusBar();
00130    virtual void      SwitchToolbarButton();
00131 
00132    TGMdiFrame *FindEditableMdiFrame(const TGWindow *win);
00133    TGuiBldEditor    *GetEditor() const { return fEditor; }
00134    TGDockableFrame  *GetToolDock() const { return fToolDock; }
00135    TGMdiMainFrame   *GetMdiMain() const { return fMain; }
00136    TGMdiFrame       *GetEditable() const { return fEditable; }
00137    TGuiBldDragManager  *GetManager() const { return fManager; }
00138 
00139    static ULong_t    GetBgnd();
00140    static TGGC      *GetBgndGC();
00141 
00142    static ULong_t    GetPopupBgnd();
00143    static TGGC      *GetPopupBgndGC();
00144 
00145    static ULong_t    GetPopupHlght();
00146    static TGGC      *GetPopupHlghtGC();
00147 
00148    static void       PropagateBgndColor(TGFrame *frame, Pixel_t color);
00149 
00150    static TGFrame     *HSplitter();
00151    static TGFrame     *VSplitter();
00152    static TGPopupMenu *CreatePopup();
00153    static TGFrame     *BuildListTree();
00154    static TGFrame     *BuildCanvas();
00155    static TGFrame     *BuildShutter();
00156    static TGFrame     *BuildTextEdit();
00157    static TGFrame     *BuildTab();
00158    static TGFrame     *BuildListBox();
00159    static TGFrame     *BuildComboBox();
00160    static TGFrame     *BuildH3DLine();
00161    static TGFrame     *BuildV3DLine();
00162    static TGFrame     *BuildHScrollBar();
00163    static TGFrame     *BuildVScrollBar();
00164    static TGFrame     *BuildHProgressBar();
00165    static TGFrame     *BuildVProgressBar();
00166 
00167 
00168    ClassDef(TRootGuiBuilder,0)  // ROOT GUI Builder
00169 };
00170 
00171 
00172 #endif

Generated on Tue Jul 5 14:22:09 2011 for ROOT_528-00b_version by  doxygen 1.5.1