Commit Graph

58632 Commits

Author SHA1 Message Date
Paul Cornett
51e766093e IsShown() now returns false for non-selected wxNotebook pages, see #4343 2015-08-15 11:09:03 -07:00
Václav Slavík
05862e608d Only set native label if nonempty in wxWindowMac::SetPeer()
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)
2015-08-15 18:56:53 +02:00
Vadim Zeitlin
f8249a7275 Don't process events handled in user code in generic scrolling code.
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)
2015-08-10 09:22:09 -07:00
Paul Cornett
f5dccf312d enable wxGraphicsContext offset for wxMemoryDC, see #17091
(cherry picked from commit 941834fd0e)
2015-08-10 09:09:54 -07:00
Paul Cornett
b8abf338c8 Make rectangle size the same as is drawn by raster-based wxDCs
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)
2015-08-09 22:08:20 -07:00
Paul Cornett
20448fbcd3 Fix wxListBox mouse wheel scrolling with GTK3
Allow default handling for GDK_SCROLL_SMOOTH when we don't handle it. Closes #17097

(cherry picked from commit bf6f3e35e8)
2015-08-09 21:05:10 -07:00
Tobias Taschner
3e7579d733 Fix wxGetWinVersion() for Windows 10
Check for Windows 10 was implemented as check for version 6.4 but the final version of Windows 10 actually returns 10.0.
2015-08-05 20:37:49 +02:00
Tobias Taschner
f7b8fdd275 Fix wxGetOsDescription() for Windows 10.
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)
2015-08-05 20:30:45 +02:00
Fulvio Senore
097466149a Don't show the last page number when printing if it wasn't defined.
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)
2015-08-04 20:46:41 -07:00
Olly Betts
1033ba59d2 Fix typo in GetOperatingSystemDescription() docs.
Fix the case of wxGetOSDescription() in the link.

Closes #17003.

(cherry picked from commit 716656ae47)
2015-08-04 20:40:49 -07:00
Catalin
2bf36da6ba Improved wxStandardPaths docs.
(cherry picked from commit e606d83e88)
2015-08-04 20:38:33 -07:00
Catalin
bed07cc212 Correctly map MAC_CHARSET to wxFONTENCODING_MACROMAN in wxMSW.
Recognize MAC_CHARSET when mapping MSW charsets to wx font encodings.

(cherry picked from commit 6e72126894)
2015-08-04 20:33:30 -07:00
Vadim Zeitlin
7bc0fe7e58 Ensure we never create empty bitmap in wxHtmlWindow::OnPaint().
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)
2015-08-04 20:22:02 -07:00
Simon Richter
0ebeb6fa73 Remove duplicate code from wxGTK wxDataViewCtrl.
Code checking got wxDATAVIEW_CELL_INSENSITIVE was repeated twice, leave just
one copy of it.

Closes #17047.

(cherry picked from commit 711827a6ee)
2015-08-04 20:21:07 -07:00
Vadim Zeitlin
a5cf08fcbd Correct wxAuiNotebook::SetUniformBitmapSize() documentation.
This function used the same documentation as Split() for some reason, document
it correctly now.

Closes #17049.

(cherry picked from commit b7f3d0d752)
2015-08-04 20:20:21 -07:00
Vadim Zeitlin
6de38c1f0e Document wxDC::{Set,Get}Logical{Scale,Origin}() functions.
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)
2015-08-04 20:19:11 -07:00
Vadim Zeitlin
17e6fa15c5 Skip drawing empty AUI panes.
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)
2015-08-04 20:15:07 -07:00
Vadim Zeitlin
b0c688d810 Fix assert when adding controls to wxAuiToolBar.
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)
2015-08-04 20:14:42 -07:00
Vadim Zeitlin
a45354d3ed Correct the documentation of wxFrame ctor parent argument.
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)
2015-08-04 20:12:57 -07:00
Vadim Zeitlin
417d242e77 Provide correct documentation for wxWindow::SetPosition().
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)
2015-08-04 20:11:55 -07:00
Vadim Zeitlin
90cec63a53 Don't use "u" option with ar(1).
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)
2015-08-04 20:11:12 -07:00
Vadim Zeitlin
adf521dea2 Handle GTK_POLICY_EXTERNAL new in GTK+ 3.16 too.
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)
2015-08-04 20:05:04 -07:00
Paul Cornett
d6403135e3 reset clipping region in DestroyClippingRegion(), see #17086 2015-07-30 09:58:01 -07:00
Vadim Zeitlin
82db53ca1a Expat compilation fix for pre-C99 compilers.
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)
2015-07-30 00:59:17 +02:00
Paul Cornett
35acf46cc4 use delete for memory allocated with new 2015-07-27 10:32:50 -07:00
Vadim Zeitlin
74da7cba07 Fix arithmetic overflow in the bundled Expat library.
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.
2015-07-27 00:45:26 +02:00
Paul Cornett
8d2772eaf2 avoid shadowed variable warnings with VS2015 2015-07-24 20:55:10 -07:00
Vadim Zeitlin
21dc1a1d4f Blind fix for wxTextDataObject trailing NUL under OS X.
Use the length provided to SetData() instead of assuming it is NUL-terminated.

Closes #9522.

(this is a backport of 20c130a578 from master)
2015-07-17 14:35:26 +02:00
Paul Cornett
312ae4c92c Fix wxSpinButton best size for GTK+ 3.12 and later, see #17051 2015-07-16 07:13:27 -07:00
Vadim Zeitlin
e315ef02c8 Remove wxOVERRIDE not available in 3.0 branch.
Fixes compilation after backporting wxHTTP-in-worker-thread fixes from master.

See #17031.
2015-07-10 13:46:58 +02:00
Vadim Zeitlin
6e5b6521a5 Update HDC in wxDC::SetLogicalScale() in wxMSW.
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.
2015-07-09 21:01:30 +02:00
Vadim Zeitlin
e62173c479 Fix using wxHTTP and wxFTP from worker thread in Unix ports.
This backports e18c8fd29a,
d421373c2e and
6c43aa90b6 from master to avoid crashes when
using wxHTTP or wxFTP from threads other than main.

See #17031.
2015-07-09 20:59:38 +02:00
Vadim Zeitlin
b08ca17749 Fix MinGW build with wxUSE_LOG==0.
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.
2015-07-07 00:00:49 +02:00
Leland Lucius
0797a6f875 Fix accessibility support in wxMSW.
Return the correct result from handing WM_GETOBJECT message.

Closes #17058.

(this is a backport of 6a435345f5 from master)
2015-07-06 23:56:48 +02:00
Paul Cornett
4db8d55913 Avoid using gdk_window_freeze_updates() to implement Freeze()
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
2015-06-24 08:42:49 -07:00
Vadim Zeitlin
918d46e2cc Add a check for wxSocketServer creation to the unit tests.
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.
2015-06-24 01:24:47 +02:00
Vadim Zeitlin
53745b5cce Brazilian Portuguese translations update from Philippe. 2015-06-23 18:11:24 +02:00
Vadim Zeitlin
432ff59772 Make wxVSCROLL explicitly of int type.
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.
2015-06-21 16:00:57 +02:00
Vadim Zeitlin
01f62c0295 Avoid warnings about narrowing casts in the long long tests.
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.
2015-06-21 16:00:55 +02:00
Vadim Zeitlin
ec434c918a Avoid g++ 4.8.2 bug that resulted in infinite loops in the test suite.
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.
2015-06-21 02:44:56 +02:00
Vadim Zeitlin
ce80118b9e Fix reading beyond end of buffer in UTF-16 decoding code.
Verify that incrementing the input pointer doesn't take us outside the buffer.
Still accept a single trailing NUL as the string terminator.
2015-06-21 02:44:37 +02:00
Vadim Zeitlin
0e0809b5f5 Avoid reading one char beyond the buffer end in UnicodeTestCase.
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.
2015-06-21 02:44:33 +02:00
Vadim Zeitlin
8b4dbf8ebf Fix mismatched new[]/delete in a test case.
Use wxDELETEA() as the comment said we did -- except that we didn't.
2015-06-19 19:59:51 +02:00
Vadim Zeitlin
77fb8cb8c1 Fix TDM-GCC warning about int to pointer cast.
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.
2015-06-14 20:37:33 +02:00
Vadim Zeitlin
2ea1d3fc19 Correctly deinitialize wxUxThemeEngine in wxMSW.
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.
2015-06-14 19:38:17 +02:00
Vadim Zeitlin
90a523da71 Add better error checking and simplify wxWebViewIE::DoSetPage().
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.
2015-06-14 19:24:13 +02:00
Vadim Zeitlin
49fb8c25f5 Check that __cplusplus is defined before checking its value.
Avoids harmless in this case warning about __cplusplus being undefined in
comparison.
2015-06-14 15:55:08 +02:00
Vadim Zeitlin
5ac3c9ac7a Provide empty wxDECL_FOR_STRICT_MINGW32() in non-MinGW case.
Fix the build after aa30a2f97a which forgot to
define wxDECL_FOR_STRICT_MINGW32() macro when MinGW was not used at all.
2015-06-14 15:45:27 +02:00
Vadim Zeitlin
0c14584842 Fix harmless signed/unsigned comparison warning in wxMSW wxTreeCtrl.
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.
2015-06-14 15:12:19 +02:00
Vadim Zeitlin
1db615c190 Work around a bug in MinGW math.h.
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.
2015-06-14 15:06:19 +02:00