These methods can be used to ensure that the exceptions thrown from event
handlers are safely rethrown from the code dispatching the events once the
control flow gets back there.
This allows to work around the problem with not being able to propagate
exceptions through non-C++ code and can be used, for example, to catch
exceptions thrown by the handlers invoked from inside wxYield() by a try/catch
block around wxYield() -- something that didn't work before, update the except
sample to show that it does work now.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77468 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Extract wxApp::OnExceptionInMainLoop() and OnUnhandledException() in a
separate Doxygen group as there will be more functions defined in it soon.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77467 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This demonstrates that under 64 bit Windows exceptions may not propagate
through the kernel code and throwing from inside wxYield() results in either
an immediate abort, even if the code calling wxYield() tries to handle the
exception, or, even more surprisingly, is just completely ignored.
See http://blog.paulbetts.org/index.php/2010/07/20/the-case-of-the-disappearing-onload-exception-user-mode-callback-exceptions-in-x64/
for more information.
Moreover, independently of Windows weirdness, throwing from wxYield() also
results in a difficult to debug crash when using wxGTK because C++ exceptions
can't propagate through C GTK+ code in this case.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77465 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Passing an invalid initial directory to wxDirDialog resulted in using the old
style Windows directory selector dialog instead of the new style (file dialog
like) one, which was unintentional, as incorrect initial directory shouldn't
prevent the dialog from being shown.
Fix this by handling ERROR_FILE_NOT_FOUND error specifically and still showing
the new dialog, just without the (non existent) initial directory value, in
this case.
Closes#16430.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77464 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
In addition to ignoring debug/release subdirectories, also ignore their
(possible) parent Win32/x64 directories, and for the same reason: this allows
the code using wxStandardPaths to work even when the program is ran from the
build directory.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77463 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This merges in the latest sources from GSoC 2014 wxQt project with just a few
minor corrections, mostly undoing wrong changes to common files in that branch
(results of a previous bad merge?) and getting rid of whitespace-only changes.
Also remove debug logging from wxGrid.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77455 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The logic for the first tab should really deal with the first visible tab as
the actual first tab might be hidden and in this case we shouldn't account for
it at all.
Closes#16432.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77093 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Override DoGetBestClientSize() instead of DoGetBestSize(), as we're really
computing just the size of our contents and like this we don't need to hard
code platform-dependent border sizes in this control itself.
Also use the client size in LayoutControls() for the same reason. This also
makes it unnecessary to pass it the width and height as it can find them on
its own. And x and y were never used in the first place, so remove them too.
Finally, center the bitmaps vertically.
Closes#16422.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77083 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This doesn't make much sense for an interface declaration anyhow and produces
a warning from g++ about assigning string literal to (non-const) BSTR pointer.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77076 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
If an unhandled exception occurs in an event handler called from Yield(),
don't exit the current event loop which can continue running after handling
this exception in the code calling Yield().
Closes#16419.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77075 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Events generated programmatically may have the same timestamp as the previous
event, which caused them to be ignored on the assumption that they were the same
event being sent to a parent window. Fix this by detecting when a new event could
be generated by the event loop.
Closes#15802
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77074 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This ended up being broken due to an interplay between different unrelated
changes (at least r15120 and r41134) which were both correct, but didn't work
well together and resulted in not only preventing IsDialogMessage() from
handling ESC, but also our own accelerator tables.
Fix this by doing the check for IsDialogMessage() brokenness in
MSWProcessMessage() itself, just before calling it, instead of doing it in
MSWShouldPreProcessMessage() which is (and must be) called before
MSWTranslateMessage() which checks for accelerators using ESC.
Closes#3813.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77071 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This partially reverts the changes of r77029 and r77039: now functions such as
Set/GetLayout(), AlphaBlend() and GradientFill() are still called (almost)
directly when using MSVC but pass by dynamic loading with the other compilers,
which don't have #pragma comment(lib) and, in MinGW case, also lack some of
these functions in their libraries even if we do link with them.
Closes#16411.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77068 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxCommandEvent::GetString() could return empty string for the
programmatically-generated wxEVT_TEXT events from a wxComboBox.
Fix this by extending the on-demand string retrieval in wxCommandEvent to
wxComboBox as well (it was done only for wxTextCtrl).
Also add a unit test checking that the string has the expected value in the
events sent by all wxTextEntry-derived controls.
Closes#3901.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77057 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use the correct $WXWIN/include/msvc path instead of the non-existing
$WXWIN/msvc.
Also mention that $WXWIN should actually be $(WXWIN) for MSVC.
Closes#16410.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77051 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The latest w32api 4.0.3, used by MinGW project, still didn't manage to apply a
one line fix to define TV_DISPINFO correctly, so tweak our sources to avoid
using it.
See #15537.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77050 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Implicitly link msimg32.lib in when using MSVC and add it to MinGW (and
Borland) makefiles.
This should have been part of r77029.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77039 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This is not necessary as wxDC already inherits RTL from the window itself and,
in fact, breaks the display when using RTL.
Closes#16250.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77038 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775