88 fBoxGC->SetStipple(
fClient->GetResourcePool()->GetCheckeredBitmap());
103 ((
TGFrame *)
main)->Connect(
"ProcessedConfigure(Event_t*)",
104 "TGMdiMainFrame",
this,
"UpdateMdiButtons()");
135 if (
main &&
main->InheritsFrom(
"TGMainFrame")) {
194 frame->UnmapWindow();
205 frame->GetHeight(),
fBoxGC));
235 if (!frame)
return kFALSE;
237 if (frame->IsEditable()) frame->SetEditable(
kFALSE);
239 while (travel && (travel->
GetFrameId() != frame->GetId()))
241 if (!travel)
return kFALSE;
265 UInt_t old_id = frame->GetId();
286 fCurrent->GetDecorFrame()->RaiseWindow();
288 fMenuBar->ShowFrames(
fCurrent->GetDecorFrame()->GetTitleBar()->GetWinIcon(),
289 fCurrent->GetDecorFrame()->GetTitleBar()->GetButtons());
297 if (!travel)
return kFALSE;
308 fCurrent->GetDecorFrame()->RaiseWindow();
310 fMenuBar->ShowFrames(
fCurrent->GetDecorFrame()->GetTitleBar()->GetWinIcon(),
311 fCurrent->GetDecorFrame()->GetTitleBar()->GetButtons());
318 if (!travel)
return kFALSE;
329 fCurrent->GetDecorFrame()->RaiseWindow();
331 fMenuBar->ShowFrames(
fCurrent->GetDecorFrame()->GetTitleBar()->GetWinIcon(),
332 fCurrent->GetDecorFrame()->GetTitleBar()->GetButtons());
338 if (!
fCurrent->GetDecorFrame()->IsMaximized())
373 if (!
fCurrent->GetDecorFrame()->IsMaximized())
378 fCurrent->GetDecorFrame()->RaiseWindow();
384 fMenuBar->ShowFrames(
fCurrent->GetDecorFrame()->GetTitleBar()->GetWinIcon(),
385 fCurrent->GetDecorFrame()->GetTitleBar()->GetButtons());
402 fCurrent->GetDecorFrame()->RaiseWindow();
407 fMenuBar->ShowFrames(
fCurrent->GetDecorFrame()->GetTitleBar()->GetWinIcon(),
408 fCurrent->GetDecorFrame()->GetTitleBar()->GetButtons());
421 fCurrent->GetDecorFrame()->LowerWindow();
428 fCurrent->GetDecorFrame()->RaiseWindow();
433 fMenuBar->ShowFrames(
fCurrent->GetDecorFrame()->GetTitleBar()->GetWinIcon(),
434 fCurrent->GetDecorFrame()->GetTitleBar()->GetButtons());
448 if (!travel)
return 0;
459 if (!travel)
return 0;
469 if (!frame)
return 0;
470 return frame->GetMdiFrame();
509 if (first)
rect = wrect;
510 else rect.Merge(wrect);
542 if (scut == (
'9' + 1)) scut =
'A';
591 Int_t num_mapped = 0;
616 if (num_mapped == 0)
return;
623 factor_y =
h / num_mapped;
633 factor_x =
w / num_mapped;
646 factor_y = (
h * 2) / 3;
647 factor_x = (
w * 2) / 3;
659 }
while (travel != tmp);
686 h =
fChildren->GetDecorFrame()->GetTitleBar()->GetDefaultHeight() +
687 fChildren->GetDecorFrame()->GetBorderWidth();
706 Int_t dist = dx * dx + dy * dy;
707 if (!closest || (dist < cdist)) {
792 if (frame->IsMaximized())
return;
794 if (frame->IsMinimized())
Restore(mdiframe);
796 frame->SetDecorBorderWidth(0);
797 frame->SetPreResizeX(frame->GetX());
798 frame->SetPreResizeY(frame->GetY());
799 frame->SetPreResizeWidth(frame->GetWidth());
800 frame->SetPreResizeHeight(frame->GetHeight());
801 frame->GetUpperHR()->UnmapWindow();
802 frame->GetLowerHR()->UnmapWindow();
803 frame->GetLeftVR()->UnmapWindow();
804 frame->GetRightVR()->UnmapWindow();
805 frame->GetUpperLeftCR()->UnmapWindow();
806 frame->GetUpperRightCR()->UnmapWindow();
807 frame->GetLowerLeftCR()->UnmapWindow();
808 frame->GetLowerRightCR()->UnmapWindow();
813 frame->GetTitleBar()->LayoutButtons(frame->GetMdiButtons(), frame->IsMinimized(),
814 frame->IsMaximized());
815 frame->GetTitleBar()->RemoveFrames(frame->GetTitleBar()->GetWinIcon(),
816 frame->GetTitleBar()->GetButtons());
817 frame->HideFrame(frame->GetTitleBar());
822 fMenuBar->AddFrames(frame->GetTitleBar()->GetWinIcon(),
823 frame->GetTitleBar()->GetButtons());
842 if (frame->IsMinimized() ==
kFALSE && frame->IsMaximized() ==
kFALSE)
return;
844 if (frame->IsMinimized()) {
845 frame->SetMinimizedX(frame->GetX());
846 frame->SetMinimizedY(frame->GetY());
851 }
else if (frame->IsMaximized()) {
853 frame->MapSubwindows();
856 fMenuBar->RemoveFrames(frame->GetTitleBar()->GetWinIcon(),
857 frame->GetTitleBar()->GetButtons());
861 frame->GetTitleBar()->AddFrames(frame->GetTitleBar()->GetWinIcon(),
862 frame->GetTitleBar()->GetButtons());
865 frame->ShowFrame(frame->GetTitleBar());
869 frame->GetTitleBar()->LayoutButtons(frame->GetMdiButtons(),
kFALSE,
kFALSE);
870 frame->MoveResize(frame->GetPreResizeX(), frame->GetPreResizeY(),
871 frame->GetPreResizeWidth(), frame->GetPreResizeHeight());
889 if (frame->IsMinimized())
return;
891 if (frame->IsMaximized())
Restore(mdiframe);
893 frame->SetPreResizeX(frame->GetX());
894 frame->SetPreResizeY(frame->GetY());
895 frame->SetPreResizeWidth(frame->GetWidth());
896 frame->SetPreResizeHeight(frame->GetHeight());
898 h = frame->GetTitleBar()->GetDefaultHeight() + frame->GetBorderWidth();
901 if (!frame->GetMinUserPlacement()) {
933 frame->SetMinimizedX(
x);
934 frame->SetMinimizedY(
y);
939 frame->MoveResize(frame->GetMinimizedX(), frame->GetMinimizedY(),
w,
h);
940 frame->LowerWindow();
941 frame->GetTitleBar()->LayoutButtons(frame->GetMdiButtons(),
942 frame->IsMinimized(),
943 frame->IsMaximized());
957 if (!mdiframe)
return kFALSE;
961 mdiframe->
Emit(
"CloseWindow()");
963 return frame->CloseWindow();
975 Int_t x = frame->GetTitleBar()->GetWidth() / 2;
976 Int_t y = frame->GetTitleBar()->GetHeight() - 1;
978 gVirtualX->Warp(
x,
y, frame->GetTitleBar()->GetId());
980 frame->GetTitleBar()->SetLeftButPressed();
981 frame->GetTitleBar()->SetX0(
x);
982 frame->GetTitleBar()->SetY0(
y);
986 gVirtualX->GrabPointer(frame->GetTitleBar()->GetId(),
999 Int_t x = frame->GetLowerRightCR()->GetWidth() - 5;
1000 Int_t y = frame->GetLowerRightCR()->GetHeight() - 5;
1005 gVirtualX->TranslateCoordinates(frame->GetLowerRightCR()->GetId(),
1006 fClient->GetDefaultRoot()->GetId(),
x,
y, xroot, yroot,
win);
1008 gVirtualX->Warp(
x,
y, frame->GetLowerRightCR()->GetId());
1013 event.fWindow = frame->GetLowerRightCR()->GetId();
1017 event.fXRoot = xroot;
1018 event.fYRoot = yroot;
1023 gVirtualX->GrabPointer(frame->GetLowerRightCR()->GetId(),
1027 frame->GetLowerRightCR()->HandleButton(&event);
1036 return mdiframe->
Help();
1047 return fCurrent->GetDecorFrame()->GetMdiFrame();
1063 Int_t th = frame->GetTitleBar()->GetDefaultHeight();
1064 Int_t bw = frame->GetBorderWidth();
1066 if (frame->IsMinimized() || frame->IsMaximized()) {
1068 frame->GetPreResizeY(),
1069 (
unsigned) frame->GetPreResizeWidth(),
1070 (
unsigned) frame->GetPreResizeHeight());
1074 (
unsigned) frame->GetWidth(),
1075 (
unsigned) frame->GetHeight());
1085 if (frame->GetMinUserPlacement()) {
1086 Int_t mh = th + 2 * bw;
1090 frame->GetMinimizedY(),
1109 if (frame->IsMinimized() || frame->IsMaximized()) {
1122 frame->SetMinimizedX(geom.
fIcon.
fX);
1123 frame->SetMinimizedY(geom.
fIcon.
fY);
1124 frame->SetMinUserPlacement();
1125 if (frame->IsMinimized())
1126 frame->Move(frame->GetMinimizedX(), frame->GetMinimizedY());
1153 if (frame)
return frame->IsMaximized();
1163 if (frame)
return frame->IsMinimized();
1172 TGFrame(p->GetViewPort(),
w,
h, options, back)
1201 Int_t vh =
fMain->GetViewPort()->GetHeight();
1203 Int_t w = std::max(vw,
rect.RightBottom().fX + 1);
1204 Int_t h = std::max(vh,
rect.RightBottom().fY + 1);
1222 out <<
"\n // MDI main frame\n";
1223 out <<
" TGMdiMainFrame *" <<
GetName() <<
" = new TGMdiMainFrame(" <<
fParent->GetName() <<
","
1227 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");\n";
1237 out <<
" " <<
GetName() <<
"->ArrangeFrames(";
1244 case kMdiCascade: out <<
"kMdiCascade);\n";
break;
1248 out <<
" " <<
GetName() <<
"->SetResizeMode(kMdiNonOpaque);\n";
Handle_t Window_t
Window handle.
const Mask_t kPointerMotionMask
const Mask_t kKeyShiftMask
Handle_t Cursor_t
Cursor handle.
const Mask_t kKeyControlMask
const Mask_t kStructureNotifyMask
const Mask_t kButtonReleaseMask
ULong_t Pixel_t
Pixel value.
bool Bool_t
Boolean (0=false, 1=true) (bool).
int Int_t
Signed integer 4 bytes (int).
long Longptr_t
Integer large enough to hold a pointer (platform-dependent).
unsigned long ULong_t
Unsigned long integer 4 bytes (unsigned long). Size depends on architecture.
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
const char Option_t
Option string (const char).
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void input
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t cursor
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void w
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t rect
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t win
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void xpos
Option_t Option_t TPoint TPoint const char mode
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void ypos
virtual void SetContainer(TGFrame *f)
TGViewPort * GetViewPort() const
void MapSubwindows() override
Map all canvas sub windows.
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Handle message generated by the canvas scrollbars.
TGCanvas(const TGCanvas &)=delete
void Layout() override
Create layout for canvas.
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
Encapsulate fonts used in the GUI system.
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
TGFrame(const TGFrame &)=delete
UInt_t fHeight
frame height
Int_t fBorderWidth
frame border width
void MapWindow() override
map window
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
virtual void SendMessage(const TGWindow *w, Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
Send message (i.e.
const TGResourcePool * GetResourcePool() const
TString SaveCtorArgs(std::ostream &out, UInt_t dflt_options=kChildFrame, Bool_t check_white_pixel=kFALSE)
Return options and custom color as constructor args Used in the SavePrimitive methods,...
Encapsulate a graphics context used in the low level graphics.
TGHotString is a string with a "hot" character underlined.
Defines top level windows that interact with the system Window Manager.
TGDimension GetDefaultSize() const override
Return dimension of MDI container.
TGMdiContainer(const TGMdiMainFrame *p, Int_t w, Int_t h, UInt_t options=0, ULong_t back=GetDefaultFrameBackground())
TGMdiContainer constructor.
Bool_t HandleConfigureNotify(Event_t *event) override
Handle configure notify events for MDI container.
const TGMdiMainFrame * fMain
This file contains all different MDI frame decoration classes.
TGMdiFrame * GetMdiFrame() const
Bool_t IsMaximized() const
Bool_t IsMinimized() const
void SetMinimizedX(Int_t x)
const char * GetWindowName()
void SetResizeMode(Int_t mode=kMdiDefaultResizeMode)
Set resize mode (opaque or transparent).
const TGPicture * GetWindowIcon()
ULong_t GetMdiButtons() const
void SetMinimizedY(Int_t y)
void SetMinUserPlacement(Bool_t place=kTRUE)
TGMdiTitleBar * GetTitleBar() const
void MoveResize(Int_t x, Int_t y, UInt_t w, UInt_t h) override
Move the MDI window at position x, y and set size to w, h.
void Move(Int_t x, Int_t y) override
Move the MDI window at position x, y.
void SetMdiButtons(ULong_t buttons)
Set-up MDI buttons.
Bool_t GetMinUserPlacement() const
void SetCyclePrev(TGMdiFrameList *prev)
UInt_t GetFrameId() const
void SetFrameId(UInt_t id)
void SetDecorFrame(TGMdiDecorFrame *decor)
TGMdiFrameList * GetCyclePrev() const
void SetPrev(TGMdiFrameList *prev)
void SetNext(TGMdiFrameList *next)
TGMdiDecorFrame * fDecor
MDI decor frame.
TGMdiFrameList * GetCycleNext() const
TGMdiDecorFrame * GetDecorFrame() const
TGMdiFrameList * GetNext() const
TGMdiFrameList * GetPrev() const
void SetCycleNext(TGMdiFrameList *next)
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a MDIframe as a C++ statement(s) on output stream out.
TGRectangle fIcon
client, decoration and icon rectangles
Int_t fValueMask
MDI hints mask.
This file contains the TGMdiMainFrame class.
TGMdiMenuBar * GetMenu() const
virtual void ArrangeFrames(Int_t mode)
Automatic repositioning and resizing of every MDI child window.
virtual void FramesArranged(Int_t mode)
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Process messages MDI main frame.
TGMdiGeometry GetWindowGeometry(TGMdiFrame *f) const
Get MDI geometry of MDI child window f.
~TGMdiMainFrame() override
MDI main frame destructor.
void AddMdiFrame(TGMdiFrame *f)
Add new MDI child window.
virtual void Restore(TGMdiFrame *frame)
Restore size of MDI child window mdiframe.
virtual void FrameMinimized(Int_t id)
TGMdiMenuBar * fMenuBar
menu bar
virtual void FreeMove(TGMdiFrame *frame)
Allow to move MDI child window mdiframe.
Bool_t SetCurrent(TGMdiFrameList *newcurrent)
Set current (active) MDI child window (by frame list).
TGFont * fFontNotCurrent
fonts for active and inactive MDI children
Bool_t IsMinimized(TGMdiFrame *f)
Check if MDI child window f is minimized;.
virtual void FrameCreated(Int_t id)
TGMdiMainFrame(const TGWindow *p, TGMdiMenuBar *menu, Int_t w, Int_t h, UInt_t options=0, Pixel_t back=GetDefaultFrameBackground())
Create a MDI main frame.
TGFrame * fContainer
MDI container.
TGGC * fBoxGC
GC used to draw resizing box (rectangle).
virtual void CirculateDown()
Send the highest window to the bottom.
TGRectangle GetBBox() const
Return resizing box (rectangle) for current MDI child.
void SetResizeMode(Int_t mode=kMdiDefaultResizeMode)
Set MDI windows resize mode (opaque or transparent).
TGMdiFrame * GetMdiFrame(UInt_t id) const
Return frame of MDI child window (by id).
Pixel_t fForeCurrent
back and fore colors for active MDI children
Long_t fNumberOfFrames
number of MDI child windows
Bool_t RemoveMdiFrame(TGMdiFrame *f)
Remove MDI child window.
virtual void FrameRestored(Int_t id)
virtual void Minimize(TGMdiFrame *frame)
Minimize MDI child window mdiframe.
virtual void CloseAll()
Close all MDI child windows.
virtual void CirculateUp()
Bring the lowest window to the top.
virtual void FrameClosed(Int_t id)
TGPopupMenu * fWinListMenu
popup menu with list of MDI child windows
TGMdiFrame * GetCurrent() const
Return pointer on current (active) MDI child window.
void SavePrimitive(std::ostream &out, Option_t *option="") override
Save a MDI main frame as a C++ statement(s) on output stream out.
virtual void ArrangeMinimized()
This is an attempt to an "smart" minimized window re-arrangement.
Bool_t IsMaximized(TGMdiFrame *f)
Check if MDI child window f is maximized;.
virtual void FrameMaximized(Int_t id)
virtual void Maximize(TGMdiFrame *frame)
Maximize MDI child window mdiframe.
TGMdiFrameList * fChildren
list of MDI child windows
Int_t fResizeMode
current MDI child XY position and resize mode
Bool_t HandleKey(Event_t *event) override
Handle keyboards events into MDI main frame.
TGRectangle GetMinimizedBBox() const
Return minimized box (rectangle) for current MDI child.
void ConfigureWindow(TGMdiFrame *f, TGMdiGeometry &geom)
Set MDI geometry for MDI child window f.
virtual Int_t Close(TGMdiFrame *frame)
Close MDI child window mdiframe.
TGMdiFrameList * fCurrent
current list of MDI child windows
virtual void FreeSize(TGMdiFrame *frame)
Allow to resize MDI child window mdiframe.
TGMdiDecorFrame * GetDecorFrame(UInt_t id) const
Return decor frame of MDI child window (by id).
void Layout() override
Recalculates the postion and the size of all MDI child windows.
void UpdateWinListMenu()
Update MDI menu entries with current list of MDI child windows.
Pixel_t fForeNotCurrent
back and fore colors for inactive MDI children
virtual Int_t ContextHelp(TGMdiFrame *frame)
Calls Help() method of MDI child window mdiframe.
void UpdateMdiButtons()
Update the status of MDI buttons in the decor frame of all children.
Int_t fArrangementMode
MDI children arrangement mode.
TGClient * fClient
Connection to display server.
Handle_t fId
X11/Win32 Window identifier.
The TGPicture class implements pictures and icons used in the different GUI elements and widgets.
This class implements a pool for the default GUI resource set, like GC's, colors, fonts,...
const TGFont * GetMenuFont() const
Pixel_t GetSelectedBgndColor() const
Pixel_t GetSelectedFgndColor() const
Pixel_t GetFrameShadowColor() const
Pixel_t GetFrameBgndColor() const
virtual void SetHPos(Int_t xpos)
Moves content of container frame in horizontal direction.
virtual void SetVPos(Int_t ypos)
Moves content of container frame in vertical direction.
virtual const TGWindow * GetMainFrame() const
Returns top level main frame.
const TGWindow * fParent
Parent window.
virtual Int_t MustCleanup() const
virtual void SetWindowName(const char *name=nullptr)
Set window name.
const char * GetName() const override
Return unique name, used in SavePrimitive methods.
Bool_t TestBit(UInt_t f) const
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
int main(int argc, char **argv)
bool HasBeenDeleted(const TObject *obj)
Check if the TObject's memory has been deleted.
EGEventType fType
of event (see EGEventType)
Window_t fWindow
window reported event is relative to
UInt_t fState
key or button mask