]> git.saurik.com Git - wxWidgets.git/blame - include/wx/os2/region.h
Fix wxPropertyGrid::GetPropertyRect when the last item is collapsed.
[wxWidgets.git] / include / wx / os2 / region.h
CommitLineData
0e320a79 1/////////////////////////////////////////////////////////////////////////////
ec02a2f7 2// Name: wx/os2/region.h
0e320a79 3// Purpose: wxRegion class
409c9842 4// Author: David Webster
0e320a79 5// Modified by:
409c9842 6// Created: 10/15/99
409c9842 7// Copyright: (c) David Webster
65571936 8// Licence: wxWindows licence
0e320a79
DW
9/////////////////////////////////////////////////////////////////////////////
10
8a16d737
VZ
11#ifndef _WX_OS2_REGION_H_
12#define _WX_OS2_REGION_H_
0e320a79 13
0e320a79 14#include "wx/list.h"
51a7e6af 15#include "wx/os2/private.h"
0e320a79 16
53a2db12 17class WXDLLIMPEXP_CORE wxRegion : public wxRegionWithCombine
5a56a532 18{
0e320a79 19public:
5a56a532
DW
20 wxRegion( wxCoord x
21 ,wxCoord y
22 ,wxCoord vWidth
23 ,wxCoord vHeight
24 );
25 wxRegion( const wxPoint& rTopLeft
26 ,const wxPoint& rBottomRight
27 );
28 wxRegion(const wxRect& rRect);
19193a2c 29 wxRegion(WXHRGN hRegion, WXHDC hPS); // Hangs on to this region
94a007ec 30 wxRegion(size_t n, const wxPoint *points, wxPolygonFillMode fillStyle = wxODDEVEN_RULE );
85f6b408
VS
31 wxRegion( const wxBitmap& bmp)
32 {
33 Union(bmp);
34 }
35 wxRegion( const wxBitmap& bmp,
36 const wxColour& transColour, int tolerance = 0)
37 {
38 Union(bmp, transColour, tolerance);
39 }
409c9842
DW
40
41 wxRegion();
d3c7fc99 42 virtual ~wxRegion();
409c9842 43
5a56a532
DW
44 //
45 // Modify region
46 //
47
48 //
409c9842 49 // Clear current region
5a56a532 50 //
8a16d737 51 virtual void Clear();
5a56a532
DW
52
53 //
409c9842 54 // Is region empty?
5a56a532 55 //
8a16d737 56 virtual bool IsEmpty() const;
5a56a532
DW
57
58 //
409c9842 59 // Get internal region handle
5a56a532 60 //
8a16d737
VZ
61 WXHRGN GetHRGN() const;
62
5a56a532 63 void SetPS(HPS hPS);
45e0dc94
DW
64
65protected:
4b3f61d1
SN
66 virtual wxGDIRefData* CreateGDIRefData(void) const;
67 virtual wxGDIRefData* CloneGDIRefData(const wxGDIRefData* pData) const;
107e4338 68
8a16d737
VZ
69 virtual bool DoIsEqual(const wxRegion& region) const;
70 virtual bool DoGetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const;
71 virtual wxRegionContain DoContainsPoint(wxCoord x, wxCoord y) const;
72 virtual wxRegionContain DoContainsRect(const wxRect& rect) const;
73
74 virtual bool DoOffset(wxCoord x, wxCoord y);
75 virtual bool DoCombine(const wxRegion& region, wxRegionOp op);
76
b5dbe15d 77 friend class WXDLLIMPEXP_FWD_CORE wxRegionIterator;
45e0dc94
DW
78 DECLARE_DYNAMIC_CLASS(wxRegion);
79
5a56a532 80}; // end of CLASS wxRegion
0e320a79 81
53a2db12 82class WXDLLIMPEXP_CORE wxRegionIterator : public wxObject
5a56a532 83{
0e320a79 84public:
409c9842 85 wxRegionIterator();
5a56a532 86 wxRegionIterator(const wxRegion& rRegion);
d3c7fc99 87 virtual ~wxRegionIterator();
0e320a79 88
5a56a532
DW
89 void Reset(void) { m_lCurrent = 0; }
90 void Reset(const wxRegion& rRegion);
0e320a79 91
5a56a532
DW
92 operator bool (void) const { return m_lCurrent < m_lNumRects; }
93 bool HaveRects(void) const { return m_lCurrent < m_lNumRects; }
0e320a79 94
5a56a532 95 void operator ++ (void);
409c9842 96 void operator ++ (int);
0e320a79 97
5a56a532
DW
98 wxCoord GetX(void) const;
99 wxCoord GetY(void) const;
100 wxCoord GetW(void) const;
101 wxCoord GetWidth(void) const { return GetW(); }
102 wxCoord GetH(void) const;
103 wxCoord GetHeight(void) const { return GetH(); }
104 wxRect GetRect(void) const { return wxRect(GetX(), GetY(), GetWidth(), GetHeight()); }
0e320a79
DW
105
106private:
5a56a532
DW
107 long m_lCurrent;
108 long m_lNumRects;
109 wxRegion m_vRegion;
110 wxRect* m_pRects;
4b3f61d1
SN
111
112 DECLARE_DYNAMIC_CLASS(wxRegionIterator)
5a56a532 113}; // end of wxRegionIterator
0e320a79 114
8a16d737 115#endif // _WX_OS2_REGION_H_