Add WXWNDPROC typedef and use it in wxMSW instead of WXFARPROC
WNDPROC and FARPROC are not the same thing in MSW and it's wrong to use WXFARPROC as the type of different window procedures we use. Introduce WXWNDPROC which is more clear and correct and use it instead. Also get rid of a few casts which are not necessary any longer.
This commit is contained in:
@@ -2845,11 +2845,18 @@ typedef wxW64 long WXLPARAM;
|
||||
typedef wxW64 long WXLRESULT;
|
||||
#endif
|
||||
|
||||
/*
|
||||
This is defined for compatibility only, it's not really the same thing as
|
||||
FARPROC.
|
||||
*/
|
||||
#if defined(__GNUWIN32__)
|
||||
typedef int (*WXFARPROC)();
|
||||
#else
|
||||
typedef int (__stdcall *WXFARPROC)();
|
||||
#endif
|
||||
|
||||
typedef WXLRESULT (wxSTDCALL *WXWNDPROC)(WXHWND, WXUINT, WXWPARAM, WXLPARAM);
|
||||
|
||||
#endif /* __WIN32__ */
|
||||
|
||||
|
||||
|
@@ -939,7 +939,7 @@ extern WXDLLIMPEXP_CORE int wxGetWindowId(WXHWND hWnd);
|
||||
//
|
||||
// wndProc parameter is unused and only kept for compatibility
|
||||
extern WXDLLIMPEXP_CORE
|
||||
bool wxCheckWindowWndProc(WXHWND hWnd, WXFARPROC wndProc = NULL);
|
||||
bool wxCheckWindowWndProc(WXHWND hWnd, WXWNDPROC wndProc = NULL);
|
||||
|
||||
// Does this window style specify any border?
|
||||
inline bool wxStyleHasBorder(long style)
|
||||
|
@@ -100,7 +100,7 @@ public:
|
||||
// for internal use only
|
||||
|
||||
// get the subclassed window proc of the buddy text
|
||||
WXFARPROC GetBuddyWndProc() const { return m_wndProcBuddy; }
|
||||
WXWNDPROC GetBuddyWndProc() const { return m_wndProcBuddy; }
|
||||
|
||||
// return the spinctrl object whose buddy is the given window or NULL
|
||||
static wxSpinCtrl *GetSpinForTextCtrl(WXHWND hwndBuddy);
|
||||
@@ -145,7 +145,7 @@ protected:
|
||||
|
||||
// the data for the "buddy" text ctrl
|
||||
WXHWND m_hwndBuddy;
|
||||
WXFARPROC m_wndProcBuddy;
|
||||
WXWNDPROC m_wndProcBuddy;
|
||||
|
||||
// Block text update event after SetValue()
|
||||
bool m_blockEvent;
|
||||
|
@@ -206,8 +206,8 @@ public:
|
||||
void SubclassWin(WXHWND hWnd);
|
||||
void UnsubclassWin();
|
||||
|
||||
WXFARPROC MSWGetOldWndProc() const { return m_oldWndProc; }
|
||||
void MSWSetOldWndProc(WXFARPROC proc) { m_oldWndProc = proc; }
|
||||
WXWNDPROC MSWGetOldWndProc() const { return m_oldWndProc; }
|
||||
void MSWSetOldWndProc(WXWNDPROC proc) { m_oldWndProc = proc; }
|
||||
|
||||
// return true if the window is of a standard (i.e. not wxWidgets') class
|
||||
//
|
||||
@@ -597,7 +597,7 @@ protected:
|
||||
WXHWND m_hWnd;
|
||||
|
||||
// the old window proc (we subclass all windows)
|
||||
WXFARPROC m_oldWndProc;
|
||||
WXWNDPROC m_oldWndProc;
|
||||
|
||||
// additional (MSW specific) flags
|
||||
bool m_mouseInWindow:1;
|
||||
|
Reference in New Issue
Block a user