]>
git.saurik.com Git - wxWidgets.git/blob - contrib/include/wx/canvas/canvas.h
b4a9b46dc88d0973d15a1a191c6e8d8c3a1b6e1f
1 /////////////////////////////////////////////////////////////////////////////
3 // Author: Robert Roebling
5 // Copyright: 2000 (c) Robert Roebling
6 // Licence: wxWindows Licence
7 /////////////////////////////////////////////////////////////////////////////
10 #define __WXCANVAS_H__
13 #pragma interface "canvas.cpp"
21 #include "wx/txtstrm.h"
25 // WDR: class declarations
27 //----------------------------------------------------------------------------
29 //----------------------------------------------------------------------------
31 class wxCanvasObject
: public wxEvtHandler
34 wxCanvasObject( int x
, int y
, int width
, int height
);
36 virtual void Move( int x
, int y
);
37 virtual void Render( int clip_x
, int clip_y
, int clip_width
, int clip_height
);
38 virtual void WriteSVG( wxTextOutputStream
&stream
);
40 wxCanvas
*GetOwner() { return m_owner
; }
41 void SetOwner( wxCanvas
*owner
) { m_owner
= owner
; }
43 bool IsControl() { return m_isControl
; }
44 bool IsVector() { return m_isVector
; }
45 bool IsImage() { return m_isImage
; }
46 inline int GetX() { return m_area
.x
; }
47 inline int GetY() { return m_area
.y
; }
48 inline int GetWidth() { return m_area
.width
; }
49 inline int GetHeight() { return m_area
.height
; }
58 friend class wxCanvas
;
61 //----------------------------------------------------------------------------
63 //----------------------------------------------------------------------------
65 class wxCanvasImage
: public wxCanvasObject
68 wxCanvasImage( const wxImage
&image
, int x
, int y
);
70 virtual void Render( int clip_x
, int clip_y
, int clip_width
, int clip_height
);
71 virtual void WriteSVG( wxTextOutputStream
&stream
);
77 //----------------------------------------------------------------------------
79 //----------------------------------------------------------------------------
81 class wxCanvasControl
: public wxCanvasObject
84 wxCanvasControl( wxWindow
*control
);
87 virtual void Move( int x
, int y
);
94 //----------------------------------------------------------------------------
96 //----------------------------------------------------------------------------
98 class wxCanvas
: public wxScrolledWindow
101 // constructors and destructors
102 wxCanvas( wxWindow
*parent
, wxWindowID id
= -1,
103 const wxPoint
& pos
= wxDefaultPosition
,
104 const wxSize
& size
= wxDefaultSize
,
105 long style
= wxScrolledWindowStyle
);
108 virtual void SetArea( int width
, int height
);
109 virtual void Update( int x
, int y
, int width
, int height
);
110 virtual void UpdateNow();
112 virtual void Prepend( wxCanvasObject
* obj
);
113 virtual void Append( wxCanvasObject
* obj
);
114 virtual void Insert( size_t before
, wxCanvasObject
* obj
);
115 virtual void Remove( wxCanvasObject
* obj
);
117 wxImage
*GetBuffer() { return &m_buffer
; }
118 bool NeedUpdate() { return m_needUpdate
; }
120 void BlitBuffer( wxDC
&dc
);
125 wxList m_updateRects
;
128 friend class wxCanvasObject
;
131 void OnChar( wxKeyEvent
&event
);
132 void OnPaint( wxPaintEvent
&event
);
133 void OnMouse( wxMouseEvent
&event
);
134 void OnSize( wxSizeEvent
&event
);
135 void OnIdle( wxIdleEvent
&event
);
136 void OnSetFocus( wxFocusEvent
&event
);
137 void OnKillFocus( wxFocusEvent
&event
);
140 DECLARE_CLASS(wxCanvas
)
141 DECLARE_EVENT_TABLE()