Commit graph

20922 commits

Author SHA1 Message Date
Vadim Zeitlin
a0f7980295 Add wxAuiTabCtrl::DoEndDragging()
No real changes, just refactor the code to reset all drag-related
variables in a single function instead of doing it manually in several
places.

As this function also resets m_clickTab, which could previosuly remain a
dangling pointer, change the code to get its value before calling it.
2023-11-06 00:11:52 +01:00
Vadim Zeitlin
0fd15e405f Initialize wxAuiTabCtrl members in their declarations
Ensure that all of them are initialized, including m_clickTab, which
didn't seem to be always initialized before.

No real changes (as m_clickTab doesn't seem to have been used before it
was initialized).
2023-11-06 00:05:50 +01:00
Vadim Zeitlin
600049f20c Merge branch 'dfb-cxx17'
Fix wxDirectFB build with C++17.

See #23991.
2023-10-25 23:49:00 +02:00
Vadim Zeitlin
9e8a913e4d Merge branch 'qt-textctrl-hittest' of https://github.com/AliKet/wxWidgets
Implement several previously missing wxTextCtrl functions in wxQt.

See #23984.
2023-10-25 23:46:30 +02:00
Vadim Zeitlin
9d06e4c4a7 Implement wxSearchCtrl::GetEditHWND() correctly in wxMSW
Since the changes of 4d76a87015 (Make wxSearchCtrl inherit from
wxTextEntry in all ports, 2023-07-09, see #23697) GetEditHWND() returned
null for wxSearchCtrl which was considered to be correct because all
wxTextEntry functions were supposed to be forwarded to wxSearchTextCtrl
anyhow.

This wasn't really correct, however, as GetEditHWND() was also called
from SetHint(), resulting in an assert failure and falling back on
generic hint implementation which, while mostly working, suffers from
some problems that the native implementation doesn't have.

So make this function return the actual HWND used by the associated text
entry to fix this and allow SetHint() to work as before and also
forestall any problems due to not having the right HWND in the future.

See #23983.

Closes #23975.
2023-10-25 23:45:23 +02:00
Vadim Zeitlin
b389483c58 Work around the use of "register" in DirectDB headers
This keyword results in deprecation warnings since C++11 and errors
since C++17 in which it was completely removed.
2023-10-24 01:21:39 +02:00
ali kettab
d91fd33ffd Implement wxTextCtrl::{Set,Is}Editable() under wxQt 2023-10-22 19:57:48 +01:00
ali kettab
334814bf85 Implement wxTextCtrl::SetMaxLength() function under wxQt
This is currently implemented for single line control only. But unfortunately the
wxEVT_TEXT_MAXLEN event is only emitted when the Qt version used is 5.12 or higher.
2023-10-22 18:54:23 +01:00
ali kettab
9b2e4ff2e5 Implement wxTextCtrl::HitTest() function under wxQt 2023-10-22 18:05:13 +01:00
ali kettab
6d7f9342be Fix wxContextMenuEvent event propagation under wxQt
Closes #23973.
2023-10-22 01:32:58 +02:00
Vadim Zeitlin
e43f913313 Remove all blank "Modified by:" lines from top comment blocks
Having this line is not useful at all as it doesn't contain any
information and shouldn't be filled in the future as git-shortlog can
provide the information about people who changed the given file more
more reliably than consulting the comments in any case.

Keep the non-blank lines for historical purposes.
2023-10-22 01:22:48 +02:00
Vadim Zeitlin
c601bf4279 Merge branch 'qt-fixes'
Fix bugs preventing GUI tests from working with wxQt and provide native
implementations of wx{Date,Time}Ctrl in this port.

See #23925.
2023-10-22 01:18:50 +02:00
Vadim Zeitlin
e478aa74b1 Use "= default" for default ctors of just added classes
Also remove a couple of unneeded lines.
2023-10-22 01:18:26 +02:00
ali kettab
032fc66cea Now wxTimePickerCtrl is a native control under wxQt 2023-10-15 13:35:24 +01:00
ali kettab
e20d8ba2cc Now wxDatePickerCtrl is a native control under wxQt 2023-10-15 13:35:24 +01:00
ali kettab
4faf201a08 Use the generic implementation of wxPalette under wxQt
Until now, wxPalette under wxQt was just a dummy implementation
Let's turn to the generic one which works perfectly under wxQt too.
2023-10-15 00:10:02 +01:00
ali kettab
216e9e14cc wxComboBox now forwards to wxTextEntry when setting its value under wxQt
Clean up no longer used code.
2023-10-14 17:58:53 +01:00
ali kettab
7ec7fe6dea Make wxTextEntry::DoSetValue() reusable under wxQt
This is a preparation for wxComboBox and wxBitmapComboBox to reuse the code
from the base class by just forwarding to wxTextEntry.
2023-10-14 17:58:53 +01:00
Paul Cornett
642f226eb6 Build fix for wxUSE_DATETIME==0 2023-10-12 16:15:16 -07:00
ali kettab
e919ec6ccd Remove newly added functions from wxQt
QtSet{Min,Max}Size() were added for use by Set{Min,Max}Size() and
DoSetSizeHints() overrides. and since we have canceled overriding
Set{Min,Max}Size() in previous commit, there is no need to keep them
around without good reason.
2023-10-10 10:51:26 +01:00
ali kettab
ee2dba802c Don't override Set{Min,Max}Size() in wxWindowQt
This partially reverts commit 3c68696 (Make wxTopLevelWindow::SetSizeHints()
work in wxQt) because it breaks some wxSizer tests. and more importantly, it
breaks the documented behaviour of SetMinSize() which says:

Notice that calling this method doesn't prevent the program from making the
window explicitly smaller than the specified size by calling SetSize(), it just
ensures that it won't become smaller than this size during the automatic layout.
2023-10-10 10:51:26 +01:00
PB
b87a7ab9e7 Remove wxNODISCARD from wxBasicString::Get() declaration
Using both wxDEPRECATED_MSG and wxNODISCARD for some reason breaks
compilation with clang (when using C++17 or newer standard).

Since wxBasicString::Get() is deprecated, one warning should be enough
so just remove wxNODISCARD from the method declaration.

Closes #23952.
2023-10-09 09:00:33 +02:00
Blake-Madden
4235a018be Document that wxGetSingleChoice() geometry parameters are ignored
Also make it clear that wxCHOICE_{HEIGHT,WIDTH} constants are not really
used for anything.

Closes #23949.

Co-authored-by: Vadim Zeitlin <vadim@wxwidgets.org>
2023-10-07 18:58:58 +02:00
Vadim Zeitlin
80e8dc3692 Merge branch 'msw-add-def-catalog'
Fix AddStdCatalog() under MSW and add functions without msg ID fallback.

See #23930.
2023-10-06 01:03:25 +02:00
Vadim Zeitlin
64476dd3e7 Deprecate wxLocale::AddCatalog() overload taking msgIdCharset
This parameter is never used any more, so it should be simply removed
from the application code using this function.
2023-10-02 19:21:48 +02:00
Vadim Zeitlin
94b1a17aeb Add AddAvailableCatalog() and use it in AddStdCatalog()
The new function only returns true if the catalog could be really
loaded and not if it is considered not to be needed because the message
ID language (which is typically "en-US") happens to be present in the
preferred UI languages list (which seems to always include "en-US" in at
least Western European MSW).

This allows to distinguish, albeit in a rather awkward (but
backwards-compatible) way between having a translation for the given
language and not needed such translation.

It is still not clear if it is really correct to return "en-US" from the
list of preferred languages even if the user has never intentionally
configured the OS to indicate that English is acceptable, but at least
now we can work around this issue and use AddAvailableCatalog() in
AddStdCatalog() to make sure we only skip loading unversioned wxstd.mo
if the versioned wxstd-x.y.mo file is really found instead of never
doing it, as was the case until now (see #23886).

Also add GetBestAvailableTranslation() helper which seems more useful
than the existing GetBestTranslation() one and is similarly related to
it.

See #18227.
2023-10-02 19:21:48 +02:00
Vadim Zeitlin
e8faf2f56c Merge branch 'wxlistctrl-fixes'
Improve consistency of checkboxes in wxListCtrl between virtual and
report mode, and between the generic and MSW implementation, see #23869.

Also disable WS_EX_COMPOSITED for virtual wxListCtrl because it
generates an endless stream of cache events, see #23878.

See #23890.
2023-09-30 23:13:51 +02:00
PB
5ca3157467 Fix return type of wxBitmap::UseAlpha() under wxMSW
The method should return bool but was returning void.

This commit is best viewed ignoring whitespace-only changes.

Closes #23903, #23919.
2023-09-30 22:32:34 +02:00
Maarten Bent
fa26c8724d
Don't use internal check state for generic virtual wxListCtrl
Just like the MSW virtual wxListCtrl, the checkbox state is determined by OnGetItemIsChecked.

See #23869
2023-09-30 17:32:54 +02:00
ali kettab
3c6869605e Make wxTopLevelWindow::SetSizeHints() work in wxQt
Override Set{Min,Max}Size and DoSetSizeHints() to pass size information
to Qt: setting min/max widget size at the wxWidgets level is not enough
to take effect unless the information is also set at the Qt level.

Closes #23917.
2023-09-30 15:23:25 +02:00
Vadim Zeitlin
7e9d06f584 Ensure that the currently shown wxSimplebook page has focus
When calling wxSimplebook::ChangeSelection(), the focus remained on the
previous, now hidden, page, unless it was explicitly set to one of the
controls on the new page.

This was completely unexpected as it could result in the user
(inadvertently) changing the values of the already "accepted" controls
on the last page, so don't let this happen and always set the focus to
the new page explicitly, even if this hasn't been done by
ShowWithEffect() which doesn't do it at least under wxMSW.

Closes #23914.
2023-09-30 15:21:50 +02:00
Vadim Zeitlin
aaabb840b5 Merge branch 'egl-wl-swap-interval'
Fix setting EGL swap interval under native Wayland too.

See #23909, #23512.
2023-09-30 15:17:39 +02:00
Vadim Zeitlin
4883e185bc Merge branch 'qt-popup' of https://github.com/AliKet/wxWidgets
Fix wxPopupWindow implementation under wxQt.

See #23904.
2023-09-30 15:15:41 +02:00
Vadim Zeitlin
d57e175a7c Merge branch 'qt-bmp-premult' of https://github.com/AliKet/wxWidgets
Use premultiplied ARGB32 format for wxBitmap under wxQt: this makes
bitmap-related unit tests pass with wxQt too.

See #23872.
2023-09-30 15:07:13 +02:00
PB
6caaf589f1 Use more modern appearance for wxMSW wxTreeCtrl by default
Change wxTreeCtrl default style under wxMSW to make it look more
up-to-date by default: use twisting buttons and full-row highlight and
don't display connector lines.

Using wxTR_LINES_AT_ROOT together with wxTR_NO_LINES may look odd but it
is needed because without wxTR_LINES_AT_ROOT, the buttons would not be
displayed.

Also update wxTreeCtrl screenshot in the docs.

Closes #23844.
2023-09-30 15:00:48 +02:00
ali kettab
4036a555bf wxPopupWindow implementation under wxQt completed 2023-09-28 14:09:59 +01:00
Vadim Zeitlin
647564126b Call eglSwapInterval() when it can succeed
Postpone calling this function until we get the (first) frame callback
as by this time the EGL context is fully valid and can be used inside it
and it doesn't fail any longer.
2023-09-27 14:43:58 +02:00
Vadim Zeitlin
6e8fc23705 Make Wayland frame callback a wxGLCanvasEGL member function
This allows to make m_readyToDraw private.

No real changes otherwise.
2023-09-27 14:38:12 +02:00
ali kettab
be75c73880 Add missing guard before using wxImage in wxBitmap code 2023-09-24 11:39:58 +01:00
ali kettab
b12cdc6739 Minor fixes to constructors
Make wxMask constructor taking QBitmap explicit

And wxBitmapRefData already has a constructor taking a QPixmap
2023-09-24 11:11:02 +01:00
ali kettab
1e43b375bc Added QtBlendMaskWithAlpha() to wxBitmap under wxQt
Blend mask with alpha channel and remove the mask.

We need this function for performance reasons. e.g. the wxImageList (used by
wxTreeCtrl and wxListCtrl) calls this function to convert the mask (if any)
to alpha. Because the controls (under wxQt) using the image list ignore the
mask on the bitmaps and expect alpha instead.

This is similar to MSWBlendMaskWithAlpha() found in wxMSW port.
2023-09-23 21:53:26 +01:00
Artur Wieczorek
2cdca2d744 Deprecate wxPGPropertyFlags that are intended for internal use 2023-09-22 23:39:53 +02:00
Artur Wieczorek
763ed589f5 Prevent from using wxPropertyGrid private header in the user code 2023-09-22 23:39:53 +02:00
Artur Wieczorek
11582b4082 Refactor wxFlagsProperty to simplify initialization 2023-09-22 23:39:53 +02:00
Artur Wieczorek
5a87cbdf3d Use enum class to represent wxPGKeyboardActions 2023-09-22 23:39:53 +02:00
Artur Wieczorek
9cb4d8fbbe Save keyboard actions as std::pair in wxPropertyGrid
Store two possible action codes in std::pair instead of packing them
into one int value with bitmasks. This reduces level of indirection
in accessing keyboard actions and make the code more maintainable.
2023-09-22 23:39:52 +02:00
Artur Wieczorek
87e86dee86 Fix wxPG_PROP_ACTIVE_BTN flag definition
wxPG_PROP_ACTIVE_BTN used in wxStringProperty is misinterpreted
as wxPG_PROP_PASSWORD so these flags they can't share the same value
(wxPG_PROP_CLASS_SPECIFIC_2).

Closes #23856.
2023-09-22 23:39:52 +02:00
Vadim Zeitlin
a0a28a7973 Fix recent wxGTK regression when using wide string entry point
The changes of 5f17915e63 (Store original command line options passed to
main(), 2023-09-02) didn't account for the possibility of the
application using an entry point such as wxEntry(), wxEntryStart() or
wxInitialize() with wide character argv under Unix -- where this is
typically not the case but still possible and if any of the wide string
overloads of these functions were called, wxInitData::arg[cv] remained
uninitialized resulting in a crash in gtk_init_check() later.

Fix this by ensuring we do initialize them in this case too and also
reconstruct the original narrow string argvA from wide string arguments
in this case, which is a bit wasteful but unavoidable if we're not
provided access to the original main() arguments.

See #23877.
2023-09-21 22:03:11 +02:00
ali kettab
c1f91177df Enable raw bitmap data access for monochrome bitmaps in wxQt 2023-09-13 19:44:14 +01:00
ali kettab
74a1d69084 Fix wxMask creation when converting wxImage to wxBitmap in wxQt
Also GetSubBitmap() should return the sub-mask too if the bitmap has a mask

Notice that masked/unmasked areas are reversed to be in accordance with wx
2023-09-13 19:24:00 +01:00