105 const TGGC *TGButton::fgHibckgndGC = 0;
106 const TGGC *TGButton::fgDefaultGC = 0;
108 const TGFont *TGTextButton::fgDefaultFont = 0;
110 const TGFont *TGCheckButton::fgDefaultFont = 0;
111 const TGGC *TGCheckButton::fgDefaultGC = 0;
113 const TGFont *TGRadioButton::fgDefaultFont = 0;
114 const TGGC *TGRadioButton::fgDefaultGC = 0;
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)
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);
1949 parGC.
Form(
"uGC->GetGC()");
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;
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;
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.
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
TGGCPool * GetGCPool() const
TGPicturePool * GetPicturePool() const
TGTextButton(const TGTextButton &)
ClassImp(TAlienJobStatusList) void TAlienJobStatusList TString split(jobstatus->GetKey("split"))
Print information about jobs.
const Mask_t kButton2Mask
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
const TGWindow * GetParent() const
const Mask_t kKeyMod2Mask
ClassImp(TSeqCollection) Int_t TSeqCollection TIter next(this)
Return index of object in collection.
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...
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
const Mask_t kKeyShiftMask
virtual void RemoveBind(const TGWindow *w, Int_t keycode, Int_t modifier) const
Remove key binding.
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 void Info(const char *method, const char *msgfmt,...) const
Issue info message.
virtual ~TGTextButton()
Delete a text button widget.
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
virtual void Layout()
layout text button
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.
Bool_t HasOwnFont() const
Returns kTRUE if text attributes are unique, returns kFALSE if text attributes are shared (global)...
const Mask_t kPointerMotionMask
const char * Data() const
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 TObject * After(const TObject *obj) const
Returns the object after object obj.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
virtual Int_t MustCleanup() const
virtual UInt_t GetOptions() const
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.
std::map< std::string, std::string >::const_iterator iter
const Mask_t kKeyLockMask
const Mask_t kGCGraphicsExposures
const char * GetName() const
Returns name of object.
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
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...
TGFontPool * GetFontPool() const
virtual void RequestFocus()
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...
const Mask_t kButtonPressMask
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)
R__EXTERN TSystem * gSystem
virtual TObject * Before(const TObject *obj) const
Returns the object before object obj.
virtual Int_t GetValue(const char *name, Int_t dflt)
Returns the integer value for a resource.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
void Init()
Common initialization used by the different ctors.
const TGPicture * GetPicture(const char *name)
Get a picture from the picture pool.
static Pixel_t fgDefaultFrameBackground
Pixel_t GetForeground() const
virtual const TGWindow * GetMainFrame() const
Returns top level main frame.
virtual void SetText(TGHotString *new_label)
Set new button text.
virtual TObject * Last() const
Return the last object in the list. Returns 0 when list is empty.
const Mask_t kEnterWindowMask
TGFont * GetFont(const char *font, Bool_t fixedDefault=kTRUE)
Get the specified font.
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
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
Pixmap_t GetPicture() const
virtual Pixmap_t GetMask()
const TGResourcePool * GetResourcePool() const
virtual TGDimension GetDefaultSize() const
returns default size
const Mask_t kButtonReleaseMask
const TGPicture * GetPicture(const char *name)
Get picture from the picture pool.
static RooMathCoreReg dummy
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.
const Mask_t kGCForeground
Cursor_t GetGrabCursor() const
TGGCPool * GetGCPool() const
virtual TObject * First() const
Return the first object in the list. Returns 0 when list is empty.
FontStruct_t GetFontStruct() const
TGFont * FindFont(FontStruct_t font) const
Find font based on its font struct. Returns 0 if font is not found.
const Mask_t kGCBackground
Short_t Max(Short_t a, Short_t b)
static const TGFont * fgDefaultFont
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().
float type_of_call hi(const int &, const int &)
const char * GetString() const
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.
const Mask_t kAnyModifier
virtual Bool_t BindKey(const TGWindow *w, Int_t keycode, Int_t modifier) const
Bind key to a window.
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.
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
static const TGGC & GetShadowGC()
Get shadow color graphics context.
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.
const GCValues_t * GetAttributes() const
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.