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
We could be left with an invalid value in the control when leaving it. E.g. in
the widgets sample whose double spin control has range from 0 to 10, 123 could
be entered in it and was not replaced by 10 when the control lost focus. This
happened because the code didn't bother to update the text control if its
contents already corresponded to the internally stored value -- but this was
wrong as it could have a different representation.
Just always update the text unconditionally when synchronizing it with the
internal value.
See #12004.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64228 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
In the native OS X tree control right cursor arrow expands the current item
and the left one collapses it if it's expanded, make the generic control work
like this too under Mac.
Closes#12019.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64227 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
We already check that positive (i.e. specified by user and not generated by
wx) window ids are in 0..SHRT_MAX range. Now do the same for the menu ids as
ids outside of this range suffer from the same problem under MSW: they get
wrapped and become negative when we receive events for them.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64226 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Instead of calling back into wxTranslations to actually load the data,
return wxMsgCatalog instance from
wxTranslationsLoader::LoadCatalog(). This requires making wxMsgCatalog
public.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64223 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wx incorrectly assumes that Unix locale codes have the form of xx_YY,
where both xx and yy are two characters long. This is wrong, xx is
ISO 639 code, which can often have 3 characters ("ast", "gez" etc.);
future ISO 639-6 will have up to 4 chars. Similarly, ISO 3166 has
alpha-3 variant of country codes too (even though they aren't used in
this context today).
For parsing needs, we can just look for '_' in the code. The only place
where a check for xx_YY code was performed was GetSystemLanguage().
Instead of bothering with correct check (or a heuristic), let's simply
assume locale is xx_YY code and only do alternative handling if that
assumption fails. According to the comments, this alternative handling
was for cases such as LANG=german environment on SuSE, but it's safe to
say that no modern systems do that anymore, so it's OK that this patch
is marginally less efficient on such legacy systems.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64218 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This class is used by wxDataViewCtrl implementation only, there is no need for
it to be in a public header.
Move the class declaration from wx/dataview.h to datavcmn.cpp.
See #11732.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64217 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This fixes the assert in wxWindow dtor checking that all event handlers pushed
on the window were removed.
Also fix a memory leak by not creating an unnecessary object of wxKillRef
class. In fact remove this class entirely.
Closes#11732.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64216 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
size_t should be used for size of objects, which wxGetTranslation() and
wxTranslations::GetString() 'n' argument isn't -- it's just a regular
integer.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64215 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
We used to show a modal dialog if the page didn't fit horizontally but this
was too intrusive when the user was just previewing the output and not really
printing it. Moreover, the question of the message box ("Print" or "Cancel")
simply didn't make sense in this case.
Fix both problems by not showing this dialog at all when previewing. Instead,
notify the user with a much less intrusive info bar in the preview window.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64214 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Unlike the old function just indicating whether a printout is being used for
previewing, the new one associates the preview object with it. This can be
useful if we need to access the window used for the preview, for example.
Also remove a bunch of apparently unnecessary SetIsPreview(false) calls as
printing (and not previewing) is already the default.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64212 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Remove m_lpAbortProc which is not needed at all and just requires ugly casts
because its type was different from the real type of wxAbortProc.
Get rid of the rest of the old Win16 code.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64211 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This handler wasn't doing anything useful as we were always using the default
preview based on an external program, so just remove it completely.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64210 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The documentation says that it takes ownership of the memory block
passed to it, but the implementation made a copy.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64209 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Native month calendar functions doesn't always return correct values in the
time part of SYSTEMTIME so ignore it and use just the date component.
To simplify doing it, add helper (MSW-specific) SetFromMSWSysDate() and
GetAsMSWSysDate() functions which convert between wxDateTime and SYSTEMTIME
but take only date component into account.
This commit partially replaces changes of r63560 and closes#11276.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64208 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
No real changes, just replace the code which was working around the absence of
a wxString::ToCDouble() with the call to the real thing now that we have it.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64204 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
As wx/log.h is not included from wx/dynlib.h (via wx/msw/private.h) any
longer, include it from here explicitly.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64202 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Although this is not needed with most compilers (including recent MinGW),
including <shellapi.h> directly apparently doesn't work with some older MinGW
versions.
This fixes compilation after the changes of r64139.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64201 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't use m_translations directly, if the user made changes to
wxTranslations instance, it would be too confusing if calls through
wxLocale compat API did nothing.
Also don't change active wxTranslations object from wxLocale if already
done by user, only call wxTranslations::Set() from wxLocale constructor
if it wasn't already set by the user. Still do if wxTranslations
instance currently in use was set by previous wxLocale on the locale
stack.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64165 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
If a catalog with full language name ("fr_BE") doesn't exist,
wxFileTranslationsLoader tries to look for just the base language ("fr")
too. This isn't something specific to wxFileTranslationsLoader, it makes
sense to do it regardless of the loader.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64154 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775