]>
git.saurik.com Git - wxWidgets.git/blob - include/wx/mgl/window.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/mgl/window.h
3 // Purpose: wxWindow class
4 // Author: Vaclav Slavik
6 // Copyright: (c) 2001 SciTech Software, Inc. (www.scitechsoft.com)
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
13 // ---------------------------------------------------------------------------
15 // ---------------------------------------------------------------------------
18 #pragma interface "window.h"
26 // ---------------------------------------------------------------------------
27 // wxWindow declaration for MGL
28 // ---------------------------------------------------------------------------
30 class WXDLLEXPORT wxWindowMGL
: public wxWindowBase
33 wxWindowMGL() { Init(); }
35 wxWindowMGL(wxWindow
*parent
,
37 const wxPoint
& pos
= wxDefaultPosition
,
38 const wxSize
& size
= wxDefaultSize
,
40 const wxString
& name
= wxPanelNameStr
)
43 Create(parent
, id
, pos
, size
, style
, name
);
46 virtual ~wxWindowMGL();
48 bool Create(wxWindow
*parent
,
50 const wxPoint
& pos
= wxDefaultPosition
,
51 const wxSize
& size
= wxDefaultSize
,
53 const wxString
& name
= wxPanelNameStr
);
58 virtual bool Show(bool show
= TRUE
);
60 virtual void SetFocus();
62 virtual bool Reparent(wxWindowBase
*newParent
);
64 virtual void WarpPointer(int x
, int y
);
65 virtual void CaptureMouse();
66 virtual void ReleaseMouse();
68 virtual void Refresh(bool eraseBackground
= TRUE
,
69 const wxRect
*rect
= (const wxRect
*) NULL
);
70 virtual void Update();
72 virtual void Freeze();
75 virtual bool SetCursor(const wxCursor
&cursor
);
76 virtual bool SetFont(const wxFont
&font
) { m_font
= font
; return TRUE
; }
78 virtual int GetCharHeight() const;
79 virtual int GetCharWidth() const;
80 virtual void GetTextExtent(const wxString
& string
,
82 int *descent
= (int *) NULL
,
83 int *externalLeading
= (int *) NULL
,
84 const wxFont
*theFont
= (const wxFont
*) NULL
)
87 #if wxUSE_DRAG_AND_DROP
88 virtual void SetDropTarget(wxDropTarget
*dropTarget
);
89 #endif // wxUSE_DRAG_AND_DROP
91 // Accept files for dragging
92 virtual void DragAcceptFiles(bool accept
);
94 #if WXWIN_COMPATIBILITY
96 // Handle a control command
97 virtual void OnCommand(wxWindow
& win
, wxCommandEvent
& event
);
99 // Override to define new behaviour for default action (e.g. double
100 // clicking on a listbox)
101 virtual void OnDefaultAction(wxControl
* WXUNUSED(initiatingItem
)) { }
102 #endif // WXWIN_COMPATIBILITY
104 virtual WXWidget
GetHandle() const { return m_wnd
; }
106 virtual void SetTitle(const wxString
& title
) { m_title
= title
; }
107 virtual wxString
GetTitle() const { return m_title
; }
109 // implementation from now on
110 // --------------------------
115 struct window_t
*m_wnd
;
116 // whether there should be wxEraseEvent before wxPaintEvent or not
117 // (see wxWindow::Refresh)
119 bool m_refreshAfterThaw
;
122 // implement the base class pure virtuals
123 virtual void DoClientToScreen( int *x
, int *y
) const;
124 virtual void DoScreenToClient( int *x
, int *y
) const;
125 virtual void DoGetPosition( int *x
, int *y
) const;
126 virtual void DoGetSize( int *width
, int *height
) const;
127 virtual void DoGetClientSize( int *width
, int *height
) const;
128 virtual void DoSetSize(int x
, int y
,
129 int width
, int height
,
130 int sizeFlags
= wxSIZE_AUTO
);
131 virtual void DoSetClientSize(int width
, int height
);
133 // move the window to the specified location and resize it: this is called
134 // from both DoSetSize() and DoSetClientSize() and would usually just call
135 // ::MoveWindow() except for composite controls which will want to arrange
136 // themselves inside the given rectangle
137 virtual void DoMoveWindow(int x
, int y
, int width
, int height
);
140 // common part of all ctors
142 // counterpart to SetFocus
145 MGLDevCtx
*m_paintMGLDC
;
146 friend class wxPaintDC
;
148 void OnEraseBackground(wxEraseEvent
& event
);
149 void OnSetFocus(wxFocusEvent
& event
);
151 DECLARE_DYNAMIC_CLASS(wxWindowMGL
);
152 DECLARE_NO_COPY_CLASS(wxWindowMGL
);
153 DECLARE_EVENT_TABLE()
156 void HandlePaint(MGLDevCtx
*dc
);
157 // needed by wxWindowPainter