171 while ((item = (
TGButton*)next())) {
199 Int_t x,
y,
l, t,
r,
b, gl,
gr, sep, max_ascent, max_descent;
205 t = (max_ascent + max_descent + 2) >> 1;
218 UInt_t rr = 5 + (sep << 1) + tw;
231 gr = gl + tw + (sep << 1);
331 while ((item = (
TGButton*)next())) {
348 if (
b && (
b->IsDown() != down)) {
376 if (button->
fGroup ==
this) {
378 return GetId(button);
386 static Int_t seq_no = -2;
389 if (
id < -1) bid = seq_no--;
390 else if (
id == -1) bid =
GetCount()+1;
400 Connect(button,
"Clicked()" ,
"TGButtonGroup",
this,
"ReleaseButtons()");
401 Connect(button,
"Pressed()" ,
"TGButtonGroup",
this,
"ButtonPressed()");
402 Connect(button,
"Released()",
"TGButtonGroup",
this,
"ButtonReleased()");
403 Connect(button,
"Clicked()" ,
"TGButtonGroup",
this,
"ButtonClicked()");
432 while ((item = (
TGButton*)next())) {
475 Error(
"ButtonPressed",
"gTQSender not a TGButton");
535 while ((item = (
TGButton*)next())) {
540 && btn->IsA()->
InheritsFrom(TGRadioButton::Class())))) {
571 Error(
"SetTitle",
"title cannot be 0, try \"\"");
588 Error(
"SetTitle",
"title cannot be 0, try \"\"");
628 parFont.
Form(
"%s::GetDefaultFontStruct()",IsA()->
GetName());
631 parGC.
Form(
"%s::GetDefaultGC()()",IsA()->
GetName());
637 parFont.
Form(
"ufont->GetFontStruct()");
643 parGC.
Form(
"uGC->GetGC()");
649 out << std::endl <<
" // buttongroup frame" << std::endl;
651 out <<
" TGButtonGroup *";
659 out <<
");" << std::endl;
672 if (option && strstr(option,
"keep_names"))
673 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
676 out <<
" " <<
GetName() <<
"->SetLayoutManager(";
680 out <<
");"<< std::endl;
685 f->fFrame->SavePrimitive(out,option);
686 if (
f->fFrame->InheritsFrom(
"TGButton"))
continue;
688 out <<
" " <<
GetName() <<
"->AddFrame(" <<
f->fFrame->GetName();
689 f->fLayout->SavePrimitive(out, option);
690 out <<
");"<< std::endl;
695 out <<
" " <<
GetName() <<
"->SetExclusive(kTRUE);" << std::endl;
698 out <<
" " <<
GetName() <<
"->SetRadioButtonExclusive(kTRUE);" << std::endl;
701 out <<
" " <<
GetName() <<
"->SetBorderDrawn(kFALSE);" << std::endl;
705 <<
"," <<
GetHeight() <<
");" << std::endl;
708 out <<
" " <<
GetName() <<
"->SetState(kFALSE);" << std::endl;
710 out <<
" " <<
GetName() <<
"->Show();" << std::endl;
723 parFont.
Form(
"%s::GetDefaultFontStruct()",IsA()->
GetName());
724 parGC.
Form(
"%s::GetDefaultGC()()",IsA()->
GetName());
730 parFont.
Form(
"ufont->GetFontStruct()");
736 parGC.
Form(
"uGC->GetGC()");
742 out << std::endl <<
" // horizontal buttongroup frame" << std::endl;
744 out <<
" TGHButtonGroup *";
752 out <<
");" << std::endl;
754 out <<
"," << parGC.
Data() <<
");" << std::endl;
757 out <<
"," << parGC.
Data() <<
"," << parFont.
Data() <<
");" << std::endl;
760 out <<
"," << parGC.
Data() <<
"," << parFont.
Data() <<
",ucolor);" << std::endl;
762 if (option && strstr(option,
"keep_names"))
763 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
768 f->fFrame->SavePrimitive(out,option);
769 if (
f->fFrame->InheritsFrom(
"TGButton")){
770 out <<
" " <<
GetName() <<
"->SetLayoutHints(";
771 f->fLayout->SavePrimitive(out,
"nocoma");
772 out <<
"," <<
f->fFrame->GetName();
773 out <<
");"<< std::endl;
776 out <<
" " <<
GetName() <<
"->AddFrame(" <<
f->fFrame->GetName();
777 f->fLayout->SavePrimitive(out, option);
778 out <<
");"<< std::endl;
783 out <<
" " <<
GetName() <<
"->SetState(kFALSE);" << std::endl;
786 out <<
" " <<
GetName() <<
"->SetExclusive(kTRUE);" << std::endl;
789 out <<
" " <<
GetName() <<
"->SetRadioButtonExclusive(kTRUE);" << std::endl;
792 out <<
" " <<
GetName() <<
"->SetBorderDrawn(kFALSE);" << std::endl;
797 out <<
" " <<
GetName() <<
"->Show();" << std::endl;
810 parFont.
Form(
"%s::GetDefaultFontStruct()",IsA()->
GetName());
811 parGC.
Form(
"%s::GetDefaultGC()()",IsA()->
GetName());
817 parFont.
Form(
"ufont->GetFontStruct()");
823 parGC.
Form(
"uGC->GetGC()");
829 out << std::endl <<
" // vertical buttongroup frame" << std::endl;
831 out <<
" TGVButtonGroup *";
838 out <<
");" << std::endl;
840 out <<
"," << parGC.
Data() <<
");" << std::endl;
843 out <<
"," << parGC.
Data() <<
"," << parFont.
Data() <<
");" << std::endl;
846 out <<
"," << parGC.
Data() <<
"," << parFont.
Data() <<
",ucolor);" << std::endl;
848 if (option && strstr(option,
"keep_names"))
849 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
854 f->fFrame->SavePrimitive(out,option);
855 if (
f->fFrame->InheritsFrom(
"TGButton"))
continue;
857 out <<
" " <<
GetName() <<
"->AddFrame(" <<
f->fFrame->GetName();
858 f->fLayout->SavePrimitive(out, option);
859 out <<
");"<< std::endl;
864 out <<
" " <<
GetName() <<
"->SetState(kFALSE);" << std::endl;
867 out <<
" " <<
GetName() <<
"->SetExclusive(kTRUE);" << std::endl;
870 out <<
" " <<
GetName() <<
"->SetRadioButtonExclusive(kTRUE);" << std::endl;
873 out <<
" " <<
GetName() <<
"->SetBorderDrawn(kFALSE);" << std::endl;
876 <<
"," <<
GetHeight() <<
");"<< std::endl;
878 out <<
" " <<
GetName() <<
"->Show();" << std::endl;
Handle_t GContext_t
Graphics context handle.
Handle_t FontStruct_t
Pointer to font structure.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
R__EXTERN void * gTQSender
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
void NeedRedraw(TGWindow *w, Bool_t force=kFALSE)
Set redraw flags.
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
virtual TList * GetList() const
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
virtual TGLayoutManager * GetLayoutManager() const
virtual void Layout()
Layout the elements of the composite frame.
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
TList * fList
container of frame elements
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
static TGLayoutHints * fgDefaultHints
Encapsulate fonts used in the GUI system.
virtual void SavePrimitive(std::ostream &out, Option_t *="")
Save the used font as a C++ statement(s) on output stream out.
A subclasses of TGWindow, and is used as base class for some simple widgets (buttons,...
UInt_t fOptions
frame options
virtual void MapRaised()
map raised
UInt_t fHeight
frame height
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().
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
virtual void UnmapWindow()
unmap window
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.
A composite frame with a border and a title.
TGString * fText
title text
static const TGGC & GetDefaultGC()
Return default graphics context in use.
Int_t fTitlePos
OPTION={GetMethod="GetTitlePos";SetMethod="SetTitlePos";Items=(-1="Left",0="Center",...
FontStruct_t fFontStruct
title fontstruct
GContext_t fNormGC
title graphics context
static FontStruct_t GetDefaultFontStruct()
Return default font structure in use.
virtual void SetTitle(TGString *title)
Set or change title of the group frame.
This class describes layout hints used by the layout classes.
This layout managers does not make use of TGLayoutHints.
TGClient * fClient
Connection to display server.
Handle_t fId
X11/Win32 Window identifier.
TGString wraps a TString and adds some graphics routines like drawing, size of string on screen depen...
const char * GetString() const
virtual void Draw(Drawable_t id, GContext_t gc, Int_t x, Int_t y)
Draw string.
ROOT GUI Window base class.
virtual void SetWindowName(const char *name=0)
Set window name.
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
const TGWindow * fParent
Parent window.
virtual void DestroyWindow()
destroy window
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
void Add(TObject *obj)
This function may not be used (but we need to provide it since it is a pure virtual in TCollection).
TObject * GetValue(const char *keyname) const
Returns a pointer to the value associated with keyname as name of the key.
TObject * FindObject(const char *keyname) const
Check if a (key,value) pair exists with keyname as name of the key.
TObject * Remove(TObject *key)
Remove the (key,value) pair with key from the map.
Mother of all ROOT objects.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a primitive as a C++ statement(s) on output stream "out".
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Class used by TMap to store (key,value) pairs.
This is the ROOT implementation of the Qt object communication mechanism (see also http://www....
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.
virtual void ChangedBy(const char *method)
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
Disconnects signal of this object from slot of receiver.
const char * Data() const
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.