Commit Graph

63943 Commits

Author SHA1 Message Date
Vadim Zeitlin
27c399adbe Remove wxALWAYS_SHOW_SB-related code from wxScrolled
There is no need to handle this style specially here, it's supposed to
be handled at wxWindow level and is, indeed, at least in all the major
ports.

So revert 2119b213e3 (see #13616) and the
workaround for it applied later for macOS (see #14856). And this also
removes the need for handling wx[HV]SCROLL in wxScrolled (see #17846).

Closes #14856, #17846.
2018-01-14 18:27:10 +01:00
Vadim Zeitlin
a6c1899092 Merge branch 'msw-wakeup-no-msg'
Restore using event objects, instead of posting WM_NULL messages, for
idle wakeup under MSW.
2018-01-14 13:38:04 +01:00
Vadim Zeitlin
bd6694761d Merge branch 'cygwin64'
Several compilation fixes due to the fact that sizeof(long)==8 under
Cygwin in 64 bits.

This allows the library to compile, but there are still run-time
problems, notably the unit tests throw an unknown exception currently.
2018-01-14 13:34:57 +01:00
Vadim Zeitlin
ae4dd59719 Merge branch 'cmake-fixes' of https://github.com/MaartenBent/wxWidgets
Miscellaneous improvements to CMake build system.

See https://github.com/wxWidgets/wxWidgets/pull/666
2018-01-14 03:10:13 +01:00
Vadim Zeitlin
00b3b323de Define std-related symbols in configure when using C++11 too
Even though we don't need to perform the checks for the availability of
<unordered_map> or <type_traits> headers when using C++11 because we can
safely assume they're indeed available, we still need to define the
corresponding symbols, as if the checks were performed, so that the code
inside and outside the library could test them in any case, whether
we're using C++11 or not.
2018-01-14 03:09:12 +01:00
Martin Koegler
f6dddd9228 Use unordered_xxx classes detected by configure
When using configure, use the same family of hash sets/maps when
building wxWidgets and the applications using it as doing otherwise
results in ABI incompatibility.
2018-01-14 03:07:48 +01:00
Vadim Zeitlin
9df5541c53 Don't show dialogs from OnExceptionInMainLoop() in the tests
Similarly to the previous commit, ensure that the tests can run
unattended under MSW even if an unhandled exception is thrown during
their execution.
2018-01-14 02:25:51 +01:00
Vadim Zeitlin
277937b0c4 Always use stderr for wxMessageOutputBest in the tests
Avoid showing message boxes even if we don't have the associated console
as this prevents the test from completing on its own if an unknown
exception happens.
2018-01-14 02:25:51 +01:00
Vadim Zeitlin
d55d5b1dd7 Use LONG for OLE IAccessible methods parameters
This is another fix for 64 bit Cygwin build: LONG is defined as a 32 bit
type in it, but not long, which is 64 bits, so use the former instead of
the latter.
2018-01-14 02:25:51 +01:00
Vadim Zeitlin
ebb06fbeaf Use wxTimeVal_t instead of timeval to fix 64 bit Cygwin problems
Due to the same problem with sizeof(long) mismatch as in the previous
commit, we can't use struct timeval, with its long fields, in 64 bit
Cygwin builds, and need to use __ms_timeval instead.

Add wxTimeVal_t type to hide this difference and update all code
compiled under MSW (there is no need to uglify Unix-only code using
timeval, as in wxSelectDispatcher, for example) to use it instead of
timeval.
2018-01-14 02:25:51 +01:00
Vadim Zeitlin
1261139bcb Fix wxSocket code compilation with Cygwin in 64 bits
Use __ms_u_long instead of just u_long with Cygwin to avoid mismatch
between (64 bit) Cygwin long and (still 32 bit, even in 64 bit build)
Windows API long.
2018-01-14 02:25:51 +01:00
Vadim Zeitlin
a5ae0685a0 Fix wxFSVolume compilation with Cygwin in 64 bits
Use __LONG32, which is always 32 bits when using Cygwin, unlike long,
which is 64 bits there in 64 bit builds, and so can't be used as an
argument to InterlockedExchange().

Closes #16746.
2018-01-14 02:25:51 +01:00
Vadim Zeitlin
88c6ce344e Fix bug with not re-enabling wxStaticBox with label sometimes
In some specific scenario, described in the newly added comment in
wxStaticBoxBase::Enable(), the box and its label could remain disabled
after its parent was disabled and re-enabled.

Fix this by continuing to use the derived class version for disabling
the box children, but not when enabling them, as the base class version
already does the right thing in this case.
2018-01-13 23:56:37 +01:00
Vadim Zeitlin
3c29b3d0ce Don't disable wxStaticBox children at wx level when disabling it
Calling Enable() on all children from wxStaticBox::Enable() was wrong,
the actual status of the child, returned by wxWindow::IsThisEnabled(),
is not supposed to change just because its parent was disabled.

Call NotifyWindowOnEnableChange() to avoid this, while still disabling
the children visually.
2018-01-13 23:56:37 +01:00
Vadim Zeitlin
967b4cdc1f Always call DoEnable() from NotifyWindowOnEnableChange()
Simplify the code by replacing 2 conditionally-compiled DoEnable() calls
with a single unconditional one.

This doesn't change the behaviour of Enable(), as it always called
DoEnable() on the window itself and only did it for its children when
wxHAS_NATIVE_ENABLED_MANAGEMENT was not defined before and continues to
do the same thing now, but it should fix a small bug in Reparent() as it
didn't update the actual status of the window if it changed as the
result of reparenting before, even though it was supposed to.
2018-01-13 23:56:37 +01:00
Vadim Zeitlin
2163b00b93 Move wxHAS_NATIVE_ENABLED_MANAGEMENT definition to the source file
There doesn't seem to be any need to have this symbol in the header,
when it's only used in NotifyWindowOnEnableChange() in wincmn.cpp.

No real changes.
2018-01-13 23:56:37 +01:00
Vadim Zeitlin
564df77283 Correct new wxStaticBox::Create() overload documentation
Fix the method name and update its description to mention that it's also
available in wxMSW.
2018-01-13 22:26:07 +01:00
Vadim Zeitlin
d1e57312c2 Revert "Don't call wxWakeUpIdle() with a lock in wxProgressDialog"
This reverts commit d26758044c which was a
workaround for the problem of wxWakeUpIdle() dispatching events, as this
is not the case any more after the latest changes.
2018-01-13 17:41:16 +01:00
Vadim Zeitlin
d617834eb9 Don't make wxEventLoop::WakeUpIdle() virtual
It just forwards to (virtual) WakeUp() and there should be no need to
ever override this method itself (nor even to keep it, except for
backwards compatibility).

No real changes.
2018-01-13 17:40:53 +01:00
Vadim Zeitlin
9b4759d7b6 Don't rely on getting WM_NULL messages in wxIdleWakeUpModule
Since the switch to using an event object for idle handling wakeup,
WM_NULLs are not being sent any longer, so wxIdleWakeUpModule didn't do
anything, resulting in pending event dispatching being paused while our
event loop was not running, as it happened, for example, while the
window was resized.

See #17579.
2018-01-13 17:33:09 +01:00
Vadim Zeitlin
91aed00288 Revert "Revert using an event object for waking up event loop in wxMSW"
This reverts commit ebb3a791b9,
effectively reapplying 6c40531fb7 once
again.

This breaks wake up when not running our own event loop once again
(see #17579), but this will be fixed in the next commit.
2018-01-13 15:23:30 +01:00
Vadim Zeitlin
d26758044c Don't call wxWakeUpIdle() with a lock in wxProgressDialog
This can result in deadlocks because wxWakeUpIdle(), admittedly rather
unexpectedly, can result in dispatching a message in the main thread,
which could reacquire the same lock again.
2018-01-12 17:17:53 +01:00
Maarten Bent
47fb2b6122 CMake: Update cotire to 1.7.10 2018-01-11 22:09:52 +01:00
Maarten Bent
f166d3b9c0 CMake: Don't use external project for wxexpat
This simplifies things a lot. And it is also not used for png, tiff and zlib.
2018-01-11 22:09:51 +01:00
Maarten Bent
21615b1634 CMake: Set Visual Studio working directory
Use the executable output directory for samples and demos, use the source directory for tests.
2018-01-11 22:09:43 +01:00
Maarten Bent
db86112675 CMake: Disable crt and socket warnings from Windows headers 2018-01-11 22:09:38 +01:00
Maarten Bent
573e887a4c CMake: Fix building and running samples
Add missing header, source and resource files.
Add missing data files (font), remove deleted data files (help).
Fix specifying xrc sample data files.
Remove WXUSINGDLL check from dialogs sample, it is not defined in e.g. static gui build.
2018-01-11 22:09:37 +01:00
Maarten Bent
4d35e8e54d CMake: Copy demo and sample data files to correct directory
Instead of 'lib/', copy it to directory where the executables are (e.g. 'lib/vc_x64_lib/').
2018-01-11 22:09:28 +01:00
Vadim Zeitlin
3357d46ccc Make it simpler to use mnemonics for wxRadioBox items in XRC
Allow specifying label="1" attribute in wxRadioBox <item> tags to
indicate that the usual translation of "_" to "&" should be done, as for
all the other labels.

This is still not the default behaviour to avoid breaking any existing
XRC files using "_", even though using labels="1" by default would make
more sense.
2018-01-11 01:19:16 +01:00
Vadim Zeitlin
bc2c9ce2a3 Fix misspelling of a label in XRC docs and example
It was spelt in 2 different ways, neither of which was actually correct.
2018-01-11 01:19:16 +01:00
Vadim Zeitlin
52635cfc10 Reuse the same XRC function for all translations
Translate all strings in the new GetNodeText() function replacing the
old GetText() which was mostly used for translatable strings before --
except that <item> tag contents didn't use it because it also performed
string unescaping, not wanted for the control items, in addition to
translation.

Replace the old GetText() (while still keeping it for compatibility,
i.e. to avoid breaking any custom XRC handlers using it) with the new
function which is more flexible and can be used for all tags.

No real changes, this is just a refactoring.
2018-01-11 01:19:16 +01:00
Vadim Zeitlin
689704119a Fix handling of underscores in <item> tags in "wxrc -g" output
Unlike all the other nodes containing translatable text, the contents of
the <item> tags, used for wxChoice, wxListBox etc items, is not escaped
(because it can't contain mnemonics), so don't unescape it when
outputting it from "wxrc --gettext" neither.

See #18033.
2018-01-11 01:19:16 +01:00
Vadim Zeitlin
6bd8cb964b Really remove removed files from the help sample
This does what 1c2e58cd85 tried to do
manually correctly, by updating bakefile and rebaking, and so finally
completing the changes of 961a1c2b39.

See #17962.
2018-01-10 23:44:08 +01:00
Vadim Zeitlin
f0d946a38d Merge branch 'xrc-spinctrldouble'
Add XRC handler for wxSpinCtrlDouble.

Closes https://github.com/wxWidgets/wxWidgets/pull/665
2018-01-10 17:45:08 +01:00
Vadim Zeitlin
c3c8a2198d Document the recently added wxSpinCtrlDouble XRC handler
Update XRC reference documentation after adding a new handler too.
2018-01-10 17:44:42 +01:00
Vadim Zeitlin
74cf8370ce Avoid code duplication between wxSpinCtrl XRC handlers
Extract styles initialization into a function reused by both
wxSpinCtrlXmlHandler and wxSpinCtrlDoubleXmlHandler.

No real changes, this is a pure refactoring.
2018-01-10 17:44:37 +01:00
Trylz
80f4c8cde3 Add XRC handler for wxSpinCtrlDouble
Create wxSpinCtrlDoubleXmlHandler class similar to the existing
wxSpinCtrlXmlHandler and update the XRC schema to account for it.
2018-01-10 17:44:32 +01:00
Vadim Zeitlin
e2a31ef3db Merge branch 'grid-clip'
See https://github.com/wxWidgets/wxWidgets/pull/648
2018-01-10 17:19:03 +01:00
Vadim Zeitlin
6ec4489189 Merge branch 'upmake-cmake'
Generate CMake files list from upmake.

See https://github.com/wxWidgets/wxWidgets/pull/663
2018-01-08 17:33:57 +01:00
Vadim Zeitlin
5def115f28 Extract common type definitions from wx/defs.h to wx/types.h
Fix the problem with compiling user code including wx/debug.h as the
first wxWidgets header under MSW. This ought to work, but didn't,
because wx/debug.h included wx/chartype.h without including wx/defs.h
(because there is already an inclusion in the other direction), which
defines SIZEOF_WCHAR_T required by wx/chartype.h, first.

Notice that we repurpose the existing but completely unused (no mentions
of it or the symbols defined in it anywhere neither in wxWidgets nor in
any of the code search engines) wx/types.h header as it has a fitting
name and this avoids having to add a new header and remove the existing
one.
2018-01-07 22:43:24 +01:00
Vadim Zeitlin
267067aa8a Regenerate CMake files list from upmake too
Replace the specialized Python script used for it before (and which was
actually forgotten to run a couple of times already) with a newer
version of upmake, which can now update CMake variable definitions too.
2018-01-07 22:29:42 +01:00
Vadim Zeitlin
b2a8c2188f Remove duplicate wx/scrolbar.h from CMake files list
This will avoid warnings when regenerating it the next time.
2018-01-07 19:19:29 +01:00
Vadim Zeitlin
d7fbf1f820 Output the message about bakefile_gen by default in upmake
This message shouldn't be given only when --verbose is given, it's
useful as a reminder and you shouldn't have to remember to give a
special option to get this reminder.
2018-01-07 18:43:01 +01:00
Vadim Zeitlin
9a75103d9a Fix upmake bug with conditions in bakefile files
Don't strip the <if> tags from bakefile variables (this bug fix is
actually in Makefile::Update Perl module, but is incorporated here by
reference) and remove these tags which somehow made it into upmake input
file, as they make no sense there.

Note also that upmake was recreated using a different version of fatpack
(0.010007), which accounts for many other differences in this file.
2018-01-07 18:36:58 +01:00
Vadim Zeitlin
c1e097cc68 Update CMake files list
Regenerate the file that was forgotten before by the changes of
48a5d6c5f8 (see #18038) and
95b28abfdf (see
https://github.com/wxWidgets/wxWidgets/pull/541).
2018-01-07 17:03:46 +01:00
Vadim Zeitlin
a6d677a0fe Check for correct window in wxNumValidatorBase::SetWindow()
Override SetWindow() to check that the validator is being associated
with the window of the correct type, this allows to trigger an assert
immediately if this is not the case, making it simpler to find the error
as the call to SetValitator() on the wrong window will be in the call
stack when this happens, unlike before when the assert would happen only
at some later time.
2018-01-07 01:26:53 +01:00
Vadim Zeitlin
bfcd51cb6a Make wxValidator::SetWindow() virtual
Allow overriding the method called when the validator is associated with
the window, this can be convenient to perform some initialization on the
validator instance actually used as it can't be done on the initially
created object itself because it will be cloned by SetValidator(),
creating a new instance.

Also change SetWindow() to take wxWindow instead of wxWindowBase, this
still requires the cast in wxWindow::SetValidator(), but it's better to
have it there rather than in wxValidator and use the simpler type in the
public function signature.
2018-01-07 01:25:10 +01:00
Vadim Zeitlin
1d037dd4c9 Don't disable wxStaticBox window label when disabling the box
This behaviour might be not completely intuitive, but it makes it much
simpler to handle the box state using a checkbox as the label control
(which is by far the most common case of using box window labels).

Notice that while we could add a separate EnableWithoutLabel() method to
wxStaticBox to make it possible to set the state of the box directly
relatively easily, it wouldn't help with using wxEVT_UPDATE_UI for
managing the box state indirectly as it relies on calling Enable() only.
And this solution does allow wxEVT_UPDATE_UI handlers for the box itself
to work (provided the handler takes care to check for the event object
being the box itself, as otherwise it would still disable the child
checkbox when its wxEVT_UPDATE_UI bubbles up to the box).
2018-01-07 01:14:17 +01:00
Paul Cornett
572fe37898 Avoid calling default "key-press-event" handler
We have already done everything it does, and doing it again seems to
cause an infinite loop with WebKitGTK. See #17932
2018-01-06 11:07:11 -08:00
rmpowell77
af56ccd46f Use semicolons as statement separators in wxHTML code
This avoids (harmless in this, but not necessarily in the other, case)
clang warning: possible misuse of comma operator here [-Wcomma].

See https://github.com/wxWidgets/wxWidgets/pull/662
2018-01-06 17:37:20 +01:00