1. Override wxWindow::GetContentScaleFactor() to use gdk_window_get_scale_factor()
when available, and to use correct scale (1.0) otherwise, as wxDC::GetPPI()
(used by overridden method) is not properly implemented for wxGTK
2. Record scale in wxBitmap(wxImage&) ctor and wxBitmap::CreateScaled()
3. Adjust cairo scale for drawing bitmap, and (inversely) for drawing on bitmap
It doesn't make sense to use any fallbacks when converting to/from UTF-8 and
this wasn't even done consistently as only wxSafeConvertWX2MB() used
MAP_INVALID_UTF8_TO_OCTAL, but not wxSafeConvertMB2WX().
More importantly, UTF-8 conversion can never fail for a valid Unicode string,
so there is no need for any fall backs.
Not doing this prevented the tooltips from working correctly if the library
was shut down and reinitialized again, so add a module ensuring this is done.
Closes#17360.
Such strings are not really URIs as they should have been encoded if they were
but we can obtain them from e.g. wxFileSystem::FindFirst(), so handle them
correctly here as it's simpler than checking all the places where Unescape()
is called.
Add a unit test checking that decoding an URI containing both Unicode and
percent-encoded Unicode characters works correctly.
Due to recent changes in utils, stdpath and the removal of carbon, building on
OS X was broken by various compiler errors and linker issues.
Closes https://github.com/wxWidgets/wxWidgets/pull/210
No real changes, just remove the nonsensical comment from wx/defs.h which
completely lost its meaning since wxWindowID typedef was replaced by a class 8
years ago in cf2810aa39.
In practice, almost everybody using validators also seems to use this style,
so make it the default (this hadn't been done when it was originally
introduced because of compatibility concerns, but now, 15+ years later, it's
probably safe enough to change this).
Add a helper wxLaunchBrowserParams struct with clearly distinct "url" and
"path" fields and GetPathOrURL() accessor which returns whichever is
appropriate.
This makes the code more clear and ensures that we never pass URLs (but only
file paths) to xdg-open under Unix as it doesn't handle them.
See #17227.
Ensure GTKEnableEvents() is called automatically on scope exit whenever
GTKDisableEvents() is called.
This fixes a couple of potential bugs where GTKEnableEvents() could be not
called if wxCHECK() condition failed and makes the code shorter and safer.
This is documented as being required in the MSDN and, in practice, is
necessary for Windows to update the icon cache and show the new icon.
Closes https://github.com/wxWidgets/wxWidgets/pull/195
Leave ownership of the native window to the user code as it may want to reuse
it for some other purpose and provide an explicit Disown() function that can
be called if the user really wants wxWidgets to take ownership of the native
window.
In particular, this avoids problems when using ARC under OS X which resulted
in a double "release" before.
Cocoa has been the default toolkit in wxWidgets for a long time. There is really no good reason to use Carbon in 2016 and this removes a lot of unused and unmaintained code.
This was broken by the refactoring during the addition of OS X implementation
of wxAppProgressIndicator in 11a5b83e2c, restore
this functionality by explicitly calling the code initializing the progress
indicator in wxGaugeBase from wxMSW implementation.
Closes#17301.
The state represented by TCHT_ONITEM Win API flag is not a superposition
TCHT_ONITEMICON and TCHT_ONITLABEL states but it represents a separate state.
The fact that binary value of TCHT_ONITEM is bitwise-OR operation on
TCHT_ONITEMICON and TCHT_ONITEMLABEL doesn't matter here. The same applies to
wxBK_HITTEST_xxx flags where state represented by wxBK_HITTEST_ONITEM is not a
superposition of wxBK_HITTEST_ONICON and wxBK_HITTEST_ONLABEL.
Add note to wxBookCtrl::HitTest documentation that wxBK_HITTEST_ONICON,
wxBK_HITTEST_ONLABEL, wxBK_HITTEST_ONITEM are mutually exclusive bits.
See https://github.com/wxWidgets/wxWidgets/pull/159
Add wxImage::SetLoadFlags() and static SetDefaultLoadFlags() to allow
suppressing the warning messages that can be logged when loading some files,
notably PNG ones with invalid sRGB profiles which, unfortunately, seem to be
rather common and result in annoying warnings about them with libpng 1.6+.
Closes#15331.
The argument to this method should basically just never be used, so while we
still keep it for compatibility (because it doesn't cost anything to do it),
make it clear that it should never be specified in the new code and, also,
that this function is actually only used inside wxWidgets and shouldn't be
normally called from outside of the library at all.
This reverts commit 62763ad541 which seems to
have been completely unnecessary as the fields had been already initialized
and this commit actually broke initialization of the propagation level of the
copied wxCommandEvent objects.
Add a unit test proving that things do work.
Closes#16739.
Since the changes to use IRichEditOleCallback in wxMSW wxTextCtrl (i.e.
bd650ec3d9 in master), wxEVT_CONTEXT_MENU was
not sent for it any more as the control consumed it after using the callback.
Send the event manually before the default handling takes place to fix this.
At least when using standard fonts under MSW, the underlines under the
consecutive words didn't overlap, resulting in ugly gaps between them when
using more than one word as the link text, for example.
Work around this by drawing an extra, slightly offset, underlined space when
the previous cell was drawn underlined.
This is not completely true, but the changes in the versions 9 and 10 of g++
ABI don't (seem to?) affect wxWidgets, so allow using later versions of the
compiler for building the code using the libraries created using earlier ones.
wxDIB::ConvertToImage called with Convert_AlphaAuto converts wxDIB to wxImage with automatic checking if 32 bpp DIB contains real alpha values (legacy way).
When it is called with Convert_AlphaAlwaysIf32bpp then automatic checking is disabled and 32 bpp DIB is unconditionally converted to ARGB wxImage.
This allows a bitmap to scale with the size of the wxStaticBitmap control.
Scaling can be controlled to fill the control with or without changing the
bitmaps aspect ratio.