The default alignment of the text in wxSpinCtrl was changed to "right"
in 7e4952db83, which added alignment
support (see #10621), but this made it inconsistent with the native
up-down control under MSW and, perhaps more importantly, with spin
controls created from XRC as the default style was never modified there
and did not include wxALIGN_RIGHT.
Resolve this inconsistency by reverting to left-aligning the text by
default.
While calling SetToolTip(wxToolTip*) overload already worked correctly for
wxCompositeWindow, using SetToolTip(wxString) did not if a tooltip already
existed, as it didn't use the virtual DoSetToolTip() in this case, resulting
in e.g. impossibility to update wxSpinCtrlDouble tooltip using this method.
Fix this by introducing DoSetToolTipText() virtual which is used by that
overload now and overriding it in wxCompositeWindow.
Also don't override DoSetToolTip() in wxSpinCtrlGenericBase any more, it is
not necessary as it's already done by its base class wxCompositeWindow.
Closes#16595.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78245 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
After the changes of r53758 wxMSW didn't generate any wxEVT_TEXT events but
this was still the case for the generic version (and hence for
wxSpinCtrlDouble under MSW too) and wasn't documented.
Fix all versions to avoid sending events for programmatic actions, add unit
tests checking this behaviour and document it.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74631 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This keyword is not expanded by Git which means it's not replaced with the
correct revision value in the releases made using git-based scripts and it's
confusing to have lines with unexpanded "$Id$" in the released files. As
expanding them with Git is not that simple (it could be done with git archive
and export-subst attribute) and there are not many benefits in having them in
the first place, just remove all these lines.
If nothing else, this will make an eventual transition to Git simpler.
Closes#14487.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74602 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This fixes a problem with using wxSpinCtrlGeneric in toolbars under wxOSX,
using the toolbar itself (i.e. the parent of the spin control) as parent for
the children didn't work there and no windows were visible at all.
Also use wxNavigationEnabled as base class of wxSpinCtrlGeneric to fix
keyboard navigation.
And override SetBackgroundColour() to set it for the text control part of the
spin control only.
Closes#15016.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73630 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Implement it for the native MSW and GTK versions and the generic one used in
the other ports and also for wxSpinCtrlDouble under MSW.
Also test this function in the spin page of the widgets sample.
Closes#14840.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72995 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This takes care of propagating methods setting fonts and colours to the
subwindows automatically, so that setting font for the generic wxSpinCtrl now
works, unlike before.
Closes#14839.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72994 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add a generic SetBase() API even though right now only bases 10 and 16 are
supported as we might support other ones (e.g. 8?) in the future. Implement it
for MSW, GTK and generic versions.
Add controls allowing to test this feature to the widgets sample.
Add "base" property support to the XRC handler for wxSpinCtrl, document it and
test it in the xrc sample.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72414 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The code always used ToDouble() and Format("%g") which was a bit strange for
integer-valued wxSpinCtrl. Move the conversions to their own virtual functions
for clarity, perhaps correctness and, especially, flexibility as they will be
overridden in wxSpinCtrl soon.
Also move wxSpinCtrlGenericBase::m_format to wxSpinCtrlDouble as the base
class really doesn't need it at all.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72412 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The existing Reparent() implementation was wrong as it reparented spin control
subwindows under the new parent but left the main window itself under the old
one. Fix this by just not overriding Reparent() at all, the inherited version
works just fine for this control.
Closes#13849.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70432 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
To really ensure that the window containing the components of wxSpinCtrlGeneric
is never enabled under MSW (as we want to avoid this to ensure that any input
always goes to its children and not the window itself, see #12045), override
DoEnable() and not Enable(). This takes care of the case when the control gets
implicitly disabled because its parent is.
Closes#13142.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70178 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxDVC installs temporary event handler that watches for focus changes
and some key events. Make wxSpinCtrlGeneric look like a native
wxControl in this respect even though it's actually a composite control.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67665 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
We don't need to catch Enter presses to generate spin control events as we do
it anyhow when we lose focus. So simply remove the Enter handling code
entirely (it could be used to generate wxEVT_COMMAND_TEXT_ENTER events but we
don't generate them nor wxEVT_COMMAND_TEXT_UPDATED at all currently in the
generic version).
Closes#12980.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67031 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The control itself can't accept focus as its window is disabled so set the
focus to its text part instead if SetFocus() is explicitly called.
Closes#12259.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65043 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This window is only used as a container for the sub-windows and shouldn't
accept focus, trying to set it to it doesn't work anyhow (see #12004).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64230 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The generic double spin control sent UPDATED events whenever it lost focus,
whether anything changed or not.
Don't send events unless the controls value has really changed.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64229 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
GNU compiler included with Mac OS X 10.2 (Jaguar) as well as August Developer
Tools update contain a bug concerning #pragma interface handling that can only
be worked around by not using them (and they are not necessary anyways)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16884 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Renamed generic wxSpinCtrl::DoGetBestClientSize to DoGetBestSize
( the "Client" appears to be a relic of the past ).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16303 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775