Commit Graph

71396 Commits

Author SHA1 Message Date
Vadim Zeitlin
a015270709 Replace CPPUNIT_ASSERT() macros in wxNumberFormatter unit tests
Just use CHECK() rather than CPPUNIT_ASSERT_EQUAL() etc.
2021-02-21 17:02:55 +01:00
Vadim Zeitlin
5ebce65494 Get rid of CppUnit boilerplate in wxNumberFormatter unit tests
No real changes, just drop CppUnit::TestCase inheritance and the legacy
macros and use TEST_CASE_METHOD() instead.
2021-02-21 16:52:07 +01:00
Vadim Zeitlin
d3f051e328 Document wxNumberFormatter overloads using long long
These overloads were added back in f2a5052baa (Add support for long long
to wxNumberFormatter., 2011-01-19) but never documented.
2021-02-21 16:43:04 +01:00
Vadim Zeitlin
7371131f1e Fix confusion around '-' handling in numeric validators code
Actual implementation of IsCharOk() didn't correspond to the comments in
it or near the function declaration which stated that it's never called
with ch='-' as argument -- it was called with it and called IsMinusOk()
right before a comment saying that it doesn't need to do it, which was
very confusing.

Fix this by making the behaviour really correspond to the comments and
handling '-' at the base class level. This required introducing a new
pure virtual CanBeNegative() function, but it's going to be useful for
other things later too.

Still keep IsMinusOk() helper, but make it private now because it
doesn't need to be called from the derived class IsCharOk() any longer.
2021-02-21 15:13:10 +01:00
Vadim Zeitlin
a5afa85c0a Always use pip for installing httpbin in Travis CI builds
Using Docker just doesn't work: simply running "docker pull" fails due
to the pull rate limits all the time, see e.g.

https://travis-ci.org/github/wxWidgets/wxWidgets/jobs/759810039#L2628

while following Travis own instructions for dealing with this problem at

https://blog.travis-ci.com/docker-rate-limits

results in the build failure due to secret environment variables not
being accessible from the PRs for security reasons, see

https://travis-ci.org/github/wxWidgets/wxWidgets/jobs/759820694

So use pip everywhere, even under Ubuntu 14.04, where it doesn't work
out of the box as it tries to install globally when it doesn't have the
permissions to do it.
2021-02-21 14:57:10 +01:00
Vadim Zeitlin
709b259bbb Don't define copy ctor in numeric validator classes unnecessarily
There is just no need to do it manually, when the compiler can do the
job perfectly well itself.

No real changes, but this will simplify the upcoming refactoring.
2021-02-21 14:55:16 +01:00
Václav Slavík
26826c9bea Fix wxOSX sizing of borderless wxBitmapButton
Don't apply the workaround required for NSRoundedBezelStyle and
NSTexturedRoundedBezelStyle, i.e. enlarging too small buttons, if these
bezel styles are not used. In particular, avoid enlarging buttons with
wxBORDER_NONE or wxBORDER_SIMPLE.

Follow-up to 0941b25.
2021-02-21 09:58:27 +01:00
Vadim Zeitlin
d2b2e0a4ed Replace CPPUNIT_ASSERT() macros in numeric validator unit tests
Simplify code and use CHECK() rather than REQUIRE(), which is what
CPPUNIT_ASSERT() is defined as, to continue running the tests even if
some of them fail.
2021-02-21 00:33:22 +01:00
Vadim Zeitlin
da973c3caf Get rid of CppUnit boilerplate in numeric validator unit tests
No real changes, just drop CppUnit::TestCase inheritance and the legacy
macros and use TEST_CASE_METHOD() instead.
2021-02-21 00:30:46 +01:00
Lauri Nurmi
7eeab1bb7e Change capitalization of stock label "&CD-Rom" to "&CD-ROM"
Use standard upper case instead of strange mixed one.

Closes https://github.com/wxWidgets/wxWidgets/pull/2241
2021-02-21 00:02:06 +01:00
Artur Wieczorek
0631ee37d9 Use dedicated WIC methods to get sub-bitmap of IWICBitmap
Using IWICBitmapClipper it is possible to get a clipped version
of the source bitmap so it should be used instead of manual way
with extracting pixels to the memory.
2021-02-20 21:00:12 +01:00
Gary Allen
9b1829c300 Add wxRibbon panel border colour option
Add wxRIBBON_ART_PANEL_HOVER_BORDER_COLOUR and
wxRIBBON_ART_PANEL_HOVER_BORDER_GRADIENT_COLOUR to allow further
customization of wxRibbon panels.

Closes https://github.com/wxWidgets/wxWidgets/pull/2239
2021-02-20 13:29:33 +01:00
Vadim Zeitlin
4705645243 Merge branch 'travis-use-pip'
Use pip rather than docker for installing httpbin under Travis to avoid
errors due to rate limits for docker pull.

See https://github.com/wxWidgets/wxWidgets/pull/2236
2021-02-20 13:24:31 +01:00
Felipe
84cb12d23b Update Portuguese translations 2021-02-20 13:23:25 +01:00
Artur Wieczorek
299f4543e3 Apply anti-alias mode to fonts with Direct2D
See #19049.
2021-02-19 20:22:00 +01:00
Artur Wieczorek
182cd25d7c Apply anti-alias mode to fonts with GDI+
See #19049.
2021-02-19 20:21:38 +01:00
Vadim Zeitlin
e848c54f0f Use pip for installing httpbin in most Travis CI builds
Using docker results in errors due to rate limit on pulling, so try to
reduce its use as much as possible. It still has to be used under Ubuntu
14.04 because it has a version of Python too old to work with HTTPS
servers using SNI and so using pip fails there.
2021-02-15 22:24:10 +01:00
Andriy Byelikov
ded4da5ce5 Add version suffix to gettext message catalog files
Change "make install" to install catalog files with version suffix and
modify the sources to look for suffixed catalog first, while still
falling back to just the base name if the variant with the version is
not found, because the message catalogs are copied manually in practice
under MSW/macOS systems and so won't have the version suffix there.

This allows to make message catalogs installed by different
wxWidgets versions to coexist on the same system, see
https://groups.google.com/g/wx-users/c/L9gC8UgrO6Y

Closes https://github.com/wxWidgets/wxWidgets/pull/2219

Co-Authored-By: Vadim Zeitlin <vadim@wxwidgets.org>
2021-02-15 18:23:05 +01:00
Vadim Zeitlin
9dc676a32c Don't run GitHub CI action when other CI scripts change
Avoid wasting resources when only the scripts used with AppVeyor or
Travis CI change.
2021-02-15 16:04:51 +01:00
ali kettab
db33e1549b Make wxWindow::TransferData{To,From}Window actually transfer to self 2021-02-15 15:38:21 +01:00
ali kettab
afbca9e1df Rename ValidationTraverserBase::DoForAllChildren to DoForSelfAndChildren 2021-02-15 15:28:28 +01:00
Dimitri Schoolwerth
7bf2dc71c3 Remove wxGridCellWithAttr
After the previous commit the coords stored by wxGridCellWithAttr have
become redundant as the coords are now also stored as part of the key
used for an attributes map. With then only an attribute remaining in
wxGridCellWithAttr it can be removed completely, letting the value of
an attributes map point directly to a (ref-counted) attribute instead.
2021-02-15 12:36:03 +01:00
Dimitri Schoolwerth
061191e659 Improve responsiveness of a wxGrid having plenty of attributes
Speed up grid attribute lookups by using a hash map instead of array.

Closes #12764.
2021-02-15 12:36:03 +01:00
Dimitri Schoolwerth
84c989626d Make slowness of attribute lookups more apparent in grid sample
Multiply the number of rows in the grid sample by a factor of 10. This
demonstrates the slowness with attribute lookups better when using
checkered (Ctrl+Shift+K) or coloured (Ctrl+Shift+L) cells, as filling
the grid is slowed down by way more than a factor of 10. Scrolling also
becomes less responsive the further away from the home cell the view is.

As a result of increasing the row count also move the cells positioned
near the end of the grid there again, and don't use fixed coords for
them.
2021-02-15 12:36:03 +01:00
Dimitri Schoolwerth
823d79ce06 Demonstrate intensive attribute usage in grid sample
Add options to fill grid either half (checkered cells) or fully (all
cells coloured) with attributes. Available from Grid > "Toggle Checkered
Cells" and "Toggle Coloured Cells".
2021-02-15 12:36:03 +01:00
Dimitri Schoolwerth
b5edfa2872 Add minor test for grid attributes
Test overwriting a cell's attribute with another attribute. With this
addition wxGridCellAttrData::Setattr() is now fully covered by tests.
2021-02-15 12:36:03 +01:00
Dimitri Schoolwerth
f048a03ea6 Fix parent of extra control not being a wxFileDialogBase on macOS
A wxEVT_UPDATE_UI handler expects the parent of the extra control panel
to be at least a wxFileDialogBase. However with wxMac when showing file
types the extra control gets reparented and has the panel containing
file type controls as a parent.

Fix by not reparenting in case the extra control itself already is
a panel, and then instead use the extra control as a container for
the file type controls.
2021-02-15 00:37:45 +01:00
Dimitri Schoolwerth
40422db37d Add wxMac wxFileDialog::GetCurrentlySelectedFilterIndex() support
Simply set the relevant variable while changing selection and give
the extra control a chance to update.

Note that updating the UI currently asserts with the dialog sample if
wxOSX_FILEDIALOG_ALWAYS_SHOW_TYPES is 1 (toggable with Ctrl+Cmd+S in
the sample), This will be fixed in the next commit.
2021-02-15 00:37:45 +01:00
Dimitri Schoolwerth
57688cf2da Refactor repetitions into wxFileDialogBase::UpdateExtraControlUI()
No real changes, just prepare for the next commit before repeating more
code.
2021-02-15 00:37:45 +01:00
Dimitri Schoolwerth
5cc2f6ce9f Fix width of file type wxChoice in open dialogs on macOS
When using both an extra control and wxOSX_FILEDIALOG_ALWAYS_SHOW_TYPES
set to 1 to show file types, the controls for the latter stretch towards
the dialog's width.

Fix by not stretching the wxChoice used for filtering and surrounding
the file type controls with stretching spacers instead. This makes
the filter controls appear the same as without an extra control:
horizontally centred and not stretching.
2021-02-15 00:37:45 +01:00
Dimitri Schoolwerth
25f981bfad Demonstrate wxOSX_FILEDIALOG_ALWAYS_SHOW_TYPES in dialogs sample
Add a menu option (Ctrl+Cmd+S) to toggle showing of the filter choice
with file types in open dialogs on macOS.
2021-02-15 00:37:45 +01:00
utelle
62a760c225 Make wxStandardPaths::IgnoreAppBuildSubDirs() more permissive
Add some common architecture-dependent directories to the list of
subdirectories that should be ignored.

For Win32 the directory name x86 is also common.

For Win64 the directory names Win64 and x86_64 are frequently in use,
too.

Closes https://github.com/wxWidgets/wxWidgets/pull/2233
2021-02-15 00:36:15 +01:00
Biswapriyo Nath
ae9b55712d Fix gcc warning when using configure --enable-permissive option
When configured with --enable-permissive option, add -fpermissive to C++
flags, not C flags, to avoid the gcc warning

command-line option '-fpermissive' is valid for C++/ObjC++ but not for C

when compiling C code.

Closes https://github.com/wxWidgets/wxWidgets/pull/2232
2021-02-14 19:45:16 +01:00
Vadim Zeitlin
d2c3c6a35b Merge branch 'msw_webview_edge4' of https://github.com/TcT2k/wxWidgets
Fix missing events for in-document navigation with wxWebViewEdge,
implement Find() for it and add wxEVT_WEBVIEW_FULLSCREEN_CHANGED for it
and wxGTK.

See https://github.com/wxWidgets/wxWidgets/pull/2227
2021-02-14 19:37:44 +01:00
Maarten Bent
2161e5270f Add check for expected line endings
Check that the EOL used in the file corresponds to the expected one for
its extension, in addition to checking that EOLs are consistent.

Closes https://github.com/wxWidgets/wxWidgets/pull/2228
2021-02-14 19:33:27 +01:00
Vadim Zeitlin
a6f6f5de27 Merge branch 'owner-combo' of https://github.com/MaartenBent/wxWidgets
Improve wxComboCtrl popup position and add DPI change handling.

See https://github.com/wxWidgets/wxWidgets/pull/2231
2021-02-14 19:27:13 +01:00
Vadim Zeitlin
d89d3b6851 Remove harmless unused variables warnings in non-debug build
Suppress a few -Wunused-variable and -Wunused-parameter warnings when
using --disable-debug.
2021-02-14 12:43:30 +01:00
Artur Wieczorek
70793777b6 Add missing constants
These constants are not defined in some non-MSVC environments.
2021-02-14 11:02:23 +01:00
Artur Wieczorek
cd6548c80e Use dedicated helper function to get window client area size 2021-02-14 00:13:48 +01:00
Artur Wieczorek
bce6c0911e Don't call obsolete method
ID2D1Factory::GetDesktopDpi() is reported as deprecated.
2021-02-14 00:12:47 +01:00
Artur Wieczorek
418ca872ec Fix reference count in wxD2DDeviceContextResourceHolder 2021-02-14 00:11:40 +01:00
Artur Wieczorek
0723da5168 Return proper Direct2D version if using ID2D1DeviceContext is enabled
ID2D1DeviceContext is available since Direct2D 1.1.
2021-02-14 00:10:37 +01:00
Artur Wieczorek
3c7493a289 Optimize converting native GDI+ bitmap to wxImage
Iterate through source pixels with pointer instead of array index.
2021-02-14 00:07:15 +01:00
Artur Wieczorek
2eb3a0460d Create native GDI+ representation of wxGraphicsBitmap directly from wxImage
Skip the conversion from wxImage to wxBitmap.
2021-02-14 00:05:30 +01:00
Artur Wieczorek
b86878c272 Cleanup Direct2D renderer
Move shared code to convert between wxImage amd IWICBitmap to the separate
methods.
2021-02-14 00:04:02 +01:00
Artur Wieczorek
a25e66d479 Create native D2D representation of wxGraphicsBitmap directly from wxImage
Skip the conversion from wxImage to wxBitmap.
2021-02-14 00:01:53 +01:00
Maarten Bent
e3491fc537 Create a wxDisplay directly from wxWindow 2021-02-13 21:11:18 +01:00
Maarten Bent
dbcfe56ae5 Make wxPenStyleComboBox in Combo sample DPI aware 2021-02-13 01:59:24 +01:00
Maarten Bent
1e17e8f500 Improve per-monitor DPI in wxVListBoxComboPopup
Adjust the default item height before the drawing size is calculated.
2021-02-13 01:59:23 +01:00
Maarten Bent
9365df2322 Improve wxPropertyGridEditor position with multiple displays 2021-02-13 01:59:23 +01:00