This should have been done together with the other related updates in
35fa1f93bc (Reset wxSpinCtrl value to GetMin() if text string is
invalid, 2021-04-23), but was forgotten there.
See #19140.
C++20 deprecates arithmetic operations with the elements of different
enums and at least clang 10 and MSVS 2019 already warn about this when
compiling in C++20 mode, so avoid such operations at least in the public
headers to avoid warnings in the applications using wxWidgets and C++20.
Headers wx/filehistory.h and wx/filename.h were included only
when WX_PRECOMP was not defined.
However, these two files are not included in wx/wxprec.h,
so they must be always included directly.
Closes https://github.com/wxWidgets/wxWidgets/pull/2344
This requires manually sending the original key event back to the native
control because NSOutlineView doesn't implement the NSTextInputClient
protocol and so doesn't allow handling the keys in the usual way.
This partially undoes the recent changes to wxGTK wxSpinCtrl and reverts
to the previous behaviour, which was actually compatible with wxMSW, and
returns the minimum value when the text of the control is set to an
invalid string.
The function was documented to not generate the events, but actually
did generate wxEVT_TEXT ones, even if it didn't generate wxEVT_SPINCTRL.
This was inconsistent with wxGTK and generic wxSpinCtrlDouble used under
MSW, so change this to avoid the unwanted events.
Previously, wxSpinCtrl (using native control) and wxSpinCtrlDouble
(using the generic implementation) behaved differently in this case,
with the former changing its value but the latter keeping the last valid
value instead.
Make them behave the same by resetting the value in both cases and
document this behaviour.
We didn't document using wxwin.m4 at all anywhere, so do it at least
minimally now (we still need a separate page documenting its full
functionality) and also show a simple makefile using wx-config.
Closes https://github.com/wxWidgets/wxWidgets/pull/2338
Fix the bug introduced in the recent 34ab87ce4d (Get rid of CppUnit
boilerplate in wxSpinCtrlDouble unit test, 2021-04-19) which resulted in
failures in the subsequent unit tests and ensure that the spin control
is destroyed at the end of the test.
wxSpinCtrl::GetValue() behaviour after calling SetValue("") is currently
inconsistent between wxMSW and wxGTK, or even between wxSpinCtrl and
wxSpinCtrlDouble in wxMSW.
Disable the recently added test checking it for now.
This warning flag is really only used for stdlib debugging/writing,
and is off by default so that normal users of the library don't see
any warnings generated by the library (since they have no control
over it).
Fixes this warning:
In file included from ../../include/wx/html/helpctrl.h:19,
from ../../include/wx/help.h:27,
from ../../include/wx/cshelp.h:18,
from ../../tests/allheaders.h:85,
from ../../tests/allheaders.cpp:435:
../../include/wx/html/helpfrm.h:74:50: error: declaration of 'wxWindowID' shadows a global declaration [-Werror=shadow]
74 | wxHtmlHelpFrame(wxWindow* parent, wxWindowID wxWindowID,
| ~~~~~~~~~~~^~~~~~~~~~
In file included from ../../include/wx/wxprec.h:12,
from ../../tests/testprec.h:4,
from ../../tests/allheaders.cpp:433:
../../include/wx/defs.h:1965:13: note: shadowed declaration is here
1965 | typedef int wxWindowID;
| ^~~~~~~~~~
See https://trac.wxwidgets.org/ticket/19153
The entered text wasn't taken into account, as the override was still
used when its numeric value was retrieved by GtkSpinButton using our
"input" handler, so reset the override now as soon as we get "changed"
signal.
This doesn't seem to change anything in practice, but still use the
correct return type.
Co-Authored-By: Paul Cornett <paulcor@users.noreply.github.com>
Make it possible to use a string value different from the numeric value,
as wxMSW version allows this and some existing code depends on it.
Closes#19140.
No real changes yet, just refactor the code to always connect these
signals handlers and not just when using non-decimal base.
Add wxSpinCtrl::GTKInput() and GTKOutput() virtual methods to handle
these signals appropriately depending on the type of the control.
This will allow further customizing conversion to/from string in the
upcoming commit and will also make it possible to handle UI locale
different from the C locale in the future.
Just use this function now that it's available rather than calling
gtk_entry_get_text() (and sometimes forgetting to specify UTF-8 encoding
explicitly).
The field is used for common placement and sizing logic in
notebook-like controls that have a "controller buddy" control. Its use
isn't wxControl-specific and only relies on wxWindow API, so the
restriction to wxControl-inherited types is arbitrary.
Change the type to the more general wxWindow* pointer.
In practical terms, this allows derived classes to use e.g.
wxNativeWindow as the controller buddy.
This allows to retrieve the current contents of the text entry part of
wxSpinCtrl.
For now provide a stub in the base class, will be made pure virtual
later.
Co-Authored-By: Vadim Zeitlin <vadim@wxwidgets.org>
Introduced in 53bd139, wxReadlink() trivially wraps readlink(), but
returned int instead of ssize_t as defined for readlink() by POSIX.
Fixes "Implicit conversion loses integer precision: 'ssize_t' (aka
'long') to 'int'" on platforms with sizeof(ssize_t)>sizeof(int).