Commit Graph

71333 Commits

Author SHA1 Message Date
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
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
Vadim Zeitlin
178ac74596 Fix crash due to missing retain in wxUILocale wxMac code
We need to retain [NSLocale availableLocaleIdentifiers] result too, as
it doesn't copy the returned object.
2021-09-10 19:11:42 +02:00
Owen Wengerd
b3f609781e Handle more wxTextCtrl accelerators in MSWShouldPreProcessMessage()
Ensure that Shift-{Home,End,Left,Right} can still be used for selecting
text in the control even if they're also used as accelerators.

Closes https://github.com/wxWidgets/wxWidgets/pull/2511
2021-09-08 23:23:24 +01:00
Vadim Zeitlin
573e4fa0ec Allow using custom main window in wxComboCtrl
Add wxComboCtrl::SetMainControl() which can be used to use some other
window instead of the default wxTextCtrl as the main window of the
combo control.

Update the sample and the documentation to show the new function.
2021-09-08 20:44:34 +02:00
Vadim Zeitlin
13c6c619ac Remove unnecessary local variable in wxComboCtrlBase code
There doesn't seem to be any point in using local "customBorder" instead
of member "m_widthCustomBorder", so remove the unnecessary local
variable and use the member variable instead.

No real changes.
2021-09-08 18:42:10 +01:00
Artur Wieczorek
4a7ac90ce3 Fix wxImage::InitAlpha tests in release build
In release build exceptions are not thrown
so there is no need to check them.
2021-09-08 17:43:25 +02:00
Vadim Zeitlin
d89af4e311 Fix regression with spurious generic wxListCtrl columns resizing
Don't set default width every time the column is updated, as it happens
e.g. when it's clicked by the user, but only when it is created, by
moving the code added in 96d36383bd (Use sensible default column width
in generic wxListCtrl too, 2021-08-17) from SetItem() to the ctor of
wxListHeaderData.

Closes #19256.
2021-09-07 19:44:02 +02:00
Vadim Zeitlin
bba9aa7122 Merge branch 'gtk-install-docs'
Improve wxGTK install docs: document prerequisites, improve formatting,
remove obsolete parts.

See https://github.com/wxWidgets/wxWidgets/pull/2510
2021-09-07 19:25:45 +02:00
Vadim Zeitlin
50493a920f Remove "fall through" comments from the samples
Use wxFALLTHROUGH when appropriate and just remove the useless "fall
through" comment from a "default" branch.

No real changes.
2021-09-07 19:24:30 +02:00
Blake Madden
1380b1914c Fix typos in sample comments
Closes https://github.com/wxWidgets/wxWidgets/pull/2513
2021-09-07 19:23:31 +02:00
Vadim Zeitlin
8368914725 Merge branch 'compare-localized'
Allow creating wxUILocale for any locale and add
wxUILocale::CompareStrings().

See https://github.com/wxWidgets/wxWidgets/pull/2506
2021-09-05 23:16:10 +02:00
Vadim Zeitlin
2bab87b140 Always initialize just added wxRibbonButtonBar field
Initialize m_ribbonBar added in the previous commit to NULL before
setting it to the correct value later, when wxRibbonButtonBar is fully
created.

See #19249.

Co-Authored-By: Maarten Bent <MaartenBent@users.noreply.github.com>
2021-09-05 18:28:38 +02:00
Vadim Zeitlin
706ab2c300 Fix crash when using popup window for wxRibbon button bars
Fix crash introduced by 8e8a68c1b (Move code accessing bitmaps to
wxRibbonButtonBarButtonBase too, 2020-02-07) which start using
GetAncestorRibbonBar() in wxRibbonButtonBar code, without taking into
account that we may have no ribbon bar ancestor when the button bar is
shown in a popup frame, as it happens when there is not enough space to
show it fully in the main window itself.

Remember the ribbon bar in a member variable, relying on the fact that
we must have it in our parent chain when constructed, and just use it
later to avoid this.

Closes #19249.
2021-09-05 18:15:41 +02:00
Vadim Zeitlin
c777a39650 Fix appearance of "%" in wxMSW install instructions
Te changes of 74c51eaff2 (Fix formatting of wxMSW build instructions,
2021-07-13) broke the rendered output of "%WXWIN%", for some reason the
leading percent sign needs to be double to appear correctly inside the
backticks, so do it to fix this.

Closes #19260.
2021-09-05 17:44:57 +02:00
Vadim Zeitlin
98c2eef619 Fix scrollbar position in wxListCtrl in wxUniv
Skip the event in wxGenericListCtrl::OnSize() to let wxUniv position the
window scrollbars correctly.

See https://github.com/wxWidgets/wxWidgets/pull/2512

Closes #19254.
2021-09-05 17:36:57 +02:00
Kvaz1r
bfd2d02b3e Fix crash in wxUniv when destroying MDI child frame
Disassociate child frame menu bar from its parent before destroying it
to avoid using a dangling pointer later, when destroying the parent.

See https://github.com/wxWidgets/wxWidgets/pull/2505

Closes #19253.
2021-09-05 17:28:13 +02:00
Vadim Zeitlin
e38e089525 Update configure --enable-debug[_flag] options description
Don't say that the application needs to be compiled with the same
__WXDEBUG__ value, as this is not true since 3.0 days.

Also link the debugging overview.
2021-09-05 16:04:56 +02:00
Vadim Zeitlin
91923dc3f1 Reformat configure options description
No changes in contents, just use a list for configure options rather
than preformatted text block.
2021-09-05 16:04:56 +02:00
Vadim Zeitlin
45f7ec9bdb Add "prerequisites" section to GTK installation instructions
List the required packages in Debian/Ubuntu and Fedora/CentOS.
2021-09-05 16:04:56 +02:00
Vadim Zeitlin
3ca3944cff Add a pseudo-test for interactive wxUILocale::FromTag() testing
This allows to easily check whether the given locale is supported.
2021-09-05 00:10:05 +01:00
Vadim Zeitlin
2c580c9190 Add wxUILocale::FromTag() helper
This is exactly the same as wxUILocale(wxLocaleIdent::FromTag()) but
shorter.
2021-09-05 01:00:04 +02:00
Vadim Zeitlin
c217eb6815 Make wxUILocale objects copyable
There doesn't seem to be any reason to disallow copying these objects
and because they only have const methods, we can use reference counting
for them without bothering with copy-on-write, so it's simple to
implement.
2021-09-05 01:00:04 +02:00
Vadim Zeitlin
c7ad052c71 Use wxLocaleIdent in Unix wxLocale and wxUILocale code
No real changes, just prefer using wxLocaleIdent to strings in a few
places.
2021-09-05 01:00:04 +02:00
Vadim Zeitlin
6f4dd01b5b Remove unnecessary wxMac check from Unix code not used under Mac
This file is not compiled under Mac, where src/osx/core/uilocale.mm is
used, so there is no need to check for __WXMAC__ here.

No real changes.
2021-09-05 01:00:04 +02:00
Vadim Zeitlin
6b26deaddc Replace wxLocaleIdent ctor from language with FromTag()
This static function parses a subset of the language tags described in
BCP 47 (see https://www.rfc-editor.org/rfc/bcp/bcp47.txt).

Use the tag, as specified by this function, rather than the locale
identifiers components under MSW, where this should allow us to use even
locales that can't be described using just language-script-region.
2021-09-05 01:00:04 +02:00
Vadim Zeitlin
a47a885718 Check that locale ID argument of wxUILocale ctor is not empty
Disallow using empty wxLocaleIdent here, GetDefault() can, and should,
be used for the user default locale.
2021-09-05 01:00:04 +02:00
Vadim Zeitlin
be01b0c36a Rename wxLocaleIdent::IsDefault() to IsEmpty()
We don't use empty wxLocaleIdent as default user locale and it doesn't
make much sense to do it, as the default locale is already accessible
via wxUILocale::GetDefault().
2021-09-05 00:15:39 +02:00
Vadim Zeitlin
4d32fd481c Move wxLocaleIdent implementation out of line
No real changes, just don't make all wxLocaleIdent setters inline, this
is not necessary as none of these methods are performance-critical.

This commit is best viewed with --color-moved git option.
2021-09-05 00:15:39 +02:00
Vadim Zeitlin
5233014a71 Add missing CHECK() to wxUILocale test case for MSW/Mac
Don't forget to check that the locale is actually supported, as
expected, under these platforms.
2021-09-05 00:15:39 +02:00
Vadim Zeitlin
44a5cf78d1 Allow rescaling larger images in Win64 builds
Use wxUIntPtr rather than (unsigned) long in wxImage::ResampleNearest()
as long is still 32 bits under Win64 and so doesn't allow the code there
to work with images larger than 2^16 in either direction, when it could
be allowed in this case.

Document the current limits on the size of the image and add a unit test
checking that resizing images of size greater than 2^16 works in 64 bits.

See #18550.
2021-09-04 18:59:33 +01:00
Vadim Zeitlin
07015d29a8 Correct comment for wxUILocaleImplUnix::m_locale
This member is not allocated on demand any more, but is only null for
the default locale object.
2021-09-04 19:17:57 +02:00
Vadim Zeitlin
7a7bc5dad2 Move wxLocaleIdent to wx/uilocale.h
No real changes, just move this class declaration as it seems more
logical to have it in the same header with wxUILocale which is the only
place where it's used.

This commit is best viewed with --color-moved git option.
2021-09-04 19:00:49 +02:00
Vadim Zeitlin
c489cd9398 Fix formatting and slightly update wxGTK install instructions
The only real change is that the part about building wxGTK under Cygwin
was removed, it wasn't very useful and shouldn't distract from other,
more important, information here.
2021-09-04 17:17:27 +01:00
Vadim Zeitlin
f2cd6344af Clarify comments in the private uilocale.h
No real changes.

Co-Authored-By: Václav Slavík <vaclav@slavik.io>
2021-09-04 15:13:53 +02:00
Vadim Zeitlin
4c9c5d08cb Refactor Unix locale creation code
Just extract the code trying to find the matching locale into its own
function.

This commit is best viewed with --color-moved git option.
2021-09-04 15:04:17 +02:00
Vadim Zeitlin
39e1cae617 Merge branch 'osx-bitmap-image'
Avoid crash in wxButton when setting invalid pressed bitmap in wxOSX and
other button bitmaps-related improvements.

See https://github.com/wxWidgets/wxWidgets/pull/2508
2021-09-04 12:28:25 +02:00
Vadim Zeitlin
89552a02f5 Remove unnecessary checks before calling GetNSImage()
Now that this function is guaranteed to return NULL if the bitmap is
invalid, the code can be simplified to rely on it.

No real changes.
2021-09-03 21:35:03 +02:00
Vadim Zeitlin
2574b9172e Rename wxBitmap::GetImage() to OSXGetImage()
Make it more clear that this function is specific to Mac ports.
2021-09-03 21:32:52 +02:00
Vadim Zeitlin
be923dc9fe Use wxBitmap::GetNSImage() in Cocoa code
Use Cocoa-specific function rather than generically-named GetImage().

No real changes.
2021-09-03 21:27:58 +02:00
Vadim Zeitlin
6f4c57260b Use wxBitmap::GetUIImage() in wxiOS code
It looks like this should be the right function to use, rather than the
more generic GetImage() which is going to be renamed in the upcoming
commits.
2021-09-03 21:26:05 +02:00