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.
Consistently handle DST start time in wxDateTime::Set().
Always move the dates invalid due to DST (i.e. falling into the "missing" hour
on the DST start date) forward, as GNU libc does, even when using a different
CRT implementation, such as MSVC one which moves the invalid dates backwards.
This seems more expected and also fixes an especially bad problem which
happened due to moving the date backwards in Brazilian time zone where DST
starts at midnight as doing this changed the day and totally broke ParseDate()
assumption that setting wxDateTime to 00:00:00 at the given date really did
set it to this date.
Add a convenience ShowWindowModalThenDo() variant of ShowWindowModal()
that takes a functor argument and calls it when the dialog is closed.
This is, of course, particularly useful when the argument is a C++11
lambda, especially when having more than one window-modal dialog invoked
from the same window, which can get messy quickly with all the
wxEVT_WINDOW_MODAL_DIALOG_CLOSED handlers.
Václav Slavík [Fri, 6 Sep 2013 17:09:05 +0000 (17:09 +0000)]
Add wxCondition::Wait() overload that also tests the condition.
Add Wait() overload that takes a functor argument and doesn't return
until the condition is signaled _and_ the predicate returns true. This
is useful for dealing with spurious wakeups and is modeled after C++11
std::condition_variable's corresponding method.
Fix bug with not selecting wxAuiNotebook page when its child was focused.
The code in OnChildFocusNotebook() handler only worked correctly if the page
itself was focused but not if the focus was given to one of its children --
which should still make the page itself current.
Revert wxDO_LOG_IF_ENABLED() change for MSVC6 in r74735.
The old solution worked fine for that compiler and the new one fails when
wxLogXXX() is used inside a switch statement to the wrong rules used by VC6
for the scope of the variables defined inside the for loop.
Simply revert back to using the old version for it, this will be easy to
re-revert after 3.0 by simply removing the check for it.
Restore correct wx-config creation and work around MinGW lack of symlinks.
This undoes the changes of r72205 and r72249 (see #14517) as using relative
paths for wx-config symlink didn't work correctly if non-default values for
$bindir and/or $libdir were used (i.e. if they were not siblings).
Instead, fix the original problem of lack of symlinks when using MinGW
directly: just use "cp -p" if "ln -s" fails. This should work everywhere and
do the right thing.
Correct erasing of background behind controls in a toolbar in wxMSW.
We need to handle WM_PRINTCLIENT in wxToolBar itself as the default handler
for this message forwards to WM_ERASEBKGND of the parent window and our
handler for that message only erases the client part of the window, in wx
sense, i.e. including a relatively big vertical offset accounting for the
toolbar. This means that when we get WM_PRINTCLIENT from the embedded control
drawing code, we don't erase anything at all as the control rectangle height
is smaller than the offset.
This fix is not perfect as ideally the existing MSWGetBgBrushForChild() should
be taken into account automatically by the default MSWPrintChild()
implementation but at least it fixes the ugly visual artefacts.
Add a test for a tooltip for a control inside a static box.
Also create the controls as children of the static box, not its siblings, to
make the tooltip work under wxGTK and because this is how we recommend doing
things now.
Add wxDEPRECATED_MSG() and use it in a couple of places.
This macro should be used instead of wxDEPRECATED() for the new deprecations
as it allows to give a helpful explanatory message (if supported by the
compiler) and also is simpler to use as it doesn't require wrapping the entire
declaration in it but can be simply used before it.
Also add wxDEPRECATED() support for clang as a side effect.
Remove superfluous mouse capturing in wxGrid row/column labels windows.
This code recaptured the mouse in the window which had already had it, thus
triggering the (recently added, see r74677) asserts in CaptureMouse(). It also
didn't preserve the invariant of m_winCapture always having the capture. And
it was apparently completely unnecessary too.
So simply remove it to fix the asserts while drag-resizing wxGrid rows/columns.
The code there was pretty wild, making clearly wrong assumptions (column size
doesn't, and AFAICS never did, include 20 pixel margin) and also was clearly
uncertain about what it was doing by trying to limit the number of iterations
to some arbitrary cutoff when it is pretty clear that the loop increasing the
width and decreasing the height on each iteration will reach the condition of
"width >= height*1.68" sooner or later.
Paul Cornett [Tue, 3 Sep 2013 05:37:30 +0000 (05:37 +0000)]
Fix referencing of cairo_t returned from wxDCImpl::GetCairoContext().
It was assumed that all callers were going to unref the cairo_t, but that is not
true, so callers that are going to unref it should ref it themselves.
See #15455
Vadim Zeitlin [Sat, 31 Aug 2013 17:41:16 +0000 (17:41 +0000)]
Rewrite wxLogXXX() macros to avoid "ambiguous else" warnings.
Use a dummy for loop instead of an if statement to avoid all problems with the
dangling else clauses: both the need for an artificially inversed "if" to make
the code like
if ( something )
wxLogError("...");
else
something-else;
to work as expected and to avoid warnings given by some versions of g++ and
clang for the code above advising to add explicit braces.
Vadim Zeitlin [Sat, 31 Aug 2013 17:41:13 +0000 (17:41 +0000)]
Removed a method using wxColour from non-GUI benchmark code.
No idea how could this work before but the presence of this code in the
non-GUI benchmark project prevented it from building. As it's not used anyhow,
just remove it.
Paul Cornett [Sat, 31 Aug 2013 03:25:12 +0000 (03:25 +0000)]
Don't update position of widgets in a wxPizza from size_allocate handler.
The values in m_{x,y} are not the same as client coordinates if the wxPizza is scrolled.
Closes #15444
Vadim Zeitlin [Fri, 30 Aug 2013 23:32:42 +0000 (23:32 +0000)]
Fix infinite loop in wxMSW with wxStaticBox inside non-wxTAB_TRAVERSAL parent.
We didn't ensure that the parent of a (native) control with WS_EX_CONTROLPARENT
had this style as well, unlike for our own windows. Fix this now to make
certain that we never call ::IsDialogMessage() on a window whose parent
doesn't have WS_EX_CONTROLPARENT as it simply hangs in this case, entering an
infinite loop searching for the default button.
Also try to reduce the possibility of such bugs in the future by checking for
WS_EX_CONTROLPARENT and not wxTAB_TRAVERSAL before calling ::IsDialogMessage()
even if this doesn't totally prevent them (it wasn't sufficient to fix even
this particular bug).
Václav Slavík [Fri, 30 Aug 2013 13:14:50 +0000 (13:14 +0000)]
Loosen the assert in IsScrollIncrement().
wxWindowGTK::GTKGetScrollEventType() tries to map GtkAdjustment's delta
to either step or page increment by comparing it with the respective
GtkAdjustment steps. Both of them can be 0, but this code is not
expected to be called in such case.
Yet, in practice, it occasionally is, see e.g.
http://devel.aegisub.org/ticket/979GTKGetScrollEventType (wxWebView is
prone to it as well).
Check for >= 0 instead, to be more robust when faced with unexpected
input from GTK+.
Vadim Zeitlin [Thu, 29 Aug 2013 12:33:44 +0000 (12:33 +0000)]
Don't define __STRICT_ANSI__, we should build both with and without it.
For some reason, wxDialUpManager code defined __STRICT_ANSI__ itself, don't do
it as __STRICT_ANSI__ can be predefined by the compiler resulting in the
redefinition warnings and, in any case, our code should build both with and
without it.
Vadim Zeitlin [Tue, 27 Aug 2013 22:49:53 +0000 (22:49 +0000)]
Don't enable dialog navigation inside wxFrame by default.
This was done, apparently accidentally, by r68366 and resulted in cursor arrow
keys not being sent by default to the wxFrame children under MSW any more as
they were used for dialog navigation instead.
So don't derive wxTopLevelWindow from wxNavigationEnabled<> any more and only
derive from it at wxDialog level.
Vadim Zeitlin [Tue, 27 Aug 2013 22:49:44 +0000 (22:49 +0000)]
Handle custom configurations in MSVC-specific setup.h.
Account for wxCFG when building the paths used for MSVC autolinking. This
variable should be defined to the same value as CFG during (command line)
build.
Vadim Zeitlin [Tue, 27 Aug 2013 22:49:23 +0000 (22:49 +0000)]
Don't use any icon for items inserted without one in wxMSW wxListCtrl.
Previously we erroneously used the first icon in the image list for them
instead. This was inconsistent with wxGTK and didn't make much sense, even if
it is the default behaviour of the native control, so don't do this any more
and explicitly specify I_IMAGENONE for the icon if it wasn't given.
Vadim Zeitlin [Sat, 24 Aug 2013 14:33:22 +0000 (14:33 +0000)]
Move code removing "-psn_xxx" command line arguments to common code.
We need to do this when using any port under OS X, not just wxOSX, e.g. the
-psn_xxx arguments passed by the Finder when launching the application, must
also be ignored when using wxGTK.
Vadim Zeitlin [Fri, 23 Aug 2013 16:37:09 +0000 (16:37 +0000)]
Fix wxHtmlHelpData::SetTempDir() to behave correctly without trailing slash.
The path passed to this function is always a directory, so use
wxFileName::AssignDir() instead of the default constructor of wxFileName which
considers the name to be a name of a file unless it ends with a path separator.