00001
00022 #ifndef _QGUI_BASE_FRAME_HH_
00023 #define _QGUI_BASE_FRAME_HH_
00024
00025
00026
00027
00028
00029
00030
00031 #include "TGFrame.h"
00032 #include "TROOT.h"
00033 #include "Rtypes.h"
00034 #include "TGTextView.h"
00035
00036
00037 #include <list>
00038
00039
00040
00041 class TGIcon;
00042 class TGPictures;
00043 class TGTextView;
00044 class TGLayoutHints;
00045
00046 class QGUIBaseFrame: public TGTransientFrame
00047 {
00048
00049 public:
00050
00051
00052
00053 enum QGUIButtons_t
00054 {
00055 QGUI_CANCEL =0,
00056 QGUI_YES =1,
00057 QGUI_OK =3,
00058 QGUI_NO =4,
00059 QGUI_RETRY =5,
00060 QGUI_CLOSE =6,
00061 QGUI_IGNORE =7
00062 };
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075 QGUIBaseFrame(const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h, UInt_t Options);
00076
00077
00078 virtual ~QGUIBaseFrame();
00079
00080
00081 virtual void CloseWindow();
00082
00083
00084 void Closed() {Emit("Closed()");}
00085
00086
00087 protected:
00088
00089
00090 inline const bool IsColored() const {return fIsColor; }
00091
00092
00093 inline void SetDebugColor(bool isColored) {fIsColor=isColored;return;}
00094 inline void EnableColor() {SetDebugColor(true) ;return;}
00095 inline void DisableColor() {SetDebugColor(false);return;}
00096
00097
00098
00099 const std::string GetROOTVersion() const{return std::string(gROOT->GetVersion());}
00100
00101
00102 void SetMainFrameName(const std::string& qName);
00103 inline const std::string GetMainFrameName() const {return std::string(GetWindowName());}
00104
00105
00106 inline void SetWho(const std::string& qWho) {fWho=qWho;return;}
00107 inline const std::string& GetWho() const {return fWho;}
00108
00109
00110
00111 void NoResizable();
00112
00113
00114 bool AddImageToFrame(const std::string& qPathName, TGCompositeFrame* qFrame, size_t qWidth, size_t qHeight,
00115 int qLeft, int qRight, int qTop, int qBottom,
00116 size_t qOptions);
00117
00118
00119 bool AddImageToFrame(const std::string& qPathName, TGCompositeFrame* qFrame, size_t qWidth, size_t qHeight,
00120 size_t qOptions);
00121
00122
00123 void AddWritingToFrame(TGCompositeFrame* qFrame, const std::string& qWriting);
00124
00125
00126
00127 void AddLogger(TGCompositeFrame* qParent, TGTextView* &qLog, TGGroupFrame* qGroup);
00128
00129
00130
00131 TGHorizontalFrame* CreateHFrame(TGCompositeFrame* qParent,
00132 size_t qWidth, size_t qHeight);
00133
00134
00135 TGHorizontalFrame* CreateHFrame(TGCompositeFrame* qParent,
00136 int qLeft, int qRight, int qTop, int qBottom,
00137 size_t qWidth, size_t qHeight);
00138
00139
00140
00141 TGVerticalFrame* CreateVFrame(TGCompositeFrame* qParent,
00142 size_t qWidth, size_t qHeight);
00143
00144
00145 TGVerticalFrame* CreateVFrame(TGCompositeFrame* qParent,
00146 int qLeft, int qRight, int qTop, int qBottom,
00147 size_t qWidth, size_t qHeight);
00148
00149
00150 const std::string GetTime();
00151
00152
00153 void SendMsgOnScreen(const std::string& qWho, const std::string& qMsg, bool without);
00154 void SendMsgOnScreen(const std::string& qMsg, bool without) {return SendMsgOnScreen(GetWho(),qMsg,without);}
00155 void SendMsgOnScreen(const std::string& qMsg) {return SendMsgOnScreen(GetWho(),qMsg,false);}
00156
00157
00158 void SetMessage(TGTextView* qLog, const std::string& qMsg, bool without);
00159 void SetMessage(TGTextView* qLog, const std::string& qMsg) {return SetMessage(qLog,qMsg,false);}
00160
00161
00162 std::string ToString(int Value, size_t nDigit);
00163 std::string ToString(int Value) {return ToString(Value,4);}
00164
00165 TGLayoutHints* AddHints(const ULong_t& hints = kLHintsNormal,
00166 const Int_t& padLeft = 0,
00167 const Int_t& padRight = 0,
00168 const Int_t& padTop = 0,
00169 const Int_t& padBottom = 0);
00170
00171
00172 private:
00173
00174 TGIcon *fIcon;
00175 const TGPicture *fPicture;
00176
00177
00178 std::string fWho;
00179
00180
00181
00182 bool fIsColor;
00183
00184 TGLayoutHints* FindHints(const ULong_t& hints = kLHintsNormal,
00185 const Int_t& padLeft = 0,
00186 const Int_t& padRight = 0,
00187 const Int_t& padTop = 0,
00188 const Int_t& padBottom = 0) const;
00189
00190 void CleanHints();
00191
00192 std::list<TGLayoutHints*> fHints;
00193
00194
00195
00196 ClassDef(QGUIBaseFrame,0)
00197
00198 };
00199
00200 #endif // _QGUI_BASE_FRAME_HH_