Commit Graph

63869 Commits

Author SHA1 Message Date
Paul Cornett
620b83109e Use gdk_seat_grab()/gdk_seat_ungrab() with GTK+4 2017-12-19 10:40:34 -08:00
Paul Cornett
97ee4582a4 Avoid GtkHandleBox, GtkTearoffMenuItem, GtkImageMenuItem with GTK+4 2017-12-19 10:38:38 -08:00
Paul Cornett
ecda9c2016 Avoid GtkAlignment with GTK+4 2017-12-19 10:12:04 -08:00
Paul Cornett
96befc88c0 Avoid gtk_tree_view_set_rules_hint() with GTK+4 2017-12-19 09:56:23 -08:00
Paul Cornett
35f6a7c1d8 Avoid deprecated GtkArrow with GTK+ >= 3.14 2017-12-19 09:52:56 -08:00
Paul Cornett
b573315e7f Add wx_is_at_least_gtk3() helper 2017-12-19 09:41:26 -08:00
Vadim Zeitlin
de7fa05245 Use wxDCXXXChanger classes instead of manual SetXXX() calls
No real changes, but the code is slightly shorter, maybe more clear and
will be easier to maintain (because more difficult to break
accidentally) in the future.
2017-12-18 17:00:44 +01:00
Vadim Zeitlin
aa7c99b275 Minor formatting fixes to recently changed wxListCtrl code
No real changes.
2017-12-18 16:58:59 +01:00
Vadim Zeitlin
8285be78f6 Merge branch 'msw-listctrl-painting' of https://github.com/discnl/wxWidgets into msw-listctrl-painting
Pull in the fixes from https://github.com/wxWidgets/wxWidgets/pull/278
2017-12-18 16:54:28 +01:00
Paul Cornett
f704c288e0 Stub out wxTaskBarIcon with GTK+4
GtkStatusIcon is no longer available
2017-12-17 21:52:35 -08:00
Paul Cornett
cefcd83ee6 Avoid GtkHandleBox and GtkEventBox with GTK+4 2017-12-17 21:52:00 -08:00
Paul Cornett
3c2f575f8e Avoid old X11 fullscreen code with GTK+4 2017-12-17 21:51:49 -08:00
Paul Cornett
b2ea617145 Avoid deprecated gtk_text_iter_begins_tag() 2017-12-17 21:51:36 -08:00
Paul Cornett
ba4da9fdf9 Use "new" GDK keysym names
Old names are no longer available with GTK+4
2017-12-17 21:51:16 -08:00
Paul Cornett
ea5cd6dbfc Avoid GdkDeviceManager with GTK+4 2017-12-17 10:36:58 -08:00
Vadim Zeitlin
3ee52836c6 Link Git-specific notes from the main README
Rename BuildGit.txt to README-GIT.md, which is a more standard name, and
a better format for viewing this file online, e.g. from GitHub Web UI,
and link it from the main README to make it easier to find.
2017-12-17 19:29:41 +01:00
Vadim Zeitlin
1dbe3dafe4 Stop storing window pointer in all wxDataViewTreeNode objects
This didn't make any sense, all these objects reachable from the given
root node are used by the same window, so storing the same pointer in
all of them just wasted memory unnecessarily.

Avoid this by passing wxDataViewMainWindow pointer explicitly to those
methods of wxDataViewTreeNode that need it.

No changes in behaviour, this is just a (memory use) optimization.
2017-12-17 19:16:34 +01:00
Vadim Zeitlin
1bfe42b0ce Simplify sort order handling for first child item
Test whether this is the first child before testing whether the branch
is open as this allows to avoid the special case of inserting the first
child under the root node and simplifies the assert condition to a
simple check that the sort order is already what we expect.
2017-12-17 19:09:04 +01:00
Vadim Zeitlin
3f41e84830 Remove unused wxDataViewSelection dynamic array macro
This should have been done in 36a5983f64
but was forgotten and the unused array remained in the code.
2017-12-17 18:59:36 +01:00
Vadim Zeitlin
5365f3563e Get rid of global sort-related variables in wxDataViewCtrl
Having to set up global variables before (re)sorting the items was too
ugly and became even more so after the latest changes optimizing item
sorting as sorting is done in more places now.

Improve the code by introducing a SortOrder class instead of dealing
with the sort column and sort order direction separately and,
especially, by using std::sort() (which should be fine to use here,
considering that it's used since quite some time in wxArrayString
implementation) with a comparator object instead of qsort(), which
doesn't allow passing any data to the sort callback otherwise than via
the global variables.

No changes in behaviour.
2017-12-17 18:58:04 +01:00
Vadim Zeitlin
a7c68663fd Replace macro-based items array with wxVector in wxDataViewCtrl
No real changes, just try to minimize the use of the old macro-based
containers as there is really no reason to do it here.
2017-12-17 18:40:03 +01:00
Vadim Zeitlin
259a357824 Use index, not value, when removing items from wxDataViewTreeNode
This avoids another (linear) search among the item siblings, as we can
use the index we've just found instead directly.
2017-12-17 17:31:09 +01:00
Vadim Zeitlin
0268c062c0 Minor improvements to wxDataViewCtrl sorting optimization commit
Simplify some code and make it more clear, notably by changing
conditionals to be easier to follow.

Also avoid repeating the same functions calls (like SortPrepare() or
UpdateDisplay()) by folding them into the functions that actually need
them to be done.
2017-12-17 17:23:42 +01:00
Vadim Zeitlin
f66fb07ce7 Resize wxDataViewCtrl to fix persistence test with wxGTK
Setting the column sizes fails with wxGTK implementation of
wxDataViewCtrl if the control is not wide enough, apparently, so make
sure it's sufficiently big when creating it to fix the unit test
failures on wxGTK build bot slaves.
2017-12-17 16:13:06 +01:00
Artur Wieczorek
b7051a9adb Fix misused wxGTK_CONV 2017-12-17 09:16:25 +01:00
Artur Wieczorek
eba33c837f Allow using labels with mnemonics for buttons in GtkAssertDialog 2017-12-17 00:31:40 +01:00
Artur Wieczorek
5ffae1c936 Don't use stock items in wxMenu
Stock items are deprecated since GTK+ 3.10 so corresponding labels
should be used instead of them.
2017-12-17 00:24:01 +01:00
Artur Wieczorek
af7b4fa084 Don't use stock items in wxInfoBar
Stock items are deprecated since GTK+ 3.10 so corresponding labels
should be used instead of them.
2017-12-17 00:00:02 +01:00
Artur Wieczorek
53ad29b389 Don't use stock items in wxMessageDialog
Stock items are deprecated since GTK+ 3.10 so corresponding labels
should be used instead of them.
2017-12-16 23:56:37 +01:00
Artur Wieczorek
da1d45e8bb Don't use stock items in wxFileDialog
Stock items are deprecated since GTK+ 3.10 so corresponding labels
should be used instead of them.
2017-12-16 23:54:06 +01:00
Artur Wieczorek
77756fae5d Don't use stock items in wxDirDialog
Stock items are deprecated since GTK+ 3.10 so corresponding labels
should be used instead of them.
2017-12-16 23:51:55 +01:00
Artur Wieczorek
38c192acc5 Don't use stock items in wxButton
Stock items are deprecated since GTK+ 3.10 so corresponding labels
should be used instead of them.
2017-12-16 23:49:42 +01:00
Paul Cornett
63634be74b Build fixes for GTK+4 2017-12-16 11:29:57 -08:00
Paul Cornett
5e27ff410c Fix building wxToolTip with GTK+4
gtk_settings_set_long_property() is no longer available. The properties
"gtk-enable-tooltips" and "gtk-tooltip-timeout" are ignored since GTK+
3.10, so just don't compile that code with GTK+4.
2017-12-16 09:42:39 -08:00
Vadim Zeitlin
8d9f0e6fef Initialize BranchNodeData members in declaration order
Doing it out of order is harmless here, but would result gcc -Wreorder
warnings.
2017-12-16 17:32:53 +01:00
Vadim Zeitlin
eef994016a Reorder BranchNodeData struct members to make it more compact
By simply putting two bool fields consecutively to each other, we reduce
the number of bytes of padding used from 6 to 2 in a typical 32 bit
build, saving 4 (or 8, in 64 bits) bytes per branch item.
2017-12-16 17:30:11 +01:00
Erik Sperling Johansen
51ed404ca5 Optimize sorting items in wxDataViewCtrl
Limit node sorting to a minimum, by making all sorts happen on demand
and utilizing already sorted child lists to do quicker insertions.
2017-12-16 17:21:04 +01:00
kathoum
f1dfb27cb1 Use the same ABI version string for MSVS 2017 as for MSVS 2015
MSVS 2017 (which uses _MSC_VER from 1910 to 1912 currently) is
ABI-compatible with MSVS 2015 (_MSC_VER 1900), so do allow linking code
compiled with one of them with the library built by the other one.

Closes #18024.
2017-12-16 15:57:02 +01:00
Vadim Zeitlin
1b6ec5c538 Merge branch 'linux-spec-files'
wxFile and wxTextFile for working with special/non-seekable files.
2017-12-16 15:26:35 +01:00
Paul Cornett
f5ab4757a6 Fix wxColourButton with GTK+4
gtk_color_button_get_rgba()/gtk_color_button_set_rgba() are gone
2017-12-15 10:48:56 -08:00
Paul Cornett
bb13e9f3da wxColourDialog implementation for GTK+4
GtkColorChooserDialog must be used instead of GtkColorSelectionDialog
2017-12-15 10:27:54 -08:00
Vadim Zeitlin
95b28abfdf Merge branch 'dvc-persist'
Implement persistence for wxDataViewCtrl columns widths and sort order.

See https://github.com/wxWidgets/wxWidgets/pull/541
2017-12-15 18:48:34 +01:00
Vadim Zeitlin
a03ece4880 Remove st_blocks hack from wxFile::Length() under Linux
This reverts commit 41f6f17d01 ("return 0
(meaning the file is not seekable, as the docs now explain) instead of
4KB for the files in sysfs under Linux") as it seems to be wrong to
return a value different from what "ls -l" or "stat" return here and the
original problem was solved in a better way in the previous commit.

See #9965.

Closes #17818.
2017-12-15 18:46:22 +01:00
Vadim Zeitlin
cc86de1416 Replace file reading code in wxTextFile with wxFile::ReadAll()
There is nothing special about wxTextFile justifying having code for
dealing with non-seekable files in it, so put this code into wxFile
itself and just call its ReadAll() method from here.

This is a better fix than 41f6f17d01
originally applied (and which is going to be reverted next) as it
doesn't break wxFile::Length() for these files and also avoids
triggering an assert if the file we're trying to read was truncated by
another process in the meanwhile -- which can happen and doesn't
indicate a programming error and so shouldn't result in an assert.

Also add a unit test checking that this really works.

See #3802, #8354, #9965.
2017-12-15 18:46:22 +01:00
Vadim Zeitlin
a30bee473e Make wxFile::ReadAll() work for unseekable files too
Calling this function with an unseekable file, such as any file under
/sys on Linux systems, would previously just hang as the loop condition
was never satisfied when length was -1.

Fix this by checking for this case and using a different approach by
extending the buffer we read the data into as we go instead of
preallocating it all at once.

See #9965.
2017-12-15 18:43:26 +01:00
Paul Cornett
8e35398037 Update gtk-4.0.m4
Minimize differences with gtk-3.0.m4, fix configuring with GTK+ 3.92.1
2017-12-15 09:31:43 -08:00
Paul Cornett
32f6d9521f Update gtk-3.0.m4
From gtk+-3.22.26/m4macros/gtk-3.0.m4
2017-12-15 09:26:40 -08:00
Vadim Zeitlin
ebcba7a385 Merge branch 'mac-mouse-event-crash'
Closes https://github.com/wxWidgets/wxWidgets/pull/640
2017-12-15 16:53:28 +01:00
Vadim Zeitlin
df2f0321fb Some simplification and tidying up of the previous commit
Explain why the order here is important.

Also get rid of now unnecessary temporary variable.
2017-12-15 16:52:41 +01:00
VZ
7ea562eb93 Fix expat config for "NMake Makefiles" target in cmake build
Closes https://github.com/wxWidgets/wxWidgets/pull/639
2017-12-15 15:45:26 +01:00