43 class TGMdiTestSubclass {
55 TGMdiFrame *GetMdiFrame()
const {
return fMdiFrame; }
56 virtual Bool_t CloseWindow();
72 void HandleText(const
char *);
75 class TGAppMainFrame {
90 TGAppMainFrame(const
TGWindow *p,
int w,
int h);
92 void HandleMenu(
Int_t id);
97 TGAppMainFrame::TGAppMainFrame(const
TGWindow *p,
int w,
int h)
114 TGMdiTestSubclass *t =
new TGMdiTestSubclass(fMainFrame, 320, 240);
115 mdiFrame = t->GetMdiFrame();
124 gClient->GetColorByName(
"red", ic);
125 mdiFrame =
new TGMdiFrame(fMainFrame, 200, 200,
133 mdiFrame->
Move(150, 200);
137 gClient->GetColorByName(
"green", ic);
147 mdiFrame->
Move(180, 220);
151 gClient->GetColorByName(
"blue", ic);
171 mdiFrame->
Move(400, 300);
178 new TGMdiHintTest(fMainFrame, 200, 200);
182 fMain->SetWindowName(
"MDI test");
183 fMain->SetClassHints(
"mdi test",
"mdi test");
188 fMain->Resize(640, 400);
190 fMain->MapSubwindows();
195 void TGAppMainFrame::HandleMenu(
Int_t id)
220 case M_WINDOW_CASCADE:
224 case M_WINDOW_ARRANGE:
228 case M_WINDOW_OPAQUE:
244 void TGAppMainFrame::InitMenu()
276 fMenuFile->
Connect(
"Activated(Int_t)",
"TGAppMainFrame",
this,
277 "HandleMenu(Int_t)");
278 fMenuWindow->
Connect(
"Activated(Int_t)",
"TGAppMainFrame",
this,
279 "HandleMenu(Int_t)");
280 fMenuHelp->
Connect(
"Activated(Int_t)",
"TGAppMainFrame",
this,
281 "HandleMenu(Int_t)");
288 void TGAppMainFrame::CloseWindow()
295 TGMdiTestSubclass::TGMdiTestSubclass(
TGMdiMainFrame *main,
int w,
int h)
298 fMdiFrame->Connect(
"CloseWindow()",
"TGMdiTestSubclass",
this,
"CloseWindow()");
299 fMdiFrame->DontCallClose();
301 fCanvasWindow =
new TGCanvas(fMdiFrame, 400, 240);
304 fMdiFrame->GetWhitePixel());
306 fCanvasWindow->SetContainer(fContainer);
308 for (
int i = 0; i < 256; ++i)
309 fCanvasWindow->AddFrame(
new TGFrame(fCanvasWindow->GetContainer(),
315 fMdiFrame->SetWindowIcon(
gClient->GetPicture(
"ofolder_t.xpm"));
318 Bool_t TGMdiTestSubclass::CloseWindow()
323 fMdiFrame->GetWindowName(),
"Really want to close the window?",
347 fMdiFrame->AddFrame(fClose, lh);
348 fMdiFrame->AddFrame(fMenu, lh);
349 fMdiFrame->AddFrame(fMin, lh);
350 fMdiFrame->AddFrame(fMax, lh);
351 fMdiFrame->AddFrame(fSize, lh);
352 fMdiFrame->AddFrame(fHelp, lh);
360 fClose->
Connect(
"Clicked()",
"TGMdiHintTest",
this,
"HandleButtons()");
361 fMenu->
Connect(
"Clicked()",
"TGMdiHintTest",
this,
"HandleButtons()");
362 fMin->
Connect(
"Clicked()",
"TGMdiHintTest",
this,
"HandleButtons()");
363 fMax->
Connect(
"Clicked()",
"TGMdiHintTest",
this,
"HandleButtons()");
364 fSize->
Connect(
"Clicked()",
"TGMdiHintTest",
this,
"HandleButtons()");
365 fHelp->
Connect(
"Clicked()",
"TGMdiHintTest",
this,
"HandleButtons()");
367 fWName =
new TGTextEntry(fMdiFrame, (
const char *)
"", 20);
372 fWName->
Connect(
"TextChanged(char*)",
"TGMdiHintTest",
this,
"HandleText(char*)");
377 fMdiFrame->SetWindowIcon(
gClient->GetPicture(
"app_t.xpm"));
379 fMdiFrame->MapSubwindows();
383 void TGMdiHintTest::HandleButtons()
394 fMdiFrame->SetMdiHints(hints);
397 void TGMdiHintTest::HandleText(
const char *)
404 new TGAppMainFrame(
gClient->GetRoot(), 640, 400);
410 int main(
int argc,
char **argv)
virtual void Resize(UInt_t w, UInt_t h)
Resize the listbox widget.
virtual void AddEntry(TGString *s, Int_t id)
Add entry with specified string and id to listbox.
virtual void TileVertical()
virtual void TileHorizontal()
virtual Int_t Close(TGMdiFrame *frame)
Close MDI child window mdiframe.
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
virtual void SetMultipleSelections(Bool_t multi=kTRUE)
virtual void Move(Int_t x, Int_t y)
Move MDI window at position x, y.
virtual void Terminate(Int_t status=0)
Terminate the application by call TSystem::Exit() unless application has been told to return from Run...
R__EXTERN TApplication * gApplication
virtual void ArrangeMinimized()
This is an attempt to an "smart" minimized window re-arrangement.
virtual void Layout()
Layout the elements of the composite frame.
virtual void CloseWindow()
Close dialog box.
const char * GetString() const
void AddText(Int_t pos, const char *text)
int main(int argc, char **argv)
TGTextBuffer * GetBuffer() const
Pixmap_t GetPicture() const
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...
TGMdiFrame * GetCurrent() const
Return pointer on current (active) MDI child window.
Bool_t SetCurrent(TGMdiFrameList *newcurrent)
Set current (active) MDI child window (by frame list).
void SetWindowName(const char *name)
Set MDI window name (set titlebar title).
virtual void SetBackgroundPixmap(Pixmap_t pixmap)
#define RQ_OBJECT(sender_class)
virtual void SetMdiHints(ULong_t mdihints)
Set MDI hints, also used to identify titlebar buttons.
TGPopupMenu * GetWinListMenu() const
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
void SetResizeMode(Int_t mode=kMdiDefaultResizeMode)
Set MDI windows resize mode (opaque or transparent).
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
TGFrame * GetContainer() const
This class creates the ROOT Application Environment that interfaces to the windowing system eventloop...