202 if (p && p->IsA()->
InheritsFrom(TGButtonGroup::Class())) {
338 Bool_t in = (
event->fX >= 0) && (
event->fY >= 0) &&
489 gval.
fTile =
gClient->GetResourcePool()->GetCheckeredPixmap();
952 Error(
"TGPictureButton",
"pixmap not found or the file format is not supported for button %d",
id);
981 Error(
"TGPictureButton",
"pixmap not found or the file format is not supported for button\n%s",
1008 if (!pic || !pic[0]) {
1009 if (p)
Error(
"TGPictureButton",
"pixmap not found or the file format is not supported for button");
1043 Error(
"SetPicture",
"pixmap not found or the file format is not supported for button %d\n%s",
1114 if (img)
delete img;
1121 img2->
Merge(img,
"overlay");
1193 Error(
"TGCheckButton",
"checked_t.xpm not found or the file format is not supported.");
1195 Error(
"TGCheckButton",
"unchecked_t.xpm not found or the file format is not supported.");
1197 Error(
"TGCheckButton",
"checked_dis_t.xpm not found or the file format is not supported.");
1199 Error(
"TGCheckButton",
"unchecked_dis_t.xpm not found or the file format is not supported.");
1338 Bool_t in = (
event->fX >= 0) && (
event->fY >= 0) &&
1557 Error(
"TGRadioButton",
"rbutton_*.xpm not found or the file format is not supported.");
1704 Bool_t in = (
event->fX >= 0) && (
event->fY >= 0) &&
1883 if (option && strstr(option,
"keep_names"))
1884 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
1887 out <<
" " <<
GetName() <<
"->SetState(kButtonDown);" << std::endl;
1890 out <<
" " <<
GetName() <<
"->SetState(kButtonDisabled);" << std::endl;
1893 out <<
" " <<
GetName() <<
"->SetState(kButtonEngaged);" << std::endl;
1897 out <<
" " <<
GetName() <<
"->ChangeBackground(ucolor);" << std::endl;
1904 out <<
GetName() <<
"->SetToolTipText(" << quote
1905 << tiptext << quote <<
");" << std::endl;
1909 << quote <<
");" << std::endl;
1922 if (outext.
First(
'\n') >= 0)
1928 parFont.
Form(
"%s::GetDefaultFontStruct()",IsA()->
GetName());
1929 parGC.
Form(
"%s::GetDefaultGC()()",IsA()->
GetName());
1935 parFont.
Form(
"ufont->GetFontStruct()");
1941 parGC.
Form(
"uGC->GetGC()");
1947 out <<
" TGTextButton *";
1949 <<
"," << quote << outext.
Data() << quote;
1955 out <<
");" << std::endl;
1957 out <<
"," <<
fWidgetId <<
");" << std::endl;
1960 out <<
"," <<
fWidgetId <<
"," << parGC <<
");" << std::endl;
1963 out <<
"," <<
fWidgetId <<
"," << parGC <<
"," << parFont <<
");" << std::endl;
1969 out <<
" " <<
GetName() <<
"->SetTextJustify(" <<
fTMode <<
");" << std::endl;
1975 <<
");" << std::endl;
1986 Error(
"SavePrimitive()",
"pixmap not found or the file format is not supported for picture button %d ",
fWidgetId);
1993 parGC.
Form(
"%s::GetDefaultGC()()",IsA()->
GetName());
1999 parGC.
Form(
"uGC->GetGC()");
2007 out <<
" TGPictureButton *";
2010 <<
",gClient->GetPicture(" << quote
2011 << picname << quote <<
")";
2016 out <<
");" << std::endl;
2018 out <<
"," <<
fWidgetId <<
");" << std::endl;
2021 out <<
"," <<
fWidgetId <<
"," << parGC.
Data() <<
");" << std::endl;
2025 <<
");" << std::endl;
2041 if (outext.
First(
'\n') >= 0)
2044 out <<
" TGCheckButton *";
2046 <<
"," << quote << outext.
Data() << quote;
2051 parFont.
Form(
"%s::GetDefaultFontStruct()",IsA()->
GetName());
2052 parGC.
Form(
"%s::GetDefaultGC()()",IsA()->
GetName());
2058 parFont.
Form(
"ufont->GetFontStruct()");
2064 parGC.
Form(
"uGC->GetGC()");
2072 out <<
");" << std::endl;
2074 out <<
"," <<
fWidgetId <<
");" << std::endl;
2077 out <<
"," <<
fWidgetId <<
"," << parGC <<
");" << std::endl;
2080 out <<
"," <<
fWidgetId <<
"," << parGC <<
"," << parFont <<
");" << std::endl;
2089 out <<
" " <<
GetName() <<
"->SetDisabledAndSelected(kTRUE);" << std::endl;
2091 out <<
" " <<
GetName() <<
"->SetDisabledAndSelected(kFALSE);" << std::endl;
2093 out <<
" " <<
GetName() <<
"->SetTextJustify(" <<
fTMode <<
");" << std::endl;
2109 if (outext.
First(
'\n') >= 0)
2112 out <<
" TGRadioButton *";
2114 <<
"," << quote << outext.
Data() << quote;
2119 parFont.
Form(
"%s::GetDefaultFontStruct()",IsA()->
GetName());
2120 parGC.
Form(
"%s::GetDefaultGC()()",IsA()->
GetName());
2126 parFont.
Form(
"ufont->GetFontStruct()");
2132 parGC.
Form(
"uGC->GetGC()");
2140 out <<
");" << std::endl;
2142 out <<
"," <<
fWidgetId <<
");" << std::endl;
2145 out <<
"," <<
fWidgetId <<
"," << parGC <<
");" << std::endl;
2148 out <<
"," <<
fWidgetId <<
"," << parGC <<
"," << parFont <<
");" << std::endl;
2157 out <<
" " <<
GetName() <<
"->SetDisabledAndSelected(kTRUE);" << std::endl;
2159 out <<
" " <<
GetName() <<
"->SetDisabledAndSelected(kFALSE);" << std::endl;
2161 out <<
" " <<
GetName() <<
"->SetTextJustify(" <<
fTMode <<
");" << std::endl;
2196 UInt_t lwidth = 0, lheight = 0;
2197 UInt_t twidth = 0, theight = 0;
2211 while (entry != 0) {
2217 if(twidth > lwidth) {
2220 if(theight > lheight) {
2257 fPopMenu->
Connect(
"Activated(Int_t)",
"TGSplitButton",
this,
"HandleMenu(Int_t)");
2339 Int_t max_ascent, max_descent;
2342 fTHeight = max_ascent + max_descent;
2362 Bool_t inTB = (
event->fX >= 0) && (
event->fY >= 0) &&
2580 Int_t n_entries = 0;
2590 if (n_entries <= 1) {
2591 Info(
"TGSplitButton",
"Only one entry in the menu.");
2597 0, 0, ax, ay, wdummy);
2739 if (
e->GetLabel()) {
2740 hot =
e->GetLabel()->GetHotChar();
2788 if (
width > bwidth) {
2791 longlabeltip =
kTRUE;
2793 Info(
"TGSplitbutton",
"Length of new label to long, label truncated.");
2856 if ((gc) && !global) {
2899 fPopMenu->
Connect(
"PoppedDown()",
"TGSplitButton",
this,
"SetMBState(=kButtonUp)");
2900 fPopMenu->
Connect(
"PoppedDown()",
"TGSplitButton",
this,
"MBReleased()");
2910 Connect(
"Clicked()",
"TGSplitButton",
this, str);
2918 fPopMenu->
Connect(
"PoppedDown()",
"TGSplitButton",
this,
"SetState(=kButtonUp)");
2919 fPopMenu->
Connect(
"PoppedDown()",
"TGSplitButton",
this,
"Released()");
2938 Bool_t in = (
event->fX >= 0) && (
event->fY >= 0) &&
3093 if (!hot || (hot != keysym))
continue;
3184 UInt_t dummya = 0, dummyb = 0;
3222 Connect(
"Clicked()",
"TGSplitButton",
this,
const Mask_t kWABitGravity
const Mask_t kGCBackground
const Mask_t kGCForeground
const Mask_t kKeyLockMask
const Mask_t kButtonPressMask
Handle_t FontH_t
Font handle (as opposed to Font_t which is an index)
const Mask_t kKeyMod1Mask
typically the Alt key
const Mask_t kGCFillStyle
const Mask_t kWAWinGravity
const Mask_t kAnyModifier
Handle_t Pixmap_t
Pixmap handle.
const Mask_t kButton1Mask
const Mask_t kPointerMotionMask
const Mask_t kKeyShiftMask
const Mask_t kKeyMod2Mask
typically mod on numeric keys
const Mask_t kButton3Mask
const Mask_t kLeaveWindowMask
const Mask_t kButton2Mask
Handle_t GContext_t
Graphics context handle.
const Mask_t kButtonReleaseMask
const Mask_t kGCGraphicsExposures
const Mask_t kEnterWindowMask
Handle_t FontStruct_t
Pointer to font structure.
ULong_t Pixel_t
Pixel value.
Handle_t Window_t
Window handle.
include TDocParser_001 C image html pict1_TDocParser_001 png width
void Info(const char *location, const char *msgfmt,...)
Use this function for informational messages.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
R__EXTERN TSystem * gSystem
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
void ProcessLine(TString cmd, Long_t msg, Long_t parm1, Long_t parm2)
Execute string "cmd" via the interpreter.
TGFont * GetFont(const char *font, Bool_t fixedDefault=kTRUE)
Get a font from the font pool.
const TGResourcePool * GetResourcePool() const
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
TGGCPool * GetGCPool() const
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
TGPicturePool * GetPicturePool() const
TGFontPool * GetFontPool() const
void FreePicture(const TGPicture *pic)
Free picture resource.
TGFont * GetFont(const char *font, Bool_t fixedDefault=kTRUE)
Get the specified font.
TGFont * FindFont(FontStruct_t font) const
Find font based on its font struct. Returns 0 if font is not found.
Encapsulate fonts used in the GUI system.
FontStruct_t GetFontStruct() const
virtual void SavePrimitive(std::ostream &out, Option_t *="")
Save the used font as a C++ statement(s) on output stream out.
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.
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
virtual void ChangeOptions(UInt_t options)
Change frame options. Options is an OR of the EFrameTypes.
virtual void SetSize(const TGDimension &s)
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
virtual void DoRedraw()
Redraw the frame.
UInt_t fOptions
frame options
UInt_t fHeight
frame height
Int_t fBorderWidth
frame border width
static const TGGC & GetHilightGC()
Get highlight color graphics context.
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
virtual UInt_t GetOptions() const
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
virtual void SendMessage(const TGWindow *w, Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
Send message (i.e.
static const TGGC & GetShadowGC()
Get shadow color graphics context.
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
Pixel_t fBackground
frame background color
static Pixel_t fgDefaultFrameBackground
TGGC * GetGC(GCValues_t *values, Bool_t rw=kFALSE)
Get the best matching graphics context depending on values.
void FreeGC(const TGGC *gc)
Delete graphics context if it is not used anymore.
TGGC * FindGC(const TGGC *gc)
Find graphics context. Returns 0 in case gc is not found.
Encapsulate a graphics context used in the low level graphics.
void SavePrimitive(std::ostream &out, Option_t *option="")
Save graphics context info as a C++ statement(s) on output stream out.
void SetFont(FontH_t v)
Set font.
Pixel_t GetForeground() const
void SetForeground(Pixel_t v)
Set foreground color.
const GCValues_t * GetAttributes() const
TGHotString is a string with a "hot" character underlined.
Defines top level windows that interact with the system Window Manager.
TGClient * fClient
Connection to display server.
Handle_t fId
X11/Win32 Window identifier.
const TGPicture * GetPicture(const char *name)
Get a picture from the picture pool.
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
const char * GetName() const
Returns name of object.
void Draw(Option_t *="")
Default Draw method for all objects.
Pixmap_t GetPicture() const
Cursor_t GetGrabCursor() const
TGGCPool * GetGCPool() const
const char * GetString() const
Yield an action as soon as it is clicked.
void Init()
Common initialization used by the different ctors.
virtual void Layout()
layout text button
virtual Bool_t HandleKey(Event_t *event)
Handle key event. This function will be called when the hotkey is hit.
static FontStruct_t GetDefaultFontStruct()
Return default font structure.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a text button widget as a C++ statement(s) on output stream out.
virtual void SetTextJustify(Int_t tmode)
Set text justification.
virtual void SetText(TGHotString *new_label)
Set new button text.
TGTextButton(const TGTextButton &)=delete
static const TGFont * fgDefaultFont
virtual ~TGTextButton()
Delete a text button widget.
Bool_t HasOwnFont() const
Returns kTRUE if text attributes are unique, returns kFALSE if text attributes are shared (global).
virtual void DoRedraw()
Draw the text button.
virtual void SetFont(FontStruct_t font, Bool_t global=kFALSE)
Changes text font.
virtual TGDimension GetDefaultSize() const
returns default size
virtual void SetTextColor(Pixel_t color, Bool_t global=kFALSE)
Changes text color.
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.
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.
ROOT GUI Window base class.
virtual void SetWindowName(const char *name=0)
Set window name.
virtual const TGWindow * GetMainFrame() const
Returns top level main frame.
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
virtual void RequestFocus()
request focus
const TGWindow * fParent
Parent window.
virtual Int_t MustCleanup() const
const TGWindow * GetParent() const
An abstract interface to image processing library.
virtual void SetImage(const Double_t *, UInt_t, UInt_t, TImagePalette *=0)
static TImage * Create()
Create an image.
virtual void Merge(const TImage *, const char *="alphablend", Int_t=0, Int_t=0)
virtual Pixmap_t GetPixmap()
virtual void FillRectangle(const char *=0, Int_t=0, Int_t=0, UInt_t=0, UInt_t=0)
virtual Pixmap_t GetMask()
virtual TObject * After(const TObject *obj) const
Returns the object after object obj.
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
virtual TObject * Before(const TObject *obj) const
Returns the object before object obj.
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
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.
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
Disconnects signal of this object from slot of receiver.
TString & Insert(Ssiz_t pos, const char *s)
Ssiz_t First(char c) const
Find first occurrence of a character c.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
void Resize(Ssiz_t n)
Resize the string. Truncate or add blanks as necessary.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
virtual Bool_t ExpandPathName(TString &path)
Expand a pathname getting rid of special shell characters like ~.
virtual const char * UnixPathName(const char *unixpathname)
Convert from a local pathname to a Unix pathname.
Short_t Max(Short_t a, Short_t b)
EGEventType fType
of event (see EGEventType)
Int_t fY
pointer x, y coordinates in event window
Window_t fWindow
window reported event is relative to
Graphics context structure.
ULong_t fBackground
background pixel
Mask_t fMask
bit mask specifying which fields are valid
Pixmap_t fTile
tile pixmap for tiling operations
Bool_t fGraphicsExposures
boolean, should exposures be generated
ULong_t fForeground
foreground pixel
Int_t fFillStyle
kFillSolid, kFillTiled, kFillStippled, kFillOpaeueStippled
Point structure (maps to the X11 XPoint structure)
Attributes that can be used when creating or changing a window.
Mask_t fMask
bit mask specifying which fields are valid
Int_t fWinGravity
one of the window gravity values
Int_t fBitGravity
one of bit gravity values