00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef ROOT_TGFontDialog
00013 #define ROOT_TGFontDialog
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef ROOT_TGFrame
00025 #include "TGFrame.h"
00026 #endif
00027
00028
00029
00030 class TGButton;
00031 class TGLabel;
00032 class TGListBox;
00033 class TGComboBox;
00034 class TGColorSelect;
00035 class TGFont;
00036
00037
00038 class TGFontDialog : public TGTransientFrame {
00039
00040 public:
00041 struct FontProp_t {
00042 TString fName;
00043 Int_t fSize;
00044 UInt_t fAlign;
00045 Pixel_t fColor;
00046 Bool_t fBold;
00047 Bool_t fItalic;
00048 };
00049
00050 protected:
00051 TGListBox *fFontNames;
00052 TGListBox *fFontSizes;
00053 TGListBox *fFontStyles;
00054 TGComboBox *fTextAligns;
00055 TGLabel *fSample;
00056 TGColorSelect *fColorSelect;
00057 TString fName;
00058 TString fLName;
00059 FontProp_t *fFontProp;
00060 Bool_t fItalic;
00061 Bool_t fBold;
00062 Int_t fSize;
00063 Int_t fTextAlign;
00064 Pixel_t fTextColor;
00065 Pixel_t fInitColor;
00066 Int_t fInitAlign;
00067 TGFont *fInitFont;
00068 TString fSampleText;
00069 TGGC *fSampleTextGC;
00070 TGFont *fLabelFont;
00071 Bool_t fHitOK;
00072 Int_t fNumberOfFonts;
00073 Bool_t fWaitFor;
00074
00075 Bool_t Build(char **fontList, Int_t cnt);
00076 void GetFontName();
00077 virtual void CloseWindow();
00078 virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
00079
00080 public:
00081 TGFontDialog(const TGWindow *parent = 0, const TGWindow *t = 0,
00082 FontProp_t *fontProp = 0, const TString &sample = "",
00083 char **fontList = 0, Bool_t wait = kTRUE);
00084 virtual ~TGFontDialog();
00085
00086 virtual void SetFont(TGFont *font);
00087 virtual void SetColor(Pixel_t color);
00088 virtual void SetAlign(Int_t align);
00089 virtual void EnableAlign(Bool_t on = kTRUE);
00090 virtual void UpdateStyleSize(const char *family);
00091
00092 virtual void FontSelected(char *font)
00093 { Emit("FontSelected(char*)", font); }
00094 virtual void AlignSelected(Int_t a)
00095 { Emit("AlignSelected(Int_t)", a); }
00096 virtual void ColorSelected(Pixel_t c)
00097 { Emit("ColorSelected(Pixel_t)", c); }
00098
00099 ClassDef(TGFontDialog,0)
00100 };
00101
00102 #endif