251 fTitlebar->GetWinIcon()->SetPicture(icon);
292 if ((event->
fX < 0) || (event->
fY < 0) ||
320 fTitlebar->GetWinIcon()->GetPopup()->EndMenu(ud);
358 fClient->GetPicture(
"mdi_default.xpm"),
430 if (isMinimized | isMaximized) {
461 fMFrame->SetBackgroundColor(back);
494 switch (event->
fCode) {
514 switch (event->
fCode) {
531 if (
f && (
f !=
this)) {
533 f->HandleButton(event);
614 fClient->GetPicture(
"mdi_minimize.xpm"),
616 fButton[0]->SetToolTipText(
"Minimize");
619 fButton[0]->Associate(titlebar);
624 fClient->GetPicture(
"mdi_restore.xpm"),
626 fButton[1]->SetToolTipText(
"Restore");
629 fButton[1]->Associate(titlebar);
634 fClient->GetPicture(
"mdi_maximize.xpm"),
636 fButton[2]->SetToolTipText(
"Maximize");
639 fButton[2]->Associate(titlebar);
644 fClient->GetPicture(
"mdi_help.xpm"),
646 fButton[3]->SetToolTipText(
"Help");
649 fButton[3]->Associate(titlebar);
654 fClient->GetPicture(
"mdi_close.xpm"),
656 fButton[4]->SetToolTipText(
"Close");
659 fButton[4]->Associate(titlebar);
698 fPopup->Associate(titlebar);
796 switch (event->
fCode) {
825 switch (event->
fCode) {
Handle_t Cursor_t
Cursor handle.
const Mask_t kButtonMotionMask
const Mask_t kButtonPressMask
const Mask_t kAnyModifier
const Mask_t kPointerMotionMask
const Mask_t kStructureNotifyMask
const Mask_t kButtonReleaseMask
ULong_t Pixel_t
Pixel value.
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).
TGDimension GetDefaultSize() const override
std::cout << fWidth << "x" << fHeight << std::endl;
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
TGFrame * GetFrameFromPoint(Int_t x, Int_t y) override
Get frame located at specified point.
Int_t MustCleanup() const override
void MapSubwindows() override
Map all sub windows that are part of the composite frame.
TGCompositeFrame(const TGCompositeFrame &)=delete
virtual Bool_t TranslateCoordinates(TGFrame *child, Int_t x, Int_t y, Int_t &fx, Int_t &fy)
Translate coordinates to child frame.
void Layout() override
Layout the elements of the composite frame.
void SetCleanup(Int_t mode=kLocalCleanup) override
Turn on automatic cleanup of child frames in dtor.
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.
void MoveResize(Int_t x, Int_t y, UInt_t w=0, UInt_t h=0) override
Move and/or resize the frame.
static const TGGC & GetBlackGC()
Get black graphics context.
void Resize(UInt_t w=0, UInt_t h=0) override
Resize the frame.
void RemoveInput(UInt_t emask)
Remove events specified in emask from the events the frame should handle.
TGFrame(const TGFrame &)=delete
UInt_t fHeight
frame height
void ReparentWindow(const TGWindow *p, Int_t x=0, Int_t y=0) override
Reparent window, make p the new parent and position the window at position (x,y) in new parent.
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 const TGGC & GetHilightGC()
Get highlight color graphics context.
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
void Move(Int_t x, Int_t y) override
Move frame.
virtual void SendMessage(const TGWindow *w, Longptr_t msg, Longptr_t parm1, Longptr_t parm2)
Send message (i.e.
static const TGGC & GetShadowGC()
Get shadow color graphics context.
Encapsulate a graphics context used in the low level graphics.
TGHotString is a string with a "hot" character underlined.
void DoRedraw() override
Redraw picture.
TGIcon(const TGIcon &)=delete
This class handles GUI labels.
This class describes layout hints used by the layout classes.
Bool_t HandleMotion(Event_t *event) override
Handle motion events in resizer (resize associated MDI window).
void DrawBorder() override
Draw corner resizer frame border.
TGMdiCornerWinResizer(const TGWindow *p, const TGWindow *mdiwin, Int_t pos, const TGGC *boxGC, Int_t linew, Int_t mdioptions=kMdiDefaultResizeMode, Int_t w=20, Int_t h=20)
TGMdiCornerWinResizer constructor.
This file contains all different MDI frame decoration classes.
Bool_t HandleConfigureNotify(Event_t *event) override
Handle configure notify event.
TGMdiTitleBar * fTitlebar
MDI window title bar.
~TGMdiDecorFrame() override
TGMdiDecorFrame destructor.
TGMdiVerticalWinResizer * fUpperHR
Bool_t IsMaximized() const
Bool_t IsMinimized() const
TGLayoutHints * fExpandHint
layout hints
TGMdiVerticalWinResizer * fLowerHR
upper and lower vertical resizers
void SetResizeMode(Int_t mode=kMdiDefaultResizeMode)
Set resize mode (opaque or transparent).
ULong_t fButtonMask
mask used to display/hide buttons
TGMdiCornerWinResizer * fUpperLeftCR
void Layout() override
Recalculates the postion and the size of all decor frame components.
TGMdiHorizontalWinResizer * fLeftVR
Bool_t fIsMaximized
minimized and maximized flags
Bool_t fMinimizedUserPlacement
user placement flag
friend class TGMdiMainFrame
TGMdiMainFrame * fMdiMainFrame
MDI main frame.
void SetWindowName(const char *name) override
Set MDI Window name (appearing in the title bar).
void SetWindowIcon(const TGPicture *pic)
Set Window icon (appearing in the title bar).
TGMdiFrame * fFrame
parent (owner) MDI frame
TGMdiDecorFrame(TGMdiMainFrame *main, TGMdiFrame *frame, Int_t w, Int_t h, const TGGC *boxGC, UInt_t options=0, Pixel_t back=GetDefaultFrameBackground())
TGMdiDecorFrame constructor.
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.
Int_t fMinimizedY
minimized position
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 * fLowerRightCR
upper right and lower right resizers
TGMdiCornerWinResizer * fUpperRightCR
Bool_t HandleButton(Event_t *event) override
Handle mouse button events.
void SetDecorBorderWidth(Int_t bw)
Set border width of the decor.
TGMdiCornerWinResizer * fLowerLeftCR
upper left and lower left resizers
TGMdiHorizontalWinResizer * fRightVR
left and right horizontal resizers
This file contains the TGMdiFrame class.
void DrawBorder() override
Draw horizontal resizer frame border.
TGMdiHorizontalWinResizer(const TGWindow *p, const TGWindow *mdiwin, Int_t pos, const TGGC *boxGC, Int_t linew, Int_t mdioptions=kMdiDefaultResizeMode, Int_t w=5, Int_t h=4)
TGMdiHorizontalWinResizer constructor.
Bool_t HandleMotion(Event_t *event) override
Handle motion events in resizer (resize associated MDI window).
Bool_t HandleButton(Event_t *event) override
Handle mouse click on title bar.
void LayoutButtons(UInt_t buttonmask, Bool_t isMinimized, Bool_t isMaximized)
Recalculates the position of every enabled (displayed) buttons.
TGMdiTitleIcon * GetWinIcon() const
TGLayoutHints * fLeftHint
void SetTitleBarColors(UInt_t fore, UInt_t back, TGFont *f)
Set title bar color (blue or grey, depends on active state).
TGLayoutHints * fMiddleHint
TGMdiTitleBar(const TGWindow *p, const TGWindow *mdiwin, const char *name="Untitled")
TGMdiTitleBar constructor.
void RemoveFrames(TGMdiTitleIcon *icon, TGMdiButtons *buttons)
This is called from TGMdiMainFrame on Maximize().
TGCompositeFrame * fLFrame
Int_t fY0
initial position of the mouse click
Bool_t ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t parm2) override
Process messages for title bar.
Bool_t HandleDoubleClick(Event_t *event) override
Handle double click in title bar (maximize window).
Bool_t HandleMotion(Event_t *event) override
Handle mouse motion events in title bar (used to move MDI window).
Bool_t fMidButPressed
mouse button pressed
void AddFrames(TGMdiTitleIcon *icon, TGMdiButtons *buttons)
This is called from TGMdiMainFrame on Restore().
TGLabel * fWinName
window name label
const TGWindow * fMdiWin
owner MDI window
~TGMdiTitleBar() override
TGMdiTitleBar destructor.
TGCompositeFrame * fMFrame
TGMdiTitleIcon * fWinIcon
title icon
TGMdiButtons * fButtons
MDI buttons.
TGCompositeFrame * fRFrame
the three parts of the title bar
TGLayoutHints * fRightHint
layout hints
Bool_t HandleDoubleClick(Event_t *event) override
Handle double click event on MDI icon (close the window).
TGMdiTitleIcon(const TGWindow *p, const TGWindow *titlebar, const TGPicture *pic, Int_t w, Int_t h)
TGMdiTitleIcon constructor.
Bool_t HandleButton(Event_t *event) override
Handle button event on MDI icon (popup menu).
TGPopupMenu * GetPopup() const
void DoRedraw() override
Redraw icon.
~TGMdiTitleIcon() override
TGMdiTitleIcon destructor.
const TGWindow * fMsgWindow
window handling container messages
TGPopupMenu * fPopup
Popup menu associated to the title icon.
TGMdiVerticalWinResizer(const TGWindow *p, const TGWindow *mdiwin, Int_t pos, const TGGC *boxGC, Int_t linew, Int_t mdioptions=kMdiDefaultResizeMode, Int_t w=4, Int_t h=5)
TGMdiVerticalWinResizer constructor.
void DrawBorder() override
Draw vertical resizer frame border.
Bool_t HandleMotion(Event_t *event) override
Handle motion events in resizer (resize associated MDI window).
Int_t fPos
position of the resizer
const TGGC * fBoxGC
GC used for resizing rectangle.
TGMdiWinResizer(const TGWindow *p, const TGWindow *mdiwin, Int_t pos, const TGGC *boxGC, Int_t linew, Int_t mdioptions=kMdiDefaultResizeMode, Int_t w=1, Int_t h=1, UInt_t options=kOwnBackground)
TGMdiWinResizer constructor.
Int_t fNewH
new MDI win position and dimension
Bool_t HandleButton(Event_t *event) override
Handle button events in resizer (grab button and resize).
friend class TGMdiMainFrame
Int_t fMdiOptions
MDI options.
Int_t fLineW
line width of resizing rectangle
const TGWindow * fMdiWin
owner MDI Window
void MoveResizeIt()
Move (resize) parent MDI window.
Int_t fY0
initial position of the mouse click
Bool_t fMidButPressed
mouse buttons flags
void DrawBox(Int_t x, Int_t y, UInt_t width, UInt_t height)
Draw resize box (rectangle).
Int_t fWinH
MDI win position and dimension.
Int_t fOldH
old MDI win position and dimension
Int_t fMinH
Min width and height of the MDI Win.
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.
TGString wraps a TString and adds some graphics routines like drawing, size of string on screen depen...
const TGWindow * fParent
Parent window.
virtual void DestroyWindow()
destroy window
virtual void SetWindowName(const char *name=nullptr)
Set window name.
virtual Bool_t IsMapped()
Returns kTRUE if window is mapped on screen, kFALSE otherwise.
UInt_t fEditDisabled
flags used for "guibuilding"
const char * GetName() const override
Returns name of object.
int main(int argc, char **argv)
EGEventType fType
of event (see EGEventType)
Int_t fY
pointer x, y coordinates in event window
UInt_t fHeight
width and height of exposed area
Window_t fWindow
window reported event is relative to
Int_t fYRoot
coordinates relative to root
UInt_t fCode
key or button code