162 while ((item = (
TGButton*)next())) {
190 Int_t x,
y,
l, t,
r,
b, gl,
gr, sep, max_ascent, max_descent;
196 t = (max_ascent + max_descent + 2) >> 1;
209 UInt_t rr = 5 + (sep << 1) + tw;
222 gr = gl + tw + (sep << 1);
322 while ((item = (
TGButton*)next())) {
339 if (
b && (
b->IsDown() != down)) {
367 if (button->
fGroup ==
this) {
369 return GetId(button);
377 static Int_t seq_no = -2;
380 if (
id < -1) bid = seq_no--;
381 else if (
id == -1) bid =
GetCount()+1;
391 Connect(button,
"Clicked()" ,
"TGButtonGroup",
this,
"ReleaseButtons()");
392 Connect(button,
"Pressed()" ,
"TGButtonGroup",
this,
"ButtonPressed()");
393 Connect(button,
"Released()",
"TGButtonGroup",
this,
"ButtonReleased()");
394 Connect(button,
"Clicked()" ,
"TGButtonGroup",
this,
"ButtonClicked()");
423 while ((item = (
TGButton*)next())) {
466 Error(
"ButtonPressed",
"gTQSender not a TGButton");
526 while ((item = (
TGButton*)next())) {
531 && btn->IsA()->
InheritsFrom(TGRadioButton::Class())))) {
562 Error(
"SetTitle",
"title cannot be 0, try \"\"");
579 Error(
"SetTitle",
"title cannot be 0, try \"\"");
619 parFont.
Form(
"%s::GetDefaultFontStruct()",IsA()->
GetName());
622 parGC.
Form(
"%s::GetDefaultGC()()",IsA()->
GetName());
628 parFont.
Form(
"ufont->GetFontStruct()");
634 parGC.
Form(
"uGC->GetGC()");
640 out << std::endl <<
" // buttongroup frame" << std::endl;
642 out <<
" TGButtonGroup *";
650 out <<
");" << std::endl;
663 if (option && strstr(option,
"keep_names"))
664 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
667 out <<
" " <<
GetName() <<
"->SetLayoutManager(";
671 out <<
");"<< std::endl;
676 f->fFrame->SavePrimitive(out,option);
677 if (
f->fFrame->InheritsFrom(
"TGButton"))
continue;
679 out <<
" " <<
GetName() <<
"->AddFrame(" <<
f->fFrame->GetName();
680 f->fLayout->SavePrimitive(out, option);
681 out <<
");"<< std::endl;
686 out <<
" " <<
GetName() <<
"->SetExclusive(kTRUE);" << std::endl;
689 out <<
" " <<
GetName() <<
"->SetRadioButtonExclusive(kTRUE);" << std::endl;
692 out <<
" " <<
GetName() <<
"->SetBorderDrawn(kFALSE);" << std::endl;
696 <<
"," <<
GetHeight() <<
");" << std::endl;
699 out <<
" " <<
GetName() <<
"->SetState(kFALSE);" << std::endl;
701 out <<
" " <<
GetName() <<
"->Show();" << std::endl;
714 parFont.
Form(
"%s::GetDefaultFontStruct()",IsA()->
GetName());
715 parGC.
Form(
"%s::GetDefaultGC()()",IsA()->
GetName());
721 parFont.
Form(
"ufont->GetFontStruct()");
727 parGC.
Form(
"uGC->GetGC()");
733 out << std::endl <<
" // horizontal buttongroup frame" << std::endl;
735 out <<
" TGHButtonGroup *";
743 out <<
");" << std::endl;
745 out <<
"," << parGC.
Data() <<
");" << std::endl;
748 out <<
"," << parGC.
Data() <<
"," << parFont.
Data() <<
");" << std::endl;
751 out <<
"," << parGC.
Data() <<
"," << parFont.
Data() <<
",ucolor);" << std::endl;
753 if (option && strstr(option,
"keep_names"))
754 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
759 f->fFrame->SavePrimitive(out,option);
760 if (
f->fFrame->InheritsFrom(
"TGButton")){
761 out <<
" " <<
GetName() <<
"->SetLayoutHints(";
762 f->fLayout->SavePrimitive(out,
"nocoma");
763 out <<
"," <<
f->fFrame->GetName();
764 out <<
");"<< std::endl;
767 out <<
" " <<
GetName() <<
"->AddFrame(" <<
f->fFrame->GetName();
768 f->fLayout->SavePrimitive(out, option);
769 out <<
");"<< std::endl;
774 out <<
" " <<
GetName() <<
"->SetState(kFALSE);" << std::endl;
777 out <<
" " <<
GetName() <<
"->SetExclusive(kTRUE);" << std::endl;
780 out <<
" " <<
GetName() <<
"->SetRadioButtonExclusive(kTRUE);" << std::endl;
783 out <<
" " <<
GetName() <<
"->SetBorderDrawn(kFALSE);" << std::endl;
788 out <<
" " <<
GetName() <<
"->Show();" << std::endl;
801 parFont.
Form(
"%s::GetDefaultFontStruct()",IsA()->
GetName());
802 parGC.
Form(
"%s::GetDefaultGC()()",IsA()->
GetName());
808 parFont.
Form(
"ufont->GetFontStruct()");
814 parGC.
Form(
"uGC->GetGC()");
820 out << std::endl <<
" // vertical buttongroup frame" << std::endl;
822 out <<
" TGVButtonGroup *";
829 out <<
");" << std::endl;
831 out <<
"," << parGC.
Data() <<
");" << std::endl;
834 out <<
"," << parGC.
Data() <<
"," << parFont.
Data() <<
");" << std::endl;
837 out <<
"," << parGC.
Data() <<
"," << parFont.
Data() <<
",ucolor);" << std::endl;
839 if (option && strstr(option,
"keep_names"))
840 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
845 f->fFrame->SavePrimitive(out,option);
846 if (
f->fFrame->InheritsFrom(
"TGButton"))
continue;
848 out <<
" " <<
GetName() <<
"->AddFrame(" <<
f->fFrame->GetName();
849 f->fLayout->SavePrimitive(out, option);
850 out <<
");"<< std::endl;
855 out <<
" " <<
GetName() <<
"->SetState(kFALSE);" << std::endl;
858 out <<
" " <<
GetName() <<
"->SetExclusive(kTRUE);" << std::endl;
861 out <<
" " <<
GetName() <<
"->SetRadioButtonExclusive(kTRUE);" << std::endl;
864 out <<
" " <<
GetName() <<
"->SetBorderDrawn(kFALSE);" << std::endl;
867 <<
"," <<
GetHeight() <<
");"<< std::endl;
869 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.
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
static TGLayoutHints * fgDefaultHints
virtual void SavePrimitive(std::ostream &out, Option_t *="")
Save the used font as a C++ statement(s) on output stream out.
virtual void MapRaised()
map raised
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().
virtual void UnmapWindow()
unmap window
void SavePrimitive(std::ostream &out, Option_t *option="")
Save graphics context info as a C++ statement(s) on output stream out.
static const TGGC & GetDefaultGC()
Return default graphics context in use.
static FontStruct_t GetDefaultFontStruct()
Return default font structure in use.
virtual void SetTitle(TGString *title)
Set or change title of the group frame.
const char * GetString() const
virtual void Draw(Drawable_t id, GContext_t gc, Int_t x, Int_t y)
Draw string.
virtual void SetWindowName(const char *name=0)
Set window name.
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
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.