Commit Graph

63587 Commits

Author SHA1 Message Date
Vadim Zeitlin
15d22aed82 Merge branch 'cmake'
Closes https://github.com/wxWidgets/wxWidgets/pull/330
2017-12-15 00:33:07 +01:00
Vadim Zeitlin
4cc2762ebc Don't call wxDataViewModel::GetValue() for container row cells
This could be unexpected as it seems reasonable that the model won't be
ever asked about the value of a cell if it's not going to appear in it
anyhow -- however it could still happen during the column width
computation in the generic wxDataViewCtrl implementation.

Fix this in a minimally invasive way by just skipping the call to
GetValue() in this case.
2017-12-15 00:14:29 +01:00
Artur Wieczorek
2f2ecfa03f Don't use hard-coded button labels
Get labels from the central repository of "stock" labels.
2017-12-14 23:33:06 +01:00
Artur Wieczorek
29820dab5b Don't use GtkStock to refer to the built-in icons in GtkAssertDialog
GtkStock is deprecated since GTK+ 3.10 and built-in icons should be
identified directly by their names.
2017-12-14 23:26:07 +01:00
Jouk
47c0aed322 Add samples/event/gestures.cpp for compilation on OpenVMS 2017-12-14 08:59:26 +01:00
Jouk
a2864f907b switch on wxUSE_GRAPHICS_CONTEXT on OpenVMS 2017-12-14 08:57:33 +01:00
Rafael Kitover
aceefac2c9 GTK4: show_uri() is gone
Use show_uri_on_window() instead of show_uri() for GTK+4, show_uri() is
not available.
2017-12-12 08:48:36 -08:00
Rafael Kitover
52f231c9ff GTK4: no support for gtk_tree_view_set_rules_hint
Don't use gtk_tree_view_set_rules_hint() in GTK+4, it's not available.

It is also deprecated in GTK+3 since 3.14, and the documentation advises
to not use it at all, but I will leave the decision about whether to
remove it entirely to someone else.
2017-12-12 08:48:36 -08:00
Rafael Kitover
9f3aa0b4e5 GTK4: different API for adding dialog button
Support the GTK+4 API for adding buttons to dialogs (via __WXGTK4__):

- set_icon_name() instead of image_new_from_stock()/set_image()

- gtk_box_pack_end() takes only two parameters
2017-12-12 08:48:36 -08:00
Rafael Kitover
c09e27cfb4 GTK3/4: GTK_STOCK_CANCEL deprecated, use labels
GTK+3 deprecates GTK_STOCK_CANCEL and GTK_STOCK_SAVE etc. and GTK+4
removes them entirely. The API documentation recommends using the
strings "Cancel" and "Save" instead, use them (or the appropriate
translation.)
2017-12-12 08:48:36 -08:00
Rafael Kitover
1879293932 GTK4: gtk_init_check() does not take args
In GTK+4 gtk_init_check() takes no arguments, while in GTK+3 you could
pass argc/argv.

I'm not quite sure how to pass any arguments to GTK+4, so just call
gtk_init_check() in GTK+4.
2017-12-12 08:48:36 -08:00
Rafael Kitover
c2ef9ba275 GTK3/4: use widget scale instead of screen scale
GTK+4 does not support the gdk_screen_get_monitor_scale_factor() API
(since gdk has become more backend independent.)

Use gtk_widget_get_scale_factor() API instead on the app top window.

TODO: This does not solve the multi-monitor problem, for that it would
be necessary to use the scale factor of the widget on which the action
is being peformed.
2017-12-12 08:48:36 -08:00
Rafael Kitover
21776b16f5 regen bakefile/autoconf files based on 3559d83bc4
Run `bakefile_gen` and `sh autogen.sh` to regenerate all bakefile and
autoconf generated files with GTK+4 support from 3559d83bc4.
2017-12-12 08:48:36 -08:00
Rafael Kitover
22b0b4dda7 autoconf and bakefile support for GTK+4
Add autoconf and bakefile support for detecting and using GTK+4, similar
to how GTK+3 is detected and used.

GTK+3 is checked for first before GTK+4, this can be overridden in
`./configure` using `--with-gtk=4`.

With GTK+4 the `__WXGTK4__` `#define` is also set in `setup.h.in`.

This commit does not regenerate any files.
2017-12-12 08:48:36 -08:00
Vadim Zeitlin
ff96ebb616 Merge branch 'radiobox' of https://github.com/MaartenBent/wxWidgets
Improve radio box geometry calculation/layout code, in particular stop
using hardcoded pixel values as this doesn't work at all with high DPI.

See https://github.com/wxWidgets/wxWidgets/pull/638

Closes #18010.
2017-12-11 14:40:05 +01:00
Jouk
15b602e125 Update OpenVMS configuration 2017-12-11 12:32:01 +01:00
Jouk
bbfe87b963 Update OpenVMS configuration 2017-12-11 12:31:13 +01:00
Artur Wieczorek
4862884ed8 Don't use GtkStock to refer to the stock icons in wxArtProvider
GtkStock is deprecated since GTK+ 3.10 and stock icons should be
identified directly by their names.
2017-12-11 00:06:36 +01:00
Bill Forster
1e8ff2486a Fix drawing of the left-most AUI notebook tab under Windows 10
Apparently, in some situations the left edge of the first tab is not
drawn when it's not selected under Windows 10. While it doesn't seem to
affect all the systems (and couldn't be reproduced here), drawing the
left edge explicitly shouldn't do any harm and should fix the problem
for the systems that are affected by it, so just do it always.

Closes #17714.
2017-12-10 23:39:00 +01:00
Maarten Bent
b833b12931 Improve wxRadioBox height on wxMSW
With larger fonts, there is an excessive gap between the box and the first (and last) radio button.
Instead of using the dynamic character size, use the fixed size of the radio button to determine this height.
2017-12-10 23:24:40 +01:00
Maarten Bent
6168e44846 Remove unused defines from private wxMSW header 2017-12-10 23:23:30 +01:00
Maarten Bent
f696d035a6 Remove unused variables from wxRadioBox
These variables never got assigned a value.
2017-12-10 23:23:29 +01:00
Maarten Bent
febd929f0f Improve wxRadioBox width on wxMSW
Do not use 'RADIO_SIZE 20' as the fixed width of the radio button, but use the actual width as returned by wxRendererNative.
wxRendererNative has no GetRadioButtonSize, so for now use GetCheckBoxSize. It returns the same sizes.
Also add a half character width to account for the space between the button and the label.
There is no need to add extra width to the label of the static box.

Closes #18010.
2017-12-10 23:22:13 +01:00
Iwbnwif Yiw
c6de521959 Remove wxTreeListCtrl special first column resizing logic
Trying to give all the remaining space after allocating enough to the
other columns to the first one doesn't work well with wxDataViewCtrl,
which tries to do the same thing, but with the last column, so we
actually get some strange mix of behaviours, with both the first and
last columns changing size after the control itself is resized.

Stop fighting with wxDataViewCtrl and just let it to its own thing.

Closes #17476.
2017-12-10 23:21:24 +01:00
Vadim Zeitlin
62af6a648f Run tests for cmake build from test bat file under AppVeyor
The tests need to be run from appveyor-test.bat and not the main
appveyor.bat itself with the current approach, so move ctest invocation
there.
2017-12-10 22:41:44 +01:00
Vadim Zeitlin
008e8fcb21 Merge branch 'reduce-dvc-getlinestart'
Reduce the number of calls to GetLineStart() in generic wxDataViewCtrl
code and thus slightly improve its performance when variable line height
is used.

See https://github.com/wxWidgets/wxWidgets/pull/438
2017-12-10 19:21:33 +01:00
Vadim Zeitlin
c85da939e5 Tidy up the previous commit slightly
Declare the variables just before using them (and also initialize them
at the same time); use more readable variable names; fix braces style
and add a comment explaining why do we do all this in the first place.

No real changes.
2017-12-10 19:21:03 +01:00
Jens Göpfert
57bdd372fb Reduce number of calls to GetLineStart() in generic wxDVC
GetLineStart() is very expensive when using wxDV_VARIABLE_LINE_HEIGHT
style, so don't call it again unnecessarily if we already have the
result.
2017-12-10 19:06:29 +01:00
Paul Cornett
67a28b7968 Use better approximation for gradient caption colors
Caption color is a better choice than black
2017-12-10 10:00:05 -08:00
Paul Cornett
fcf21e61db Add wxDisplay implementation for GTK+4
GdkMonitor replaces GdkScreen
2017-12-10 09:40:26 -08:00
Vadim Zeitlin
6f23cea6df Fix the path of Expat library after move to submodules
It's in src/expat/expat now instead of being directly under src/expat.
2017-12-10 17:53:21 +01:00
Vadim Zeitlin
05a40aa510 Merge branch 'master' into cmake
Pull in the latest fixes, notably for wx(X)Locale to allow the tests to
pass.
2017-12-10 17:52:06 +01:00
Vadim Zeitlin
198adec748 Merge branch 'xlocale-fixes'
Fix completely broken wxXLocale and wxLocale unit tests.
2017-12-10 17:48:20 +01:00
Vadim Zeitlin
b5d0a291a5 Merge branch 'msw-double-buffer'
Improve double-buffering support in wxMSW wxListCtrl and optionally use
it in wxTreeCtrl too.

Closes https://github.com/wxWidgets/wxWidgets/pull/636
2017-12-10 17:47:31 +01:00
Steve Browne
ef91e5ecbe Implement wxTreeCtrl::SetDoubleBuffered() in MSW wxTreeCtrl
Also don't erase background when the control is double-buffered because
it's not necessary and can cause flicker.

See https://github.com/wxWidgets/wxWidgets/pull/374
2017-12-10 17:47:26 +01:00
Vadim Zeitlin
061e6f9a3c Fix flicker when resizing columns of report-mode MSW wxListCtrl
Just turn off background erasing to avoid having horrible flicker which
can be seen perfectly well simply by drag-resizing a column in a list
control with non-default background colour.

See https://github.com/wxWidgets/wxWidgets/pull/374
2017-12-10 17:47:21 +01:00
Vadim Zeitlin
17105cfd07 Simplify changing window styles in wxMSW code
Add wxMSWWinStyleUpdater and wxMSWWinExStyleUpdater helper classes which
allow writing code changing GWL_STYLE and GWL_EXSTYLE bits,
respectively, in a shorter and more clear way.

There should be no real changes in behaviour.
2017-12-10 17:47:16 +01:00
Vadim Zeitlin
588ae3744c Move fallback BS_TYPEMASK definition to wx/msw/missing.h
It can be useful in source files other than src/msw/control.cpp too.
2017-12-10 17:47:11 +01:00
Vadim Zeitlin
badf6bc300 Disable scrollbars for frozen wxTreeCtrl in MSW
Replace the hack with resizing the control to the minimal possible size
while it's frozen with just disabling its scrollbars in the frozen
state. This should also fix the original problem (of scrollbar jumping
around wildly as the items are added), but without different problems
due to the control being resized unexpectedly.

Unfortunately we don't have a reproducer for the original problem, which
the commits 6754c300cf ("Freeze wxTreeCtrl
in wxMSW by hiding it") and 4e1e8dc51b
("Change wxMSW wxTreeCtrl::DoFreeze() to not hide the tree any more" --
but resize it instead) tried to fix, so it's difficult to be sure that
it really doesn't exist any more, but it does seem like it ought to be
as the comment added back then spoke of the problem with scrollbar
updating and this really shouldn't happen if scrollbars are completely
disabled.

See https://github.com/wxWidgets/wxWidgets/pull/375
2017-12-10 17:47:06 +01:00
Vadim Zeitlin
2ad2bccf33 Don't call static wxLocale::GetInfo() via an object
This is just confusing and unnecessary.

No real changes.
2017-12-10 03:28:18 +01:00
Vadim Zeitlin
9036b3dba8 Remove "C" locale date and time formats test
This test didn't make sense at all as it didn't actually test "C" locale
formats as calling setlocale(LC_ALL, "C") didn't actually change the
values returned by wxLocale::GetInfo(), so it still returned the values
corresponding to the French locale set in this test setUp() method and
the test only passed because it used wrong values (i.e. the same ones as
in French locale test).

We also don't have any simple way to test "C" locale formats, we can
only test them for wxLANGUAGE_DEFAULT, but this corresponds to the OS
defaults which can be customized by user (e.g. in the control panel
under MSW) and so we can't expect them to be equal to any fixed values.

The simplest solution is to just drop this test, as it's not very useful
anyhow (French locale test above already covers the same code).
2017-12-10 03:24:47 +01:00
Vadim Zeitlin
e97c020285 Fix wxLocale::GetInfo() test for French locale under macOS 10.12
The date and time format has changed since 10.10 and now contains an extra
" à " in its middle, so adjust the test to deal with this.
2017-12-09 19:04:52 -07:00
Vadim Zeitlin
38cc8498d1 Fix wxXLocale availability detection in configure
This was broken by 9507bc430e which
stopped defining HAVE_LOCALE_T in configure but didn't update the code
using it.

Restore the old behaviour by continuing to define HAVE_LOCALE_T even if
we don't test (just) for it any longer.

See https://github.com/wxWidgets/wxWidgets/pull/461
2017-12-10 02:32:54 +01:00
Vadim Zeitlin
17041075b4 Fix wxLanguageInfo::GetLocaleName()
This function could (and did) return completely wrong results because
the value of the pointer returned by setlocale() could be (and was)
changed by the subsequent call to setlocale() with different arguments.

Fix the problem by copying the returned value into wxString immediately,
without any intervening setlocale() calls.
2017-12-10 02:32:54 +01:00
Vadim Zeitlin
5e429702bf Fix fatal bug in wxXLocale initialization
Ensure that m_locale is always initialized to null pointer, as it could
remain not initialized at all if information for wxLanguage could be
found, but its locale name was empty, which resulted in a crash in dtor
when the wxXLocale object was destroyed as freelocale() was called with
an invalid pointer.
2017-12-10 02:32:54 +01:00
Vadim Zeitlin
8cb84cd0f7 Add LexEDIFACT.cxx to wxscintilla library CMake sources
This file has been added after CMake branch split from master.
2017-12-09 23:56:12 +01:00
Vadim Zeitlin
f6c7e8f774 Don't use "-t" command line option when running tests
This option just lists the available tags now instead of running the
tests with timing information as before.
2017-12-09 22:00:34 +01:00
Vadim Zeitlin
82b92c6d8f Update CMake files after switch from CppUnit to Catch
Don't look for CppUnit library nor build it any longer, but just use the
Catch headers under 3rdparty/catch.
2017-12-09 18:33:12 +01:00
Vadim Zeitlin
d37f758ae9 Update the list of non-GUI test source files
streams/bstream.cpp was removed in the meanwhile while a new
strings/hexconv.cpp was added.
2017-12-09 18:25:33 +01:00
Vadim Zeitlin
aa4d51d579 Fix font creation using font flags in Cairo wxGraphicsContext
Don't crash trying to use an uninitialized font in
GetPartialTextExtents() later if the font was created using
CreateFont(sizeInPixels, facename, flags) overload.

Closes #18021.
2017-12-09 16:31:28 +01:00