Remove an explicitly set CMAKE_OSX_DEPLOYMENT_TARGET from the CMake iOS
build in order to use the default value which is now also set to an iOS
instead of macOS version.
The minimal sample doesn't have an implicit deployment target set, while
the library does through CMakeLists.txt in root. This can result in iOS
link errors when not explicitly setting CMAKE_OSX_DEPLOYMENT_TARGET as
the sample will then use a target OS with an architecture that may not
be present in the library with its current target OS version.
Fix by copying the part setting CMAKE_OSX_DEPLOYMENT_TARGET in the
library to the minimal sample as well. Both parts should be kept in sync
but that still seemed preferable to additionally polluting an example
file for CMake usage with a dependency by introducing a common include
file.
Differentiate between the minimal supported version of macOS (10.10)
and iOS (12.0) instead of setting CMAKE_OSX_DEPLOYMENT_TARGET to
(macOS-only) 10.10 for both platforms.
Cancel the request and wait until it actually is cancelled when exiting
the sample.
This is a bit ugly, especially the busy-waiting part, but still better
than potentially crashing.
A cancelled request is not supposed to end up in the "failed" state, but
it did, resulting in showing an error in the webrequest sample after
pressing on the "Cancel" button, which was clearly unwanted.
When cancelling a request it was possible for it to be deleted while it
was still used from another thread.
Fix this and make the code much more obviously correct by simply
"locking" the request until the event generated by it is processed: now
IncRef() and DecRef() calls are always balanced as they're called from
ctor and dtor of StateEventProcessor helper only.
Use wxLogStatus() to update the status bar, this is shorter and simpler
than using GetStatusBar()->SetStatusText(wxString::Format(...)).
Also use wxFrame::SetStatusText() which forwards to wxStatusBar method
with the same name when we want to just clear the status bar.
No real changes.
Shared ownership semantics again seems inappropriate here as we're not
actually sharing the pointers here, so just use raw pointers instead
(with C++11 we could use std::unique_ptr<>, but this is impossible with
our own map and scoped pointer implementations).
No real changes.
Using shared pointer seems to be ill-advised here, the stream shouldn't
be shared as it's going to be used by wxWebRequest itself and can't be
used by the application code in parallel, so the ownership transfer
semantics is more appropriate.
We could take a wxScopedPtr<> instead, but wx API takes ownership of raw
pointers everywhere else, so do it here too.
Incidentally fix a bug with calling IsOk() on a possibly null pointer.
When using pre-v6 comctl32.dll (e.g. by disabling the visual styles
explicitly or by just not using the manifest), we need to update the
drop down height manually, and for this we must ensure that overridden
wxChoice::DoMoveWindow() is called from MSWUpdateDropDownHeight().
Closes#19026.
Instead of trying to mimic native statusbar background rendering in our
own code, use NSWindow setContentBorderThickness:forEdge: to extend the
border that is drawn by the system. This is the canonical way of doing
statusbars ("bottom bar") in AppKit.
The text is still drawn generically, but that's a much smaller issue
than trying to match the border gradient.
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.
Using this object we can put an wxImage on or retrieve it from the clipboard. wxImage is stored internally as a blob with either a PNG file (wxMSW, wxGTK) or a TIFF file (wxOSX) and therefore some its metadata (like resolution) is stored on the clipboard too (what is not the case for wxBitmap stored with wxBitmapDataObject). wxImages stored with wxImageDataObject can be used by native applications.
Closes#17631.
PNG is a custom clipboard format but images stored in this format are supported by e.g. MS Excel, MS PowerPoint, GIMP (including image transparency).
See #17631.
When an item is marked as not containing any value in the expander
column, we must still draw the expander button if it has children, so
skip only drawing the item value in this case (and also preparing it for
drawing it, as calling PrepareForItem() would trigger an assert failure
for the items without value), but still execute the rest of the drawing
code for it, including drawing the background and expander button.
Closes https://github.com/wxWidgets/wxWidgets/pull/2144
Remove the platform-specific wxWebRequest headers from the files lists
and from MSVS 200x project files.
This should have been done in e5bd5a926c (Move backend-specific
wxWebRequest headers to private subdirs, 2020-12-26) manually, as
update-setup-h script doesn't remove the old files from the variable
definitions.
It notably fixes CMake build under MSW and Mac, which failed due to not
finding the referenced files.
Fix CMake build with 3.10, which gave the following errors
CMake Error at build/cmake/init.cmake:321 (check_c_source_compiles):
Unknown CMake command "check_c_source_compiles".
Call Stack (most recent call first):
build/cmake/main.cmake:16 (include)
CMakeLists.txt:69 (include)
previously. Apparently the required CheckCSourceCompiles module was
already included from somewhere else with later CMake versions, but not
with this one, so do include it explicitly.
Don't force the application code to deal with wxObjectDataPtr<> or,
worse, calling {Inc,Dec}Ref() manually by hiding it inside the wx
objects themselves and giving the value-like semantics to them.
There should be no real changes in the behaviour, but the API does
change significantly. Notably, wxWebRequest is not a wxEvtHandler itself
any longer, as this would be incompatible with the value semantics, and
an event handler needs to be specified when creating it, so that it
could be notified about the request state changes.
Generalize copy ctor and assignment operators to allow implicit
conversions from wxObjectDataPtr<D> to wxObjectDataPtr<B> if D is
implicitly convertible to B (e.g. if B is the base class and D is a
class derived from it).
This makes wxObjectDataPtr<> more like standard smart pointer classes
and more useful.
We can't skip resorting wxDataViewCtrl contents when the sort order is
defined by the model class, as it can change at any moment, so restrict
this optimization to the cases when we're sorting by the value of some
column.
Closes https://github.com/wxWidgets/wxWidgets/pull/2153
Do not invoke a renderer's PrepareForItem when estimating best column
width in generic wxDVC for items with no value because PrepareForItem
fails for items with no value when the null variant cannot be converted
to the expected type.
Closes https://github.com/wxWidgets/wxWidgets/pull/2149
Double clicking on empty space under the items in wxDataViewCtrl still
results in actionDoubleClick: being called, even though there is no
valid item under the mouse.
Just ignore such notifications, as we're not supposed to generate any
events in this case (neither GTK nor generic version do it) and calling
itemAtRow: with invalid row results in errors due to invalid index use.
Closes https://github.com/wxWidgets/wxWidgets/pull/2142Closes#18984.
If HBITMAP represents 32-bit bitmap we need to check if this is a bitmap with transparency (ARGB) or maybe RGB only (0RBG) and set alpha flag accordingly.
Closes#18798.
When using wxGridCellAutoWrapStringRenderer::GetBestWidth() with a cell
containing more newlines than fit, the function never exits because it
keeps on trying to wrap fit into the number of lines based on available
height only.
Fix by also taking into account the number of newlines a cell's text
value has.
Closes#15943.
Check that a row's height doesn't change when auto-sizing a column with
an auto-wrapping cell containing newlines.
Also currently will cause an infinite loop which will be fixed in the
next commit.
See #15943.