void DecTo(const wxSize& sz)
{ if ( sz.x < x ) x = sz.x; if ( sz.y < y ) y = sz.y; }
+ void Scale(float xscale, float yscale)
+ { x = (int)(x*xscale); y = (int)(y*yscale); }
+
// accessors
void Set(int xx, int yy) { x = xx; y = yy; }
void SetWidth(int w) { x = w; }
wxPoint operator+(const wxSize& s) const { return wxPoint(x + s.GetWidth(), y + s.GetHeight()); }
wxPoint operator-(const wxSize& s) const { return wxPoint(x - s.GetWidth(), y - s.GetHeight()); }
+
+ wxPoint operator-() const { return wxPoint(-x, -y); }
};
// ---------------------------------------------------------------------------
// return true if the point is (not strcitly) inside the rect
bool Inside(int x, int y) const;
bool Inside(const wxPoint& pt) const { return Inside(pt.x, pt.y); }
+ // return true if the rectangle is (not strcitly) inside the rect
+ bool Inside(const wxRect& rect) const;
// return true if the rectangles have a non empty intersection
bool Intersects(const wxRect& rect) const;
typedef wxInt8 wxDash;
-class WXDLLEXPORT wxPenList : public wxList
-{
+class WXDLLIMPEXP_CORE wxGDIObjListBase {
public:
- wxPenList() { }
- ~wxPenList();
+ wxGDIObjListBase();
+ ~wxGDIObjListBase();
- void AddPen(wxPen *pen);
- void RemovePen(wxPen *pen);
- wxPen *FindOrCreatePen(const wxColour& colour, int width, int style);
+protected:
+ wxList list;
};
-class WXDLLEXPORT wxBrushList : public wxList
+class WXDLLIMPEXP_CORE wxPenList: public wxGDIObjListBase
{
public:
- wxBrushList() { }
- ~wxBrushList();
+ wxPen *FindOrCreatePen(const wxColour& colour, int width, int style);
+#if WXWIN_COMPATIBILITY_2_6
+ wxDEPRECATED( void AddPen(wxPen*) );
+ wxDEPRECATED( void RemovePen(wxPen*) );
+#endif
+};
- void AddBrush(wxBrush *brush);
- void RemoveBrush(wxBrush *brush);
+class WXDLLIMPEXP_CORE wxBrushList: public wxGDIObjListBase
+{
+public:
wxBrush *FindOrCreateBrush(const wxColour& colour, int style = wxSOLID);
+#if WXWIN_COMPATIBILITY_2_6
+ wxDEPRECATED( void AddBrush(wxBrush*) );
+ wxDEPRECATED( void RemoveBrush(wxBrush*) );
+#endif
};
-class WXDLLEXPORT wxFontList : public wxList
+class WXDLLIMPEXP_CORE wxFontList: public wxGDIObjListBase
{
public:
- wxFontList() { }
- ~wxFontList();
-
- void AddFont(wxFont *font);
- void RemoveFont(wxFont *font);
wxFont *FindOrCreateFont(int pointSize, int family, int style, int weight,
bool underline = false,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
+#if WXWIN_COMPATIBILITY_2_6
+ wxDEPRECATED( void AddFont(wxFont*) );
+ wxDEPRECATED( void RemoveFont(wxFont*) );
+#endif
};
-WX_DECLARE_STRING_HASH_MAP( wxColour *, wxStringToColourHashMap );
+WX_DECLARE_STRING_HASH_MAP(wxColour*, wxStringToColourHashMap);
class WXDLLEXPORT wxColourDatabase
{
wxStringToColourHashMap *m_map;
};
-class WXDLLEXPORT wxBitmapList : public wxList
-{
-public:
- wxBitmapList(){}
- ~wxBitmapList();
-
- void AddBitmap(wxBitmap *bitmap);
- void RemoveBitmap(wxBitmap *bitmap);
-};
-
class WXDLLEXPORT wxResourceCache: public wxList
{
public:
#if !wxUSE_STL
wxResourceCache(const unsigned int keyType) : wxList(keyType) { }
#endif
- ~wxResourceCache();
+ virtual ~wxResourceCache();
};
// ---------------------------------------------------------------------------
extern WXDLLEXPORT_DATA(wxPenList*) wxThePenList;
extern WXDLLEXPORT_DATA(wxBrushList*) wxTheBrushList;
extern WXDLLEXPORT_DATA(wxFontList*) wxTheFontList;
-extern WXDLLEXPORT_DATA(wxBitmapList*) wxTheBitmapList;
/* Stock objects
extern WXDLLEXPORT_DATA(const wxSize) wxDefaultSize;
extern WXDLLEXPORT_DATA(const wxPoint) wxDefaultPosition;
-// The list of objects which should be deleted
-extern WXDLLEXPORT_DATA(wxList) wxPendingDelete;
-
// ---------------------------------------------------------------------------
// global functions
// ---------------------------------------------------------------------------