Commit Graph

88 Commits

Author SHA1 Message Date
Vadim Zeitlin
36d359c470 fixup! Improve date validation in wxDatePickerCtrlGeneric 2023-03-13 17:07:38 +01:00
Vadim Zeitlin
4d3b158125 fixup! Improve date validation in wxDatePickerCtrlGeneric 2023-03-13 16:24:55 +01:00
Vadim Zeitlin
fe3dff8aa6 Add forgotten wxUSE_VALIDATORS checks
Compilation with wxUSE_VALIDATORS==0 would have failed after the recent
changes, so fix this by adding the missing check.

See #23312.

(cherry picked from commit 623591823d503a46a843503c126d2bfc542fef3f)
2023-03-09 00:22:09 +01:00
Vadim Zeitlin
70b31c6b52 Improve date validation in wxDatePickerCtrlGeneric
And a couple of minor fixes in the related code.

See #23310.

(cherry picked from commit 8f22eb515776333e48a15f35ec7f37867f9d58bc)
2023-03-09 00:17:39 +01:00
utelle
1c65e88221 Replace references to wxLocale by wxUILocale
Use newer wxUILocale class directly instead of using wxLocale functions
that forward to it anyhow.

No real changes.

Closes #22375.
2022-05-01 03:02:26 +02:00
Paul Cornett
1508fa1e4c Use a more accurate width for wxDatePickerCtrlGeneric
See #19078
2021-02-23 10:01:01 -08:00
PB
f57f214122 Remove BCC-specific hdrstop pragma from everywhere 2020-10-12 21:58:37 +02:00
ali kettab
36f6f8ad49 wxTextValidator improvements
Improve char inclusion/exclusion support; update the sample to show more
features of this class and add a unit test for it.

Closes https://github.com/wxWidgets/wxWidgets/pull/1093
2019-01-05 23:33:35 +01:00
Artur Wieczorek
f3b6e6d3b5 Fix date format specification in wxDatePickerCtrlGeneric with wxUSE_INTL=0
Conversion specification for preferred date representation is "%x", not "x".
2018-11-10 14:59:27 +01:00
Vadim Zeitlin
d7351536c1 Change the data in generic wxDatePickerCtrl immediately
Accept the new date typed into the text control immediately if it's
valid. This is more consistent with the native MSW control behaviour and
avoids semi-duplicated events on text change and then on focus loss that
occurred before.
2018-07-30 22:36:53 +02:00
Vadim Zeitlin
d406f23e67 Fix behaviour on focus loss in generic wxDatePickerCtrl
Don't send any events if the date is invalid when leaving the control.
Also, for the controls without wxDP_ALLOWNONE style, ensure that we
revert to the valid date we had before when this happens, as such
controls must, by definition, always have a valid sate.

Note that there already was a check for wxDP_ALLOWNONE, added back in
aae5ec8bbe0b14bd2f43708186428e3c09d10739 (and cherry-picked to master as
d6781628fd), but it seemed to be reversed,
as it only set the date to invalid if the control did not have this
style.
2018-07-30 22:18:11 +02:00
Vadim Zeitlin
b8401d2fb5 Fix return value of wxCalendarComboPopup::ParseDateTime()
Don't pretend that empty string represents a valid date, this made no
sense and resulted in unwanted events with an invalid date on clearing
the text part of the generic wxDatePickerCtrl.
2018-07-30 22:05:24 +02:00
Vadim Zeitlin
9293634af1 Avoid assertion failure when typing into generic wxDatePickerCtrl
Don't call wxCalendarCtrl::SetDate() if the current date is invalid,
this would just result in an assertion failure.
2018-07-30 21:48:48 +02:00
Vadim Zeitlin
97e217e175 Ensure that wxDatePickerCtrlGeneric does get focus events
Revert 1de107c037 and remove the focus
event handler which duplicated and interfered with the handler inherited
from this class to make sure that we get wxEVT_{SET,KILL}_FOCUS for the
objects of this class.

Unfortunately these events now come in pairs, due to an extra artificial
event generated by wxComboBoxExtraInputHandler::OnFocus(), which is
still wrong -- but arguably less wrong and more useful than not sending
them at all.
2018-07-22 19:12:17 +02:00
Vadim Zeitlin
d4f380e16e Use Bind() instead of Connect() in wxWidgets code
Use more modern function which allows to avoid wxXXXEventHandler()
macros use.

No real changes.
2018-05-30 13:06:20 +02:00
Vadim Zeitlin
e3de2916bb Adjust the date in wxDatePickerCtrlGeneric after changing range.
Ensure that the current value remains between the lower and upper range
boundaries in the generic implementation, as it was already done by the MSW
one.
2015-07-17 17:59:40 +02: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
33ad33d447 Add wxOVERRIDE and use it in common and wxOSX code.
Make overriding virtual methods more explicit and enable additional checks
provided by C++11 compilers when "override" is used.

Closes #16100.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76173 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-20 13:26:28 +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
2060e34cd2 Improve wxDatePickerCtrlGeneric best size calculation.
Make the control just wide enough to fully show the contents of its text part.

This is still not ideal as we don't take into account wxComboCtrl internal
complications but better than before.

Closes #14342.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71579 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-05-28 19:38:02 +00:00
Vadim Zeitlin
af184f1d2f Work around wxDateTime::ParseFormat() problem in generic wxDateTimePickerCtrl.
Due to a bug in wxDateTime::ParseFormat(), calling it with wxString::c_str()
currently just crashes, so don't do this in generic wxDateTimePickerCtrl code.
The real fix is, of course, to correct the bug in wxDateTime itself but for
now this at least prevents the crash when executing the test suite. And using
c_str() here is unnecessary anyhow.

See #14214.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71317 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-04-29 23:22:05 +00:00
Vadim Zeitlin
162e221f76 Allow returning NULL windows from GetCompositeWindowParts().
wxCompositeWindow::GetCompositeWindowParts() becomes simpler to implement in
the derived classes with optionally shown elements if NULL windows are allowed
(and ignored) in the list returned by it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68910 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-08-27 12:13:18 +00:00
Dimitri Schoolwerth
88def1632e Compilation fixes for wxUSE_LOCALE and wxUSE_XLOCALE set to 0.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67393 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-04-04 22:07:42 +00:00
Stefan Csomor
809d69287e avoid populating the array with NULL controls during creation (SetWindowVariant calling SetFont crashing)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66771 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-01-26 15:52:41 +00:00
Vadim Zeitlin
a9e41db760 Add wxCompositeWindow<> and use it in wxDatePickerCtrlGeneric.
wxCompositeWindow<> is a convenient base class for composite windows, i.e.
windows consisting of several other wxWindows. Currently it just automatically
forwards various attributes setters calls to all of the composite window parts
but it could become more useful in the future.

Similarly, for now it is only used in wxDatePickerCtrlGeneric but it could
(and should) be used for other composite controls later and we probably should
even make this class public to allow its use in the client code.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66534 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-01-03 11:24:13 +00:00
Dimitri Schoolwerth
df16cb09b1 Fixed compilation of datectlg.cpp.
Only including wx/datectrl.h does not always include wx/generic/datectrl.h, for example it does not for MSW non-Universal. As a result when compiling datectlg.cpp wxDatePickerCtrlGeneric is unknown and compilation fails. Fixed by including wx/generic/datectrl.h again (regression since r66524).



git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66532 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-01-03 11:01:59 +00:00
Vadim Zeitlin
4a40cd9bae Forward declare classes instead of including their declarations.
No real changes, just reduce the compilation dependencies a bit by only
forward declaring wxComboCtrl and wxCalendarCtrl in wx/generic/datectrl.h
instead of including the headers with their full declarations.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66524 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2011-01-02 22:03:56 +00:00
Vadim Zeitlin
4d4c704c3e Use wxLocale::GetInfo() to get date format in wxDatePickerCtrlGeneric.
Instead of trying (and failing) to manually decode the format used by "%x",
simply use wxLocale::GetInfo(wxLOCALE_SHORT_DATE_FMT) and just change "%y" to
"%Y" if necessary.

The new code is more than 10 times shorter and also gives correct results
unlike the old version.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65511 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-09-10 19:42:23 +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
8f2a8de6e7 fix many mostly harmless warnings in wxOSX/Carbon build
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61140 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-06-20 00:21:53 +00:00
Vadim Zeitlin
2ccc6650ca support wxDP_ALLOWNONE in generic wxDatePickerCtrl (#3164)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54407 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-06-28 18:58:07 +00:00
Vadim Zeitlin
6c70323fcb fix handling of wxDP_SHOWCENTURY for some non-C locales (one of the problems of #4743)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54330 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-06-22 15:06:57 +00:00
Vadim Zeitlin
b0fb790beb fix for crash under wxX11: we get text event there when m_popup is still NULL
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54098 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-06-11 11:47:24 +00:00
Vadim Zeitlin
c245a01202 use native calendar control in wxDatePickerCtrl if available (#9548)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54097 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-06-11 11:45:57 +00:00
Robin Dunn
d6781628fd Merge r53510 from 2.8 branch
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53511 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-05-09 22:18:34 +00:00
Vadim Zeitlin
628e155d8c added native GTK implementation of wxCalendarCtrl (modified patch 1925439)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52891 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-03-28 02:47:12 +00:00
Vadim Zeitlin
2fda1fe5fd fix redundant storage of current date both in wxCalendarCtrl (which was itself redundantly stored as both wxDatePickerCtrl::m_cal and m_popup) and popup m_currentDate variable which resulted in multiple bugs, e.g. calendar didn't open at the current date value
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51843 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2008-02-16 15:39:06 +00:00
Václav Slavík
330e8ab901 dont use wxChar* arguments in wxDatePickerCtrlGeneric API
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47004 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-06-28 17:03:42 +00:00
Václav Slavík
e0a050e347 more changes to make wx compile without implicit wxString->char* conversion (for STL build)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46553 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-06-20 07:44:45 +00:00
Robin Dunn
d1b736b796 Send the calendar and date changed events to the datepicker ctrl first
(not its parent) so they can be caught by dynamic event handlers
connected directly to the picker.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46530 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-06-18 19:34:56 +00:00
Mattia Barbon
eafd76b02c Replace direct calls to ProcessEvent() with
GetEventHandler()->ProcessEvent().


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45359 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2007-04-09 16:43:23 +00:00
Robin Dunn
170acdc90e GetBestFittingSize --> GetEffectiveMinSize
SetBestFittingSize --> SetInitialSize
SetBestSize  --> SetInitialSize
SetInitialBestSize --> SetInitialSize


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42816 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-10-31 08:50:17 +00:00
Robert Roebling
4427c0a3ff [ 1585858 ] Fix wxDatePickerCtrlGeneric and wxComboCtrl kb navigation
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42539 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-10-27 18:02:21 +00:00
Włodzimierz Skiba
82df62ef8e Warning fix.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42270 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-10-23 10:51:20 +00:00
Vadim Zeitlin
06077aaf2c add alt popup window style allowing to use keyboard and comboboxes in the popup window and use it for the generic date picker (patch 1582391 from Jaakko)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42247 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-10-22 20:25:08 +00:00
Vadim Zeitlin
85fa9d60c4 use wxComboCtrl instead of custom popup window (patch 1575343)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42241 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-10-22 14:15:46 +00:00
Vadim Zeitlin
005eba5abd fixed crash if the control is moved while the popup is open (patch 1539194)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40590 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-08-13 01:24:30 +00:00
Włodzimierz Skiba
68f2155bb7 Better temporary fix.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40154 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-07-17 06:28:39 +00:00
Włodzimierz Skiba
3d3d7d0994 Build fix to make tinderbox work, needs asap change.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40153 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-07-17 06:19:29 +00:00
Stefan Neis
40a33c46e3 Avoid trouble during initialisation & typo fix (patch #1523304).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40142 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2006-07-16 20:41:48 +00:00