The documentation's notes about MSW limitations about setting priority
before creating the thread do not appear to be true (anymore). Thread
priority is already set by Create() if SetPriority() was called earlier.
Setting it immediately just failed, because the thread did not exist
yet, but this was fixed by the previous commit.
It defaults to 1, but can be set to 0 to force using the generic version
of the control even under GTK or Mac, where the native version is used
by default.
This can, unfortunately, be useful to work around various but multiple
native control limitations.
This makes more sense for a page of a GtkNotebook, which is always
positioned at (0, 0) relative to its client area, and is also more
compatible with wxMSW.
Closes#18548.
Closes https://github.com/wxWidgets/wxWidgets/pull/1670
macOS 10.12+ implements automatic tabbing in the OS. This adds
entries to the menus and also adds a tab bar. Some applications
might want to disable this, so provide an interface for doing this.
Closes https://github.com/wxWidgets/wxWidgets/pull/1674
Add support for this attribute for text-like cells to the native macOS
version too, to bring it up to parity with the generic and GTK ones.
Closes https://github.com/wxWidgets/wxWidgets/pull/1673
Under wxOSX non-solid wxColour with NSColor backend is represented by
pattern image and it would be useful to have ability to get it e.g. to help
dealing with non-solid wxColours by frameworks not supporting such colours,
like e.g. Cairo.
Partially work around currently unimplemented cache invalidation in
wxMac and do it on the fly if an invalid index is passed to
GetDisplay() to at least avoid crashing, even if this doesn't fully
solve the problem, e.g. we still can use stale information.
Closes#18607.
The change of 4990515aba resulted in
(disabled by default, but which may be enabled when building
applications using wxWidgets) MSVS 2017 warning C4265 ('class' : class
has virtual functions, but destructor is not virtual), so test for clang
explicitly instead of just testing for non-gcc.
Fix positions of the checkboxes drawn by wxGridCellBoolRenderer and
shown by wxGridCellBoolEditor so that there is no jump when starting or
stopping to edit grid cells with boolean values.
See https://github.com/wxWidgets/wxWidgets/pull/1662
Using wxRendererNative::GetCheckBoxSize() as the size of wxCheckBox just
doesn't work with GTK 3, as the control has additional padding between
its actual contents and the focus rectangle, which means that its actual
size must be greater than the size to be passed to DrawCheckBox() in
order to draw a checkbox of the same size.
However it isn't really necessary to resize wxCheckBox at all, it's
enough for DrawCheckBox() to produce a check mark of the same size as
that shown in a default-sized wxCheckBox and this does work in wxGTK.
So keep the default size of wxCheckBox to make everything work.
This means wxGetGridCheckBoxRect() is not useful any more, so replace it
with wxGetContentRect() which just positions a rectangle of the given
size inside another one (this should probably be moved somewhere else,
as it's more general than wxGrid).
Doing this makes the checkbox unusable with the default GTK 3 theme as
the default grid background colour (white) is the same as the colour of
the check mark -- so changing the checkbox background to it makes it
invisible.
Work around this by adding a new SetTransparentPartColour() method that
can be used by wxGrid (and, in the future, user code if we decide that
this is really the best solution to this problem that we can provide) to
make the checkbox blend in with its background without actually changing
its appearance.
It doesn't make much sense to pass the size to the function supposed to
compute it, so call wxRendererNative::GetCheckBoxSize() from the
function itself instead of forcing its callers to do it.
No real changes.
Remove the code in wxGrid::ShowCellEditControl() which moves grid
editors unnecessarily and also remove workarounds that were required
because of it in the editors SetSize() functions.
This helps to ensure that the editor is placed at the same position the
renderer draws the cell value, so that it doesn't jump around annoyingly
when editing starts (which was especially noticeable for boolean-valued
cells).
Make this header self-sufficient, instead of requiring wx/headerctrl.h
to be included before including it.
Remove the now unnecessary wx/headerctrl.h inclusion from
src/generic/grideditors.cpp.
Add ability to get the size of the checkbox without any margins by
passing wxCONTROL_CELL flag: this can be useful when the checkbox is
part of some "cell", e.g. wxGrid one, and doesn't need any extra margins
around it.
Currently wxCONTROL_CELL is only really used by wxGTK2 implementation.
This method of wxGtkStyleContext uses a GTK function only available
since 3.20, and so can't be implemented for the earlier versions, hence
don't even define it in this case.
Note that the caller still needs to test for the run-time version.
Sockets returned by wxSocket::Accept() are non-blocking by default and
the only way to use them safely in worker threads is by switching them
to the blocking mode by calling SetFlags(wxSOCKET_BLOCK).
However this didn't work correctly since at least 2.8 days, as turning
wxSOCKET_BLOCK on didn't unregister the socket from the event loop, with
which it had been registered on creation. Fix this by doing this now,
which ensures that the main thread doesn't get any notifications about
the socket if it's used, in a blocking way, in a worker thread.
Note that making the new socket blocking after accpeting is still pretty
inefficient and pre-creating the socket as blocking and using
AcceptWith() is still preferable, but at least it does work now.
Closes#12886.
In addition to unblocking and registering the socket, also support using
this function to make the socket blocking and unregistering it from the
event loop, if its flags include wxSOCKET_BLOCK.
This was already half-done by wxMSW, which took wxSOCKET_BLOCK presence
into account in its implementation, but not by the Unix implementation.
Now do it under all platforms, as this will be useful for switching a
previously non-blocking socket to blocking mode.
Finally, rename the function to better reflect what it really does.
See #12886.
It should still be possible to use DoEnableEvents() to disable events
for blocking sockets and this can be useful if a previously non-blocking
socket became blocking due to a SetFlags(wxSOCKET_BLOCK) call, so adjust
the fix of e18c8fd29a (see #17031) to
avoid calling EnableEvents() for blocking sockets instead of ignoring
them in DoEnableEvents() itself.
Also add an assert checking that we never try enabling events for
blocking sockets as this still doesn't make sense and so shouldn't
happen.
No real changes yet, but this is necessary for the upcoming commits.
See #12886.
Fix bug with not being able to update wxTaskBarIcon under MSW after a
DPI scale change or [dis]connection of another monitor using different
DPI: this resulted in "TaskbarCreated" message being sent by the system,
which we handled by trying to create the taskbar icon again. However in
this case, recreating it failed, presumably because it still existed, as
modifying the existing icon still worked.
Change the handle of "TaskbarCreated" to try both adding and updating
the icon, as it seems that we can't be sure whether we still have it or
not when we get this message.
Refactor the existing code to specify the operation to perform when
calling the new DoSetIcon(). This actually makes things slightly simpler
for it, as it doesn't need to update m_iconAdded inside it any more.
Closes#18588.
There is absolutely no good reason to do it and it resulted in
silently truncating all the string formatted using "%s" to their first
65535 characters when using our wxPrintf() implementation.
Closes#18586.
Actually allow using wxWebVieWIE-specific methods for setting the
emulation level.
Make it possible to include wx/msw/webvieW_ie.h by removing inclusion of
the private headers from it, which was in turn achieved by moving all
the implementation details into a private class.
See https://github.com/wxWidgets/wxWidgets/pull/1647
Ensure that the entry is always (just) big enough to show any value
valid in this spin control.
This also ensures that GetBestSize() doesn't need to be overridden to
use GetSizeFromTextSize() any longer as the best size will be determined
correctly by GTK itself.