71592 Commits

Author SHA1 Message Date
Alexander Koshelev
e2aca9cbd5 Add wxStyledTextCtrl XRC handler
Closes https://github.com/wxWidgets/wxWidgets/pull/2530

Co-authored-by: VZ <vz-github@zeitlins.org>
2021-09-28 15:39:20 +02:00
IhateTrains
adef4c27c2 Support for VS 2022 in wxwidgets.props 2021-09-27 14:21:28 +02:00
rlbxku1r
7dcf004f0e wxMBConv_iconv: Fix wrong buffer size
This is an oversight in commit 878c265.
2021-09-27 00:21:03 +09:00
Vadim Zeitlin
44fe94fad8 Merge branch 'bitmap-rescale'
Add wxBitmap::Rescale() and use it instead of RescaleBitmap().

See https://github.com/wxWidgets/wxWidgets/pull/2534
2021-09-24 14:27:10 +02:00
Vadim Zeitlin
c5430cbbcd Fix self-assignment bug in wxObjectDataPtr
wxObjectDataPtr::operator=() didn't handle self-assignment correctly,
i.e. could delete the object when doing "x = x".

Fix this by incrementing the reference count before decrementing it on
possibly the same object to ensure that it never reaches 0.
2021-09-24 14:27:02 +02:00
Jouk
29c408c3c5 Add uilocale in OpenVMS makefiles 2021-09-24 08:59:20 +02:00
Vadim Zeitlin
5a91ab92f7 Use high quality in wxBitmap::Rescale()
This function is currently used for relatively small icons in
wxArtProvider and wxSearchCtrl, so it shouldn't be a problem to use
wxIMAGE_QUALITY_HIGH from performance point of view and if it ever does
become a problem, the application could easily use wxImage::Rescale()
with a different option directly instead.
2021-09-24 00:30:02 +02:00
Vadim Zeitlin
024c231624 Replace multiple RescaleBitmap() with wxBitmap::Rescale()
Define a single function and use it in both wxArtProvider and (the
generic implementation of) wxSearchCtrl instead of repeating the same
code elsewhere.

Note that another, but slightly different, version of RescaleBitmap()
still remains in wxPropertyGrid.

Deprecate undocumented wxArtProvider::RescaleBitmap() which is
completely useless now.

No real changes, this is just a refactoring.
2021-09-24 00:30:02 +02:00
Vadim Zeitlin
46314bd6b1 Merge branch 'toolbar-high-dpi'
Show how to use bitmaps appropriate for the current DPI in the toolbar
sample using the current API.

See https://github.com/wxWidgets/wxWidgets/pull/2520
2021-09-23 16:31:20 +02:00
Artur Wieczorek
b0331f58b5 Don't run CI builds on Ubuntu 16 not supported any longer
Support for Ubuntu 16.04 ended on September 20, 2021.
See: https://github.blog/changelog/2021-04-29-github-actions-ubuntu-16-04-lts-virtual-environment-will-be-removed-on-september-20-2021/

See https://github.com/wxWidgets/wxWidgets/pull/2531
2021-09-23 16:29:10 +02:00
Vadim Zeitlin
79582adeb4 Merge branch 'list-std'
Fix build in STL mode under OpenVMS.

See https://github.com/wxWidgets/wxWidgets/pull/2528
2021-09-23 16:25:51 +02:00
Vadim Zeitlin
3b3169fa15 Fix refresh problems when scrolling with mousewheel in wxUniv/MSW
Use native scrolling under MSW, just as we already did under X11,
instead of our own version which doesn't work correctly when scrolling
using the mouse wheel.

See https://github.com/wxWidgets/wxWidgets/pull/2525
2021-09-23 16:24:20 +02:00
Vadim Zeitlin
7043963831 Add wxHAS_IMAGE_RESOURCES defined under MSW and Mac
Unlike the existing wxHAS_IMAGES_IN_RESOURCES constant defined only
under MSW, the new one is also defined under Mac and could be defined
for the other platforms/ports later (e.g. wxQt could probably support it
too).

It's unfortunate that two very similar constants are needed, but it
doesn't seem wise to change the meaning of the existing constant, as
this would change how the commonly used wxICON() and wxBITMAP() macros
behave and would break all our own samples that use them for their frame
icon but don't embed this icon into the bundle resources under Mac.

Do change the toolbar sample to use the new constant however, as this
one does include the bitmaps it uses in its bundle under Mac.
2021-09-22 23:24:32 +01:00
Artur Wieczorek
5ecf2e05a5 Execute ChoiceTestCase on wxMac 2021-09-22 22:19:45 +02:00
Artur Wieczorek
711b548c59 Invalidate selection of item being removed from wxChoice (wxOSX)
We need to explicitly invalidate selection of item being removed
because it's not done by wxChoiceWidgetsImpl::RemoveItem().
2021-09-22 22:19:45 +02:00
Artur Wieczorek
37ad7bb30e Adjust point to be tested in wxListBox::HitTest for macOS 11
On macOS >= 11 wxListBox has a new layout because underlying
NSTableView has a new style with padding so we need to move
the point to be tested to another position.
2021-09-22 22:19:45 +02:00
Artur Wieczorek
ce9f8d065a Execute ListBox-related tests under wxMac 2021-09-22 22:19:45 +02:00
Artur Wieczorek
c97cd8d280 Invalidate selection of item being removed from wxNSTableView
We need to explicitly invalidate selection of item being removed
because it's not done by NSTableView (selection index is retained).
2021-09-22 22:19:45 +02:00
Artur Wieczorek
5715c7f573 Execute ComboBoxTestCase under wxMac 2021-09-22 22:19:45 +02:00
Artur Wieczorek
61989086f2 Retain selection of wxComboBox item whose text has been changed
In wxComboBox::SetString() implementation for wxMac the item is
first removed from the list so its selection is invalidated.
We have to retain it so we need to re-select just inserted item.
2021-09-22 22:19:45 +02:00
Artur Wieczorek
2f3fc152bf Invalidate selection of item being removed from wxNSComboBoxControl
We need to explicitly invalidate selection of item being removed
because it's not done by NSComboBox (selection index is retained).
2021-09-22 22:19:45 +02:00
Vadim Zeitlin
d15bf90050 Attempt to work around build problem under OpenVMS
OpenVMS build was broken by 303d899cc0 (Make STL-based wxList more
compatible with the default one, 2021-09-02), try to blindly fix it by
casting the element to the same type it had had before.
2021-09-22 18:07:08 +02:00
Vadim Zeitlin
364835706c Add unit test for wxWindowList::Find()
Check that Find() of a list declared using WX_DECLARE_LIST_3 (as
wxWindowList is) can be passed a pointer to the base class object and
still compiles and works correctly.
2021-09-22 18:07:08 +02:00
Vadim Zeitlin
fee249f3ae Merge branch 'filename-misc-fixes'
Fix handling of single letter UNC paths and other wxFileName
improvements.

See https://github.com/wxWidgets/wxWidgets/pull/2519
2021-09-22 16:12:23 +02:00
Vadim Zeitlin
9604c729bf Update the shown file name in wxGTK wxFilePickerCtrl::SetPath()
This still doesn't work if the file doesn't exist, but at least shows
the correct file name if it does exist, which is better than nothing and
the best we can reasonably do when using the native control.

Closes #19163.
2021-09-22 16:11:35 +02:00
Vadim Zeitlin
bd423096df Restore recently removed #include wx/textctrl.h in wx/combobox.h
Some existing code relies on wxEVT_TEXT being defined after including
just wx/combobox.h too, so just keep this formally unnecessary but by
now impossible to remove #include removed in d3eafa4d18 (Fix compilation
of wxFormBuilder-generated code using wxTE_XXX, 2021-07-14).

See #14132.

Closes #19264.
2021-09-22 16:11:35 +02:00
Jouk
f4e0c76346 Add wxUSE_SPELLCHECK to setup for OpenVMS 2021-09-22 08:44:01 +02:00
Vadim Zeitlin
19002a54ad Regenerate toolbar sample bitmaps in 32 and 64 pixel sizes
They're more appropriate than 16 and 32 pixels nowadays.

Also add SVG versions of the icons, from which these bitmaps were
created.
2021-09-21 23:45:09 +02:00
Mehmet Soyturk
6d9288c12b Further optimize wrapping long lines in wxRichTextCtrl
When adding characters to a long word-wrapped line one by one, there was an hotspot in wxString(const wxString&) and wxString::replace.

When rendering or getting caret position, each broken line from a long line of text was being processed separately. Before handling each line, some preprocessing is done: replace a character by another character and make uppercase if necessary.

Before, this way happening for each line:
* make a copy of the whole long string
* preprocess that copy of long string
* get the needed substring of it

Now, we do this in most cases:
* get the needed substring of the long string
* preprocess that short string
2021-09-17 09:51:14 +03:00
Mehmet Soyturk
3e6ae97e89 Optimize wrapping long lines in wxRichTextCtrl
When one inserts one big line to a wxRichTextCtrl that is too long (say 300k words of average size 9), then wxRichTextCtrl could freeze for a few seconds. It could also freeze again when the control is resized (such that word wrapping is triggered again).

Problem: `wxRichTextParagraph::AllocateLine(int pos)` can be called many times. Each call triggers `m_cachedLines.Item(pos)`, which traverses the linked list. As a result we get quadratic time complexity.
In this commit, we improve the function by also caching the lines in a vector, which supports random access in O(1) time.
2021-09-17 09:19:48 +03:00
Vadim Zeitlin
47211fa520 Show how to use higher resolution toolbar bitmaps in high DPI
Update the toolbar sample to show how to use bigger images for the
toolbar in high DPI.
2021-09-15 21:15:19 +02:00
Vadim Zeitlin
d6f1f79cef Remove unnecessary calls to wxToolBar::SetToolBitmapSize()
This is unnecessary, just as an existing comment said, so don't bother
doing it.
2021-09-15 21:15:19 +02:00
Vadim Zeitlin
fe615bdeea Get rid of INIT_TOOL_BMP() macro in the toolbar sample
It isn't really useful any more now that all ports use wxBITMAP_PNG()
and just obfuscates the code.

No real changes.
2021-09-15 21:15:19 +02:00
Vadim Zeitlin
8a337fcdd9 Use PNG icons instead of BMP and XPM ones in the toolbar sample
Update the sample for the 21st century (with just a bit of delay) and
use PNGs under all platforms instead of using BMPs under MSW and XPMs
elsewhere.

Copy PNG icons from Tango, even if we already have almost of them in
art/tango because we plan to also use "2x" versions of them in this
sample soon.
2021-09-15 21:15:19 +02:00
Vadim Zeitlin
acb43011c1 Remove extra blank lines from png2c.py output
Adding them just seems unnecessary.
2021-09-15 21:15:19 +02:00
Vadim Zeitlin
fc104c8b4f Link only GUI libraries, not wxBase, with gspell
Don't add dependencies on gspell and all GUI libraries that it uses to
wxBase library, only link the GUI libraries with it.

See https://github.com/wxWidgets/wxWidgets/pull/2516
2021-09-15 15:35:33 +02:00
Vadim Zeitlin
ed19e5625b Fix wxFileName unit test under Unix after recent changes
Don't use GetVolumeSeparator() to combine UNC or GUID volumes with
paths, this doesn't work because this kind of paths doesn't contain
colons at all.

Update the documentation to mention this.
2021-09-15 13:10:25 +02:00
Vadim Zeitlin
e8629db48a Add another test case for wxPATH_NORM_DOTS
This was reported to not work but does work now.

See #15012.
2021-09-15 02:06:30 +01:00
Vadim Zeitlin
549e0a59b1 Fix handling of single letter shares in UNC paths in wxFileName
This comes at the price of breaking compatibility and returning
"\\share" rather than just "share" from wxFileName::GetVolume() for the
UNC paths. This breakage seems justified because it is required in order
to allow application code to distinguish between paths "x:\foo" and
"\\x\foo", which was previously impossible as GetVolume() returned just
"x" in both cases.

Document this change, adjust the existing checks for the new GetVolume()
semantics and add a new test which passes now, but didn't pass before.

Closes #19255.

This commit is best viewed ignoring whitespace-only changes.
2021-09-15 01:51:35 +01:00
Vadim Zeitlin
7e4b54a00a Replace old hack in wxFileName::Assign() with better solution
Replace the workaround introduced as a "temporary fix to avoid breaking
backwards compatibility in 2.8" back in 9e1c7236e0 (don't treat foo in
c:\\foo\bar as network share, 2006-12-17) with a better solution
proposed in the comment in that commit, i.e. don't even try to extract
the volume from the path if we already have the volume separately.

This commit is best viewed ignoring whitespace-only changes.
2021-09-15 00:35:34 +01:00
Vadim Zeitlin
abf26b03a7 Fix wxFileName::Mkdir("/foo") under MSW
Creating a directory with the leading path separator unexpectedly
created it under the current directory rather than in the root of the
current drive under MSW, due to the path being considered relative, in
spite of starting with the path separator, because it didn't have the
volume.

Fix this by avoiding the use of IsAbsolute() in Mkdir() and checking for
m_relative instead, as it seems the safest possible fix for this bug
because changing IsAbsolute() to return true in this case might change
the behaviour of the existing code.

Closes #4470.
2021-09-13 21:25:30 +01:00
Vadim Zeitlin
8d13440d69 Fix wxPATH_RMDIR_FULL documentation
Explain what this flag really does in Rmdir() documentation itself, as
the old wording was confusing.

Closes #16682.
2021-09-13 21:05:21 +01:00
Vadim Zeitlin
8db2f45171 Fix handling multiple leading backslashes in wxFileName under MSW
Extend the existing workaround to work not only with explicitly
wxPATH_DOS paths, but with paths implicitly using the DOS format due to
it being the default format for the current platform.

Closes #19261.
2021-09-13 20:53:27 +01:00
Artur Wieczorek
efb40daf4f Execute Window::SizerErrors test under wxMac 2021-09-11 23:24:22 +02:00
Artur Wieczorek
a86419c0be Fix Window::SizerErrors test in release build
In release build no exceptions are thrown by wxASSERT/wxCHECK
so there is no need to check them.
2021-09-11 23:24:22 +02:00
Vadim Zeitlin
3840b0b1c4 Merge branch 'combo-non-text'
Allow using non-text control as main window of wxComboCtrl.

See https://github.com/wxWidgets/wxWidgets/pull/2515
2021-09-11 14:03:02 +02:00
Iwbnwif Yiw
5ba2461fd1 Switch to using GSpell for wxTextCtrl proof checker in wxGTK
Use GSpell rather than GtkSpell because GSpell also allows to check
single line text controls.

Closes https://github.com/wxWidgets/wxWidgets/pull/2516
2021-09-11 14:02:13 +02:00
Vadim Zeitlin
0fd138a4e7 Slightly simplify running the GUI tests in the Mac CI workflow
No real changes, just don't use pipefail option when we're not using
pipelines at all -- this was somewhat confusing.
2021-09-11 13:54:24 +02:00
Artur Wieczorek
0381b16bd1 Skip tests that currently fail under wxMac 2021-09-11 09:16:32 +02:00
Artur Wieczorek
301b08b95d Execute GUI tests under wxOSX 2021-09-11 09:16:32 +02:00