Commit Graph

67865 Commits

Author SHA1 Message Date
Maarten Bent
bfe737e7e7 Fix build with wxUSE_FILE disabled 2019-11-27 21:25:14 +01:00
Maarten Bent
e80be3e3cb Fix unreferenced function warning with wxUSE_DRAG_AND_DROP disabled 2019-11-27 21:25:14 +01:00
Maarten Bent
d068bcfb57 Fix unreferenced parameter warning with wxUSE_ACCEL disabled 2019-11-27 21:25:13 +01:00
Maarten Bent
3d1a8ef54e Fix 'switch label contains default but no case' warning 2019-11-27 21:25:13 +01:00
Maarten Bent
0c212421f5 Fix building wxDebugReport without wxUSE_OWNER_DRAWN
replace wxCheckListBox with wxListBox.
2019-11-27 21:24:33 +01:00
Maarten Bent
5fefe1df11 wxUSE_ACCESSIBILITY requires wxUSE_OLE 2019-11-27 21:24:33 +01:00
Maarten Bent
3d9ee4852a CMake: fix build with wxUSE_OLE disabled
wxDirDialog falls back to using wxGenericDirDialog, add this file to the
sources.
2019-11-27 21:24:33 +01:00
Maarten Bent
b42de093f6 CMake: disable wxUSE_MIMETYPE when wxUSE_TEXTFILE is disabled 2019-11-27 21:24:32 +01:00
Maarten Bent
51fc85f16a CMake: disable options when ole or ActiveX is not available 2019-11-27 21:24:32 +01:00
Vadim Zeitlin
5ad2470504 Avoid disabling -Wcast-function-type when not using gcc 8
The changes of 173f035bc2 resulted in

unknown warning group '-Wcast-function-type', ignored [-Wunknown-warning-option]

diagnostics from clang (even clang-10) and, presumably, also from
versions of gcc earlier than 8, which added this option, so use the
special wxGCC_WARNING_SUPPRESS_CAST_FUNCTION_TYPE() macro added in
ed01fede2e just for this instead.

No real changes.
2019-11-27 17:39:21 +01:00
Paul Cornett
ae7fcc440c Use C++11 default copy ctor for wxUniCharRef
It's a little simpler, and still suppresses -Wdeprecated-copy warnings
2019-11-25 21:27:09 -08:00
Paul Cornett
4990515aba Avoid clang-cl -Wnon-virtual-dtor warning
Extend the existing workaround to all compilers, not just GCC
2019-11-25 21:16:00 -08:00
Paul Cornett
ef99c2a6db Avoid warning from clang-cl about unrecognized pragma 2019-11-25 21:05:35 -08:00
Paul Cornett
d3ea00b40f Remove an extraneous semicolon 2019-11-25 20:59:21 -08:00
Paul Cornett
173f035bc2 Suppress a GCC -Wcast-function-type warning
We're setting the same event handler GTK uses internally, so the warning isn't helpful
2019-11-25 20:58:16 -08:00
Paul Cornett
d85794e87f Remove some unnecessary GTK preprocessor version checks
The contained code no longer uses anything version-specific
2019-11-25 20:54:51 -08:00
Paul Cornett
0fab5eb071 Allow scrollwheel events when mouse is captured with GTK3, see #18593 2019-11-25 20:52:12 -08:00
Paul Cornett
abaccbc2e2 Fixes for checkbox rendering with GTK3
Size should include border and padding. Margin values seem to be for a checkbox with text
label, so don't include margin. Check mark should be drawn inside border and padding.
2019-11-24 23:31:09 -08:00
Artur Wieczorek
7b86958b25 Fix wxColour::GetAsString called for non-solid colour
Don't return RGB values if colour is not solid
and hence cannot be represented with these values.
Non-solid colour should be reported as an unknown
RGB value, e.g. '??????'.

Closes #18596.
2019-11-24 19:49:59 +01:00
Paul Cornett
fee30940b6 Take wxDC transformations into account when resetting clipping with GTK3
The paint update region is in device coordinates, it needs to be converted to
current logical coordinates to apply correctly. See #18584, #18560
2019-11-23 08:41:31 -08:00
Artur Wieczorek
e763ae96ac Fix wxSystemAppearance::GetName()
'NSApp.effectiveAppearance' is available for macOS
10.14+ not 10.9.

Closes #18595.
2019-11-22 18:41:43 +01:00
Maarten Bent
84edda2ba0 Fix wxSpinCtrl arrow position in RTL layout and High DPI
Just use hardcoded 2px overlap between the text control and the spin
buttons, as it doesn't seem to depend on the DPI and works in both LTR
and RTL modes, unlike the existing code, which claimed to work but
actually didn't.

Closes https://github.com/wxWidgets/wxWidgets/pull/1660
2019-11-22 15:23:07 +01:00
Vadim Zeitlin
a77b8f85bf Merge branch 'display-unique-modes' of https://github.com/MaartenBent/wxWidgets
Return unique modes from wxDisplay::GetModes() and minor improvements to
the display sample.

See https://github.com/wxWidgets/wxWidgets/pull/1659
2019-11-22 15:22:22 +01:00
Vadim Zeitlin
d51a9f9686 Use "wxWidgets application" in the manifests descriptions
We don't use "wxWindows" since many years.
2019-11-22 15:21:15 +01:00
GH Cao
c0c2260944 Add MSW manifests for ARM and ARM64 platforms
Closes https://github.com/wxWidgets/wxWidgets/pull/1657
2019-11-22 15:17:40 +01:00
Vadim Zeitlin
2bc6e50ede Wrap variable initializations after '=' consistently
Replace a few occurrences of

        type var
            = value;

with

        type var =
            value;

which is used much more widely in wx sources for consistency.

Also get rid of a couple of such lines, when it could be done easily.

No real changes.
2019-11-22 00:53:45 +01:00
Maarten Bent
136a43f033 Fix building display sample without wxUSE_DISPLAY 2019-11-21 23:43:04 +01:00
Maarten Bent
c4e54c78fd Select active mode in display sample
Update sample to use SizerFlags.
Set a minimum size to the dialog.
2019-11-21 23:43:02 +01:00
Maarten Bent
44cd0409cd Return unique modes from wxDisplay::GetModes 2019-11-21 23:18:12 +01:00
Vadim Zeitlin
73f0c9dff8 Fix crash with blocking accepting sockets in threads under Unix
Sockets returned by wxSocket::Accept() are non-blocking by default and
the only way to use them safely in worker threads is by switching them
to the blocking mode by calling SetFlags(wxSOCKET_BLOCK).

However this didn't work correctly since at least 2.8 days, as turning
wxSOCKET_BLOCK on didn't unregister the socket from the event loop, with
which it had been registered on creation. Fix this by doing this now,
which ensures that the main thread doesn't get any notifications about
the socket if it's used, in a blocking way, in a worker thread.

Note that making the new socket blocking after accpeting is still pretty
inefficient and pre-creating the socket as blocking and using
AcceptWith() is still preferable, but at least it does work now.

Closes #12886.
2019-11-20 20:21:25 +01:00
Vadim Zeitlin
51ea713826 Extend and rename wxSocketImpl::UnblockAndRegisterWithEventLoop()
In addition to unblocking and registering the socket, also support using
this function to make the socket blocking and unregistering it from the
event loop, if its flags include wxSOCKET_BLOCK.

This was already half-done by wxMSW, which took wxSOCKET_BLOCK presence
into account in its implementation, but not by the Unix implementation.
Now do it under all platforms, as this will be useful for switching a
previously non-blocking socket to blocking mode.

Finally, rename the function to better reflect what it really does.

See #12886.
2019-11-20 18:59:51 +01:00
Vadim Zeitlin
e0102c2396 Allow disabling events for blocking sockets in Unix version
It should still be possible to use DoEnableEvents() to disable events
for blocking sockets and this can be useful if a previously non-blocking
socket became blocking due to a SetFlags(wxSOCKET_BLOCK) call, so adjust
the fix of e18c8fd29a (see #17031) to
avoid calling EnableEvents() for blocking sockets instead of ignoring
them in DoEnableEvents() itself.

Also add an assert checking that we never try enabling events for
blocking sockets as this still doesn't make sense and so shouldn't
happen.

No real changes yet, but this is necessary for the upcoming commits.

See #12886.
2019-11-20 18:47:09 +01:00
Stefan Csomor
59d1cb8756 improving autorelease memory handling
life sample was using up memory when running in a tight loop, because the normal event autorelease pool was never reached
2019-11-20 16:23:52 +01:00
Jouk
db2e571c1b Add samples/event/chessboard.cpp to be compiled into the sample on OpenVMS 2019-11-19 08:33:38 +01:00
Jouk
c7be8c9798 merge changes recently made to setup.h.in into setup.h_vms 2019-11-19 08:31:09 +01:00
Vadim Zeitlin
5cf9c735cb Handle taskbar updates not removing notification icons from it
Fix bug with not being able to update wxTaskBarIcon under MSW after a
DPI scale change or [dis]connection of another monitor using different
DPI: this resulted in "TaskbarCreated" message being sent by the system,
which we handled by trying to create the taskbar icon again. However in
this case, recreating it failed, presumably because it still existed, as
modifying the existing icon still worked.

Change the handle of "TaskbarCreated" to try both adding and updating
the icon, as it seems that we can't be sure whether we still have it or
not when we get this message.

Refactor the existing code to specify the operation to perform when
calling the new DoSetIcon(). This actually makes things slightly simpler
for it, as it doesn't need to update m_iconAdded inside it any more.

Closes #18588.
2019-11-18 19:14:38 +01:00
Vadim Zeitlin
64ee3bebb4 Merge branch 'long-string-format'
Fix using "%s" with long (>65KiB) strings when using our own printf()
implementation.

See https://github.com/wxWidgets/wxWidgets/pull/1654
2019-11-18 15:07:00 +01:00
Vadim Zeitlin
29db4e7d83 Remove extraneous parenthesis in --without-libjbig help message
No real changes, this is purely cosmetic.
2019-11-17 23:50:54 +01:00
Vadim Zeitlin
91dc325ca9 Don't disable wxGraphicsContext if Cairo not available under Mac
This breaks Mac build by default and shouldn't be done. In fact, Cairo
should be used only optionally under MSW and Mac, where it's not always
needed, so add a new configure option to request it.
2019-11-17 23:49:21 +01:00
Artur Wieczorek
bdee154c96 Fix build with wxUSE_CAIRO==1 under wxMSW/wxOSX
'bmpSource' is declared later but we can check
original bitmap 'bmp' for 'alpha flag' instead
because 'bmpSource' is just a non-const copy
of 'bmp'.
2019-11-17 22:17:27 +01:00
Artur Wieczorek
3ca6e04d61 Allow building library with Cairo under wxOSX
Enable checking for Cairo in the configure script.
2019-11-17 22:14:38 +01:00
Vadim Zeitlin
8cba51978e Add a check for using wxString::Format() with a very long string
This used to fail until it was fixed in the previous commit.

See #18586.
2019-11-17 18:30:33 +01:00
Vadim Zeitlin
8005c59615 Stop truncating all wxString::Printf() arguments to 65535 chars
There is absolutely no good reason to do it and it resulted in
silently truncating all the string formatted using "%s" to their first
65535 characters when using our wxPrintf() implementation.

Closes #18586.
2019-11-17 18:30:33 +01:00
PB
8cf8c918b9 Correct and update code in new event class example
The code in the example showing how to create a new event class
confusingly used several names for the event type.

Fix this and also prefix the name of the new event type with "EVT_" to
match wxWidgets convention for naming event types.

Also explicitly mark the parts that are not needed if only Bind() is
used for event handling.

Closes https://github.com/wxWidgets/wxWidgets/pull/1586
2019-11-17 17:11:52 +01:00
Igor Korot
68de1b2acf Fix initial value returned from wxRichTextCtrl::IsModified()
A just created control shouldn't be considered modified, so reset its
modified state in Create().

And add a unit test checking that IsModified() really behaves as
expected.

Closes https://github.com/wxWidgets/wxWidgets/pull/1652
2019-11-17 17:04:15 +01:00
Vadim Zeitlin
b690caba84 Replace CPPUNIT_XXX macros with CHECKs
This results in better error messages and also allows the test to
continue executing even if a check fails.
2019-11-16 17:05:06 +01:00
Vadim Zeitlin
505e694347 Get rid of useless VarArgTestCase test fixture
We don't need it any more, just define individual tests as independent
test cases.

This required using some other pointer instead of "this" in one of the
tests, but it doesn't really matter which pointer we use there anyhow.

No real changes.
2019-11-16 17:01:57 +01:00
Vadim Zeitlin
ac14c3ffbc Only use font scaling code with GTK 3 or later
It's useless to do it for GTK 2 which doesn't support font scaling
anyhow.
2019-11-16 12:00:40 +01:00
Vadim Zeitlin
4d4e3e71a5 Use helper function for applying scaled font to PangoLayout
Don't scale, or even copy, the font object unnecessarily in the common
case when the font scaling factor is 1.0 anyhow.

No real changes, just make the code slightly more efficient and also a
bit more concise after the changes of the previous commit.
2019-11-16 12:00:40 +01:00
iwbnwif
fbc75ec8e0 Add support for fractional font scaling to wxGTK3
Respect the system font scaling parameter (e.g. "Fonts->Scaling Factor"
in Gnome Tweaks, "Force font DPI" in KDE System Settings or
GDK_DPI_SCALE environment variable) when drawing text using wxFont.

This ensures that generic widgets have their text scaled appropriately
to be consistent with native widgets.

Closes https://github.com/wxWidgets/wxWidgets/pull/1635
2019-11-16 12:00:40 +01:00