Václav Slavík [Tue, 1 Oct 2013 12:19:56 +0000 (12:19 +0000)]
Destroy the wxDialog::ShowWindowModalThenDo() functor a.s.a.p.
Previously, the functor was kept in a helper event handler that was bound to
wxEVT_WINDOW_MODAL_DIALOG_CLOSED and only marked as already called, but never
unbound. Consequently, the functor object remained allocated for as long as the
event table existed and was only freed with the dialog instance.
Change the logic to destroy the functor object as soon as it was called and is
no longer needed for anything.
This is particularly important when used with C++11 lambdas that capture the
dialog in a wxWindowPtr pointer, because the pointer would be retained forever
otherwise.
Fix crash when auto-sizing a wxDataViewCtrl column.
The code was confused about the difference between the model and view columns
indices and incorrectly used the former as the latter, which could result in
an out of bound array access.
Define __MINGW64_TOOLCHAIN__ and __MINGW32_TOOLCHAIN__ symbols.
__MINGW64_TOOLCHAIN__ macro is more readable and shorter than the standard
predefined __MINGW64_VERSION_MAJOR and __MINGW32_TOOLCHAIN__ is defined for
the symmetry and also because it will make many tests simpler as we often
need to test not so much for MinGW-w64 for its own sake but rather to disable
the workarounds for MinGW32 when using it.
Fix problem with COMDLG_FILTERSPEC declaration with MinGW-w64 4.8.
Forward declaring as a struct a symbol previously defined as a typedef results
in an error when using MinGW-w64 4.8.1, so forward declare the struct itself
instead.
Use GetParamAsXXX() accessors instead as they combine the calls to HasParam()
and GetParam() and make the code shorter and avoid the duplication of the tag
name.
wxRTC: fixed guidelines overwriting adjacent cell borders; corrected capitalisation in command labels; now sends text update event when an object is changed.
Václav Slavík [Sat, 21 Sep 2013 10:11:08 +0000 (10:11 +0000)]
Make public headers compatible with Objective-C++ with ARC.
OSXGetViewOrWindow() virtual methods were defined in headers and were casting
NSView*/NSWindow* to void*, which the compiler complains about with ARC
enabled. Rather than writing conditional code in the header, move the
implementations into .cpp files. They were virtual anyway, so this is no less
efficient, and doesn't leave any problematic code in public headers.
Václav Slavík [Sat, 21 Sep 2013 09:28:47 +0000 (09:28 +0000)]
Revert "using #ifdef wxABORT_ON_CONFIG_ERROR not just #if as elsewhere"
This reverts commit r74656, because it breaks initialization order by
calling OnInit() too late. See
https://groups.google.com/d/topic/wx-dev/H5vgc2VO7K4/discussion
Use std::isfinite() for wxFinite() for C++11 compilers.
This should fix compilation with MinGW 4.8.1 cross-compiler in C++11 mode as
it doesn't seem to provide finite() any more then.
Also, only defined wxFinite() and wxIsNaN() for C++, not C. This makes the
checks for __cplusplus >= 201103 simpler and is consistent with how
wxIsSameDouble() and wxRound() were already only defined for C++ (this is also
the source of most of the changes in this diff, viewing it ignoring whitespace
will show the only real changes).
Václav Slavík [Wed, 18 Sep 2013 16:03:31 +0000 (16:03 +0000)]
Add wxTranslations::GetTranslatedString().
Replace GetString(), which always returns something (possibly the
original string) with GetTranslatedString() that returns either a
pointer to translated string or NULL.
This simplifies the code a bit, all handling of missing translations is
now done in wxGetTranslation().
Václav Slavík [Wed, 18 Sep 2013 16:03:20 +0000 (16:03 +0000)]
Make _() and friends safe to call from any thread.
The GetUntranslatedString() hack keeps a global copy of all strings, so
that it can return a const reference as wxGetTranslation() return value.
A global wxHashSet instance shared by all threads won't do, even guarded
with a critical section, because it may internally copy values on any
insert and thus invalidate pointers that may still be used on another
thread.
Add wxDataViewRendererBase::GetEffectiveAlignment() and use it.
This helper method falls back on the alignment of the column if the renderer
alignment is not specified. This is almost always what should be used instead
of GetAlignment() to determine the alignment that really should be used in the
drawing code.
In particular, using GetEffectiveAlignment() in wxDataViewCustomRenderer fixes
the problem with bitmap columns ignoring column alignment for their bitmaps.
Show full screen windows with WS_POPUP style in wxMSW.
This doesn't make any difference for most windows but fixes a problem with
wxGLCanvas windows using stereo support of Nvidia cards and generally it does
make sense to use WS_POPUP with full screen windows as they are definitely not
overlapped, so just use this style unconditionally.
Propagate the event handling fixes to wxVarScrollHelperBase.
Merge the fixes to wxScrollHelperBase::ProcessEvent() of r64358, r64370,
r64464, r72939 and possibly a few more in wxVarScrollHelperBase to fix its
behaviour too, as it wasn't generating the correct events any longer.
Unfortunately the fix right now is to physically copy the code from one class
to the other. This should be avoided, of course, and a more in depth
refactoring should be done to move the code common to both classes into
wxAnyScrollHelperBase after 3.0 release. But for now continuing to duplicate
code is better than not having a working wxVarScrollHelperBase.
Add wxAnyScrollHelperBase to reduce code duplication in wxVarScrollHelperBase.
This is just a small refactoring to move some trivially common parts of
wxScrollHelperBase and wxVarScrollHelperBase in a new common base class.
This will make it possible to apply other corrections to wxVarScrollHelperBase
without having to physically duplicate the code from wxScrollHelperBase in it.
Fix flickering of wxStaticBox background in wxMSW.
First of all, don't erase background in WM_ERASEBKGND at all if we erase it
anyhow in WM_PAINT, this is totally useless and is what wxBG_STYLE_PAINT is for.
Second, clip out not only the siblings of the static box but also its children
when erasing the background to avoid painting over the controls created as the
box children, which is the preferred way to create them now.
Don't crash when laying out wxGridBagSizer with only hidden elements.
wxGridBagSizer lay out algorithm needs at least a single row and a single
column to work, so simply don't run it at all if there is nothing to lay out.
Mention that wxSizer::Clear() always deletes child sizers.
The existence of "delete_windows" argument could mislead people into thinking
that sizers were not deleted neither when it had false value, see #15475.
Improve composite flags handling in the property grid wxFlagsProperty.
Don't consider that a flag is on just because one of its bits is enabled in
the current flags, for the composite flags (e.g. something like "BOTH = ONE |
TWO") all the bits composing the flag must be on for it to be enabled.
Steve Lamerton [Fri, 13 Sep 2013 12:55:08 +0000 (12:55 +0000)]
Handle WebKitWebView create-web-view.
In some cases a new window is signalled using create-web-view rather than new-window-policy-decision-requested and so we need to handle it to emit the correct new window events.
Handle non-ASCII output from lsb_release in wxGetLinuxDistributionInfo().
Assume that lsb_release always output UTF-8 text as this seems to be the case
right now for the only (common) Linux distribution which uses anything but
ASCII for its code name (Fedora 19 "Schrödinger's Cat").
Václav Slavík [Wed, 11 Sep 2013 15:20:21 +0000 (15:20 +0000)]
Don't lie about wxImageList in XRC format spec.
The documentation for setting image lists on controls was a complete
fabrication. It pretended that image lists were created as child
<object>s, while in reality they are properties just as e.g. fonts are.
Fix this and also better document the related 'image' property.
Václav Slavík [Wed, 11 Sep 2013 15:20:13 +0000 (15:20 +0000)]
Better name for wxXmlResource::GetDirection() argument.
'dir' is not very descriptive (of course it's a direction!), it's better
to include 'default' in the name to indicate this is the default value
to use in absence of a specific one.