138 fTWidth = fTHeight = 0;
157 fBgndColor = fBackground;
158 fHighColor =
gClient->GetResourcePool()->GetHighLightColor();
239 if (style && strstr(style,
"modern")) {
288 Bool_t in = (
event->fX >= 0) && (event->
fY >= 0) &&
402 if (text && strlen(text))
439 gval.
fTile =
gClient->GetResourcePool()->GetCheckeredPixmap();
902 Error(
"TGPictureButton",
"pixmap not found for button %d",
id);
931 Error(
"TGPictureButton",
"pixmap not found for button\n%s",
958 if (!pic || !pic[0]) {
959 if (p)
Error(
"TGPictureButton",
"pixmap not found for button");
993 Error(
"SetPicture",
"pixmap not found for button %d\n%s",
1064 if (img)
delete img;
1071 img2->
Merge(img,
"overlay");
1143 Error(
"TGCheckButton",
"checked_t.xpm not found");
1145 Error(
"TGCheckButton",
"unchecked_t.xpm not found");
1147 Error(
"TGCheckButton",
"checked_dis_t.xpm not found");
1149 Error(
"TGCheckButton",
"unchecked_dis_t.xpm not found");
1288 Bool_t in = (
event->fX >= 0) && (event->
fY >= 0) &&
1507 Error(
"TGRadioButton",
"rbutton_*.xpm not found");
1654 Bool_t in = (
event->fX >= 0) && (event->
fY >= 0) &&
1833 if (option && strstr(option,
"keep_names"))
1834 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
1837 out <<
" " <<
GetName() <<
"->SetState(kButtonDown);" << std::endl;
1840 out <<
" " <<
GetName() <<
"->SetState(kButtonDisabled);" << std::endl;
1843 out <<
" " <<
GetName() <<
"->SetState(kButtonEngaged);" << std::endl;
1847 out <<
" " <<
GetName() <<
"->ChangeBackground(ucolor);" << std::endl;
1854 out <<
GetName() <<
"->SetToolTipText(" << quote
1855 << tiptext << quote <<
");" << std::endl;
1859 << quote <<
");" << std::endl;
1872 if (outext.First(
'\n') >= 0)
1878 parFont.
Form(
"%s::GetDefaultFontStruct()",IsA()->
GetName());
1879 parGC.
Form(
"%s::GetDefaultGC()()",IsA()->
GetName());
1885 parFont.
Form(
"ufont->GetFontStruct()");
1891 parGC.
Form(
"uGC->GetGC()");
1897 out <<
" TGTextButton *";
1899 <<
"," << quote << outext.Data() << quote;
1905 out <<
");" << std::endl;
1907 out <<
"," <<
fWidgetId <<
");" << std::endl;
1910 out <<
"," <<
fWidgetId <<
"," << parGC <<
");" << std::endl;
1913 out <<
"," <<
fWidgetId <<
"," << parGC <<
"," << parFont <<
");" << std::endl;
1919 out <<
" " <<
GetName() <<
"->SetTextJustify(" <<
fTMode <<
");" << std::endl;
1925 <<
");" << std::endl;
1936 Error(
"SavePrimitive()",
"pixmap not found for picture button %d ",
fWidgetId);
1943 parGC.
Form(
"%s::GetDefaultGC()()",IsA()->
GetName());
1949 parGC.
Form(
"uGC->GetGC()");
1954 const char *picname = fPic->GetName();
1956 out <<
" TGPictureButton *";
1959 <<
",gClient->GetPicture(" << quote
1965 out <<
");" << std::endl;
1967 out <<
"," <<
fWidgetId <<
");" << std::endl;
1970 out <<
"," <<
fWidgetId <<
"," << parGC.
Data() <<
");" << std::endl;
1974 <<
");" << std::endl;
1990 if (outext.First(
'\n') >= 0)
1993 out <<
" TGCheckButton *";
1995 <<
"," << quote << outext.Data() << quote;
2000 parFont.
Form(
"%s::GetDefaultFontStruct()",IsA()->
GetName());
2001 parGC.
Form(
"%s::GetDefaultGC()()",IsA()->
GetName());
2007 parFont.
Form(
"ufont->GetFontStruct()");
2013 parGC.
Form(
"uGC->GetGC()");
2021 out <<
");" << std::endl;
2023 out <<
"," <<
fWidgetId <<
");" << std::endl;
2026 out <<
"," <<
fWidgetId <<
"," << parGC <<
");" << std::endl;
2029 out <<
"," <<
fWidgetId <<
"," << parGC <<
"," << parFont <<
");" << std::endl;
2038 out <<
" " <<
GetName() <<
"->SetDisabledAndSelected(kTRUE);" << std::endl;
2040 out <<
" " <<
GetName() <<
"->SetDisabledAndSelected(kFALSE);" << std::endl;
2042 out <<
" " <<
GetName() <<
"->SetTextJustify(" <<
fTMode <<
");" << std::endl;
2058 if (outext.First(
'\n') >= 0)
2061 out <<
" TGRadioButton *";
2063 <<
"," << quote << outext.Data() << quote;
2068 parFont.
Form(
"%s::GetDefaultFontStruct()",IsA()->
GetName());
2069 parGC.
Form(
"%s::GetDefaultGC()()",IsA()->
GetName());
2075 parFont.
Form(
"ufont->GetFontStruct()");
2081 parGC.
Form(
"uGC->GetGC()");
2089 out <<
");" << std::endl;
2091 out <<
"," <<
fWidgetId <<
");" << std::endl;
2094 out <<
"," <<
fWidgetId <<
"," << parGC <<
");" << std::endl;
2097 out <<
"," <<
fWidgetId <<
"," << parGC <<
"," << parFont <<
");" << std::endl;
2106 out <<
" " <<
GetName() <<
"->SetDisabledAndSelected(kTRUE);" << std::endl;
2108 out <<
" " <<
GetName() <<
"->SetDisabledAndSelected(kFALSE);" << std::endl;
2110 out <<
" " <<
GetName() <<
"->SetTextJustify(" <<
fTMode <<
");" << std::endl;
2125 :
TGTextButton(p, menulabel, id, norm, fontstruct, options)
2145 UInt_t lwidth = 0, lheight = 0;
2146 UInt_t twidth = 0, theight = 0;
2160 while (entry != 0) {
2166 if(twidth > lwidth) {
2169 if(theight > lheight) {
2206 fPopMenu->
Connect(
"Activated(Int_t)",
"TGSplitButton",
this,
"HandleMenu(Int_t)");
2275 points[1].
fX = x + 5;
2277 points[2].
fX = x + 2;
2278 points[2].
fY = y + 3;
2288 Int_t max_ascent, max_descent;
2291 fTHeight = max_ascent + max_descent;
2311 Bool_t inTB = (
event->fX >= 0) && (event->
fY >= 0) &&
2529 Int_t n_entries = 0;
2539 if (n_entries <= 1) {
2540 Info(
"TGSplitButton",
"Only one entry in the menu.");
2546 0, 0, ax, ay, wdummy);
2737 if (width > bwidth) {
2740 longlabeltip =
kTRUE;
2742 Info(
"TGSplitbutton",
"Length of new label to long, label truncated.");
2805 if ((gc) && !global) {
2848 fPopMenu->
Connect(
"PoppedDown()",
"TGSplitButton",
this,
"SetMBState(=kButtonUp)");
2849 fPopMenu->
Connect(
"PoppedDown()",
"TGSplitButton",
this,
"MBReleased()");
2859 Connect(
"Clicked()",
"TGSplitButton",
this, str);
2867 fPopMenu->
Connect(
"PoppedDown()",
"TGSplitButton",
this,
"SetState(=kButtonUp)");
2868 fPopMenu->
Connect(
"PoppedDown()",
"TGSplitButton",
this,
"Released()");
2887 Bool_t in = (
event->fX >= 0) && (event->
fY >= 0) &&
3034 gVirtualX->LookupString(event, tmp,
sizeof(tmp), keysym);
3042 if (!hot || (hot != keysym))
continue;
3133 UInt_t dummya = 0, dummyb = 0;
3171 Connect(
"Clicked()",
"TGSplitButton",
this,
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
static FontStruct_t GetDefaultFontStruct()
Return default font structure.
Cursor_t GetGrabCursor() const
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
TGFont * FindFont(FontStruct_t font) const
Find font based on its font struct. Returns 0 if font is not found.
virtual UInt_t GetOptions() const
TGTextButton(const TGTextButton &)
const Mask_t kButton2Mask
const char * GetName() const
Returns name of object.
const Mask_t kKeyMod2Mask
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
const Mask_t kKeyShiftMask
const Mask_t kKeyMod1Mask
TString & ReplaceAll(const TString &s1, const TString &s2)
void SetForeground(Pixel_t v)
Set foreground color.
static const TGGC & GetHilightGC()
Get highlight color graphics context.
const Mask_t kLeaveWindowMask
virtual ~TGTextButton()
Delete a text button widget.
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
virtual void SetTextColor(Pixel_t color, Bool_t global=kFALSE)
Changes text color.
virtual void SetTextJustify(Int_t tmode)
Set text justification.
const Mask_t kWABitGravity
const TGResourcePool * GetResourcePool() const
Bool_t HasOwnFont() const
Returns kTRUE if text attributes are unique, returns kFALSE if text attributes are shared (global)...
virtual void Layout()
layout text button
void DrawText(Drawable_t dst, GContext_t gc, Int_t x, Int_t y, Int_t firstChar, Int_t lastChar) const
Use the information in the TGTextLayout object to display a multi-line, justified string of text...
An abstract interface to image processing library.
virtual void Merge(const TImage *, const char *="alphablend", Int_t=0, Int_t=0)
TGGC * FindGC(const TGGC *gc)
Find graphics context. Returns 0 in case gc is not found.
TString & Insert(Ssiz_t pos, const char *s)
virtual void SavePrimitive(std::ostream &out, Option_t *="")
Save the used font as a C++ statement(s) on output stream out.
virtual void SetImage(const Double_t *, UInt_t, UInt_t, TImagePalette *=0)
virtual Pixmap_t GetPixmap()
virtual const char * UnixPathName(const char *unixpathname)
Convert from a Unix pathname to a local pathname.
void Draw(Option_t *="")
Default Draw method for all objects.
const Mask_t kPointerMotionMask
virtual void DoRedraw()
Redraw the frame.
virtual void FillRectangle(const char *=0, Int_t=0, Int_t=0, UInt_t=0, UInt_t=0)
virtual Int_t MustCleanup() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
TGPicturePool * GetPicturePool() const
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
virtual void DoRedraw()
Draw the text button.
void FreePicture(const TGPicture *pic)
Free picture resource.
void ProcessLine(TString cmd, Long_t msg, Long_t parm1, Long_t parm2)
Execute string "cmd" via the interpreter.
const Mask_t kKeyLockMask
const Mask_t kGCGraphicsExposures
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
virtual const TGWindow * GetMainFrame() const
Returns top level main frame.
virtual Bool_t BindKey(const TGWindow *w, Int_t keycode, Int_t modifier) const
Bind key to a window.
virtual void RequestFocus()
const GCValues_t * GetAttributes() const
void UnderlineChar(Drawable_t dst, GContext_t gc, Int_t x, Int_t y, Int_t underline) const
Use the information in the TGTextLayout object to display an underline below an individual character...
virtual TGDimension GetDefaultSize() const
returns default size
const Mask_t kButtonPressMask
Pixmap_t GetPicture() const
const Mask_t kButton3Mask
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot...
void SetFont(FontH_t v)
Set font.
Bool_t fGraphicsExposures
virtual void SetSize(const TGDimension &s)
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
R__EXTERN TSystem * gSystem
Pixel_t GetForeground() const
virtual Int_t GetValue(const char *name, Int_t dflt)
Returns the integer value for a resource.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
virtual TObject * Before(const TObject *obj) const
Returns the object before object obj.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
void Init()
Common initialization used by the different ctors.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
const TGPicture * GetPicture(const char *name)
Get a picture from the picture pool.
static Pixel_t fgDefaultFrameBackground
virtual TObject * After(const TObject *obj) const
Returns the object after object obj.
const char * GetString() const
virtual void SetText(TGHotString *new_label)
Set new button text.
TGFontPool * GetFontPool() const
const Mask_t kEnterWindowMask
TGFont * GetFont(const char *font, Bool_t fixedDefault=kTRUE)
Get the specified font.
void SavePrimitive(std::ostream &out, Option_t *option="")
Save graphics context info as a C++ statement(s) on output stream out.
const Mask_t kGCFillStyle
virtual Pixmap_t GetMask()
const Mask_t kButtonReleaseMask
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
static RooMathCoreReg dummy
TGTextLayout * ComputeTextLayout(const char *string, Int_t numChars, Int_t wrapLength, Int_t justify, Int_t flags, UInt_t *width, UInt_t *height) const
Computes the amount of screen space needed to display a multi-line, justified string of text...
FontStruct_t GetFontStruct() const
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a text button widget as a C++ statement(s) on output stream out.
const Mask_t kWAWinGravity
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
Disconnects signal of this object from slot of receiver.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t e
const Mask_t kGCForeground
const TGWindow * GetParent() const
TGGCPool * GetGCPool() const
virtual void RemoveBind(const TGWindow *w, Int_t keycode, Int_t modifier) const
Remove key binding.
const Mask_t kGCBackground
Short_t Max(Short_t a, Short_t b)
static const TGFont * fgDefaultFont
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
virtual Bool_t HandleKey(Event_t *event)
Handle key event. This function will be called when the hotkey is hit.
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
float type_of_call hi(const int &, const int &)
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
virtual void SetFont(FontStruct_t font, Bool_t global=kFALSE)
Changes text font.
static TImage * Create()
Create an image.
const Mask_t kAnyModifier
double norm(double *x, double *p)
const Mask_t kButton1Mask
virtual void ChangeOptions(UInt_t options)
Change frame options. Options is an OR of the EFrameTypes.
static const TGGC & GetShadowGC()
Get shadow color graphics context.
int main(int argc, char **argv)
TGFont * GetFont(const char *font, Bool_t fixedDefault=kTRUE)
Get a font from the font pool.
void FreeGC(const TGGC *gc)
Delete graphics context if it is not used anymore.
void Resize(Ssiz_t n)
Resize the string. Truncate or add blanks as necessary.
virtual void SetWindowName(const char *name=0)
Set window name.
TGGC * GetGC(GCValues_t *values, Bool_t rw=kFALSE)
Get the best matching graphics context depending on values.
TGGCPool * GetGCPool() const
const char * Data() const