projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Applied patch [ 583922 ] Make generic/wxListCtrl avail. in WIN32
[wxWidgets.git]
/
src
/
msw
/
spinctrl.cpp
diff --git
a/src/msw/spinctrl.cpp
b/src/msw/spinctrl.cpp
index f41eb5d32d1cb7e549ef3308b41278f0f7ee5b8c..dbf5cdceef1a3bd91550f85a00294f72ad7b16e3 100644
(file)
--- a/
src/msw/spinctrl.cpp
+++ b/
src/msw/spinctrl.cpp
@@
-40,7
+40,7
@@
#include "wx/spinctrl.h"
#include "wx/msw/private.h"
#include "wx/spinctrl.h"
#include "wx/msw/private.h"
-#if defined(__WIN95__) && !(
defined(__GNUWIN32_OLD__) || defined(__TWIN32
__))
+#if defined(__WIN95__) && !(
(defined(__GNUWIN32_OLD__) || defined(__TWIN32__)) && !defined(__CYGWIN10
__))
#include <commctrl.h>
#endif
#include <commctrl.h>
#endif
@@
-85,9
+85,12
@@
LRESULT APIENTRY _EXPORT wxBuddyTextWndProc(HWND hwnd,
{
wxSpinCtrl *spin = (wxSpinCtrl *)::GetWindowLong(hwnd, GWL_USERDATA);
{
wxSpinCtrl *spin = (wxSpinCtrl *)::GetWindowLong(hwnd, GWL_USERDATA);
- // forward some messages (the key ones only so far) to the spin ctrl
+ // forward some messages (the key and focus ones only so far) to
+ // the spin ctrl
switch ( message )
{
switch ( message )
{
+ case WM_SETFOCUS:
+ case WM_KILLFOCUS:
case WM_CHAR:
case WM_DEADCHAR:
case WM_KEYUP:
case WM_CHAR:
case WM_DEADCHAR:
case WM_KEYUP:
@@
-98,7
+101,12
@@
LRESULT APIENTRY _EXPORT wxBuddyTextWndProc(HWND hwnd,
if (!(::IsWindow(hwnd) && ((wxSpinCtrl *)::GetWindowLong(hwnd, GWL_USERDATA)) == spin))
return 0;
break;
if (!(::IsWindow(hwnd) && ((wxSpinCtrl *)::GetWindowLong(hwnd, GWL_USERDATA)) == spin))
return 0;
break;
+
+ case WM_GETDLGCODE:
+ // we want to get WXK_RETURN in order to generate the event for it
+ return DLGC_WANTCHARS;
}
}
+
return ::CallWindowProc(CASTWNDPROC spin->GetBuddyWndProc(),
hwnd, message, wParam, lParam);
}
return ::CallWindowProc(CASTWNDPROC spin->GetBuddyWndProc(),
hwnd, message, wParam, lParam);
}
@@
-245,6
+253,9
@@
bool wxSpinCtrl::Create(wxWindow *parent,
if ( want3D || wxStyleHasBorder(style) )
msStyle |= WS_BORDER;
if ( want3D || wxStyleHasBorder(style) )
msStyle |= WS_BORDER;
+ if ( style & wxCLIP_SIBLINGS )
+ msStyle |= WS_CLIPSIBLINGS;
+
// create the text window
m_hwndBuddy = (WXHWND)::CreateWindowEx
(
// create the text window
m_hwndBuddy = (WXHWND)::CreateWindowEx
(
@@
-309,6
+320,10
@@
wxSpinCtrl::~wxSpinCtrl()
{
ms_allSpins.Remove(this);
{
ms_allSpins.Remove(this);
+ // This removes spurious memory leak reporting
+ if (ms_allSpins.GetCount() == 0)
+ ms_allSpins.Clear();
+
// destroy the buddy window because this pointer which wxBuddyTextWndProc
// uses will not soon be valid any more
::DestroyWindow(GetBuddyHwnd());
// destroy the buddy window because this pointer which wxBuddyTextWndProc
// uses will not soon be valid any more
::DestroyWindow(GetBuddyHwnd());