Include wx/defs.h to get wxUSE_DIRDLG value from it, otherwise it could be
undefined, and hence evaluate to 0 (unfortunately without even a warning with
some compilers), if this header was the first wx header to be included.
(this is a backport of 5948602f4f from master)
For the programs that use wxWidgets but can also run using just CLI, exiting
the program would show a bogus GTK error
GLib-GObject-CRITICAL **: g_type_class_unref: assertion 'g_class != NULL' failed
Fix this by only releasing the references to GTK_TYPE_WIDGET if we had
acquired it in the first place.
See https://github.com/wxWidgets/wxWidgets/pull/129
(this is a backport of e1f31febadea7d6277c7ee92c424ae7581e1d6d1 from master)
Fall back to the main application window if no parent was explicitly specified
using the standard GetParentForModalDialog() method.
See #17295
(cherry picked from commit 50435ef678)
Since the changes of db9baf9aa5 the label wasn't
explicitly reset to be empty on wxWindow creation because it was assumed it
would already be empty if not explicitly set, but this turned out to be false
for the controls using NSButton which (very helpfully) uses "Button" as its
label by default and so kept this useless label if it wasn't explicitly
overridden.
Fix this by explicitly resetting the NSButton title after creating it, to
ensure consistency between the real state of the control and what wxWidgets
thinks it is.
Closes#17152.
(cherry picked from commit ef1db7acda)
Mimics the scrolling behaviour of native MSW and GTK calendars by allowing to
increment/decrement the month by scrolling anywhere on the generic calendar.
Additionally, use horizontal scrolling to increment/decrement the year.
Backport of 50daf1feab + 4177593aef
into WX_3_0_BRANCH.
See also 50daf1feab (commitcomment-13087042)
The existing code tried writing to HKEY_CLASSES_ROOT which doesn't work, in
general, for normal, i.e. non administrator, users, under any post-XP versions
of Windows.
Fix it to write to HKEY_CURRENT_USER\Software\Classes, which is the part of
HKEY_CLASSES_ROOT for the current user and to which we do have write access,
and only continue to use HKEY_CLASSES_ROOT itself for reading.
(this is a backport of 0ed580f451 from master)
Use explicit c_str() when calling Cygwin functions taking char* or void*
instead of relying on implicit conversions.
(this is a backport of 09e7dc290c from master)
Use full path to the selected file before checking whether it exists,
otherwise the check could fail even if the file does exist but the current
directory is different from the one it is in.
Closes#16698.
(this is a backport of 5846144614 from
master)
This is not the case any more since 3.0 and it actually never used the same
ref-counting model as the classes described in the ref-counting overview
anyhow.
See #17216.
(this is a backport of 876e0501d8 from master)
Ever since 700256bbdb IsOk() returned true even
if setting the locale actually failed because the old locale was still set to
the null value.
Apply the minimal possible fix for this and just reset the old locale pointer
to null if initializing the locale fails to make sure IsOk() doesn't return
true in this case.
Explicitly set the last error indicator to 0 before checking that
wxLogSysError() logs it correctly as it wasn't always set to 0 otherwise.
(this is a backport of 2c64172825 from master)
::TlsGetValue() resets the last error code which means that the previous last
error is lost, but it shouldn't as we might be in the middle of logging it
with wxLogSysError(). So preserve the last error explicitly.
See #17209.
(this is a backport of 5e29b26d9e from master)
Verify that accessing a property really succeeded before using the returned
value.
This should fix at least one crash due to the use of uninitialized BSTR in
wxWebViewIE::GetCurrentTitle().
See #17204.
(this is a backport of 4489ec80e0 from master)
According to the documentation, insertText: argument is either NSString
or NSAttributedString. The latter is not a subclass of the former, yet
the code assumed the argument is always a NSString. This caused the
following exception:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason:
-[NSConcreteMutableAttributedString characterAtIndex:]: unrecognized selector sent to instance
Fix this by checking for NSAttributedString and extracting plain string
from it.
(cherry picked from commit 1acfe88347)
An invalid pointer was dereferenced after being deleted as ToDVI(item) checked
the item parent, i.e. used it, even though the item was already invalid.
Closes#17198.
This warning was harmless but very annoying as it was given for each and
every inclusion of this header.
Closes#16968.
(this is a backport of 5aae7c7387,
d2c1fce24e and
ec510a0c4b from master)
Use pango_font_description_copy() to copy fonts instead of
pango_font_description_to_string() and pango_font_description_from_string()
via wxNativeFontInfo::{To,From}String() respectively.
This is not only more efficient but also preserves the original family whereas
wxNativeFontInfo::FromString() helpfully replaces any fonts it doesn't know
about with the normal font name. That behaviour is probably wrong on its own,
but for now at least avoid silently changing fonts when copying them.
(cherry picked from commit 07380ba0b5)
Use both the contents and the header width when wxLIST_AUTOSIZE_USEHEADER is
given instead of just the latter.
Also make both wxLIST_AUTOSIZE_USEHEADER and the previously implemented
wxLIST_AUTOSIZE work efficiently for the virtual list controls by reusing
wxMaxWidthCalculatorBase already used in the generic wxDataViewCtrl.
Closes#10326.
(this is a backport of de7e315557 and
0e2d9e539c from master)