Commit graph

20996 commits

Author SHA1 Message Date
Vadim Zeitlin
72c164f28c Make wxStandardPaths::AppendAppInfo() public
This function can be useful to the application code and will be used by
wxFileConfig in the upcoming commits.
2024-01-02 01:57:04 +01:00
Martin Corino
6ee9056c16 Fix column reordering in wxHeaderCtrlSimple and related problems
Override required functions in wxHeaderCtrlSimple to avoid asserts if
its columns are reordered.

Also bring the code behaviour in agreement with the documentation by
calling UpdateColumn() after calling UpdateColumnVisibility().

Finally, only call UpdateColumnsOrder() if the corresponding event was
not processed as the application should use one xor the other mechanism
for reacting to columns reordering, but not both.

Closes #24108.

Closes #24172.
2023-12-31 17:57:19 +01:00
Paul Cornett
ce1d317768 Remove GLU dependency
See #23721
2023-12-28 14:49:42 -08:00
Paul Cornett
fc8a780932 Avoid applying "no-window" mouse coordinate conversion to generic wxWindow
For a wxPizza widget in a GtkScrolledWindow, the coordinates are already correct.
2023-12-28 12:32:59 -08:00
Vadim Zeitlin
7a306c4a42 Merge branch 'qt-fixes' of https://github.com/AliKet/wxWidgets
Many wxQt improvements and simplifications.

See #24135.
2023-12-27 02:57:14 +01:00
ali kettab
aa562ea2fb Get rid of QtCreateControl() from wxQt code base
If possible, all windows should call wxWindow::Create() on creation now,
because among other things:
- It manages generic and non-generic windows uniformly and transparently
- It ensures an appropriate initial size for the window
- AddChild() and PostCreation() are automatically called
- Scrollbar policies are set in one place.
2023-12-26 22:50:59 +01:00
ali kettab
69ec562f16 Update outdated comments under wxQt
There is no longer a QtGetContainer() function name. wxQtEventForwarder was renamed
to wxQtEventSignalHandler. And QtGetScrollBarContainer() was just removed in previous
commits.
2023-12-26 12:45:52 +01:00
ali kettab
840d362a70 Keep forward declarations of Qt classes in alphabetical order 2023-12-26 12:45:52 +01:00
ali kettab
31aac5fac4 Get rid of QtGetScrollBarsContainer() from wxWindow API under wxQt
Because It is simpler to initialize (the inherited) m_qtContainer member
directly in derived classes during construction process, and make the API
a little bit cleaner.
2023-12-26 12:45:52 +01:00
ali kettab
5fb8a54e14 Change the return type of QtGetScrollBarsContainer() under wxQt
Neither QListWidget nor QTextEdit derive from QScrollArea and the cast to it is
just UB. Instead, using the common base class QAbstractScrollArea is safer and
eliminates the need to these dangerous and insidious crosscast'ings.
2023-12-26 12:45:52 +01:00
ali kettab
484785fb88 Override {Set,Is}DoubleBuffered() under wxQt
Closes #24136.
2023-12-26 12:45:52 +01:00
ali kettab
d44408d448 Fix wxScrollWindow not scrolling by mouse dragging under wxQt
Get rid of wxQtInternalScrollBar and use QScrollArea's scrollbars instead.
2023-12-26 12:45:52 +01:00
ali kettab
6a76e7a610 Fix wxPaintDC under wxQt after the last commits
The {menu,tool,status} bars will not be painted correctly otherwise.
2023-12-26 12:45:52 +01:00
ali kettab
1a7f1ccc85 Add missing override to wxQtEventSignalHandler 2023-12-26 12:45:52 +01:00
Vadim Zeitlin
400ce8b582 Return null from wxGetX11Display() when using Wayland
Returning Wayland display pointer as XDisplay was really confusing and
resulted in more weird crashes than just using null pointer directly.
2023-12-25 21:17:17 +01:00
Artur Wieczorek
5725f0be41 Replace macro with inline function in wxPGPropertyGridIterator-related code
Replace wxPG_ITERATOR_CREATE_MASKS macro with inline function to ensure
type safety.
2023-12-25 15:10:14 +01:00
Artur Wieczorek
6a5b0667b5 Remove macro from wxPGPropertyGridIterator-related code
Remove simple wxPG_ITERATOR_PARENTEXMASK_TEST macro and use just the code
to increase code readability.
2023-12-25 15:10:08 +01:00
Artur Wieczorek
c8552aec0c Make wxPGPropertyFlags a bitmask
To improve type safety of flags.
2023-12-25 15:09:50 +01:00
Artur Wieczorek
6dd129049f Initialize array for wxPropertyGrid alphabetic mode only once
Array holding items to use in non-categoric mode should be created and
initially populated only once.

Closes #24145.
2023-12-23 18:57:38 +01:00
Viachaslau Lisouski
ca405352e0 Add wxFileSystemHandler for "data" scheme
This notably allows embedding images directly in HTML.

Closes #24138.
2023-12-18 22:19:11 +01:00
Vadim Zeitlin
68eaff5c02 Merge branch 'valgen-wxlb_single' of https://github.com/wsu-cb/wxWidgets
Extend wxGenericValidator to work with single selection wxListBox,
3-state wxCheckBox and wxColourPickerCtrl.

See #24134.
2023-12-18 20:02:24 +01:00
Vadim Zeitlin
f8a6f0cd39 Initialize wxFileDialog::m_data in default ctor in wxMSW too
This corrects a problem introduced in 11ed91af8f (Add missing default
constructor of wxFileDialog in wxMSW, 2023-12-03) as m_data remained
uninitialized when default ctor was used.

See #24113.
2023-12-18 16:49:35 +01:00
Artur Wieczorek
41109f64f0 Initialize member variables 2023-12-17 16:47:52 +01:00
Artur Wieczorek
a8f3e0da70 Get rid of of unsupported overloads of wxIntProperty::DoValidation()
wxIntProperty::DoValidation() overloads for wxLongLong_t and wxULongLong_t
parameters are not supported because for these types there are no direct
conversions to wxVariant.
Arguments of such types will be handled by overloads for wxLongLong
and wxULongLong.
2023-12-17 16:47:30 +01:00
Bill Su
fb6a7d5a8e wxGenericValidator: add support for wxCheckBoxState 2023-12-17 02:10:51 -05:00
Bill Su
4d3acc90d7 wxGenericValidator: add wxColourPickerCtrl support 2023-12-14 19:17:32 -05:00
Bill Su
ea4800fcb9 comment that single-select wxListBox allows works with int 2023-12-14 18:58:53 -05:00
Blake-Madden
6d89a14c72 Add wxGrid::CopySelection()
This code was already used for Ctrl-C handling, refactor it into a
separate function that can be called from the application now.

This commit is best viewed with --color-moved-ws=ignore-all-space Git
option.

Closes #24124.
2023-12-12 20:18:59 +01:00
Vadim Zeitlin
188b5b8942 Merge branch 'generic-tree-icon-fixes'
Generic tree icon fixes, notably fixing regression in icons position in
high DPI for the legacy code using wxImageList.

See #24127.
2023-12-12 20:18:05 +01:00
Vadim Zeitlin
18ce5a07fd Merge branch 'misc-mac-fixes'
Some minor changes to get rid of a few warnings in Mac build.

See #24123.
2023-12-12 20:03:56 +01:00
Vadim Zeitlin
60f6c0f4e1 Adjust indent and spacing after DPI change if necessary
Although wxGenericTreeCtrl is not used under MSW by default, it still
doesn't hurt to adjust its metrics when DPI changes there.

Note that this shouldn't be done for the platforms using DIPs.
2023-12-11 02:19:02 +01:00
Vadim Zeitlin
7c7429c015 Stop using "short" for wxGenericTreeCtrl::m_indent
There doesn't seem no reason at all not to use "int" for this member.
2023-12-11 02:09:26 +01:00
Vadim Zeitlin
0999976f6d Fix using wxImageList in wxTreeCtrl in wxGTK in high DPI
The icons positioning was broken by 53b4f4ddf2 (Use physical size in
wxImageList, 2023-11-03) because the logical size was calculated
incorrectly in the case when wxImageList was used for the icons and
ended up being 8x8 for 16x16 icons when using 200% scaling, which was
clearly wrong and resulted in the icons not fitting in the space
allocated for them because they actually took 32x32 physical pixels due
to scaling of all bitmaps from wxImageList.

Fix this by correctly taking account of the window DPI scale factor.
This is a bit roundabout because using FromPhys() later just undoes
this, but it allows to keep using the same code when using wxImageList
and wxBitmapBundle for storing bitmaps and so is simpler.

Note that we must only do this when wxImageList was provided by the
user, i.e. with the legacy code, but not when it was created internally
in addition to wxBitmapBundle, as in this case we recreate it on DPI
change using the correct, DPI-adjusted size, already, so restrict this
scaling to the case when we don't have wxBitmapBundle only.

This commit is best viewed ignoring whitespace-only changes.
2023-12-11 01:47:10 +01:00
Vadim Zeitlin
5dffb76d0a Remove bool parameter from MacSetClipChildren()
This parameter was always "true" in the existing calls to this function
and the underlying UseClippingView() didn't support passing "false" to
it anyhow, so it seems simpler and more clear to just remove the
parameter.

It also avoids clang warnings about it being unused.

No real changes.
2023-12-11 00:41:48 +01:00
Vadim Zeitlin
d4b5c21de7 Fix compile-time check for macOS 11
This fixes warnings about MAC_OS_X_VERSION_11_0 not being defined when
using older SDKs, as 21da0e128d (Change wxRendererNative to use
NSCell-based methods under Mac, 2023-11-12) used a wrong name for the
version constant: since macOS 11 these constants don't use "X" in their
names any longer.

Remove this and add a comment to the place where we define them to
document this not quite obvious naming convention.
2023-12-11 00:40:16 +01:00
Paul Cornett
c3d1618cc8 Fix transitory visual glitch with wxBORDER_NONE on GTK3
Changing the CSS after adding child to already-showing parent
can cause a fleeting glimpse of the original style.
See #24105
2023-12-10 09:10:42 -08:00
ali kettab
5c46947c57 Fix wxStatusBar with field controls under wxQt
Postpone the creation of the QStatusBar fields until the first call to
SetStatusText(). This is to account for any field control added by the
user and also to avoid having to call UpdateFields() multiple times.

wxSTB_ELLIPSIZE_XXX and wxSTB_SHOW_TIPS supports are also implemented now.

The statbar sample is also updated: The OnSize() handler is removed because
it doesn't do much. that is: it is defined to keep the bitmap centered in the
status bar field it occupies if it is resized. but this is already done by the
wxStaticBitmap control, at least under wxMSW, wxGTK3 and wxQt.
2023-12-07 17:20:00 +01:00
ali kettab
02610d5d4b Remove trivial Init() from wxStatusBar under wxQt 2023-12-07 17:20:00 +01:00
ali kettab
d3bdf486b3 Don't override Refresh() in wxStatusBar under wxQt
This is not necessary and, more importantly, results in a crash if you try
to recreate the status bar (which can be seen in the statbar example)

Also remove leftover QList declaration
2023-12-07 17:20:00 +01:00
Blake-Madden
5ba009e861 Add Catholic Feasts holiday authority class (US observances)
This includes a static function to calculate Easter that can be used for
other authorities.

Document the wxDateTimeWorkDays and wxDateTimeHolidayAuthority classes.

Closes #24094.
2023-12-05 00:53:26 +01:00
ali kettab
2c9fee3d6f Add wxStatusBar::AddFieldControl() to simplify adding controls
This allows user codes to simply designate where their controls should
appear in the status bar without the need to handle wxEVT_SIZE
themselves.

They can still handle the event if the default positioning does not meet
their needs, but the new API is simpler and can be implemented for wxQt.

Closes #24092.
2023-12-05 00:39:04 +01:00
Kumazuma
11ed91af8f Add missing default constructor of wxFileDialog in wxMSW
This ctor exists in the other ports and there is no reason for it not to
exist in wxMSW too.

Closes #24113.
2023-12-03 15:03:12 +01:00
Vadim Zeitlin
6f501fd022 Merge branch 'qt-overlay' of https://github.com/AliKet/wxWidgets
Add native wxOverlay implementation under wxQt.

See #24080.
2023-12-03 15:00:34 +01:00
Vadim Zeitlin
7e2b0eea19 Merge branch 'args-init-improve'
Minor improvements to command line arguments initialization.

See #24103.
2023-11-30 02:53:44 +01:00
Vadim Zeitlin
5318637839 Merge branch 'fix_SVG_premultiply' of https://github.com/teliseo/wxWidgets
Fix wxBitmapBundle::FromSVG(), which renders incorrectly on GTK and add
wxHAS_PREMULTIPLIED_ALPHA to make the code dealing with alpha more clear
and correct.

See #24097.
2023-11-30 02:35:20 +01:00
Stefan Csomor
bcbc31e97f Fix clipping of scrolled windows under macOS Sonoma
We need to use a native clip view for things to behave correctly under
this OS version, otherwise scrollbars can be overdrawn by the window
contents.

Closes #24067.

Closes #24073.
2023-11-30 02:16:04 +01:00
Vadim Zeitlin
d4484c48c4 Rename wxInitData::InitializeFromWide() to InitIfNecessary()
And do nothing in this function if the arguments had been already
initialized, as it will make it more convenient to call from other
places.

No real changes.
2023-11-30 00:41:09 +01:00
Tim Eliseo
fce4941404 Add wxHAS_PREMULTIPLIED_ALPHA to abstract if wxBitmap pixels are premultiplied.
All previous relevant platform-specific tests have been changed to use this
symbol. Also, samples/image now premultiplies conditionally, correcting a
visual anomaly on wxGTK.
2023-11-26 13:23:52 -08:00
ali kettab
d205e331ce Added native wxOverlay implementation under wxQt 2023-11-23 22:49:15 +01:00
ali kettab
0c6e2fafd6 Make wxWindowDC work if constructed outside of a paint event under wxQt
Also prepare wxScreenDC to work with wxOverlay (in the upcoming commit)
2023-11-23 22:49:15 +01:00