32 class TGWindow :
public TGObject {
34 friend class TGClient;
37 const TGWindow *fParent;
40 static Int_t fgCounter;
43 TGWindow(Window_t
id) :
44 fParent(0), fNeedRedraw(kFALSE), fName(), fEditDisabled(0) { fClient = 0; fId = id; }
45 TGWindow(
const TGWindow& tgw) :
46 TGObject(tgw), fParent(tgw.fParent), fNeedRedraw(tgw.fNeedRedraw),
47 fName(tgw.fName), fEditDisabled(tgw.fEditDisabled) { }
49 TGWindow& operator=(
const TGWindow& tgw)
50 {
if (
this!=&tgw) { TGObject::operator=(tgw); fParent=tgw.fParent;
51 fNeedRedraw=tgw.fNeedRedraw; fName=tgw.fName;
52 fEditDisabled=tgw.fEditDisabled; }
return *
this; }
54 virtual void DoRedraw() { }
59 kEditDisable = BIT(0),
60 kEditDisableEvents = BIT(1),
61 kEditDisableGrab = BIT(2),
62 kEditDisableLayout = BIT(3),
63 kEditDisableResize = BIT(4),
64 kEditDisableHeight = BIT(5),
65 kEditDisableWidth = BIT(6),
66 kEditDisableBtnEnable = BIT(7),
67 kEditDisableKeyEnable = BIT(8)
74 TGWindow(
const TGWindow *p = 0, Int_t x = 0, Int_t y = 0,
75 UInt_t w = 0, UInt_t h = 0, UInt_t border = 0,
79 SetWindowAttributes_t *attr = 0,
81 TGWindow(TGClient *c, Window_t
id,
const TGWindow *parent = 0);
85 const TGWindow *GetParent()
const {
return fParent; }
86 virtual const TGWindow *GetMainFrame()
const;
88 virtual void MapWindow() { gVirtualX->MapWindow(fId); }
89 virtual void MapSubwindows() { gVirtualX->MapSubwindows(fId); }
90 virtual void MapRaised() { gVirtualX->MapRaised(fId); }
91 virtual void UnmapWindow() { gVirtualX->UnmapWindow(fId); }
92 virtual void DestroyWindow() { gVirtualX->DestroyWindow(fId); }
93 virtual void DestroySubwindows() { gVirtualX->DestroySubwindows(fId); }
94 virtual void RaiseWindow() { gVirtualX->RaiseWindow(fId); }
95 virtual void LowerWindow() { gVirtualX->LowerWindow(fId); }
96 virtual void IconifyWindow() { gVirtualX->IconifyWindow(fId); }
97 virtual void ReparentWindow(
const TGWindow *p, Int_t x = 0, Int_t y = 0);
98 virtual void RequestFocus() { gVirtualX->SetInputFocus(fId); }
100 virtual void SetBackgroundColor(Pixel_t color)
101 { gVirtualX->SetWindowBackground(fId, color); }
102 virtual void SetBackgroundPixmap(Pixmap_t pixmap)
103 { gVirtualX->SetWindowBackgroundPixmap(fId, pixmap); }
105 virtual Bool_t HandleExpose(Event_t *event)
106 {
if (event->fCount == 0) fClient->NeedRedraw(
this);
return kTRUE; }
107 virtual Bool_t HandleEvent(Event_t *) {
return kFALSE; }
108 virtual Bool_t HandleTimer(TTimer *) {
return kFALSE; }
109 virtual Bool_t HandleIdleEvent(TGIdleHandler *) {
return kFALSE; }
111 virtual void Move(Int_t x, Int_t y);
112 virtual void Resize(UInt_t w, UInt_t h);
113 virtual void MoveResize(Int_t x, Int_t y, UInt_t w, UInt_t h);
114 virtual Bool_t IsMapped();
115 virtual Bool_t IsEditable()
const {
return (fClient->GetRoot() ==
this); }
116 virtual UInt_t GetEditDisabled()
const {
return fEditDisabled; }
117 virtual void SetEditDisabled(UInt_t on = kEditDisable) { fEditDisabled = on; }
118 virtual void SetEditable(Bool_t on = kTRUE)
119 {
if (!(fEditDisabled & kEditDisable)) fClient->SetRoot(on ?
this : 0); }
120 virtual Int_t MustCleanup()
const {
return 0; }
121 virtual void Print(Option_t *option=
"")
const;
123 virtual void SetWindowName(
const char *name = 0);
124 virtual const char *GetName()
const;
125 virtual void SetName(
const char *name) { fName = name; }
127 virtual void SetMapSubwindows(Bool_t ) { }
128 virtual Bool_t IsMapSubwindows()
const {
return kTRUE; }
130 static Int_t GetCounter();
132 ClassDef(TGWindow, 0);
145 class TGUnknownWindowHandler :
public TObject {
148 TGUnknownWindowHandler() { }
149 virtual ~TGUnknownWindowHandler() { }
151 virtual Bool_t HandleEvent(Event_t *) = 0;
153 ClassDef(TGUnknownWindowHandler,0)