Commit Graph

65326 Commits

Author SHA1 Message Date
Andrew Radke
4101849b4d Grow wxGenericProgressDialog automatically if needed
If the new message is longer than the previously shown one, increase the
dialog size to fit it, instead of truncating the message. Still don't do
anything if the new message is shorter to avoid unwanted constant
changes in the dialog size if the message keeps changing.

This is the original patch proposed in #10624, which it really makes
sense to apply now because it makes the generic version match the
behaviour of the native one under MSW (and the behaviour of the native
version cannot be changed).

See #10624.
2017-11-16 01:35:49 +01:00
Vadim Zeitlin
0473d14ef1 Make wxProgressDialog::Fit() work in native MSW version
This method is supposed to adjust the dialog size to its contents and
while the dialog increases automatically when using native
implementation under MSW, it doesn't shrink back on its own and so it's
still useful to allow Fit() to do it.

Update the sample to test Fit() too.
2017-11-16 01:35:49 +01:00
Vadim Zeitlin
0736bdfb28 Prevent constant size changes in native MSW wxProgressDialog
MSW implementation of wxProgressDialog adjusted the dialog size to the
size of the message shown in it on each update, resulting in visually
unpleasant constant jumping around (this is the same problem that we
used to have in wxGenericProgressDialog long time ago, see #10624).

Minimize this by using TDM_UPDATE_ELEMENT_TEXT instead of
TDM_SET_ELEMENT_TEXT for changing the element text. This still increases
the dialog size if the new element text is longer than the old value,
but at least doesn't shrink it back if it is shorter, which is already
quite an improvement.

Notice that this change requires using TDF_EXPAND_FOOTER_AREA style, as
otherwise the expanded information can't be updated without a re-layout.
But this doesn't seem to be a big loss and it's not really clear why did
we explicitly clear this flag before anyhow.

Update the dialogs sample to make it easy to test for this behaviour and
the documentation to mention MSW version peculiarities.
2017-11-16 01:35:48 +01:00
Vadim Zeitlin
6d2f903a48 Remove an apparently unnecessary line from MSW wxProgressDialog
It doesn't seem necessary to disable the use of common buttons, so don't
do it.
2017-11-16 01:35:48 +01:00
Paul Cornett
c1c9c2c5e5 Fix build with GTK+ 2.6 2017-11-15 10:52:21 -08:00
Paul Cornett
21620da3e5 Move GTK3 wxNO_BORDER handling to wxControl
So wxNO_BORDER works with other controls, such as wxBitmapButton.
Also use GTK prefix on ApplyCssStyle(), and add an overload that
creates the GtkCssProvider.
2017-11-15 10:51:38 -08:00
Vadim Zeitlin
ef0309c141 Fix wxTypeIdentifier::operator==() to be const
Comparing things doesn't change them.

Also rewrite operator!=() in terms of operator==() to ensure
consistency.
2017-11-14 15:58:17 +01:00
Vadim Zeitlin
a98c51e6bc Check for pangoft2 >= 1.38 in configure too
We need to use PKG_CHECK_MODULES(pangoft2) anyhow because we need to
link with its libraries, so make the version check there too and
simplify wxFont::AddPrivateFont() implementation in wxGTK.
2017-11-14 15:27:49 +01:00
Scott Talbert
0d62f728ae Avoid crashing when wxTaskBarIcon is used with a non-X11 display
Fixes #17779
2017-11-13 20:30:59 -08:00
Vadim Zeitlin
5463402e39 Try to show when do X errors happen while running tests
Install an X11 error handler to try to gather more information about the
GUI tests failures on buildbot.
2017-11-14 02:57:57 +01:00
Vadim Zeitlin
f5703673ad Skip focus event test when running under buildbot
This test seems to consistently fail, but the failure can't be
reproduced locally nor debugged on buildbot, so, lacking any other
solution, just disable it.
2017-11-14 02:41:58 +01:00
Vadim Zeitlin
f3b5cc32fa Fix recently introduced crash in ClippingBoxTestCase
Commit fc7f20c419 did fix a memory leak in
this test case, but at the price of introducing a crash due to deleting
the same pointer twice.

The real fix would be to change the code here to avoid returning a
pointer which sometimes needs to be deleted and sometimes must not, but
for now just add a crude check to avoid crashing.
2017-11-14 00:41:31 +01:00
Vadim Zeitlin
ad448da284 Suppress deprecation warnings for g_option_group_free()
Closes #17877.
2017-11-14 00:41:31 +01:00
Vadim Zeitlin
99367a1530 Update glib version check in GetStandardCmdLineOptions()
This code still works fine with glib 2.50.
2017-11-14 00:41:31 +01:00
Vadim Zeitlin
d3b033f432 Allow webview sample to build without wxSTC
There doesn't seem to be any special reason to use wxStyledTextControl
in this sample and doing it unconditionally breaks the build with
--disable-stc, so use wxTextCtrl instead in this case.

Closes #17998.
2017-11-14 00:09:08 +01:00
Vadim Zeitlin
f3995658ff Increase timeout for WindowTestCase::FocusEvent()
The default 100ms doesn't seem to be enough when this test runs under
buildbot.
2017-11-14 00:06:21 +01:00
Vadim Zeitlin
11a5728b32 Replace remaining std::auto_ptr<> with wxScopedPtr in the tests
This should have been done in b8c9cd3528
to avoid all warnings about std::auto_ptr<> being deprecated when using
g++ 6 or later which compiles in C++14 mode by default.
2017-11-14 00:06:18 +01:00
Vadim Zeitlin
283f5a4d56 Remove useless wxFont::ActivatePrivateFonts()
Just "activate" the font immediately when adding it using
AddPrivateFont(), nothing seems to be gained from having two functions
and it just makes things more complicated both when implementing and
when using the API.
2017-11-13 22:29:30 +01:00
Vadim Zeitlin
c9d1f9a719 Clean up FcConfig object on library shutdown
Don't just leak it as was done before.
2017-11-13 22:29:30 +01:00
Vadim Zeitlin
d99a255e98 Fix private fonts support in wxGTK
Use pango_fc_font_map_set_config() to associate the FcConfig containing
the private fonts with the global Pango context to make them available.

Also use FcInitLoadConfigAndFonts() instead of just FcConfigCreate() to
initialize the new config with all the default fonts instead of just
using our private fonts in it.
2017-11-13 22:29:30 +01:00
Vadim Zeitlin
3158a46ce7 Require fontconfig >= 2.8 and change its guard macro name
FcConfigAppFontAddFile() that we use is only available since 2.8, so
check for at least this version of the library in configure.

Also change the macro guarding its use to the more semantically
appropriate "wxHAVE" rather than "wxUSE" and make it more precise by
adding "2_8_0" suffix to it.
2017-11-13 22:29:30 +01:00
Vadim Zeitlin
ed655bfcde Add wxFontEnumerator::InvalidateCache()
This is necessary to recognize new fonts, for example those added using
AddPrivateFont(), as being valid: otherwise they were not found in the
cache and couldn't be used in wxGTK.
2017-11-13 22:29:29 +01:00
Vadim Zeitlin
5a13e4eda2 Clear wxFontEnumerator face names cache on library shutdown
Don't rely on it being done during statics cleanup as this doesn't work
if the library is shutdown and re-initialized.

Use a module to do the cleanup, just as it's already done for a lot of
other global data in wx.
2017-11-13 22:29:29 +01:00
Vadim Zeitlin
5c17c4b745 Set ATSApplicationFontsPath in Mac app bundle
This is required to allow loading private fonts from the bundle
Resources/Fonts subdirectory and doesn't seem to have any negative
consequences for the applications which don't need this functionality.
2017-11-13 22:29:29 +01:00
Vadim Zeitlin
5d134711a1 Add BUNDLE_FONT_RESOURCES and use it in font sample
Allow copying font files to the Fonts subdirectory of the app bundle,
private fonts can only be loaded from there under macOS currently.
2017-11-13 22:29:29 +01:00
Vadim Zeitlin
4f5f4af3b1 Compilation fixes for wxUSE_STL==1 build
Add an explicit call to wc_str() in one place where conversion to
wchar_t* is needed and use wxString::operator==() instead of lstrcmp()
to avoid having to perform this conversion explicitly in another place.
2017-11-13 22:29:29 +01:00
Vadim Zeitlin
ac4f99fa0d Test for FontConfig availability in configure when using wxGTK
This library is now needed in order to implement wxFont private font
methods.
2017-11-13 22:29:29 +01:00
Vadim Zeitlin
28864d3ef6 Clean up private fonts on library shut down under MSW
Ensure we don't keep the values in the global gs_privateFontFileNames
variable if the library is shutdown and reinitialized later, this would
be unexpected.
2017-11-13 22:29:29 +01:00
Vadim Zeitlin
149807db26 Move wxMSW wxFont private font methods to src/msw/font.cpp
This ensures that they will be defined and work even when building with
wxUSE_GRAPHICS_CONTEXT==0 (as can happen even by default with old MinGW
versions).

Private fonts are still made available to wxGraphicsContext as well by
providing access to them from GDI+ code via wxGetPrivateFontFileNames().
2017-11-13 22:29:28 +01:00
Vadim Zeitlin
4145a30e06 Report errors if using private font fails in the font sample
Give more information instead of just silently not showing the
corresponding menu item.
2017-11-13 22:29:28 +01:00
Vadim Zeitlin
a7a59a263d Update the version when private font support was added
It will be 3.1.1 and not 2.9.5 as originally planned.
2017-11-13 22:29:28 +01:00
Arthur Norman
547e40b114 Add support for loading fonts from files.
wxFont::AddPrivateFont() can now be used to load a font from a file for the
applications private use. Update the font sample to show this.

Closes #13568.
2017-11-13 22:29:28 +01:00
Vadim Zeitlin
91697a8724 Use correct commit of src/png submodule
Fixes wrong commit accidentally used in the previous commit.
2017-11-13 22:25:59 +01:00
Vadim Zeitlin
760bd1bf4e Update png submodule to avoid -Wundef warnings 2017-11-13 22:16:10 +01:00
Vadim Zeitlin
f65a608993 Remove declared but not implemented wxFont::Unshare() in wxGTK
No real changes, just remove a method which was never defined nor used.
2017-11-13 22:16:10 +01:00
Václav Slavík
926d486f54 Fix NSFont bridging crash with Asian input methods on 10.11
There's a bug in OS X 10.11 where a toll-free bridged font may have an
attributed of private class __NSCFCharacterSet that unlike
NSCharacterSet doesn't conform to NSSecureCoding. This poses a problem
when such font is used in user-editable content, because some Asian
input methods then crash in 10.11 when editing the string. As a
workaround for this bug, don't use toll-free bridging, but re-create
NSFont from the descriptor instead on buggy OS X versions.

Fixes regression introduced in a77066d530
(#507).
2017-11-13 18:46:37 +02:00
Vadim Zeitlin
af16d8ba5c Explicitly set "update = checkout" option for submodules
It seems that older Git versions don't update submodules when issuing
just "git submodule update" if this option is not set.

We might actually prefer to use "update = rebase" but for now use the
smallest change that will (hopefully) allow people using older Git
versions to get the submodule updates.
2017-11-13 15:24:37 +01:00
Vadim Zeitlin
818a710af6 Update bundled libtiff to not use wxjpeg_boolean any more
This is not needed after e35f01384f.
2017-11-12 23:23:48 +01:00
Artur Wieczorek
4df04a88c5 Set wxPG cell background colour as wxPGComboBox background colour
Default wxGenericComboCtrl background colour is obtained under wxGTK
with wxComboBox::GetClassDefaultAttributes(). For wxGTK 3 returned colour
is fully transparent (00000000) which can cause problems with
proper drawing of controls deriving from wxGenericComboCtrl, like
wxPGComboBox which in turn is used by wxEnumProperty, wxCursorProperty,
etc.
wxPGComboBox should have background with the same colour as the cell
so we can explicitly set background colour to avoid using default one.

Closes #17986.
2017-11-12 22:09:09 +01:00
Paul Cornett
7592595252 fix SetPosition() parameter in documentation 2017-11-12 09:36:33 -08:00
Paul Cornett
142004884f Build fixes for wxUSE_UNICODE==0 2017-11-12 09:35:12 -08:00
Paul Cornett
cdb9436975 Use wxFALLTHROUGH 2017-11-12 09:34:22 -08:00
Paul Cornett
65cc4c1624 Avoid ifdef-ed override specification
Instead, add the base class functions so the derived class always
overrides. If/when wxX11 and wxMotif are removed there won't be an
ifdef that no one ever notices isn't needed anymore.
2017-11-12 09:33:37 -08:00
Vadim Zeitlin
4e226d6784 Merge branch 'extra-warn-fixes'
Fix a few harmless warnings given with -Wextra.
2017-11-12 17:48:16 +01:00
Vadim Zeitlin
4e593b9f06 Document switch to submodules for 3rd party libraries
Update the build instructions and the change log.
2017-11-12 17:47:09 +01:00
Vadim Zeitlin
e35f01384f Merge branch 'jpeg-submodule'
Switch to using submodule and update the library version.
2017-11-12 17:43:22 +01:00
Vadim Zeitlin
fc9d41fad3 Avoid -Wmissing-field-initializers for Dl_info struct
Rely on the default initialization, this is arguably slightly less
clear, but allows to avoid the warning (which is disabled by default,
but still).

Closes #17997.
2017-11-12 17:07:35 +01:00
Scott Furry
b39d29f433 Fix harmless -Wmissing-field-initializers in wxGTK
Closes #17996.
2017-11-12 17:05:55 +01:00
Scott Furry
3653b753d3 Fix clang -Winconsistent-missing-override in wxGLApp
Use "override" for wxGLApp::GetXVisualInfo(), but only for wxGTK2 where
it really overrides it, unlike in wxX11.

Closes #17995.
2017-11-12 17:02:43 +01:00
Vadim Zeitlin
a03441f959 Suppress harmless -Wmissing-fields-initialize in wxSecretStore
This warning is difficult to avoid as we don't want to initialize the
unused/reserved fields of SecretSchema struct, yet the compiler warns
about it (when using -Wextra).
2017-11-12 16:57:40 +01:00