ROOT logo
// @(#)root/guibuilder:$Id: TRootGuiBuilder.h 20882 2007-11-19 11:31:26Z rdm $
// Author: Valeriy Onuchin   12/09/04

/*************************************************************************
 * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TRootGuiBuilder
#define ROOT_TRootGuiBuilder


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TRootGuiBuilder                                                      //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TGFrame
#include "TGFrame.h"
#endif
#ifndef ROOT_TGuiBuilder
#include "TGuiBuilder.h"
#endif

enum EGuiBuilderMenuIds {
   kGUIBLD_FILE_NEW,
   kGUIBLD_FILE_CLOSE,
   kGUIBLD_FILE_EXIT,
   kGUIBLD_FILE_START,
   kGUIBLD_FILE_STOP,
   kGUIBLD_FILE_SAVE,

   kGUIBLD_EDIT_PREF,

   kGUIBLD_WINDOW_HOR,
   kGUIBLD_WINDOW_VERT,
   kGUIBLD_WINDOW_CASCADE,
   kGUIBLD_WINDOW_OPAQUE,
   kGUIBLD_WINDOW_ARRANGE,

   kGUIBLD_HELP_CONTENTS,
   kGUIBLD_HELP_ABOUT,
   kGUIBLD_HELP_BUG
};


class TGShutter;
class TGMdiMainFrame;
class TGDockableFrame;
class TGMdiMenuBar;
class TGPopupMenu;
class TGStatusBar;
class TGuiBldDragManager;
class TGToolBar;
class TGMdiFrame;
class TGuiBldEditor;
class TGButton;
class TGPictureButton;
class TImage;
class TTimer;

class TRootGuiBuilder : public TGuiBuilder, public TGMainFrame {
friend class TGuiBldDragManager;

private:
   TGuiBldDragManager *fManager;    // drag and drop manager
   TGButton          *fActionButton;// action button 
   TGToolBar         *fToolBar;     // guibuider toolbar
   TGShutter         *fShutter;     // widget palette
   TGMdiMainFrame    *fMain;        // main mdi frame
   TGDockableFrame   *fToolDock;    // dockable frame where toolbar is located 
   TGDockableFrame   *fShutterDock; // dockable frame where widget palette is located  
   TGMdiMenuBar      *fMenuBar;     // guibuilder menu bar
   TGPopupMenu       *fMenuFile;    // "File" popup menu
   TGPopupMenu       *fMenuWindow;  // "Window" popup menu
   TGPopupMenu       *fMenuEdit;    // "Edit" popup menu
   TGPopupMenu       *fMenuHelp;    // "Help" popup menu
   TGStatusBar       *fStatusBar;   //  guibuilder status bar
   TGFrame           *fSelected;    //  selected frame
   TGMdiFrame        *fEditable;    //  mdi frame where editted frame is  located
   TGuiBldEditor     *fEditor;      // frame property editor
   const TGPicture   *fIconPic;     // icon picture
   TGPictureButton   *fStartButton; // start button

   static TGGC       *fgBgnd;
   static TGGC       *fgBgndPopup;
   static TGGC       *fgBgndPopupHlght;

   void InitMenu();
   void EnableLassoButtons(Bool_t on = kTRUE);
   void EnableSelectedButtons(Bool_t on = kTRUE);
   void EnableEditButtons(Bool_t on = kTRUE);
   void BindKeys();
   TGButton *FindActionButton(const char *name, const char *section);

public:
   TRootGuiBuilder(const TGWindow *p = 0);
   virtual ~TRootGuiBuilder();

   virtual void      AddAction(TGuiBldAction *act, const char *sect);
   virtual void      AddMacro(const char *macro, TImage *img);
   virtual void      AddSection(const char *sect);
   virtual TGFrame  *ExecuteAction();
   virtual void      HandleButtons();
   virtual void      Show() { MapRaised(); }
   virtual void      Hide();
   virtual void      ChangeSelected(TGFrame *f);
   virtual void      Update();
   virtual Bool_t    IsSelectMode() const;
   virtual Bool_t    IsGrabButtonDown() const;
   virtual Bool_t    OpenProject(Event_t *event = 0);
   virtual Bool_t    SaveProject(Event_t *event = 0);
   virtual Bool_t    NewProject(Event_t *event = 0);
   virtual Bool_t    HandleKey(Event_t *event);
   virtual void      HandleMenu(Int_t id);
   virtual void      CloseWindow();
   virtual void      HandleWindowClosed(Int_t id);
   virtual void      UpdateStatusBar(const char *text = 0);
   virtual void      EraseStatusBar();
   virtual void      SwitchToolbarButton();

   TGMdiFrame *FindEditableMdiFrame(const TGWindow *win);
   TGuiBldEditor    *GetEditor() const { return fEditor; }
   TGDockableFrame  *GetToolDock() const { return fToolDock; }
   TGMdiMainFrame   *GetMdiMain() const { return fMain; }  
   TGMdiFrame       *GetEditable() const { return fEditable; }

   static ULong_t    GetBgnd();
   static TGGC      *GetBgndGC();

   static ULong_t    GetPopupBgnd();
   static TGGC      *GetPopupBgndGC();

   static ULong_t    GetPopupHlght();
   static TGGC      *GetPopupHlghtGC();

   static void       PropagateBgndColor(TGFrame *frame, Pixel_t color);

   static TGFrame     *HSplitter();
   static TGFrame     *VSplitter();
   static TGPopupMenu *CreatePopup();
   static TGFrame     *BuildListTree();
   static TGFrame     *BuildCanvas();
   static TGFrame     *BuildShutter();
   static TGFrame     *BuildTextEdit();
   static TGFrame     *BuildTab();
   static TGFrame     *BuildListBox();
   static TGFrame     *BuildComboBox();
   static TGFrame     *BuildH3DLine();
   static TGFrame     *BuildV3DLine();
   static TGFrame     *BuildHScrollBar();
   static TGFrame     *BuildVScrollBar();
   static TGFrame     *BuildHProgressBar();
   static TGFrame     *BuildVProgressBar();

   ClassDef(TRootGuiBuilder,0)  // ROOT GUI Builder
};


#endif
 TRootGuiBuilder.h:1
 TRootGuiBuilder.h:2
 TRootGuiBuilder.h:3
 TRootGuiBuilder.h:4
 TRootGuiBuilder.h:5
 TRootGuiBuilder.h:6
 TRootGuiBuilder.h:7
 TRootGuiBuilder.h:8
 TRootGuiBuilder.h:9
 TRootGuiBuilder.h:10
 TRootGuiBuilder.h:11
 TRootGuiBuilder.h:12
 TRootGuiBuilder.h:13
 TRootGuiBuilder.h:14
 TRootGuiBuilder.h:15
 TRootGuiBuilder.h:16
 TRootGuiBuilder.h:17
 TRootGuiBuilder.h:18
 TRootGuiBuilder.h:19
 TRootGuiBuilder.h:20
 TRootGuiBuilder.h:21
 TRootGuiBuilder.h:22
 TRootGuiBuilder.h:23
 TRootGuiBuilder.h:24
 TRootGuiBuilder.h:25
 TRootGuiBuilder.h:26
 TRootGuiBuilder.h:27
 TRootGuiBuilder.h:28
 TRootGuiBuilder.h:29
 TRootGuiBuilder.h:30
 TRootGuiBuilder.h:31
 TRootGuiBuilder.h:32
 TRootGuiBuilder.h:33
 TRootGuiBuilder.h:34
 TRootGuiBuilder.h:35
 TRootGuiBuilder.h:36
 TRootGuiBuilder.h:37
 TRootGuiBuilder.h:38
 TRootGuiBuilder.h:39
 TRootGuiBuilder.h:40
 TRootGuiBuilder.h:41
 TRootGuiBuilder.h:42
 TRootGuiBuilder.h:43
 TRootGuiBuilder.h:44
 TRootGuiBuilder.h:45
 TRootGuiBuilder.h:46
 TRootGuiBuilder.h:47
 TRootGuiBuilder.h:48
 TRootGuiBuilder.h:49
 TRootGuiBuilder.h:50
 TRootGuiBuilder.h:51
 TRootGuiBuilder.h:52
 TRootGuiBuilder.h:53
 TRootGuiBuilder.h:54
 TRootGuiBuilder.h:55
 TRootGuiBuilder.h:56
 TRootGuiBuilder.h:57
 TRootGuiBuilder.h:58
 TRootGuiBuilder.h:59
 TRootGuiBuilder.h:60
 TRootGuiBuilder.h:61
 TRootGuiBuilder.h:62
 TRootGuiBuilder.h:63
 TRootGuiBuilder.h:64
 TRootGuiBuilder.h:65
 TRootGuiBuilder.h:66
 TRootGuiBuilder.h:67
 TRootGuiBuilder.h:68
 TRootGuiBuilder.h:69
 TRootGuiBuilder.h:70
 TRootGuiBuilder.h:71
 TRootGuiBuilder.h:72
 TRootGuiBuilder.h:73
 TRootGuiBuilder.h:74
 TRootGuiBuilder.h:75
 TRootGuiBuilder.h:76
 TRootGuiBuilder.h:77
 TRootGuiBuilder.h:78
 TRootGuiBuilder.h:79
 TRootGuiBuilder.h:80
 TRootGuiBuilder.h:81
 TRootGuiBuilder.h:82
 TRootGuiBuilder.h:83
 TRootGuiBuilder.h:84
 TRootGuiBuilder.h:85
 TRootGuiBuilder.h:86
 TRootGuiBuilder.h:87
 TRootGuiBuilder.h:88
 TRootGuiBuilder.h:89
 TRootGuiBuilder.h:90
 TRootGuiBuilder.h:91
 TRootGuiBuilder.h:92
 TRootGuiBuilder.h:93
 TRootGuiBuilder.h:94
 TRootGuiBuilder.h:95
 TRootGuiBuilder.h:96
 TRootGuiBuilder.h:97
 TRootGuiBuilder.h:98
 TRootGuiBuilder.h:99
 TRootGuiBuilder.h:100
 TRootGuiBuilder.h:101
 TRootGuiBuilder.h:102
 TRootGuiBuilder.h:103
 TRootGuiBuilder.h:104
 TRootGuiBuilder.h:105
 TRootGuiBuilder.h:106
 TRootGuiBuilder.h:107
 TRootGuiBuilder.h:108
 TRootGuiBuilder.h:109
 TRootGuiBuilder.h:110
 TRootGuiBuilder.h:111
 TRootGuiBuilder.h:112
 TRootGuiBuilder.h:113
 TRootGuiBuilder.h:114
 TRootGuiBuilder.h:115
 TRootGuiBuilder.h:116
 TRootGuiBuilder.h:117
 TRootGuiBuilder.h:118
 TRootGuiBuilder.h:119
 TRootGuiBuilder.h:120
 TRootGuiBuilder.h:121
 TRootGuiBuilder.h:122
 TRootGuiBuilder.h:123
 TRootGuiBuilder.h:124
 TRootGuiBuilder.h:125
 TRootGuiBuilder.h:126
 TRootGuiBuilder.h:127
 TRootGuiBuilder.h:128
 TRootGuiBuilder.h:129
 TRootGuiBuilder.h:130
 TRootGuiBuilder.h:131
 TRootGuiBuilder.h:132
 TRootGuiBuilder.h:133
 TRootGuiBuilder.h:134
 TRootGuiBuilder.h:135
 TRootGuiBuilder.h:136
 TRootGuiBuilder.h:137
 TRootGuiBuilder.h:138
 TRootGuiBuilder.h:139
 TRootGuiBuilder.h:140
 TRootGuiBuilder.h:141
 TRootGuiBuilder.h:142
 TRootGuiBuilder.h:143
 TRootGuiBuilder.h:144
 TRootGuiBuilder.h:145
 TRootGuiBuilder.h:146
 TRootGuiBuilder.h:147
 TRootGuiBuilder.h:148
 TRootGuiBuilder.h:149
 TRootGuiBuilder.h:150
 TRootGuiBuilder.h:151
 TRootGuiBuilder.h:152
 TRootGuiBuilder.h:153
 TRootGuiBuilder.h:154
 TRootGuiBuilder.h:155
 TRootGuiBuilder.h:156
 TRootGuiBuilder.h:157
 TRootGuiBuilder.h:158
 TRootGuiBuilder.h:159
 TRootGuiBuilder.h:160
 TRootGuiBuilder.h:161
 TRootGuiBuilder.h:162
 TRootGuiBuilder.h:163
 TRootGuiBuilder.h:164