Also remove the macros used in the test to perform the same tests for
wxStaticText and wxCheckBox and use a helper function instead, making
the code more clear and extensible.
No real changes.
The names of these methods were confusing because they implied that they
were the actual implementations of the public [SG]etLabel(), while this
wasn't at all the case.
Give them then ames describing what they really do and also update the
comments to hopefully be more clear.
No real changes.
Fix bug introduced by the (relatively) recent wxJoystick rewrite: using
"!m_buttons" is wrong as it always returns 0 for any button(s) but the
first one, we need bit-wise "~m_buttons" here instead.
See https://github.com/wxWidgets/wxWidgets/pull/942
See #1142.
Combination of multiple borders looks bad, so skip drawing the left/top
borders in wxGrid{Row,Col,Corner}LabelWindow if wxGrid already has a
border around it.
Grid contents was drawn in grey colour instead of the usual active one
when it was disabled, but the row and column labels kept their default
appearance, which looked out of place.
Fix this by greying them out too. This should have been arguably done in
73145b0ed1 ~17 years ago, but better late
than never.
Don't assume that m_findIter is always valid initially, i.e. after
FindFirst() is called, as this is not the case if the memory FS is
empty, i.e. which no files had been added to it yet.
This also allows to simplify the iteration logic, as we don't need to
check m_findArgument (which, in turn, obviates the need to clear it when
we reach the end of the iteration) and can just use m_findIter directly.
Closes#18416.
Using "!(cond)" inside wxASSERT macro expansion prevented both gcc and
clang (although not MSVC) from giving -Wparentheses warnings if the
assignment operator was accidentally used instead of the equality
comparison operator.
Change the macro definition to use the condition directly, without
negating it, to let gcc/clang give the warning if appropriate.
After enabling wxBUILD_USE_STATIC_RUNTIME it cannot be disabled again
(except by manually modifying CMAKE_C*_FLAGS_*). Improve this by setting
the build flags to their default value when wxBUILD_USE_STATIC_RUNTIME
is disabled.
Closes https://github.com/wxWidgets/wxWidgets/pull/1338
Allow changing the colour of the label in the active and hover states to
make it possible to improve its contrast with the tab background in
these states.
Closes#18406.
Even though the data is supposed to be 7-bit here, we can make an effort
to decode 8-bit data if we get any as it can't be worse than just
throwing it away.
Closes https://github.com/wxWidgets/wxWidgets/pull/1336Closes#2793.
If accepting a socket connection failed, wxSocketImpl::Accept() used
close() to close the socket even under MSW, but it can be only used for
the file descriptors there and closesocket() must be used instead for
the sockets.
Add new (private) wxCloseSocket define and use it both here, to fix the
bug, and elsewhere to make the code more clear.
Closes#18407.
wxControl::Create() has a different signature than wxWindow::Create()
(its 6-th parameter is of const wxValidator& type instead of
const wxString&) so it cannot be invoked from the the general template of
wxScrolled<T>::Create() method. We need to move a call to T::Create()
function to a dedicated template function wxCreateScrolled() responsible
for actual creation of the scrolled window and overload it for custom
classes if necessary.
This has to be done for wxControl and from this overloaded function
wxControl::Create() can be called with rearranged parameters.
Items using wxSYS_COLOUR_BTNFACE (light grey in the default theme) for
their background are, for some reason, drawn using the colour of active
selection (blue) even when the control doesn't have focus.
This is wrong, but there just doesn't seem to be any way to prevent this
from happening when using the native drawing logic other than not using
wxSYS_COLOUR_BTNFACE for the background (modifying any colour channel by
1 is enough to work around the issue). So to draw the item ourselves in
this case and hope that it remains indistinguishable from the native
appearance when not using the system theme.
Closes#17988.
This is important as enabling the system theme results in changes to the
native ListView control appearance that are not undone later even if the
system theme is disabled. Notably, the item rectangle width is reduced
by 2 pixels when system theme is enabled and it's not increased to its
original value even when it's disabled later, resulting in gaps between
items through which the control background shows, for example. This also
makes items drawn using our own HandleItemPaint() slightly, but
noticeably, larger than the items using standard appearance, which looks
bad.
All these problems can be avoided if we skip enabling the system theme
in the first place if EnableSystemTheme(false) had been called before
creating the control, so support doing it like this and document that
this is the preferred way of disabling the system theme use.
Closes#17404, #18296.