32 class TGLabel :
public TGFrame {
49 TGTextLayout *fTLayout;
53 virtual void DoRedraw();
54 virtual void DrawText(GContext_t gc, Int_t x, Int_t y);
56 static const TGFont *fgDefaultFont;
57 static const TGGC *fgDefaultGC;
60 TGLabel(
const TGLabel&);
61 TGLabel& operator=(
const TGLabel&);
64 static FontStruct_t GetDefaultFontStruct();
65 static const TGGC &GetDefaultGC();
67 TGLabel(
const TGWindow *p, TGString *text,
68 GContext_t norm = GetDefaultGC()(),
69 FontStruct_t font = GetDefaultFontStruct(),
70 UInt_t options = kChildFrame,
71 Pixel_t back = GetDefaultFrameBackground());
72 TGLabel(
const TGWindow *p = 0,
const char *text = 0,
73 GContext_t norm = GetDefaultGC()(),
74 FontStruct_t font = GetDefaultFontStruct(),
75 UInt_t options = kChildFrame,
76 Pixel_t back = GetDefaultFrameBackground());
80 virtual TGDimension GetDefaultSize()
const;
82 const TGString *GetText()
const {
return fText; }
83 virtual const char *GetTitle()
const {
return fText->Data(); }
84 virtual void SetText(TGString *newText);
85 void SetText(
const char *newText) { SetText(
new TGString(newText)); }
86 virtual void ChangeText(
const char *newText) { SetText(newText); }
87 virtual void SetTitle(
const char *label) { SetText(label); }
88 void SetText(Int_t number) { SetText(
new TGString(number)); }
89 void SetTextJustify(Int_t tmode);
90 Int_t GetTextJustify()
const {
return fTMode; }
91 virtual void SetTextFont(TGFont *font, Bool_t global = kFALSE);
92 virtual void SetTextFont(FontStruct_t font, Bool_t global = kFALSE);
93 virtual void SetTextFont(
const char *fontName, Bool_t global = kFALSE);
94 virtual void SetTextColor(Pixel_t color, Bool_t global = kFALSE);
95 virtual void SetTextColor(TColor *color, Bool_t global = kFALSE);
96 virtual void SetForegroundColor(Pixel_t fore) { SetTextColor(fore); }
97 virtual void Disable(Bool_t on = kTRUE)
98 { fDisabled = on; fClient->NeedRedraw(
this); }
99 virtual void Enable() { fDisabled = kFALSE; fClient->NeedRedraw(
this); }
100 Bool_t IsDisabled()
const {
return fDisabled; }
101 Bool_t HasOwnFont()
const;
103 void SetWrapLength(Int_t wl) { fWrapLength = wl; Layout(); }
104 Int_t GetWrapLength()
const {
return fWrapLength; }
106 void Set3DStyle(Int_t style) { f3DStyle = style; fClient->NeedRedraw(
this); }
107 Int_t Get3DStyle()
const {
return f3DStyle; }
109 void SetMargins(Int_t left=0, Int_t right=0, Int_t top=0, Int_t bottom=0)
110 { fMLeft = left; fMRight = right; fMTop = top; fMBottom = bottom; }
111 Int_t GetLeftMargin()
const {
return fMLeft; }
112 Int_t GetRightMargin()
const {
return fMRight; }
113 Int_t GetTopMargin()
const {
return fMTop; }
114 Int_t GetBottomMargin()
const {
return fMBottom; }
116 GContext_t GetNormGC()
const {
return fNormGC; }
117 FontStruct_t GetFontStruct()
const {
return fFont->GetFontStruct(); }
118 TGFont *GetFont()
const {
return fFont; }
120 virtual void Layout();
121 virtual void SavePrimitive(std::ostream &out, Option_t *option =
"");