Some native controls don't take kindly to being set setStringValue: with
a value invalid for the control (such as empty string for
NSPathControl). Don't do this if the label is empty anyway to avoid
problems with wxNativeWindow when the underlying native control is like
that.
(This is backport of db9baf9 from master)
Undo the change introduced, probably accidentally, by r11369 (12 years ago)
and skip the default handling of all events except wxEVT_SIZE and wxEVT_PAINT,
which are special for the reasons explained in the comments in the code, if
the user code has already handled the event.
This allows to customize scrolling by selectively handling some scrolling
events only and generally makes sense.
Closes#15684.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75252 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
(cherry picked from commit de54520c95)
Outlined rectangles are one pixel larger with vector-based drawing,
adjust them to get consistent behavior.
Ellipses do not appear to need adjustment.
See #17091
(cherry picked from commit 4623c5ad9c)
Check for Windows 10 was implemented as check for version 6.4 but the final
version of Windows 10 actually returns 10.0.
(this is a backport of c87c432033)
Show just the current page in the printing progress messages if the last page
has its default "infinitely big" value.
Closes#16987.
(cherry picked from commit 1cd916fc0a)
Doing this resulted in an assert from wxBitmap ctor and was useless anyhow,
just skip the drawing code if the window is reduced to empty client area.
(cherry picked from commit bede8a3296)
They are relatively important, especially the origin-related ones as
SetUserScale() can (should?) be used instead of SetLogicalScale(), but
SetLogicalOrigin() can be more convenient than SetDeviceOrigin(), so provide
at least skeletal documentation for them.
(cherry picked from commit 394b04b7e4)
This seems to be unnecessary and generates GTK+ warnings as it results in
passing rectangle with negative (after accounting for padding/margins) size to
gtk_paint_box() in wxAuiGtkTabArt, as could be seen e.g. when closing
"wxTextCtrl 2" tab in the aui sample.
(cherry picked from commit 1f16829c01)
The code was always wrong as it added the control to a new sizer when it was
still element of an old one, but this went unnoticed until the changes of
efce9b2306 which now trigger an assert.
Fix this by deleting the old sizer, and thus breaking the association between
it and the controls inside it, before adding the controls to the new one.
Closes#17080.
(cherry picked from commit 0e5f3612df)
It doesn't result in the frame floating over its parent, this is what
wxFRAME_FLOAT_ON_PARENT style is for, it just means that the frame is
minimized/restored when its parent is.
(cherry picked from commit 6339837ffa)
Just refer to Move(), this is trivial but necessary as otherwise Doxygen
"helpfully" reuses the first comment in the section for the otherwise
undocumented SetPosition() which didn't make any sense at all.
(cherry picked from commit 949d2eeaa5)
It seems like it was never really needed as we always delete the archive
before creating it anyhow and there is no advantage in "updating" it if it
doesn't exist. Worse, with recent ar versions (like the one from binutils 2.25
in Debian Sid), using "u" results in a somewhat unclear warning
ar: `u' modifier ignored since `D' is the default (see `U')
so just get rid of it to avoid the warning.
(cherry picked from commit 004b5a4f49)
Apparently this still doesn't display any scrollbars in the window itself, so
from our point of view it is equivalent to GTK_POLICY_NEVER.
(cherry picked from commit 2509e7927a)
Don't mix statements and declarations, this is not allowed in C89.
Fixes compilation with MSVC <= 10 after 74da7cba07
See #17083.
(this is a backport of 9b029ea88a from master)
This is a modified version of the patch from Mozilla (see
https://hg.mozilla.org/releases/mozilla-esr31/rev/2f3e78643f5c) which was also
applied to Chromium. This version prefers to use the buffer of the correct
size instead of just returning an out-of-memory error if the size needed is
relatively (but not extraordinarily so, e.g. just slightly more than 64KB in
32 bit builds) big.
Unlike the similar (identical?) SetUserScale(), this function didn't call
RealizeScaleAndOrigin(), add it now for consistency.
(this is a backport of 75794137f605328e2d3e6a45106f30b8ac268cbb from master)
See #17053.
Don't apply Watcom workaround for empty vararg log functions to MinGW, it
doesn't seem to need it and using it actually breaks compilation of the code
in wxWidgets itself when wxLogSysError() is used with wxString argument.
Closes#17048.
Implement Freeze() by blocking the GtkWindow "expose-event"/"draw" signal
instead. Since the introduction of client-side windows in GTK+ 2.18,
gdk_window_freeze_updates() is unuseable because the impl_window (and thus the
update_freeze_count) for a given GdkWindow can change unpredictably. See #16795
This should prevent an assert failure which happens if we call Accept() on an
invalid server below and also confirm if the server creation really failed or
not.
Its value (0x80000000) is outside of the int type range on 32 bit platforms,
but we still want to allow using it as an initializer of int and/or long
variables for consistency with the other types, so cast it to int explicitly
to suppress -Wnarrowing warnings from recent g++ which were given when doing
this before.
Recent g++ versions give -Wnarrowing warning when a value outside of the type
range is used to initialize a variable of this type in { }. Avoid it in the
long long tests using explicit casts as we already cast between long long and
unsigned long long values here anyhow.
g++ 4.8.2, shipped with Ubuntu 14.04, generates incorrect code for checking
the loop termination condition, resulting in never ending loops in
HashMapTest().
Disable the optimizations for this function for 4.8.[012] as the bug seems to
be fixed in 4.8.4 and several similar (but not really identical) bug reports
in gcc bugzilla have been fixed in 4.8.3.
This should allow the unit tests on Linux buildbots, using 4.8.2, to run to
completion again.
Valgrind complains about reading beyond the end of buffer when using glibc
std::string for wxString implementation under amd64 Linux. Don't suppose that
the buffer has one extra null word at its end to avoid this.
Use wxUIntToPtr() to suppress the warning, we know that the cast here is safe
because Windows uses only pointers fitting in the UINT range for the menu (and
other) handles.
Set ms_isThemeEngineAvailable to -1, meaning that we need to reinitialize
themes, instead of false, meaning that themes are not available.
This fixes problems when the library is initialized, shut down and then
initialized again.
Closes#17023.
Don't ignore errors (this resulted in warnings in optimized builds because
variable "hr" containing the error code to was assigned but never used) and
don't leak memory in the (admittedly unlikely) case an error really occurs.
Also don't duplicate the code for creating a one element SAFEARRAY<VARIANT>,
extract it into a helper function.
Don't cast NMHDR::code field to int, this cast was added in the previous
millennium, probably to work around the wrong definition of NM_DBLCLK in some
ancient MinGW headers, but nowadays all MinGW distributions (tested with
MinGW 4.8.1, MinGW-64 4.9.1 and TDM-GCC 4.9.2) define it correctly and so
using this cast results in a warning -- just remove it to get rid of it.
Including standard math.h header with both -O2 and -std=c++NN options results
in compilation error due to a bug in the header, see MinGW bug report at
https://sourceforge.net/p/mingw/bugs/2250/
Work around this to allow the library to compile in release build with
-std=c++11. This is ugly but better than failing to compile at all.