Commit Graph

55 Commits

Author SHA1 Message Date
Artur Wieczorek
43f7e35c52 Explicitly return Boolean value as declared 2018-11-10 20:56:24 +01:00
Vadim Zeitlin
f53923dd31 Left-align wxSpinCtrl contents by default
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.
2018-05-12 19:14:00 +02:00
Maarten
977a826639 use more wxOVERRIDE (#329) 2016-09-25 13:21:28 -07:00
Hartwig
308de8b69d Addition of overrides in anybutton.h, collpaneg.h, notebook.h, spinctlg.h, srchctrl.h and radiobox.h 2015-11-22 10:15:41 +01:00
Dimitri Schoolwerth
8f8d58d193 Use wx-prefixed macros throughout the repository.
Change {DECLARE,IMPLEMENT}_*CLASS and {DECLARE,BEGIN,END}_EVENT_TABLE
occurrences to use the wx-prefixed version of the macros.
2015-04-23 22:00:35 +04:00
Vadim Zeitlin
a2b0b8dbaa Handle updating tooltip text in wxCompositeWindow correctly.
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
2014-12-05 22:19:10 +00:00
Vadim Zeitlin
b736d59eb5 Don't generate any events from wxSpinCtrl and wxSpinCtrlDouble methods.
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
2013-08-06 17:00:00 +00:00
Vadim Zeitlin
3f66f6a5b3 Remove all lines containing cvs/svn "$Id$" keyword.
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
2013-07-26 16:02:46 +00:00
Vadim Zeitlin
29cc4cc9bc Use generic spin control itself as parent for its children.
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
2013-03-09 15:08:31 +00:00
Vadim Zeitlin
40aa1a7e60 Implement GetSizeFromTextSize() for wxSpinCtrl.
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
2012-11-20 12:49:53 +00:00
Vadim Zeitlin
29604c85d6 Make wxSpinCtrlGenericBase a wxCompositeWindow.
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
2012-11-20 12:49:29 +00:00
Vadim Zeitlin
9e565667d0 Add wxSpinCtrl::SetBase() to allow entering hexadecimal numbers.
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
2012-08-30 20:24:38 +00:00
Vadim Zeitlin
62f96636b5 Refactor text to/from double conversion in wxSpinCtrlGenericBase.
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
2012-08-30 20:23:49 +00:00
Vadim Zeitlin
c8fb50b794 Fix reparenting generic wxSpinCtrl.
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
2012-01-21 17:03:52 +00:00
Vadim Zeitlin
a2fb9138b2 Better fix for wxSpinCtrlGeneric enabling/disabling bug in wxMSW.
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
2011-12-29 22:05:27 +00:00
Václav Slavík
c81394808b Make wxSpinCtrlGeneric usable as wxDVC editor control.
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
2011-05-01 18:44:35 +00:00
Vadim Zeitlin
cb7ef329e7 Fix setting tooltips for generic wxSpinCtrl.
Forward the tooltip set for the control to its subcontrols.

Closes #9817.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67199 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-03-15 11:10:38 +00:00
Vadim Zeitlin
af07be96eb Don't use wxTE_PROCESS_ENTER in wxSpinCtrlGeneric.
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
2011-02-26 17:46:54 +00:00
Vadim Zeitlin
fda43a0e01 Fix compilation of wxSpinCtrlGenericBase when PCH are not used.
This fixes PCH-less compilation broken by r65043.

Closes #12259 (again).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65044 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-07-22 13:42:38 +00:00
Vadim Zeitlin
713c7336f2 Fix explicitly setting focus to generic wxSpinCtrl.
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
2010-07-22 12:16:26 +00:00
Vadim Zeitlin
64b62afea8 Don't accept focus in the dummy main generic spin control window.
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
2010-05-06 12:58:36 +00:00
Vadim Zeitlin
3a71210569 Don't send wxEVT_COMMAND_SPINCTRLDOUBLE_UPDATED when nothing changed.
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
2010-05-06 12:58:32 +00:00
Paul Cornett
f0368d28bf wxSpinCtrl values are always integral, they don't need to be rounded
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62586 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-10 17:36:53 +00:00
Paul Cornett
92e164ff92 wxSpinCtrl::SetIncrement is supposed to take an int, not a double
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62583 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-10 17:12:36 +00:00
Vadim Zeitlin
9a83f86094 Globally replace _T() with wxT().
Standardize on using a single macro across all wxWidgets sources and solve the name clash with Sun CC standard headers (see #10660).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61508 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-07-23 20:30:22 +00:00
Vadim Zeitlin
f1ddb476b1 use wxALIGN_LEFT/CENTRE/RIGHT instead of wxTE_XXX to avoid problems with the latter not being defined in wx/spinctrl.h on non-MSW platforms (see #10621)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59722 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-22 10:55:55 +00:00
Vadim Zeitlin
c218ccee9f no changes, just wrap long lines
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59721 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-22 10:51:26 +00:00
Vadim Zeitlin
7e4952db83 add alignment flags support to wxSpinCtrl[Double] (closes #10621)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59719 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-22 09:18:46 +00:00
Vadim Zeitlin
70c147281a also fix handling of wxSP_ARROW_KEYS|wxSP_WRAP (see #10565)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59473 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-03-10 15:45:13 +00:00
Robert Roebling
674f0f2783 use wxRound(x) instead of int( x+0.5 )
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@57909 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-01-08 14:36:18 +00:00
Vadim Zeitlin
7f0cbaaa4a correct the signature of the overriden Reparent()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53492 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-05-08 14:15:07 +00:00
Francesco Montorsi
53a2db124c substitute WXDLLEXPORT with WXDLLIMPEXP_CORE and WXDLLEXPORT_DATA with WXDLLIMPEXP_DATA_CORE
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52834 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-03-26 15:06:00 +00:00
Vadim Zeitlin
405f0fef4b rename classes use by generic wxSpinCtrl implementation to have "Generic" suffix to avoid conflicts with the classes with the same names in wxMac
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52673 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-03-22 03:15:56 +00:00
Vadim Zeitlin
8cd6a9ad50 added wxSpinCtrlDouble (slightly modified patch 1835864)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52612 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-03-18 14:04:19 +00:00
Vadim Zeitlin
03d4194d6b implement wxSpinCtrl::Reparent() to properly reparent both the spin button and the text control part (slightly modified patch 1914190)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52543 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-03-15 04:10:43 +00:00
Václav Slavík
b5dbe15d0b added WXDLLIMPEXP_FWD_FOO macros in addition to WXDLLIMPEXP_FOO for use with forward declarations (in preparation for GCC visibility support)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47254 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-07-09 10:09:52 +00:00
Mart Raudsepp
8907154c1a Nuke #pragma implementation/interface's
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@35650 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2005-09-23 12:56:45 +00:00
Włodzimierz Skiba
ca65c0440a Code cleaning: wxID_ANY, wxDefaultSize, wxDefaultPosition, true, false, wxEmptyString, tabs and white spaces.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27853 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-06-17 16:22:36 +00:00
Julian Smart
655719367a Use old licence name
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27408 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-05-23 20:53:33 +00:00
Julian Smart
77ffb5937e Name and version changes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27404 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-05-23 14:56:36 +00:00
Václav Slavík
1202890513 added support for gcc precompiled headers
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22722 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2003-08-09 12:38:21 +00:00
Vadim Zeitlin
739555e321 SetSelection() for generic wxSpinCtrl (forgot to commit before)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16898 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-08-31 22:52:24 +00:00
Gilles Depeyrot
af49c4b8a2 disable use of #pragma interface under Mac OS X
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
2002-08-31 11:29:13 +00:00
Mattia Barbon
dba006200f Implemented wxSpinButton for wxMotif.
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
2002-07-28 13:33:29 +00:00
Václav Slavík
70c2fde399 fixed crash in wxSpinCtrl under wxGTK
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13729 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-01-21 19:03:40 +00:00
Stefan Csomor
9453cf2bd7 several mac fixes (Mark Newsams patches)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10975 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-07-11 20:33:12 +00:00
Stefan Csomor
90b959aee4 post wxUniv merge fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10719 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-06-29 16:19:53 +00:00
Gilles Depeyrot
6c0ba0d02d added missing dynamic class declaration
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10703 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-06-28 06:27:53 +00:00
Vadim Zeitlin
1e6feb95a7 first pass of wxUniv merge - nothing works, most parts don't even compile
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10673 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-06-26 20:59:19 +00:00
Gilles Depeyrot
fd88dcbccd added missing interface pragma
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9749 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-04-14 20:09:19 +00:00