This method is needed to determine the sorted state of a control derived
from wxItemContainer without knowing the actual derived control class.
Closes#23971.
If a control is contained in a wxStaticBoxSizer or its child sizer,
wxStaticBoxSizer::GetStaticBox() should be used as the control's parent.
However, widgets and dialogs samples did not do that, which resulted in
flooding the message log in widgets sample with warnings about this; in
dialogs sample the warnings were shown in the debug output.
Fix this by always using the static box as the control's parent when the
control is contained (directly or indirectly) in a wxStaticBoxSizer.
Closes#23967.
To sort its items (files and folders) wxFileCtrl used simple string
compare and wxDirCtrl case-insensitive string compare.
However, the files and folders should be presented to the users in the
way they are used to, i.e., in the natural order. Therefore, use
wxCmpNatural() for file and folder names and wxStricmp() for file
extensions.
Closes#22054.
Closes#23962.
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.
Changing the selection could behave wrongly and result in an assert
failure as the selection anchor could have become invalid, due to the
change of the number of items in the control.
Fix this by invalidating it when this happens.
Not sure if it really helps, but try to wait for the events in these
tests as well if only for consistency with what was done in 3d07de66b1
(Add a wait to wxGrid UI unit tests too, 2023-10-03).
A console program should not really be linked with the GUI library, but it used
to work, and it's unavoidable with the monolithic build, so fix the regression.
See #23981
Added in commit a605ee3 (Don't pass hyphenated shortcuts to Qt) which
mistakenly replaces the last minus sign (-) of an accelerator with plus
sign (+).
Use the right type when inserting new items into the list box. This ensures that
the wxEVT_CHECKLISTBOX event is emitted for these new items. And in fact, it should
be part of this commit 16da1a1 when wxQtListWidgetItem was introduced.
Qt uses QString::localeAwareCompare() for comparison and this is what their
documentation says: "On other Unix-like systems without ICU, the comparison
falls back to the system library's strcoll()". Under MSW, Qt uses CompareStringEx()
IOW, Qt always compares strings by locale-specific sorting criteria and BTW
this is what wxGTK was like before this commit 625ed74 (Make sorting of wxListBox,
wxChoice and wxComboBox identical to the MSW sorting)
Qt spits out annoying warnings about inactive painter (QPainter::font:
Painter not active) when using wxDC::GetChar{Width,Height}(). Simply mute
them by using the default application font explicitly.
The wxListCtrl would assert with this message: '../src/qt/listctrl.cpp(452):
assert "col < columnCount()" failed in SetItem(): Invalid col'
Because under wxQt: no columns means no items, and no items means
no selection can be made at all.
Changes of 9710592cc4 (Erase unwanted list view separators in dark mode
under Windows 11, 2023-06-05) wrongly kept the check for "itemCount",
verifying that the control is not empty, only in the "needToDraw" case,
but it is needed in the "needToErase" case as well because it also uses
the bottom item index which is invalid if there are no items.
Fix this by always checking that the control is non-empty before doing
anything else.
Closes#23960.
Co-authored-by: Vadim Zeitlin <vadim@wxwidgets.org>
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.
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.
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.
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>
Mark it as deprecated in the documentation without deprecating it
formally in the code, as it seems to be used in some existing code and
there is no urgency to remove it, but using it in new code still doesn't
make any sense.
Closes#23945.
The check for the line being deleted being in the visible range
prevented us from refreshing anything at all if the line which was just
deleted was the last line of the control.
When the wxWidgets sources are in a path containing '++', CMake would
show errors on the command line:
[cmake] RegularExpression::compile(): Nested *?+.
[cmake] RegularExpression::compile(): Error in compile
This happens because the full path was interpreted as a regular
expression when creating the source_groups. Without wxSOURCE_DIR the
regular expressions still match and create correct source groups, so
remove it.
Closes#22738.
Closes#23943.
Remove any remaining mouse messages from the input queue after showing
the file dialog because they somehow remain after it is destroyed and
could be processed by the application once wxFileDialog::ShowModal()
returns, resulting in phantom events being processed by the controls
that just happen to be under the button of the file dialog that was
clicked to close it.
Closes#10924, #23944.