X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d66d050088ee2012542a2d2607b5329ff5f3a491..99d82720737ebf91d3a387d53dd0cf6c8cf9a643:/include/wx/msw/private.h diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index 0c5c99ed2c..3a0ffc9e75 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -306,6 +306,22 @@ extern HICON wxBitmapToHICON(const wxBitmap& bmp); extern HCURSOR wxBitmapToHCURSOR(const wxBitmap& bmp, int hotSpotX, int hotSpotY); + +#if wxUSE_OWNER_DRAWN + +// Draw the bitmap in specified state (this is used by owner drawn controls) +enum wxDSBStates +{ + wxDSB_NORMAL = 0, + wxDSB_SELECTED, + wxDSB_DISABLED +}; + +extern +BOOL wxDrawStateBitmap(HDC hDC, HBITMAP hBitmap, int x, int y, UINT uState); + +#endif // wxUSE_OWNER_DRAWN + // get (x, y) from DWORD - notice that HI/LOWORD can *not* be used because they // will fail on system with multiple monitors where the coords may be negative // @@ -605,14 +621,25 @@ private: class GlobalPtr { public: + // default ctor, call Init() later + GlobalPtr() + { + m_hGlobal = NULL; + } + // allocates a block of given size - GlobalPtr(size_t size, unsigned flags = GMEM_MOVEABLE) + void Init(size_t size, unsigned flags = GMEM_MOVEABLE) { m_hGlobal = ::GlobalAlloc(flags, size); if ( !m_hGlobal ) wxLogLastError(_T("GlobalAlloc")); } + GlobalPtr(size_t size, unsigned flags = GMEM_MOVEABLE) + { + Init(size, flags); + } + ~GlobalPtr() { if ( m_hGlobal && ::GlobalFree(m_hGlobal) ) @@ -904,17 +931,17 @@ inline bool wxStyleHasBorder(long style) wxSUNKEN_BORDER | wxDOUBLE_BORDER)) != 0; } -inline long wxGetWindowExStyle(const wxWindow *win) +inline long wxGetWindowExStyle(const wxWindowMSW *win) { return ::GetWindowLong(GetHwndOf(win), GWL_EXSTYLE); } -inline bool wxHasWindowExStyle(const wxWindow *win, long style) +inline bool wxHasWindowExStyle(const wxWindowMSW *win, long style) { return (wxGetWindowExStyle(win) & style) != 0; } -inline long wxSetWindowExStyle(const wxWindow *win, long style) +inline long wxSetWindowExStyle(const wxWindowMSW *win, long style) { return ::SetWindowLong(GetHwndOf(win), GWL_EXSTYLE, style); } @@ -930,7 +957,7 @@ extern WXDLLIMPEXP_CORE wxWindow* wxFindWinFromHandle(HWND hwnd); // without STRICT WXHWND is the same as HWND anyhow inline wxWindow* wxFindWinFromHandle(WXHWND hWnd) { - return wxFindWinFromHandle(wx_static_cast(HWND, hWnd)); + return wxFindWinFromHandle(static_cast(hWnd)); } // find the window for HWND which is part of some wxWindow, i.e. unlike