88 fBoxGC->SetStipple(
fClient->GetResourcePool()->GetCheckeredBitmap());
103 ((
TGFrame *)
main)->Connect(
"ProcessedConfigure(Event_t*)",
104 "TGMdiMainFrame",
this,
"UpdateMdiButtons()");
135 if (
main &&
main->InheritsFrom(
"TGMainFrame")) {
167 gVirtualX->LookupString(event, input,
sizeof(input), keysym);
235 if (!frame)
return kFALSE;
241 if (!travel)
return kFALSE;
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;
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)) {
957 if (!mdiframe)
return kFALSE;
961 mdiframe->
Emit(
"CloseWindow()");
1006 fClient->GetDefaultRoot()->GetId(),
x,
y, xroot, yroot, win);
1017 event.fXRoot = xroot;
1018 event.fYRoot = yroot;
1036 return mdiframe->
Help();
1047 return fCurrent->GetDecorFrame()->GetMdiFrame();
1086 Int_t mh = th + 2 * bw;
1172 TGFrame(p->GetViewPort(), w,
h, options, back)
1201 Int_t vh =
fMain->GetViewPort()->GetHeight();
1222 out <<
"\n // MDI main frame\n";
1223 out <<
" TGMdiMainFrame *" <<
GetName() <<
" = new TGMdiMainFrame(" <<
fParent->GetName() <<
","
1226 if (option && strstr(option,
"keep_names"))
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 Cursor_t
Cursor handle.
const Mask_t kPointerMotionMask
const Mask_t kKeyShiftMask
const Mask_t kKeyControlMask
const Mask_t kStructureNotifyMask
const Mask_t kButtonReleaseMask
ULong_t Pixel_t
Pixel value.
Handle_t Window_t
Window handle.
int Int_t
Signed integer 4 bytes (int).
long Longptr_t
Integer large enough to hold a pointer (platform-dependent).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
unsigned long ULong_t
Unsigned long integer 4 bytes (unsigned long). Size depends on architecture.
bool Bool_t
Boolean (0=false, 1=true) (bool).
const char Option_t
Option string (const char).
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.
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
UInt_t GetDefaultHeight() const override
virtual void ShowFrame(TGFrame *f)
Show sub frame.
Bool_t IsEditable() const override
Return kTRUE if frame is being edited.
virtual void RemoveFrame(TGFrame *f)
Remove frame from composite frame.
void SetEditable(Bool_t on=kTRUE) override
Switch ON/OFF edit mode.
virtual void HideFrame(TGFrame *f)
Hide sub 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.
Int_t GetBorderWidth() const
TGFrame(const TGFrame &)=delete
UInt_t fHeight
frame height
Int_t fBorderWidth
frame border width
void SetBackgroundColor(Pixel_t back) override
Set background color (override from TGWindow base class).
void MapWindow() override
map window
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
void UnmapWindow() override
unmap window
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
TGMdiHorizontalWinResizer * GetLeftVR() const
Int_t GetMinimizedY() const
Int_t GetMinimizedX() 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).
void Layout() override
Recalculates the postion and the size of all decor frame components.
void Maximize(Bool_t max=kTRUE)
TGMdiCornerWinResizer * GetLowerRightCR() const
Int_t GetPreResizeWidth() const
void Minimize(Bool_t min=kTRUE)
const TGPicture * GetWindowIcon()
void SetPreResizeX(Int_t x)
Int_t GetPreResizeX() const
ULong_t GetMdiButtons() const
TGMdiHorizontalWinResizer * GetRightVR() const
void SetPreResizeWidth(Int_t w)
void SetMinimizedY(Int_t y)
void SetPreResizeY(Int_t y)
void SetMinUserPlacement(Bool_t place=kTRUE)
TGMdiTitleBar * GetTitleBar() const
TGMdiCornerWinResizer * GetLowerLeftCR() 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.
virtual Int_t CloseWindow()
Int_t GetPreResizeY() const
TGMdiVerticalWinResizer * GetUpperHR() const
Int_t GetPreResizeHeight() const
TGMdiVerticalWinResizer * GetLowerHR() const
void SetPreResizeHeight(Int_t 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.
TGMdiCornerWinResizer * GetUpperRightCR() const
Bool_t GetMinUserPlacement() const
TGMdiCornerWinResizer * GetUpperLeftCR() const
void SetDecorBorderWidth(Int_t bw)
Set border width of the decor.
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.
void LayoutButtons(UInt_t buttonmask, Bool_t isMinimized, Bool_t isMaximized)
Recalculates the position of every enabled (displayed) buttons.
TGMdiTitleIcon * GetWinIcon() const
void SetTitleBarColors(UInt_t fore, UInt_t back, TGFont *f)
Set title bar color (blue or grey, depends on active state).
void RemoveFrames(TGMdiTitleIcon *icon, TGMdiButtons *buttons)
This is called from TGMdiMainFrame on Maximize().
void SetLeftButPressed(Bool_t press=kTRUE)
void AddFrames(TGMdiTitleIcon *icon, TGMdiButtons *buttons)
This is called from TGMdiMainFrame on Restore().
TGMdiButtons * GetButtons() const
Bool_t HandleButton(Event_t *event) override
Handle button events in resizer (grab button and resize).
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.
TGPosition LeftTop() const
void Merge(const TGRectangle &r)
TGPosition RightBottom() const
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 LowerWindow()
lower window
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