Commit Graph

67395 Commits

Author SHA1 Message Date
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
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
PB
33da780ecf Add sample code showing how to create a new wxEvent class
In the event sample, show how create and use a new
wxEvent-derived class.

Closes https://github.com/wxWidgets/wxWidgets/pull/1633
2019-11-16 00:56:23 +01:00
Vadim Zeitlin
785ad3b63b Merge branch 'ellipsize-fixes'
Fix ellipsization of strings containing mnemonics and TABs and also
improve handling of trailing spaces (by ignoring them).

See https://github.com/wxWidgets/wxWidgets/pull/1649
2019-11-16 00:51:56 +01:00
Vadim Zeitlin
db846f15ab Disable wxMediaCtrl and wxWebView when OLE is disabled in wxMSW
Avoid errors in wx/msw/chkconf.h during compilation by proactively
turning these options off in configure if wxUSE_OLE==0.
2019-11-15 17:09:43 +01:00
Vadim Zeitlin
37d8b6018c Remove test for ole2.h from configure
This is unnecessary, this header should always be available, so it was a
waste of time to check for it at best and, actually, this broke the
Cygwin build under AppVeyor as configure didn't find the header somehow,
even if compiling the code using it works perfectly well.
2019-11-15 17:06:17 +01:00
Vadim Zeitlin
428d47f534 Merge branch 'wxwebviewieimpl' of https://github.com/MaartenBent/wxWidgets
Actually allow using wxWebVieWIE-specific methods for setting the
emulation level.

Make it possible to include wx/msw/webvieW_ie.h by removing inclusion of
the private headers from it, which was in turn achieved by moving all
the implementation details into a private class.

See https://github.com/wxWidgets/wxWidgets/pull/1647
2019-11-14 17:26:00 +01:00
Vadim Zeitlin
2da8426ed6 Merge branch 'gtk-spin-width-from-text'
Fixes for wxSpinCtrl::GetSizeFromTextSize() and best size in wxGTK.

Closes #18568.

See https://github.com/wxWidgets/wxWidgets/pull/1645
2019-11-14 16:07:05 +01:00
Maarten Bent
e67c814765 Make webview_missing.h a private header 2019-11-14 00:04:56 +01:00
Maarten Bent
9455fe2d21 Move wxWebViewIE specific functions to correct interface class 2019-11-14 00:04:48 +01:00
Maarten Bent
67ace7b243 Move wxWebViewIE classes to private header
Cleanup includes.
2019-11-13 23:56:40 +01:00
Maarten Bent
7e682a09d6 Add wxWebViewIEImpl class for all private wxWebViewIE members and functions
Move wxWebViewIE::Find implementation to wxWebViewIEImpl because it has a lot
of member accesses.
2019-11-13 23:46:13 +01:00
Ian McInerney
e093199058 Fix parameter name in wxDir::HasSubDirs() documentation
Closes https://github.com/wxWidgets/wxWidgets/pull/1648
2019-11-13 19:18:06 +01:00
iwbnwif
5cf745611b Don't take trailing whitespace into account when ellipsizing
Trailing spaces and tabs are invisible, so the string shouldn't be
truncated (possibly losing some printable characters that could have
been displayed) just in order to show "..." instead of them.
2019-11-13 18:40:07 +01:00
Vadim Zeitlin
cbda47ff15 Tighten assert check in EllipsizeCalculator
Verify that we have exactly as many offsets as expected, both in the
case when the string terminates with a (lone) ampersand and when it
doesn't, instead of checking that it's one or the other without caring
in which case we're.

No real changes, but this seems slightly cleaner and avoids questions
about the expression "s.length() - 1" when the string is empty.
2019-11-13 18:38:05 +01:00
Vadim Zeitlin
aa1891e524 Remove unnecessary and unused EllipsizationTestCase class
No real changes, just don't use a text fixture which does nothing, this
is useless and confusing.
2019-11-13 18:25:42 +01:00
iwbnwif
315c5a1d6d Fix ellipsization of strings containing mnemonics
The old code didn't work correctly in the presence of TABs in the string
(without wxELLIPSIZE_FLAGS_EXPAND_TABS being used), as their width is
elastic and so simply subtracting the width of the ampersands didn't
work in this case and could result in ellipsized string being longer
than the maximum available width.

Fix this by using a different approach and computing the widths of the
actually shown string and then just inserting extra entries into the
array of widths to match the invisible ampersands positions.
2019-11-13 18:09:03 +01:00
iwbnwif
7155e82255 Show the used font in case of failure in Ellipsization unit test 2019-11-13 18:04:53 +01:00
Vadim Zeitlin
9b43bd8af2 Merge branch 'dpi-textctrl' of https://github.com/MaartenBent/wxWidgets
Improvements for wxTextCtrl, wxSearchCtrl, wxButton when using
non-default DPI.

See https://github.com/wxWidgets/wxWidgets/pull/1634
2019-11-13 15:47:59 +01:00
Vadim Zeitlin
34f26bd18f Don't change max number of digits in wxSpinCtrl code
This doesn't seem to affect anything, i.e. the function returns the same
results whether we do it or not, so just don't.
2019-11-13 15:46:16 +01:00
Vadim Zeitlin
b472a791c1 Return fitting size from wxSpinCtrl::GetSizeFromTextSize() in GTK
Previously we added the extent of the text to the preferred size of a
spin button with 0 digits, but this didn't account for the fact that the
control still reserved enough space for 3 digits in this case, and so
the returned size was always too big than the required size by the width
needed to show 3 digits.

Fix this by directly asking for the size required to show the number of
digits corresponding to the given text size.

Note that ideal would be to provide GTK API at wx level directly, i.e.
allow to just specify the number of digits instead of the text extent.
But we still need to fix the already existing GetSizeFromTextSize()
anyhow, so do this for now.

See #18568.
2019-11-13 15:46:16 +01:00
Vadim Zeitlin
7f368872d7 Adjust entry width of wxSpinCtrl in wxGTK to its range
Ensure that the entry is always (just) big enough to show any value
valid in this spin control.

This also ensures that GetBestSize() doesn't need to be overridden to
use GetSizeFromTextSize() any longer as the best size will be determined
correctly by GTK itself.
2019-11-13 15:46:16 +01:00