Commit Graph

63841 Commits

Author SHA1 Message Date
Vadim Zeitlin
8c06a24da4 Move m_labelWin to wxStaticBoxBase itself
It will be reused by all platforms and is not specific to wxGTK.

This also means WXDestroyWithoutChildren() doesn't need to be virtual
any longer.
2017-12-24 22:38:10 +01:00
Vadim Zeitlin
7c849276f8 Add support for using arbitrary windows as wxStaticBox labels
This commit implements the new feature in wxGTK and updates the sample
and the documentation.
2017-12-24 22:38:10 +01:00
Vadim Zeitlin
29bd25b757 Add GTKDoApplyWidgetStyle() helper
This allows to call the protected wxWindowGTK::DoApplyWidgetStyle()
method when it's really necessary, e.g. when forwarding to it from
DoApplyWidgetStyle() implementation for another window.
2017-12-24 22:35:45 +01:00
Vadim Zeitlin
aa47c15abd Add WXDestroyWithoutChildren() and use it from wxStaticBoxSizer
Factor out the code from wxStaticBoxSizer dtor into a wxStaticBox method
to improve encapsulation: the static box knows better than another class
how to detach its children from it before destroying it.

No real changes yet.
2017-12-24 22:35:45 +01:00
Vadim Zeitlin
87afebd6f2 Inline wxStaticBox ctors in wxGTK
No real changes, just make the trivial ctors of this class inline for
consistency with the new ctor about to be added.
2017-12-24 22:35:45 +01:00
John Roberts
f36973875e Silence uninitialized variable warning in wxMac PanGestureEvent
Even though the value of this variable is not actually used in this
case, we still must initialize it to something before comparing with
NSGestureRecognizerState{Began,Ended} below.

Closes https://github.com/wxWidgets/wxWidgets/pull/645
2017-12-24 15:54:51 +01:00
jonkraber
7f52ff751f Fix clipping of cell contents in wxGrid
Use wxDCClipper, now that it doesn't lose the previously set clipping
region any more, in wxGridCellStringRenderer::Draw() to ensure that we
don't overflow the area allocated for the cell.

Closes #17872.
2017-12-24 15:46:57 +01:00
John Roberts
ba719c576e Document the new wxDCClipper behaviour after last commit change
wxDCClipper does restore the (bounding box of the) previously active
clipping region now.

See #13834.
2017-12-24 15:46:57 +01:00
jonkraber
2a8c290e0d Restore previous clipping box in wxDCClipper
Remember the clipping box of the previously active clipping region in
wxDCClipper ctor and restore it in its dtor.

See #13834.
2017-12-24 15:46:57 +01:00
skruse
3de89b2710 Fix auto-sizing multiline wxGrid column labels with empty lines
Account for the empty lines explicitly by reserving enough vertical
space for them, as wxDC::GetTextExtent() wouldn't do it as it simply
returns 0 for empty strings.

Closes #18028.
2017-12-24 15:20:23 +01:00
Artur Wieczorek
4f7fb24ef4 Use composite template to create GtkAssertDialog as a composite children
GtkAssertDialog UI is now defined with GtkBuilder XML because
gtk_widget_push_composite_child() and gtk_widget_pop_composite_child() are
deprecated since 3.10 and composite widget templates should be used
to make composite children.
2017-12-24 00:40:58 +01:00
Paul Cornett
be35405129 Apply current style to wxStaticBox container when it's created
Background may have been set before adding any children
See #15466
2017-12-21 10:06:10 -08:00
Paul Cornett
c867e0a23b Fix wxRadioBox non-default background with GTK+2 2017-12-20 22:33:07 -08:00
Paul Cornett
121ac8742d Fix wxStaticBox non-default background with GTK+2
See #15466
2017-12-20 22:29:21 -08:00
Paul Cornett
c23cac4c79 Avoid GtkAlignment with GTK+4 2017-12-19 21:49:13 -08:00
Paul Cornett
9249e823d9 Avoid gtk_window_set_opacity() with GTK+4 2017-12-19 21:48:34 -08:00
Paul Cornett
1235c7bb74 Avoid gtk_widget_is_composited() with GTK+4 2017-12-19 21:43:16 -08:00
Paul Cornett
72fe3a1d07 Avoid gdk_window_set_composited() with GTK+4 2017-12-19 21:40:38 -08:00
Paul Cornett
a3518a550f Use GtkGrid instead of GtkTable with GTK+3
GtkTable was deprecated in GTK+ 3.4
2017-12-19 20:47:10 -08:00
Paul Cornett
54bcf1b9b6 Avoid gtk_widget_get_pointer() with GTK+4 2017-12-19 10:46:37 -08:00
Paul Cornett
de273046a4 Avoid gtk_entry_{get,set}_inner_border() with GTK+4 2017-12-19 10:42:47 -08:00
Paul Cornett
9d837f7556 Avoid gdk_screen_get_width() with GTK+4 2017-12-19 10:41:49 -08:00
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