00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082 #include "TGButtonGroup.h"
00083 #include "TGButton.h"
00084 #include "TClass.h"
00085 #include "TGLayout.h"
00086 #include "TList.h"
00087 #include "TGResourcePool.h"
00088 #include "Riostream.h"
00089
00090
00091 ClassImp(TGButtonGroup)
00092 ClassImp(TGHButtonGroup)
00093 ClassImp(TGVButtonGroup)
00094
00095
00096 TGButtonGroup::TGButtonGroup(const TGWindow *parent,
00097 const TString &title,
00098 UInt_t options,
00099 GContext_t norm,
00100 FontStruct_t font,
00101 ULong_t back) :
00102 TGGroupFrame(parent, new TGString(title), options, norm, font, back)
00103 {
00104
00105
00106 Init();
00107 if (options & kVerticalFrame) {
00108 SetLayoutManager(new TGVerticalLayout(this));
00109 } else {
00110 SetLayoutManager(new TGHorizontalLayout(this));
00111 }
00112
00113 fDrawBorder = !title.IsNull();
00114 }
00115
00116
00117 TGButtonGroup::TGButtonGroup(const TGWindow *parent,
00118 UInt_t r, UInt_t c,
00119 Int_t s, Int_t h,
00120 const TString &title,
00121 GContext_t norm ,
00122 FontStruct_t font ,
00123 ULong_t back) :
00124 TGGroupFrame(parent, new TGString(title), 0, norm, font, back)
00125 {
00126
00127
00128
00129
00130
00131
00132 Init();
00133 fDrawBorder = !title.IsNull();
00134 SetLayoutManager(new TGMatrixLayout(this,r,c,s,h));
00135 }
00136
00137
00138 void TGButtonGroup::Init()
00139 {
00140
00141
00142 fState = kTRUE;
00143 fMapOfButtons = new TMap();
00144 fExclGroup = kFALSE;
00145 fRadioExcl = kFALSE;
00146 fDrawBorder = kTRUE;
00147
00148 SetWindowName();
00149 }
00150
00151
00152 TGButtonGroup::~TGButtonGroup()
00153 {
00154
00155
00156 TIter next(fMapOfButtons);
00157 register TGButton *item = 0;
00158
00159 while ((item = (TGButton*)next())) {
00160 item->SetGroup(0);
00161 }
00162
00163 SafeDelete(fMapOfButtons);
00164 }
00165
00166
00167 void TGButtonGroup::DoRedraw()
00168 {
00169
00170
00171
00172 gVirtualX->ClearArea(fId, 0, 0, fWidth, fHeight);
00173
00174 DrawBorder();
00175 }
00176
00177
00178 void TGButtonGroup::DrawBorder()
00179 {
00180
00181
00182
00183
00184
00185 if (!fDrawBorder) return;
00186
00187 Int_t x, y, l, t, r, b, gl, gr, sep, max_ascent, max_descent;
00188
00189 UInt_t tw = gVirtualX->TextWidth(fFontStruct, fText->GetString(), fText->GetLength());
00190 gVirtualX->GetFontProperties(fFontStruct, max_ascent, max_descent);
00191
00192 l = 0;
00193 t = (max_ascent + max_descent + 2) >> 1;
00194 r = fWidth - 1;
00195
00196 TGLayoutManager * lm = GetLayoutManager();
00197 if ((lm->InheritsFrom(TGHorizontalLayout::Class())) ||
00198 (lm->InheritsFrom(TGMatrixLayout::Class())))
00199 b = fHeight - 1;
00200 else
00201 b = fHeight - t;
00202
00203 sep = 3;
00204 UInt_t rr = 5 + (sep << 1) + tw;
00205
00206 switch (fTitlePos) {
00207 case kRight:
00208 gl = fWidth>rr ? Int_t(fWidth - rr) : 5 + sep;
00209 break;
00210 case kCenter:
00211 gl = fWidth>tw ? Int_t((fWidth - tw)>>1) - sep : 5 + sep;
00212 break;
00213 case kLeft:
00214 default:
00215 gl = 5 + sep;
00216 }
00217 gr = gl + tw + (sep << 1);
00218
00219 switch (fOptions & (kSunkenFrame | kRaisedFrame)) {
00220 case kRaisedFrame:
00221 gVirtualX->DrawLine(fId, GetHilightGC()(), l, t, gl, t);
00222 gVirtualX->DrawLine(fId, GetShadowGC()(), l+1, t+1, gl, t+1);
00223
00224 gVirtualX->DrawLine(fId, GetHilightGC()(), gr, t, r-1, t);
00225 gVirtualX->DrawLine(fId, GetShadowGC()(), gr, t+1, r-2, t+1);
00226
00227 gVirtualX->DrawLine(fId, GetHilightGC()(), r-1, t, r-1, b-1);
00228 gVirtualX->DrawLine(fId, GetShadowGC()(), r, t, r, b);
00229
00230 gVirtualX->DrawLine(fId, GetHilightGC()(), r-1, b-1, l, b-1);
00231 gVirtualX->DrawLine(fId, GetShadowGC()(), r, b, l, b);
00232
00233 gVirtualX->DrawLine(fId, GetHilightGC()(), l, b-1, l, t);
00234 gVirtualX->DrawLine(fId, GetShadowGC()(), l+1, b-2, l+1, t+1);
00235 break;
00236 case kSunkenFrame:
00237 default:
00238 gVirtualX->DrawLine(fId, GetShadowGC()(), l, t, gl, t);
00239 gVirtualX->DrawLine(fId, GetHilightGC()(), l+1, t+1, gl, t+1);
00240
00241 gVirtualX->DrawLine(fId, GetShadowGC()(), gr, t, r-1, t);
00242 gVirtualX->DrawLine(fId, GetHilightGC()(), gr, t+1, r-2, t+1);
00243
00244 gVirtualX->DrawLine(fId, GetShadowGC()(), r-1, t, r-1, b-1);
00245 gVirtualX->DrawLine(fId, GetHilightGC()(), r, t, r, b);
00246
00247 gVirtualX->DrawLine(fId, GetShadowGC()(), r-1, b-1, l, b-1);
00248 gVirtualX->DrawLine(fId, GetHilightGC()(), r, b, l, b);
00249
00250 gVirtualX->DrawLine(fId, GetShadowGC()(), l, b-1, l, t);
00251 gVirtualX->DrawLine(fId, GetHilightGC()(), l+1, b-2, l+1, t+1);
00252 break;
00253 }
00254
00255 x = gl + sep;
00256 y = 1;
00257
00258 if (fState) {
00259 fText->Draw(fId, fNormGC, x, y + max_ascent);
00260 } else {
00261 fText->Draw(fId, GetHilightGC()(), x, y + 1 + max_ascent);
00262 fText->Draw(fId, GetShadowGC()(), x, y + max_ascent);
00263 }
00264 }
00265
00266
00267 void TGButtonGroup::SetBorderDrawn(Bool_t enable)
00268 {
00269
00270
00271 if (enable != IsBorderDrawn()) {
00272 fDrawBorder = enable;
00273 ChangedBy("SetBorderDrawn");
00274 }
00275 }
00276
00277
00278 void TGButtonGroup::SetExclusive(Bool_t enable)
00279 {
00280
00281
00282
00283
00284
00285
00286
00287 if (enable != IsExclusive()) {
00288 fExclGroup = enable;
00289 ChangedBy("SetExclusive");
00290 }
00291 }
00292
00293
00294 void TGButtonGroup::SetRadioButtonExclusive(Bool_t enable)
00295 {
00296
00297
00298
00299
00300
00301 if (enable != IsRadioButtonExclusive()) {
00302 fRadioExcl = enable;
00303 ChangedBy("SetRadioButtonExclusive");
00304 }
00305 }
00306
00307
00308 void TGButtonGroup::SetState(Bool_t state)
00309 {
00310
00311
00312 fState = state;
00313
00314 TIter next(fMapOfButtons);
00315 register TGButton *item = 0;
00316
00317 while ((item = (TGButton*)next())) {
00318 if (state) {
00319 item->SetState(kButtonUp);
00320 } else {
00321 item->SetState(kButtonDisabled);
00322 }
00323 }
00324 DoRedraw();
00325 }
00326
00327 void TGButtonGroup::SetButton(Int_t id, Bool_t down)
00328 {
00329
00330
00331
00332 TGButton *b = Find(id);
00333
00334 if (b && (b->IsDown() != down)) {
00335 b->SetState(kButtonDown, kTRUE);
00336 }
00337 }
00338
00339
00340 Int_t TGButtonGroup::Insert(TGButton *button, Int_t id)
00341 {
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359 if (button->fGroup && button->fGroup != this)
00360 button->fGroup->Remove(button);
00361
00362 if (button->fGroup == this) {
00363 if (id == -1)
00364 return GetId(button);
00365 else
00366 button->fGroup->Remove(button);
00367 }
00368
00369 button->fGroup = this;
00370 button->Associate(this);
00371
00372 static Int_t seq_no = -2;
00373 Long_t bid;
00374
00375 if (id < -1) bid = seq_no--;
00376 else if (id == -1) bid = GetCount()+1;
00377 else bid = id;
00378
00379 fMapOfButtons->Add(button, (TObject*)bid);
00380 AddFrame(button);
00381
00382 SetRadioButtonExclusive(button->IsA()->InheritsFrom(TGRadioButton::Class()));
00383
00384 Connect(button, "Clicked()" , "TGButtonGroup", this, "ReleaseButtons()");
00385 Connect(button, "Pressed()" , "TGButtonGroup", this, "ButtonPressed()");
00386 Connect(button, "Released()", "TGButtonGroup", this, "ButtonReleased()");
00387 Connect(button, "Clicked()" , "TGButtonGroup", this, "ButtonClicked()");
00388
00389 return (Int_t) bid;
00390 }
00391
00392
00393 void TGButtonGroup::Remove(TGButton *button)
00394 {
00395
00396
00397 TGButton *item = (TGButton*) fMapOfButtons->Remove(button);
00398 if (item) {
00399 button->SetGroup(0);
00400 button->Disconnect(this);
00401 button->DestroyWindow();
00402 }
00403
00404 RemoveFrame(button);
00405 }
00406
00407
00408 TGButton *TGButtonGroup::Find(Int_t id) const
00409 {
00410
00411
00412
00413 TIter next(fMapOfButtons);
00414 register TGButton *item = 0;
00415
00416 while ((item = (TGButton*)next())) {
00417 if ((Long_t)fMapOfButtons->GetValue(item) == id) break;
00418 }
00419
00420 return item;
00421 }
00422
00423
00424 Int_t TGButtonGroup::GetId(TGButton *button) const
00425 {
00426
00427
00428
00429 TPair *a = (TPair*) fMapOfButtons->FindObject(button);
00430 if (a)
00431 return (Int_t)Long_t(a->Value());
00432 else
00433 return -1;
00434 }
00435
00436
00437 void TGButtonGroup::ButtonPressed()
00438 {
00439
00440
00441
00442 #if 0
00443
00444
00445
00446
00447
00448 TGButton *btn = dynamic_cast<TGButton*>((TQObject*)gTQSender);
00449
00450 if (!btn) {
00451 Error("ButtonPressed", "gTQSender not a TGButton");
00452 return;
00453 }
00454 #else
00455 TGButton *btn = (TGButton*)gTQSender;
00456 #endif
00457
00458 TPair *a = (TPair*) fMapOfButtons->FindObject(btn);
00459 if (a) {
00460 Int_t id = (Int_t)Long_t(a->Value());
00461 Pressed(id);
00462 }
00463 }
00464
00465
00466 void TGButtonGroup::ButtonReleased()
00467 {
00468
00469
00470
00471 TGButton *btn = (TGButton*)gTQSender;
00472
00473 TPair *a = (TPair*) fMapOfButtons->FindObject(btn);
00474 if (a) {
00475 Int_t id = (Int_t)Long_t(a->Value());
00476 Released(id);
00477 }
00478 }
00479
00480
00481 void TGButtonGroup::ButtonClicked()
00482 {
00483
00484
00485
00486 TGButton *btn = (TGButton*)gTQSender;
00487
00488 TPair *a = (TPair*) fMapOfButtons->FindObject(btn);
00489 if (a) {
00490 Int_t id = (Int_t)Long_t(a->Value());
00491 Clicked(id);
00492 }
00493 }
00494
00495
00496 void TGButtonGroup::ReleaseButtons()
00497 {
00498
00499
00500
00501 if (!fExclGroup && !fRadioExcl) return;
00502
00503 TGButton *btn = (TGButton*)gTQSender;
00504
00505 if (!fExclGroup && !btn)
00506 return;
00507
00508 TIter next(fMapOfButtons);
00509 register TGButton *item = 0;
00510
00511 while ((item = (TGButton*)next())) {
00512 if (btn != item && item->IsToggleButton() && item->IsOn() &&
00513 (fExclGroup || (item->IsA()->InheritsFrom(TGRadioButton::Class())
00514 && btn->IsA()->InheritsFrom(TGRadioButton::Class())))) {
00515 item->SetOn(kFALSE);
00516 }
00517 }
00518 }
00519
00520
00521 void TGButtonGroup::Show()
00522 {
00523
00524
00525 MapSubwindows();
00526 Resize();
00527 MapRaised();
00528 fClient->NeedRedraw(this);
00529 }
00530
00531
00532 void TGButtonGroup::Hide()
00533 {
00534
00535
00536 UnmapWindow();
00537 }
00538
00539
00540 void TGButtonGroup::SetTitle(TGString *title)
00541 {
00542
00543
00544 if (!title) {
00545 Error("SetTitle", "title cannot be 0, try \"\"");
00546 return;
00547 }
00548
00549 if (strcmp(fText->GetString(), title->GetString())) {
00550 SetBorderDrawn(title->GetLength() ? kTRUE : kFALSE);
00551 TGGroupFrame::SetTitle(title);
00552 ChangedBy("SetTitle");
00553 }
00554 }
00555
00556
00557 void TGButtonGroup::SetTitle(const char *title)
00558 {
00559
00560
00561 if (!title) {
00562 Error("SetTitle", "title cannot be 0, try \"\"");
00563 return;
00564 }
00565
00566 if (strcmp(fText->GetString(), title)) {
00567 SetBorderDrawn(title && strlen(title));
00568 TGGroupFrame::SetTitle(title);
00569 ChangedBy("SetTitle");
00570 }
00571 }
00572
00573
00574 void TGButtonGroup::SetLayoutHints(TGLayoutHints *l, TGButton *button)
00575 {
00576
00577
00578
00579 TGFrameElement *el;
00580 TIter next(fList);
00581
00582 while ((el = (TGFrameElement *)next())) {
00583 if ((el->fFrame==(TGFrame*)button) || !button) {
00584 el->fLayout = l ? l : fgDefaultHints;
00585 }
00586 }
00587 Layout();
00588 }
00589
00590
00591 void TGButtonGroup::SavePrimitive(ostream &out, Option_t *option )
00592 {
00593
00594
00595 char quote ='"';
00596
00597
00598 option = GetName()+5;
00599 TString parGC, parFont;
00600 parFont.Form("%s::GetDefaultFontStruct()",IsA()->GetName());
00601 parGC.Form("%s::GetDefaultGC()()",IsA()->GetName());
00602
00603 if ((GetDefaultFontStruct() != fFontStruct) || (GetDefaultGC()() != fNormGC)) {
00604 TGFont *ufont = gClient->GetResourcePool()->GetFontPool()->FindFont(fFontStruct);
00605 if (ufont) {
00606 ufont->SavePrimitive(out, option);
00607 parFont.Form("ufont->GetFontStruct()");
00608 }
00609
00610 TGGC *userGC = gClient->GetResourcePool()->GetGCPool()->FindGC(fNormGC);
00611 if (userGC) {
00612 userGC->SavePrimitive(out, option);
00613 parGC.Form("uGC->GetGC()");
00614 }
00615 }
00616
00617 if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
00618
00619 out << endl << " // buttongroup frame" << endl;
00620
00621 out << " TGButtonGroup *";
00622 out << GetName() << " = new TGButtonGroup(" << fParent->GetName()
00623 << ","<< quote << fText->GetString() << quote;
00624
00625 if (fBackground == GetDefaultFrameBackground()) {
00626 if (fFontStruct == GetDefaultFontStruct()) {
00627 if (fNormGC == GetDefaultGC()()) {
00628 if (!GetOptions()) {
00629 out <<");" << endl;
00630 } else {
00631 out << "," << GetOptionString() <<");" << endl;
00632 }
00633 } else {
00634 out << "," << GetOptionString() << "," << parGC.Data() <<");" << endl;
00635 }
00636 } else {
00637 out << "," << GetOptionString() << "," << parGC.Data() << "," << parFont.Data() <<");" << endl;
00638 }
00639 } else {
00640 out << "," << GetOptionString() << "," << parGC.Data() << "," << parFont.Data() << ",ucolor);" << endl;
00641 }
00642 if (option && strstr(option, "keep_names"))
00643 out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
00644
00645
00646 out << " " << GetName() <<"->SetLayoutManager(";
00647 GetLayoutManager()->SavePrimitive(out, option);
00648 out << ");"<< endl;
00649
00650 TGFrameElement *f;
00651 TIter next(GetList());
00652 while ((f = (TGFrameElement *)next())) {
00653 f->fFrame->SavePrimitive(out,option);
00654 if (f->fFrame->InheritsFrom("TGButton")) continue;
00655 else {
00656 out << " " << GetName() << "->AddFrame(" << f->fFrame->GetName();
00657 f->fLayout->SavePrimitive(out, option);
00658 out << ");"<< endl;
00659 }
00660 }
00661
00662 if (IsExclusive())
00663 out << " " << GetName() <<"->SetExclusive(kTRUE);" << endl;
00664
00665 if (IsRadioButtonExclusive())
00666 out << " " << GetName() <<"->SetRadioButtonExclusive(kTRUE);" << endl;
00667
00668 if (!IsBorderDrawn())
00669 out << " " << GetName() <<"->SetBorderDrawn(kFALSE);" << endl;
00670
00671
00672 out << " " << GetName() << "->Resize(" << GetWidth()
00673 << "," << GetHeight() << ");" << endl;
00674
00675 if (!IsEnabled())
00676 out << " " << GetName() <<"->SetState(kFALSE);" << endl;
00677
00678 out << " " << GetName() << "->Show();" << endl;
00679 }
00680
00681
00682 void TGHButtonGroup::SavePrimitive(ostream &out, Option_t *option )
00683 {
00684
00685
00686 char quote ='"';
00687
00688
00689 option = GetName()+5;
00690 TString parGC, parFont;
00691 parFont.Form("%s::GetDefaultFontStruct()",IsA()->GetName());
00692 parGC.Form("%s::GetDefaultGC()()",IsA()->GetName());
00693
00694 if ((GetDefaultFontStruct() != fFontStruct) || (GetDefaultGC()() != fNormGC)) {
00695 TGFont *ufont = gClient->GetResourcePool()->GetFontPool()->FindFont(fFontStruct);
00696 if (ufont) {
00697 ufont->SavePrimitive(out, option);
00698 parFont.Form("ufont->GetFontStruct()");
00699 }
00700
00701 TGGC *userGC = gClient->GetResourcePool()->GetGCPool()->FindGC(fNormGC);
00702 if (userGC) {
00703 userGC->SavePrimitive(out, option);
00704 parGC.Form("uGC->GetGC()");
00705 }
00706 }
00707
00708 if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
00709
00710 out << endl << " // horizontal buttongroup frame" << endl;
00711
00712 out << " TGHButtonGroup *";
00713 out << GetName() << " = new TGHButtonGroup(" << fParent->GetName()
00714 << "," << quote << fText->GetString() << quote;
00715 if (fBackground == GetDefaultFrameBackground()) {
00716
00717 if (fFontStruct == GetDefaultFontStruct()) {
00718
00719 if (fNormGC == GetDefaultGC()()) {
00720 out << ");" << endl;
00721 } else {
00722 out << "," << parGC.Data() <<");" << endl;
00723 }
00724 } else {
00725 out << "," << parGC.Data() << "," << parFont.Data() <<");" << endl;
00726 }
00727 } else {
00728 out << "," << parGC.Data() << "," << parFont.Data() << ",ucolor);" << endl;
00729 }
00730 if (option && strstr(option, "keep_names"))
00731 out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
00732
00733 TGFrameElement *f;
00734 TIter next(GetList());
00735 while ((f = (TGFrameElement *)next())) {
00736 f->fFrame->SavePrimitive(out,option);
00737 if (f->fFrame->InheritsFrom("TGButton")){
00738 out << " " << GetName() << "->SetLayoutHints(";
00739 f->fLayout->SavePrimitive(out, "nocoma");
00740 out << "," << f->fFrame->GetName();
00741 out << ");"<< endl;
00742 }
00743 else {
00744 out << " " << GetName() << "->AddFrame(" << f->fFrame->GetName();
00745 f->fLayout->SavePrimitive(out, option);
00746 out << ");"<< endl;
00747 }
00748 }
00749
00750 if (!IsEnabled())
00751 out << " " << GetName() <<"->SetState(kFALSE);" << endl;
00752
00753 if (IsExclusive())
00754 out << " " << GetName() <<"->SetExclusive(kTRUE);" << endl;
00755
00756 if (IsRadioButtonExclusive())
00757 out << " " << GetName() <<"->SetRadioButtonExclusive(kTRUE);" << endl;
00758
00759 if (!IsBorderDrawn())
00760 out << " " << GetName() <<"->SetBorderDrawn(kFALSE);" << endl;
00761
00762 out << " " << GetName() <<"->Resize(" << GetWidth() << ","
00763 << GetHeight() << ");" << endl;
00764
00765 out << " " << GetName() << "->Show();" << endl;
00766 }
00767
00768
00769 void TGVButtonGroup::SavePrimitive(ostream &out, Option_t *option )
00770 {
00771
00772
00773 char quote ='"';
00774
00775
00776 option = GetName()+5;
00777 TString parGC, parFont;
00778 parFont.Form("%s::GetDefaultFontStruct()",IsA()->GetName());
00779 parGC.Form("%s::GetDefaultGC()()",IsA()->GetName());
00780
00781 if ((GetDefaultFontStruct() != fFontStruct) || (GetDefaultGC()() != fNormGC)) {
00782 TGFont *ufont = gClient->GetResourcePool()->GetFontPool()->FindFont(fFontStruct);
00783 if (ufont) {
00784 ufont->SavePrimitive(out, option);
00785 parFont.Form("ufont->GetFontStruct()");
00786 }
00787
00788 TGGC *userGC = gClient->GetResourcePool()->GetGCPool()->FindGC(fNormGC);
00789 if (userGC) {
00790 userGC->SavePrimitive(out, option);
00791 parGC.Form("uGC->GetGC()");
00792 }
00793 }
00794
00795 if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
00796
00797 out << endl << " // vertical buttongroup frame" << endl;
00798
00799 out << " TGVButtonGroup *";
00800 out << GetName() << " = new TGVButtonGroup(" << fParent->GetName()
00801 << "," << quote << fText->GetString() << quote;
00802
00803 if (fBackground == GetDefaultFrameBackground()) {
00804 if (fFontStruct == GetDefaultFontStruct()) {
00805 if (fNormGC == GetDefaultGC()()) {
00806 out <<");" << endl;
00807 } else {
00808 out << "," << parGC.Data() <<");" << endl;
00809 }
00810 } else {
00811 out << "," << parGC.Data() << "," << parFont.Data() <<");" << endl;
00812 }
00813 } else {
00814 out << "," << parGC.Data() << "," << parFont.Data() << ",ucolor);" << endl;
00815 }
00816 if (option && strstr(option, "keep_names"))
00817 out << " " << GetName() << "->SetName(\"" << GetName() << "\");" << endl;
00818
00819 TGFrameElement *f;
00820 TIter next(GetList());
00821 while ((f = (TGFrameElement *)next())) {
00822 f->fFrame->SavePrimitive(out,option);
00823 if (f->fFrame->InheritsFrom("TGButton")) continue;
00824 else {
00825 out << " " << GetName() << "->AddFrame(" << f->fFrame->GetName();
00826 f->fLayout->SavePrimitive(out, option);
00827 out << ");"<< endl;
00828 }
00829 }
00830
00831 if (!IsEnabled())
00832 out << " " << GetName() <<"->SetState(kFALSE);" << endl;
00833
00834 if (IsExclusive())
00835 out << " " << GetName() <<"->SetExclusive(kTRUE);" << endl;
00836
00837 if (IsRadioButtonExclusive())
00838 out << " " << GetName() <<"->SetRadioButtonExclusive(kTRUE);" << endl;
00839
00840 if (!IsBorderDrawn())
00841 out << " " << GetName() <<"->SetBorderDrawn(kFALSE);" << endl;
00842
00843 out << " " << GetName() << "->Resize(" << GetWidth()
00844 << "," << GetHeight() << ");"<< endl;
00845
00846 out << " " << GetName() << "->Show();" << endl;
00847 }