wxSTD_COL_BTNSHADOW,
wxSTD_COL_BTNFACE,
wxSTD_COL_BTNHIGHLIGHT,
- wxSTD_COL_MAX,
+ wxSTD_COL_MAX
};
struct WXDLLEXPORT wxCOLORMAP
// this function is implemented in src/msw/window.cpp
extern wxCOLORMAP *wxGetStdColourMap();
+// create a wxRect from Windows RECT
+inline wxRect wxRectFromRECT(const RECT& r)
+{
+ return wxRect(r.left, r.top, r.right - r.left, r.bottom - r.top);
+}
+
// copy Windows RECT to our wxRect
inline void wxCopyRECTToRect(const RECT& r, wxRect& rect)
{
- rect.y = r.top;
- rect.x = r.left;
- rect.width = r.right - r.left;
- rect.height = r.bottom - r.top;
+ rect = wxRectFromRECT(r);
}
// translations between HIMETRIC units (which OLE likes) and pixels (which are
DECLARE_NO_COPY_CLASS(SelectInHDC)
};
+// a class for temporary bitmaps
+class CompatibleBitmap
+{
+public:
+ CompatibleBitmap(HDC hdc, int w, int h)
+ {
+ m_hbmp = ::CreateCompatibleBitmap(hdc, w, h);
+ }
+
+ ~CompatibleBitmap()
+ {
+ if ( m_hbmp )
+ ::DeleteObject(m_hbmp);
+ }
+
+ operator HBITMAP() const { return m_hbmp; }
+
+private:
+ HBITMAP m_hbmp;
+};
+
// when working with global pointers (which is unfortunately still necessary
// sometimes, e.g. for clipboard) it is important to unlock them exactly as
// many times as we lock them which just asks for using a "smart lock" class