197 TGButtonGroup *bg = (TGButtonGroup*) p;
198 bg->Insert(this, id);
332 Bool_t in = (
event->fX >= 0) && (event->
fY >= 0) &&
483 gval.
fTile =
gClient->GetResourcePool()->GetCheckeredPixmap();
561 if ((hotchar =
fLabel->GetHotChar()) != 0) {
659 if ((hotchar =
fLabel->GetHotChar()) != 0) {
946 Error(
"TGPictureButton",
"pixmap not found or the file format is not supported for button %d",
id);
975 Error(
"TGPictureButton",
"pixmap not found or the file format is not supported for button\n%s",
1002 if (!pic || !pic[0]) {
1003 if (p)
Error(
"TGPictureButton",
"pixmap not found or the file format is not supported for button");
1037 Error(
"SetPicture",
"pixmap not found or the file format is not supported for button %d\n%s",
1108 if (img)
delete img;
1111 TString back =
gEnv->GetValue(
"Gui.BackgroundColor",
"#c0c0c0");
1115 img2->
Merge(img,
"overlay");
1187 Error(
"Init",
"checked*_t.xpm not found or the file format is not supported.");
1191 if ((hotchar =
fLabel->GetHotChar()) != 0) {
1329 Bool_t in = (
event->fX >= 0) && (event->
fY >= 0) &&
1439 Int_t smax = std::max(
fOn->GetHeight(),
fOff->GetHeight());
1548 Error(
"Init",
"rbutton_*.xpm not found or the file format is not supported.");
1554 if ((hotchar =
fLabel->GetHotChar()) != 0) {
1699 Bool_t in = (
event->fX >= 0) && (event->
fY >= 0) &&
1809 Int_t smax = std::max(
fOn->GetHeight(),
fOff->GetHeight());
1876 if (option && strstr(option,
"keep_names"))
1877 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");\n";
1880 out <<
" " <<
GetName() <<
"->SetState(kButtonDown);\n";
1882 out <<
" " <<
GetName() <<
"->SetState(kButtonDisabled);\n";
1884 out <<
" " <<
GetName() <<
"->SetState(kButtonEngaged);\n";
1888 out <<
" " <<
GetName() <<
"->ChangeBackground(ucolor);\n";
1892 out <<
" " <<
GetName() <<
"->SetToolTipText(\""
1904 if (
fLabel->GetHotPos() > 0)
1917 parFont.
Form(
"ufont->GetFontStruct()");
1923 parGC.
Form(
"uGC->GetGC()");
1927 out <<
" TGTextButton *" <<
GetName() <<
" = new TGTextButton(" <<
fParent->GetName()
1939 out <<
"," <<
fWidgetId <<
"," << parGC <<
");\n";
1942 out <<
"," <<
fWidgetId <<
"," << parGC <<
"," << parFont <<
");\n";
1948 out <<
" " <<
GetName() <<
"->SetTextJustify(" <<
fTMode <<
");\n";
1964 Error(
"SavePrimitive",
"pixmap not found or the file format is not supported for picture button %d ",
fWidgetId);
1977 parGC.
Form(
"uGC->GetGC()");
1982 gSystem->ExpandPathName(picname);
1984 out <<
" TGPictureButton *" <<
GetName() <<
" = new TGPictureButton(" <<
fParent->GetName()
1995 out <<
"," <<
fWidgetId <<
"," << parGC <<
");\n";
2010 if (
fLabel->GetHotPos() > 0)
2013 out <<
" TGCheckButton *" <<
GetName() <<
" = new TGCheckButton(" <<
fParent->GetName()
2026 parFont.
Form(
"ufont->GetFontStruct()");
2032 parGC.
Form(
"uGC->GetGC()");
2045 out <<
"," <<
fWidgetId <<
"," << parGC <<
");\n";
2048 out <<
"," <<
fWidgetId <<
"," << parGC <<
"," << parFont <<
");\n";
2057 out <<
" " <<
GetName() <<
"->SetDisabledAndSelected(kTRUE);\n";
2059 out <<
" " <<
GetName() <<
"->SetDisabledAndSelected(kFALSE);\n";
2061 out <<
" " <<
GetName() <<
"->SetTextJustify(" <<
fTMode <<
");\n";
2073 if (
fLabel->GetHotPos() > 0)
2076 out <<
" TGRadioButton *" <<
GetName() <<
" = new TGRadioButton(" <<
fParent->GetName() <<
", \""
2089 parFont.
Form(
"ufont->GetFontStruct()");
2095 parGC.
Form(
"uGC->GetGC()");
2108 out <<
"," <<
fWidgetId <<
"," << parGC <<
");\n";
2111 out <<
"," <<
fWidgetId <<
"," << parGC <<
"," << parFont <<
");\n";
2120 out <<
" " <<
GetName() <<
"->SetDisabledAndSelected(kTRUE);\n";
2122 out <<
" " <<
GetName() <<
"->SetDisabledAndSelected(kFALSE);\n";
2124 out <<
" " <<
GetName() <<
"->SetTextJustify(" <<
fTMode <<
");\n";
2159 UInt_t lwidth = 0, lheight = 0;
2160 UInt_t twidth = 0, theight = 0;
2174 while (entry != 0) {
2180 if(twidth > lwidth) {
2183 if(theight > lheight) {
2220 fPopMenu->Connect(
"Activated(Int_t)",
"TGSplitButton",
this,
"HandleMenu(Int_t)");
2243 if ((hotchar =
fLabel->GetHotChar()) != 0) {
2302 Int_t max_ascent, max_descent;
2305 fTHeight = max_ascent + max_descent;
2325 Bool_t inTB = (
event->fX >= 0) && (event->
fY >= 0) &&
2543 Int_t n_entries = 0;
2553 if (n_entries <= 1) {
2554 Info(
"TGSplitButton",
"Only one entry in the menu.");
2560 0, 0, ax, ay, wdummy);
2702 if (
e->GetLabel()) {
2703 hot =
e->GetLabel()->GetHotChar();
2742 UInt_t width = 0, bwidth = 0, dummy;
2751 if (width > bwidth) {
2754 longlabeltip =
kTRUE;
2756 Info(
"TGSplitbutton",
"Length of new label to long, label truncated.");
2780 if ((hotchar =
fLabel->GetHotChar()) != 0) {
2819 if ((gc) && !global) {
2862 fPopMenu->Connect(
"PoppedDown()",
"TGSplitButton",
this,
"SetMBState(=kButtonUp)");
2863 fPopMenu->Connect(
"PoppedDown()",
"TGSplitButton",
this,
"MBReleased()");
2873 Connect(
"Clicked()",
"TGSplitButton",
this, str);
2881 fPopMenu->Connect(
"PoppedDown()",
"TGSplitButton",
this,
"SetState(=kButtonUp)");
2882 fPopMenu->Connect(
"PoppedDown()",
"TGSplitButton",
this,
"Released()");
2901 Bool_t in = (
event->fX >= 0) && (event->
fY >= 0) &&
3048 gVirtualX->LookupString(event, tmp,
sizeof(tmp), keysym);
3056 if (!hot || (hot != keysym))
continue;
3147 UInt_t dummya = 0, dummyb = 0;
3185 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.
int Int_t
Signed integer 4 bytes (int).
long Longptr_t
Integer large enough to hold a pointer (platform-dependent).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
bool Bool_t
Boolean (0=false, 1=true) (bool).
const char Option_t
Option string (const char).
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
void Info(const char *location, const char *msgfmt,...)
Use this function for informational messages.
Bool_t InheritsFrom(const char *cl) const override
Return kTRUE if this class inherits from a class with name "classname".
Encapsulate fonts used in the GUI system.
FontStruct_t GetFontStruct() const
void SavePrimitive(std::ostream &out, Option_t *="") override
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.
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.
UInt_t fOptions
frame options
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
TGFrame(const TGFrame &)=delete
UInt_t fHeight
frame height
Int_t fBorderWidth
frame border width
void DoRedraw() override
Redraw the frame.
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.
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
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 SetFont(FontH_t v)
Set font.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save graphics context info as a C++ statement(s) on output stream out.
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.
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
void Draw(Option_t *="") override
Default Draw method for all objects.
const char * GetString() const
void Init()
Common initialization used by the different ctors.
static FontStruct_t GetDefaultFontStruct()
Return default font structure.
void Layout() override
layout text button
Bool_t HandleKey(Event_t *event) override
Handle key event. This function will be called when the hotkey is hit.
TClass * IsA() const override
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
TGDimension GetDefaultSize() const override
returns default size
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a text button widget as a C++ statement(s) on output stream out.
Bool_t HasOwnFont() const
Returns kTRUE if text attributes are unique, returns kFALSE if text attributes are shared (global).
virtual void SetFont(FontStruct_t font, Bool_t global=kFALSE)
Changes text font.
~TGTextButton() override
Delete a text button widget.
void DoRedraw() override
Draw the text button.
virtual void SetTextColor(Pixel_t color, Bool_t global=kFALSE)
Changes text color.
ROOT GUI Window base class.
virtual const TGWindow * GetMainFrame() const
Returns top level main frame.
virtual void RequestFocus()
request focus
const TGWindow * fParent
Parent window.
virtual void SetWindowName(const char *name=nullptr)
Set window name.
const char * GetName() const override
Return unique name, used in SavePrimitive methods.
TClass * IsA() const override
An abstract interface to image processing library.
virtual void FillRectangle(const char *=nullptr, Int_t=0, Int_t=0, UInt_t=0, UInt_t=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 SetImage(const Double_t *, UInt_t, UInt_t, TImagePalette *=nullptr)
virtual Pixmap_t GetMask()
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=nullptr, void *receiver=nullptr, const char *slot=nullptr)
Disconnects signal of this object from slot of receiver.
TString & Insert(Ssiz_t pos, const char *s)
TString & ReplaceSpecialCppChars()
Find special characters which are typically used in printf() calls and replace them by appropriate es...
const char * Data() const
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.
int main(int argc, char **argv)
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
UInt_t fState
key or button mask
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