66 fClient->GetShadow(GetDefaultFrameBackground()));
81 fFontNotCurrent = fFontCurrent;
83 fBoxGC =
new TGGC(*
gClient->GetResourcePool()->GetFrameGC());
85 fBoxGC->SetBackground(fBackNotCurrent);
86 fBoxGC->SetFunction(
kGXxor);
89 fBoxGC->SetStipple(fClient->GetResourcePool()->GetCheckeredBitmap());
92 fCurrentX = fCurrentY = 0;
95 fWinListMenu =
new TGPopupMenu(fClient->GetDefaultRoot());
104 ((
TGFrame *)main)->Connect(
"ProcessedConfigure(Event_t*)",
105 "TGMdiMainFrame",
this,
"UpdateMdiButtons()");
168 gVirtualX->LookupString(event, input,
sizeof(input), keysym);
236 if (!frame)
return kFALSE;
242 if (!travel)
return kFALSE;
298 if (!travel)
return kFALSE;
319 if (!travel)
return kFALSE;
449 if (!travel)
return 0;
460 if (!travel)
return 0;
470 if (!frame)
return 0;
510 if (first) rect = wrect;
511 else rect.
Merge(wrect);
543 if (scut == (
'9' + 1)) scut =
'A';
592 Int_t num_mapped = 0;
617 if (num_mapped == 0)
return;
624 factor_y = h / num_mapped;
634 factor_x = w / num_mapped;
647 factor_y = (h * 2) / 3;
648 factor_x = (w * 2) / 3;
660 }
while (travel != tmp);
708 if (!closest || (dist < cdist)) {
918 if ((x <= p.fX + (
Int_t) s.fWidth - 1) && (x + w - 1 >= p.fX) &&
919 (y <= p.fY + (
Int_t) s.fHeight - 1) && (y + h - 1 >= p.fY)) {
958 if (!mdiframe)
return kFALSE;
962 mdiframe->
Emit(
"CloseWindow()");
1018 event.fXRoot = xroot;
1019 event.fYRoot = yroot;
1037 return mdiframe->
Help();
1087 Int_t mh = th + 2 * bw;
1173 TGFrame(p->GetViewPort(), w, h, options, back)
1222 out << std::endl <<
" // MDI main frame" << std::endl;
1223 out <<
" TGMdiMainFrame *";
1229 out <<
");" << std::endl;
1236 if (option && strstr(option,
"keep_names"))
1237 out <<
" " <<
GetName() <<
"->SetName(\"" <<
GetName() <<
"\");" << std::endl;
1246 out <<
" " <<
GetName() <<
"->ArrangeFrames(";
1250 out <<
"kMdiTileHorizontal);" << std::endl;
1254 out <<
"kMdiTileVertical);" << std::endl;
1258 out <<
"kMdiCascade);" << std::endl;
1263 out <<
" " <<
GetName() <<
"->SetResizeMode(kMdiNonOpaque);" << std::endl;
1267 <<
");" << std::endl;
void SetMinUserPlacement(Bool_t place=kTRUE)
virtual void HideFrame(TGFrame *f)
Hide sub frame.
Pixel_t GetFrameShadowColor() const
virtual Bool_t HandleButton(Event_t *event)
Handle button events in resizer (grab button and resize).
void SetPreResizeHeight(Int_t h)
double dist(Rotation3D const &r1, Rotation3D const &r2)
virtual void CloseAll()
Close all MDI child windows.
void Maximize(Bool_t max=kTRUE)
TGMdiFrame * GetCurrent() const
Return pointer on current (active) MDI child window.
virtual const char * GetName() const
Return unique name, used in SavePrimitive methods.
TGPopupMenu * fWinListMenu
virtual void FreeSize(TGMdiFrame *frame)
Allow to resize MDI child window mdiframe.
TGMdiHorizontalWinResizer * GetRightVR() const
void SetDecorFrame(TGMdiDecorFrame *decor)
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual Int_t Close(TGMdiFrame *frame)
Close MDI child window mdiframe.
Int_t GetPreResizeY() const
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
void SetMdiButtons(ULong_t buttons)
Set-up MDI buttons.
const Mask_t kKeyShiftMask
virtual void RemoveBind(const TGWindow *w, Int_t keycode, Int_t modifier) const
Remove key binding.
void Merge(const TGRectangle &r)
virtual Int_t ContextHelp(TGMdiFrame *frame)
Calls Help() method of MDI child window mdiframe.
void SetDecorBorderWidth(Int_t bw)
Set border width of the decor.
const TGFont * GetMenuFont() const
virtual void Minimize(TGMdiFrame *frame)
Minimize MDI child window mdiframe.
virtual void Maximize(TGMdiFrame *frame)
Maximize MDI child window mdiframe.
void SetForeground(Pixel_t v)
Set foreground color.
void SetLeftButPressed(Bool_t press=kTRUE)
virtual void FrameCreated(Int_t id)
Pixel_t GetFrameBgndColor() const
virtual void SetVPos(Int_t ypos)
Moves content of container frame in vertical direction.
void AddMdiFrame(TGMdiFrame *f)
Add new MDI child window.
virtual Bool_t HandleConfigureNotify(Event_t *event)
Handle configure notify events for MDI container.
TGPosition RightBottom() const
virtual void SetContainer(TGFrame *f)
Bool_t RemoveMdiFrame(TGMdiFrame *f)
Remove MDI child window.
virtual void FrameRestored(Int_t id)
TGMdiFrame * GetMdiFrame(UInt_t id) const
Return frame of MDI child window (by id).
virtual Int_t CloseWindow()
virtual void FrameClosed(Int_t id)
virtual void ShowFrame(TGFrame *f)
Show sub frame.
void SetTitleBarColors(UInt_t fore, UInt_t back, TGFont *f)
Set title bar color (blue or grey, depends on active state).
void SetCycleNext(TGMdiFrameList *next)
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 RemoveFrame(TGFrame *f)
Remove frame from composite frame.
void Minimize(Bool_t min=kTRUE)
Pixel_t GetSelectedFgndColor() const
const Mask_t kPointerMotionMask
const char * Data() const
Bool_t IsMaximized(TGMdiFrame *f)
Check if MDI child window f is maximized;.
const TGMdiMainFrame * fMain
virtual void Restore(TGMdiFrame *frame)
Restore size of MDI child window mdiframe.
void SetMinimizedY(Int_t y)
virtual void LowerWindow()
virtual ~TGMdiMainFrame()
MDI main frame destructor.
ClassImp(TGMdiMainFrame) ClassImp(TGMdiContainer) ClassImp(TGMdiGeometry) ClassImp(TGMdiFrameList) TGMdiMainFrame
Create a MDI main frame.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
virtual Int_t MustCleanup() const
TGPosition LeftTop() const
virtual UInt_t GetOptions() const
virtual void Move(Int_t x, Int_t y)
Move the MDI window at position x, y.
void UpdateWinListMenu()
Update MDI menu entries with current list of MDI child windows.
void SetPreResizeX(Int_t x)
void SetNext(TGMdiFrameList *next)
TGMdiFrameList * GetPrev() const
Int_t GetMinimizedX() const
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process messages MDI main frame.
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a MDIframe as a C++ statement(s) on output stream out.
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
virtual void FreeMove(TGMdiFrame *frame)
Allow to move MDI child window mdiframe.
void SetFrameId(UInt_t id)
Int_t GetMinimizedY() const
TGMdiContainer(const TGMdiMainFrame *p, Int_t w, Int_t h, UInt_t options=0, ULong_t back=GetDefaultFrameBackground())
TGMdiContainer constructor.
TGMdiButtons * GetButtons() const
void UpdateMdiButtons()
Update the status of MDI buttons in the decor frame of all children.
TGMdiMenuBar * GetMenu() const
Bool_t IsMinimized(TGMdiFrame *f)
Check if MDI child window f is minimized;.
TGMdiFrameList * GetNext() const
TGMdiFrameList * fCurrent
void Emit(const char *signal)
Acitvate signal without args.
virtual Bool_t HandleKey(Event_t *event)
Handle keyboards events into MDI main frame.
virtual void FrameMinimized(Int_t id)
UInt_t GetFrameId() const
virtual void FrameMaximized(Int_t id)
virtual void MoveResize(Int_t x, Int_t y, UInt_t w, UInt_t h)
Move the MDI window at position x, y and set size to w, h.
void SetPreResizeY(Int_t y)
virtual void CirculateUp()
Bring the lowest window to the top.
TGMdiFrameList * fChildren
void FreeFont(const TGFont *font)
Free a font.
Bool_t IsMaximized() const
Bool_t SetCurrent(TGMdiFrameList *newcurrent)
Set current (active) MDI child window (by frame list).
void RemoveFrames(TGMdiTitleIcon *icon, TGMdiButtons *buttons)
This is called from TGMdiMainFrame on Maximize().
void SetPrev(TGMdiFrameList *prev)
TGMdiTitleIcon * GetWinIcon() const
Pixel_t GetSelectedBgndColor() const
Bool_t GetMinUserPlacement() const
virtual UInt_t GetDefaultHeight() const
TGMdiGeometry GetWindowGeometry(TGMdiFrame *f) const
Get MDI geometry of MDI child window f.
TGMdiFrameList * GetCyclePrev() const
Bool_t TestBit(UInt_t f) const
TGMdiDecorFrame * GetDecorFrame() const
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Handle message generated by the canvas scrollbars.
TGMdiTitleBar * GetTitleBar() const
virtual void Layout()
Recalculates the postion and the size of all MDI child windows.
const TGPicture * GetWindowIcon()
void ConfigureWindow(TGMdiFrame *f, TGMdiGeometry &geom)
Set MDI geometry for MDI child window f.
virtual void SavePrimitive(std::ostream &out, Option_t *option="")
Save a MDI main frame as a C++ statement(s) on output stream out.
virtual const TGWindow * GetMainFrame() const
Returns top level main frame.
virtual void CirculateDown()
Send the highest window to the bottom.
int main(int argc, char *argv[])
const TGWindow * GetDefaultRoot() const
Returns the root (i.e.
TGMdiCornerWinResizer * GetUpperLeftCR() const
Int_t GetPreResizeWidth() const
const Mask_t kStructureNotifyMask
TGMdiDecorFrame * GetDecorFrame(UInt_t id) const
Return decor frame of MDI child window (by id).
Int_t GetPreResizeX() const
ULong_t GetMdiButtons() const
TGMdiFrame * GetMdiFrame() const
const Mask_t kButtonReleaseMask
virtual void RaiseWindow()
const char * GetWindowName()
TGMdiCornerWinResizer * GetLowerRightCR() const
virtual Bool_t IsEditable() const
Return kTRUE if frame is being edited.
void SetMinimizedX(Int_t x)
Bool_t IsMinimized() const
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.
TGMdiFrameList * GetCycleNext() const
TGRectangle GetMinimizedBBox() const
Return minimized box (rectangle) for current MDI child.
void LayoutButtons(UInt_t buttonmask, Bool_t isMinimized, Bool_t isMaximized)
Recalculates the position of every enabled (displayed) buttons.
virtual void UnmapWindow()
virtual void Layout()
Create layout for canvas.
virtual void SetHPos(Int_t xpos)
Moves content of container frame in horizontal direction.
RooCmdArg Layout(Double_t xmin, Double_t xmax=0.99, Double_t ymin=0.95)
Int_t GetBorderWidth() const
Short_t Max(Short_t a, Short_t b)
void SetPreResizeWidth(Int_t w)
TGMdiVerticalWinResizer * GetUpperHR() const
TGMdiCornerWinResizer * GetUpperRightCR() const
void SaveUserColor(std::ostream &out, Option_t *)
Save a user color in a C++ macro file - used in SavePrimitive().
virtual void Layout()
Recalculates the postion and the size of all decor frame components.
void AddFrames(TGMdiTitleIcon *icon, TGMdiButtons *buttons)
This is called from TGMdiMainFrame on Restore().
TGRectangle GetBBox() const
Return resizing box (rectangle) for current MDI child.
const Mask_t kKeyControlMask
void SetCyclePrev(TGMdiFrameList *prev)
virtual void SetEditable(Bool_t on=kTRUE)
Switch ON/OFF edit mode.
TString GetOptionString() const
Returns a frame option string - used in SavePrimitive().
TGMdiVerticalWinResizer * GetLowerHR() const
void SetResizeMode(Int_t mode=kMdiDefaultResizeMode)
Set resize mode (opaque or transparent)
virtual void FramesArranged(Int_t mode)
TGMdiHorizontalWinResizer * GetLeftVR() const
TGMdiCornerWinResizer * GetLowerLeftCR() const
Int_t GetPreResizeHeight() const
virtual TGDimension GetDefaultSize() const
Return dimension of MDI container.
virtual void ArrangeFrames(Int_t mode)
Automatic repositionning and resizing of every MDI child window.
TGViewPort * GetViewPort() const