wxImage with mask should be converted to wxBitmap with mask and not to
wxBitmap with alpha channel values. Converting wxImage mask to wxBitmap
alpha is not implemented under wxMSW and wxGTK and wxOSX implementation
should adhere to this convention.
Use more appropriate colours for the row/column cell headers and don't
hardcode black (i.e. at least use white instead in dark mode) for the
frozen border.
Closes https://github.com/wxWidgets/wxWidgets/pull/2026
See #18941.
This macro replaces the deprecated __Verify_noErr defined in the SDK.
It is different from assert, as the expression given to the macro is
always evaluated and then, if the result is not zero, and asserts are
on, an assert containing a human readable message with the description
of the error code is triggered.
Closes https://github.com/wxWidgets/wxWidgets/pull/1973
Co-authored-by: Vadim Zeitlin <vadim@wxwidgets.org>
The changes of 1065e61ab7 (Merge branch 'log-ms', 2021-01-16) broke
logging when timestamps were disabled as they still tried to format the
timestamp in this case, using empty timestamp, which resulted in an
assert.
Fix this and also make new code more similar to the existing one by
adding wxLog::TimeStampMS() helper parallel to the already existing
TimeStamp() and write it in the same way -- which notably ensures that
it does nothing when the timestamp is empty.
See #13059.
This event was processed in a worker thread, which was different from
all the other events and also almost surely not thread-safe, so change
this and queue it for processing in the main thread instead.
Use wxMemoryBuffer instead of non-owning pointer in wxWebRequestEvent
and reset the buffer used internally every time to ensure the data is
still available by the time the event is processed.
Also increase the amount of data downloaded in the "advanced" page of
the sample as it has to be greater than wxWEBREQUEST_BUFFER_SIZE, which
is currently 64KiB, to have a chance of seeing the value actually
change, otherwise all the data arrives in a single event. As it is,
using the maximal size supported by the httpbin service, we only get 2
events.
Sizing the images stored in the list should stick to the convention
adopted in the native wxImageList implemented in wxMSW.
Images stored in the list should have the sizes as it is declared for
the list even if provided bitmaps have different sizes.
In case of discrepancies their dimensions should be adjusted accordingly
(cropped or extended).
If image using bitmap and mask colour is added to nonmasked wxImageList we
need to convert effective mask to alpha channel values prior to adding the
image to the native list to preserve transparency.
Revert 8535cde836 (Remove apparently unnecessary m_hasExplicitFont,
2020-07-14) and make 9cd3ab5ebd (Improve wxGenericTreeCtrl colours/fonts
updating on theme change, 2020-07-14) really work as expected by using
not only m_hasExplicitFont, but also m_hasExplicit{Fg,Bg}Col in order to
ensure that we only update the attributes if they hadn't been explicitly
set.
This is necessary because the hack with reusing m_has{Fg,Bg}Col didn't
work under Mac where the colour wasn't used at all when they were false.
This still seems to be a problem as the behaviour is different from that
of the other ports, but fixing this in wxOSX doesn't seem to be simple,
so don't rely on this working and use separate variables instead.
Closes#18940.
This doesn't seem to be necessary and is actually actively harmful, as
this code prevented tooltips from working with non-native windows, such
as those used inside wxSplitterWindow in the splitter sample.
Just remove this code entirely and add SetToolTip() calls to the sample
to show that they do work now.
Closes https://github.com/wxWidgets/wxWidgets/pull/1978Closes#14220.
Remove a lot of Mac-specific code from wxStatusBarMac in favour of using
shared wxStatusBarGeneric:
- Now that wxFRAME_EX_METAL aka NSWindowStyleMaskTexturedBackground
doesn’t affect text placement, there’s no reason for customized
DrawFieldText(). As a side effect of this removal, ellipsizing fields
is now supported.
- Remove customized DoUpdateStatusText() code that is no longer needed.
See https://github.com/wxWidgets/wxWidgets/pull/2160#pullrequestreview-563916013
macOS 11 has an option (on by default) to tint window backgrounds with
wallpaper colors. This means that standard window background color is
not a constant anymore and can change as the window is moved across the
screen.
The key to supporting this is to _not set background color_ internally
to what we think is the correct default color, or to repaint
backgrounds. Let the OS handle the default behavior instead.
Closes https://github.com/wxWidgets/wxWidgets/pull/2158
Notable record the commands that can be used to recover from a conflict
with the server version of the notes (merging notes is more involved and
usually not worth it, they can just be re-added after resetting).
Call GetResponse() only once.
Also put the code for State_Completed inside the case for this state in
the switch instead of testing for it separately later.
No real changes.
Semantics of this function wasn't really clear and it was used only
once, so just inline it at the point of use and define better what
happens for various states there.
Also use a switch rather than testing for individual states to make sure
this code is updated if another state is added in the future.
No real changes.
We shouldn't call SetState() to switch to the state that we're currently
already in, normally. Add an assert to verify that this indeed doesn't
happen.
Also improve the logging statement to show both the old and the new
states.
Under MSW, don't set the state to State_Cancelled as soon as Cancel()
was called, as the request was still used from the other threads
afterwards, resulting in race conditions and crashes.
Fix this by just removing the SetState(State_Cancelled) call from the
main thread, as it was redundant anyhow. This also makes the behaviour
correspond to the documentation, which indicates that Cancel() works
asynchronously.
Also ensure, for all backends, that we actually cancel the request only
once, even if public Cancel() is called multiple times. This required
renaming the existing wxWebRequestImpl::Cancel() to DoCancel().
Add a trivial wxWinHTTPCloseHandle() wrapper calling wxLogLastError() if
closing the handle failed -- this is really not expected to happen, so
make sure to at least log it if it does.
It's better not to have this method in the public class, even if it
means that we need to pass a wxWebSessionImpl object to wxWebRequestImpl
ctor explicitly now.
No real changes.
No real changes, just use the same name as in the other backends for
consistency (we could also rename m_sessionImpl in the other ones to
m_sessionCURL and m_sessionURLSession respectively, but this would have
been more work and the latter name is really not great).