Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TRootGuiBuilder.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/guibuilder:$Id$
0002 // Author: Valeriy Onuchin   12/09/04
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TRootGuiBuilder
0013 #define ROOT_TRootGuiBuilder
0014 
0015 
0016 #include "TGFrame.h"
0017 #include "TGuiBuilder.h"
0018 
0019 enum EGuiBuilderMenuIds {
0020    kGUIBLD_FILE_NEW,
0021    kGUIBLD_FILE_CLOSE,
0022    kGUIBLD_FILE_EXIT,
0023    kGUIBLD_FILE_START,
0024    kGUIBLD_FILE_STOP,
0025    kGUIBLD_FILE_SAVE,
0026 
0027    kGUIBLD_EDIT_PREF,
0028 
0029    kGUIBLD_WINDOW_HOR,
0030    kGUIBLD_WINDOW_VERT,
0031    kGUIBLD_WINDOW_CASCADE,
0032    kGUIBLD_WINDOW_OPAQUE,
0033    kGUIBLD_WINDOW_ARRANGE,
0034 
0035    kGUIBLD_HELP_CONTENTS,
0036    kGUIBLD_HELP_ABOUT,
0037    kGUIBLD_HELP_BUG,
0038 
0039    kGUIBLD_FILE_OPEN
0040 };
0041 
0042 
0043 class TGShutter;
0044 class TGMdiMainFrame;
0045 class TGDockableFrame;
0046 class TGMdiMenuBar;
0047 class TGPopupMenu;
0048 class TGStatusBar;
0049 class TGuiBldDragManager;
0050 class TGToolBar;
0051 class TGMdiFrame;
0052 class TGuiBldEditor;
0053 class TGButton;
0054 class TGPictureButton;
0055 class TImage;
0056 class TTimer;
0057 
0058 //////////////////////////////////////////////////////////////////////////
0059 class TRootGuiBuilder : public TGuiBuilder, public TGMainFrame {
0060 
0061 friend class TGuiBldDragManager;
0062 
0063 private:
0064    TGuiBldDragManager *fManager;    // drag and drop manager
0065    TGButton          *fActionButton;// action button
0066    TGToolBar         *fToolBar;     // guibuider toolbar
0067    TGShutter         *fShutter;     // widget palette
0068    TGMdiMainFrame    *fMain;        // main mdi frame
0069    TGDockableFrame   *fToolDock;    // dockable frame where toolbar is located
0070    TGDockableFrame   *fShutterDock; // dockable frame where widget palette is located
0071    TGMdiMenuBar      *fMenuBar;     // guibuilder menu bar
0072    TGPopupMenu       *fMenuFile;    // "File" popup menu
0073    TGPopupMenu       *fMenuWindow;  // "Window" popup menu
0074    TGPopupMenu       *fMenuEdit;    // "Edit" popup menu
0075    TGPopupMenu       *fMenuHelp;    // "Help" popup menu
0076    TGStatusBar       *fStatusBar;   // guibuilder status bar
0077    TGFrame           *fSelected;    // selected frame
0078    TGMdiFrame        *fEditable;    // mdi frame where edited frame is  located
0079    TGuiBldEditor     *fEditor;      // frame property editor
0080    const TGPicture   *fIconPic;     // icon picture
0081    TGPictureButton   *fStartButton; // start button
0082    Int_t              fClosing;
0083 
0084    static TGGC       *fgBgnd;
0085    static TGGC       *fgBgndPopup;
0086    static TGGC       *fgBgndPopupHlght;
0087 
0088    void InitMenu();
0089    void EnableLassoButtons(Bool_t on = kTRUE);
0090    void EnableSelectedButtons(Bool_t on = kTRUE);
0091    void EnableEditButtons(Bool_t on = kTRUE);
0092    void BindKeys();
0093    TGButton *FindActionButton(const char *name, const char *section);
0094 
0095 public:
0096    TRootGuiBuilder(const TGWindow *p = nullptr);
0097    ~TRootGuiBuilder() override;
0098 
0099    void      AddAction(TGuiBldAction *act, const char *sect) override;
0100    virtual void      AddMacro(const char *macro, TImage *img);
0101    void      AddSection(const char *sect) override;
0102    TGFrame  *ExecuteAction() override;
0103    virtual void      HandleButtons();
0104    void      Show() override { MapRaised(); }
0105    void      Hide() override;
0106    virtual void      ChangeSelected(TGFrame *f);
0107    virtual void      Update();
0108    virtual Bool_t    IsSelectMode() const;
0109    virtual Bool_t    IsGrabButtonDown() const;
0110    virtual Bool_t    OpenProject(Event_t *event = nullptr);
0111    virtual Bool_t    SaveProject(Event_t *event = nullptr);
0112    virtual Bool_t    NewProject(TString type = "");
0113    Bool_t    HandleKey(Event_t *event) override;
0114    virtual void      HandleMenu(Int_t id);
0115    void      CloseWindow() override;
0116    virtual void      MaybeCloseWindow();
0117    virtual void      HandleWindowClosed(Int_t id);
0118    virtual void      UpdateStatusBar(const char *text = nullptr);
0119    virtual void      EraseStatusBar();
0120    virtual void      SwitchToolbarButton();
0121 
0122    TGMdiFrame *FindEditableMdiFrame(const TGWindow *win);
0123    TGuiBldEditor    *GetEditor() const { return fEditor; }
0124    TGDockableFrame  *GetToolDock() const { return fToolDock; }
0125    TGMdiMainFrame   *GetMdiMain() const { return fMain; }
0126    TGMdiFrame       *GetEditable() const { return fEditable; }
0127    TGuiBldDragManager  *GetManager() const { return fManager; }
0128 
0129    static ULong_t    GetBgnd();
0130    static TGGC      *GetBgndGC();
0131 
0132    static ULong_t    GetPopupBgnd();
0133    static TGGC      *GetPopupBgndGC();
0134 
0135    static ULong_t    GetPopupHlght();
0136    static TGGC      *GetPopupHlghtGC();
0137 
0138    static void       PropagateBgndColor(TGFrame *frame, Pixel_t color);
0139 
0140    static TGFrame     *HSplitter();
0141    static TGFrame     *VSplitter();
0142    static TGPopupMenu *CreatePopup();
0143    static TGFrame     *BuildListTree();
0144    static TGFrame     *BuildCanvas();
0145    static TGFrame     *BuildShutter();
0146    static TGFrame     *BuildTextEdit();
0147    static TGFrame     *BuildTab();
0148    static TGFrame     *BuildListBox();
0149    static TGFrame     *BuildComboBox();
0150    static TGFrame     *BuildH3DLine();
0151    static TGFrame     *BuildV3DLine();
0152    static TGFrame     *BuildHScrollBar();
0153    static TGFrame     *BuildVScrollBar();
0154    static TGFrame     *BuildHProgressBar();
0155    static TGFrame     *BuildVProgressBar();
0156 
0157 
0158    ClassDefOverride(TRootGuiBuilder,0)  // ROOT GUI Builder
0159 };
0160 
0161 
0162 #endif