From 36b0b0907868ef9e55ebae74f876dfff91c8b153 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 9 May 2012 14:24:27 +0000 Subject: [PATCH] Allow entering more digits in wxSpinCtrl in wxMSW than fits into it. Scroll the control automatically if there is not enough space. This is consistent with (single line) wxTextCtrl and wxSpinCtrl under the other platforms. Closes #14211. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71389 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 8 ++++++++ src/msw/spinctrl.cpp | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index e2ea3f0e85..59e99ea5fc 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -450,6 +450,14 @@ Deprecated methods and their replacements possible or wxWindowDisabler otherwise. +Changes in behaviour visible to end users +----------------------------------------- + +- In wxMSW wxSpinCtrl used to prevent the user from entering more digits than + could fit in its visible area. This was inconsistent with the other ports and + now the control scrolls if too much text is added. + + Major new features in this release ---------------------------------- diff --git a/src/msw/spinctrl.cpp b/src/msw/spinctrl.cpp index d5b95d4115..0017413e0a 100644 --- a/src/msw/spinctrl.cpp +++ b/src/msw/spinctrl.cpp @@ -298,6 +298,10 @@ bool wxSpinCtrl::Create(wxWindow *parent, WXDWORD exStyle = 0; WXDWORD msStyle = MSWGetStyle(GetWindowStyle(), & exStyle) ; + // Scroll text automatically if there is not enough space to show all of + // it, this is better than not allowing to enter more digits at all. + msStyle |= ES_AUTOHSCROLL; + // propagate text alignment style to text ctrl if ( style & wxALIGN_RIGHT ) msStyle |= ES_RIGHT; -- 2.47.2