52 TGMdiFrame::TGMdiFrame(TGMdiMainFrame *main, Int_t w, Int_t h, UInt_t options,
54 TGCompositeFrame(main->GetContainer(), w, h,
55 options | kOwnBackground | kMdiFrame, back)
58 fMain->AddMdiFrame(
this);
59 fMdiHints = kMdiDefaultHints;
65 TGMdiFrame::~TGMdiFrame()
68 fMain->RemoveMdiFrame(
this);
74 Bool_t TGMdiFrame::CloseWindow()
85 void TGMdiFrame::DontCallClose()
87 SetBit(kDontCallClose);
93 void TGMdiFrame::SetMdiHints(ULong_t mdihints)
96 ((TGMdiDecorFrame *)fParent)->SetMdiButtons(mdihints);
102 void TGMdiFrame::SetWindowName(
const char *name)
104 ((TGMdiDecorFrame *)fParent)->SetWindowName(name);
105 fMain->UpdateWinListMenu();
111 void TGMdiFrame::SetWindowIcon(
const TGPicture *pic)
113 ((TGMdiDecorFrame *)fParent)->SetWindowIcon(pic);
114 fMain->UpdateWinListMenu();
120 const char *TGMdiFrame::GetWindowName()
122 return ((TGMdiDecorFrame *)fParent)->GetWindowName();
128 const TGPicture *TGMdiFrame::GetWindowIcon()
130 return ((TGMdiDecorFrame *)fParent)->GetWindowIcon();
136 void TGMdiFrame::Move(Int_t x, Int_t y)
138 ((TGMdiDecorFrame *)fParent)->Move(x, y);
145 TString TGMdiFrame::GetMdiHintsString()
const
148 if (fMdiHints == kMdiDefaultHints)
149 hints =
"kMdiDefaultHints";
151 if (fMdiHints & kMdiClose) {
152 if (hints.Length() == 0) hints =
"kMdiClose";
153 else hints +=
" | kMdiClose";
155 if (fMdiHints & kMdiRestore) {
156 if (hints.Length() == 0) hints =
"kMdiRestore";
157 else hints +=
" | kMdiRestore";
159 if (fMdiHints & kMdiMove) {
160 if (hints.Length() == 0) hints =
"kMdiMove";
161 else hints +=
" | kMdiMove";
163 if (fMdiHints & kMdiSize) {
164 if (hints.Length() == 0) hints =
"kMdiSize";
165 else hints +=
" | kMdiSize";
167 if (fMdiHints & kMdiMinimize) {
168 if (hints.Length() == 0) hints =
"kMdiMinimize";
169 else hints +=
" | kMdiMinimize";
171 if (fMdiHints & kMdiMaximize) {
172 if (hints.Length() == 0) hints =
"kMdiMaximize";
173 else hints +=
" | kMdiMaximize";
175 if (fMdiHints & kMdiHelp) {
176 if (hints.Length() == 0) hints =
"kMdiHelp";
177 else hints +=
" | kMdiHelp";
179 if (fMdiHints & kMdiMenu) {
180 if (hints.Length() == 0) hints =
"kMdiMenu";
181 else hints +=
" | kMdiMenu";
190 void TGMdiFrame::SavePrimitive(std::ostream &out, Option_t *option )
194 if (fBackground != GetDefaultFrameBackground()) SaveUserColor(out, option);
196 TGMdiTitleBar *tb = fMain->GetWindowList()->GetDecorFrame()->GetTitleBar();
198 out << std::endl <<
" // MDI frame "<< quote << GetWindowName() << quote << std::endl;
199 out <<
" TGMdiFrame *";
200 out << GetName() <<
" = new TGMdiFrame(" << fMain->GetName()
201 <<
"," << GetWidth() + GetBorderWidth()*2
202 <<
"," << GetHeight() + tb->GetHeight() + GetBorderWidth()*2;
204 if (fBackground == GetDefaultFrameBackground()) {
206 out <<
");" << std::endl;
208 out <<
"," << GetOptionString() <<
");" << std::endl;
211 out <<
"," << GetOptionString() <<
",ucolor);" << std::endl;
213 if (option && strstr(option,
"keep_names"))
214 out <<
" " << GetName() <<
"->SetName(\"" << GetName() <<
"\");" << std::endl;
216 SavePrimitiveSubframes(out, option);
218 out <<
" " << GetName() <<
"->SetWindowName(" << quote << GetWindowName()
219 << quote <<
");" << std::endl;
220 out <<
" " << GetName() <<
"->SetMdiHints(" << GetMdiHintsString()
221 <<
");" << std::endl;
222 if ((GetX() != 5) && (GetY() != 23))
223 out <<
" " << GetName() <<
"->Move(" << GetX() <<
"," << GetY()
224 <<
");" << std::endl;
226 out <<
" " << GetName() <<
"->MapSubwindows();" << std::endl;
227 out <<
" " << GetName() <<
"->Layout();" << std::endl;