43class TGMdiTestSubclass {
55 TGMdiFrame *GetMdiFrame()
const {
return fMdiFrame; }
56 virtual Bool_t CloseWindow();
72 void HandleText(const
char *);
90 TGAppMainFrame(const
TGWindow *p,
int w,
int h);
92 void HandleMenu(
Int_t id);
97TGAppMainFrame::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();
195void TGAppMainFrame::HandleMenu(
Int_t id)
220 case M_WINDOW_CASCADE:
224 case M_WINDOW_ARRANGE:
228 case M_WINDOW_OPAQUE:
244void 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)");
288void TGAppMainFrame::CloseWindow()
298 fMdiFrame->Connect(
"CloseWindow()",
"TGMdiTestSubclass",
this,
"CloseWindow()");
299 fMdiFrame->DontCallClose();
301 fCanvasWindow =
new TGCanvas(fMdiFrame, 400, 240);
304 fMdiFrame->GetWhitePixel());
305 fContainer->SetLayoutManager(
new TGTileLayout(fContainer, 8));
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"));
318Bool_t TGMdiTestSubclass::CloseWindow()
323 fMdiFrame->GetWindowName(),
"Really want to close the window?",
326 if (ret ==
kMBYes)
return fMdiFrame->CloseWindow();
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();
383void TGMdiHintTest::HandleButtons()
394 fMdiFrame->SetMdiHints(hints);
397void TGMdiHintTest::HandleText(
const char *)
404 new TGAppMainFrame(
gClient->GetRoot(), 640, 400);
410int main(
int argc,
char **argv)
#define RQ_OBJECT(sender_class)
R__EXTERN TApplication * gApplication
This class creates the ROOT Application Environment that interfaces to the windowing system eventloop...
virtual void Terminate(Int_t status=0)
Terminate the application by call TSystem::Exit() unless application has been told to return from Run...
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
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 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 SetMultipleSelections(Bool_t multi=kTRUE)
virtual void Move(Int_t x, Int_t y)
Move MDI window at position x, y.
virtual void SetMdiHints(ULong_t mdihints)
Set MDI hints, also used to identify titlebar buttons.
void SetWindowName(const char *name)
Set MDI window name (set titlebar title).
Bool_t SetCurrent(TGMdiFrameList *newcurrent)
Set current (active) MDI child window (by frame list).
void SetResizeMode(Int_t mode=kMdiDefaultResizeMode)
Set MDI windows resize mode (opaque or transparent).
TGMdiFrame * GetCurrent() const
Return pointer on current (active) MDI child window.
virtual void ArrangeMinimized()
This is an attempt to an "smart" minimized window re-arrangement.
TGPopupMenu * GetWinListMenu() const
virtual void TileHorizontal()
virtual void TileVertical()
virtual Int_t Close(TGMdiFrame *frame)
Close MDI child window mdiframe.
TGFrame * GetContainer() const
Pixmap_t GetPicture() const
void AddText(Int_t pos, const char *text)
const char * GetString() const
TGTextBuffer * GetBuffer() const
virtual void SetBackgroundPixmap(Pixmap_t pixmap)
set background pixmap
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.
int main(int argc, char **argv)