Commit Graph

64238 Commits

Author SHA1 Message Date
Vadim Zeitlin
508a409f7e Suppress focus loss on opening combobox popup in wxGTK
Make GTKHandleFocusOut() virtual and override it in wxChoice in order to
avoid generating wxEVT_KILL_FOCUS events when the combobox dropdown
button is clicked.

This is important because it allows fatal problems when using a
combobox-based in-place editor in wxDataViewCtrl as getting these events
totally broke the UI before.

See #17034.
2018-02-04 14:51:58 +01:00
Paul Cornett
fa000d254d Use wxFALLTHROUGH 2018-02-03 22:38:23 -08:00
Paul Cornett
52a30cde6f Remove useless gtk_widget_set_size_request()
It won't have any effect on the best size computation, and leaving the
size set to (0,0) is really bad form
2018-02-03 22:36:44 -08:00
Paul Cornett
e2a04e1fd7 Use signal blocking rather than disconnection to temporarily disable events 2018-02-03 22:30:36 -08:00
Paul Cornett
c391cfd617 Avoid using already-destroyed parts of wxChoice/wxComboBox during destruction
When used as a wxDVC cell editor, GtkComboBox has already destroyed
it's model and child GtkEntry by the time our dtor is called.
See #17034
2018-02-03 22:28:35 -08:00
Vadim Zeitlin
3a16250303 Don't make inert toggle/choice wxDataViewCtrl cell editable in wxOSX
Don't disable all inert renderers as this results in ugly "disabled"
look for some of them (see 6e885992f5),
but do disable the renderers that would be editable otherwise, such as
wxDataViewChoiceRenderer and wxDataViewToggleRenderer, in wxOSX as it
shouldn't be possible to change value of the inert cells.

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

Closes #18056.
2018-02-04 00:35:11 +01:00
Maarten Bent
2fb4e11174 Remove "update = checkout" option for submodules
This reverts af16d8ba5c. It caused
problems with older git versions (e.g. 1.8.5) that do not recognize the
checkout option: warning: unknown update mode 'checkout' suggested for
submodule '3rdparty/catch' Skipping submodule '3rdparty/catch'

Also specify the branch for the catch submodule, to be in line with the
other submodules.
2018-02-04 00:33:08 +01:00
Maarten Bent
683185aee1 Explicitly mention build environments for Travis CI
This removes a duplicate build on Travis, cause by a change of the
default build environment.
2018-02-04 00:33:08 +01:00
Vadim Zeitlin
d44dd8caf4 Document wxDataViewCtrl::GetMainWindow()
This method can be useful, so make it part of the public API, similarly
to e.g. wxGrid::GetGridWindow().

See #17786.
2018-02-04 00:28:08 +01:00
Vadim Zeitlin
50e9984d68 Merge branch 'msw-renderer-rect'
A couple of fixes to rectangles used in wxMSW wxRenderer code

See https://github.com/wxWidgets/wxWidgets/pull/711
2018-02-04 00:16:15 +01:00
Vadim Zeitlin
d7b88827b8 Avoid spurious focus events for composite windows in wxMSW
Composite windows, i.e. wxWindows composed of several HWNDs at MSW
level, didn't handle focus events correctly and, for example, generated
wxEVT_KILL_FOCUS event when the focus simply switched from wxComboBox
itself to the EDIT control inside it, which broke using non-readonly
wxComboBox as in-place editor inside wxDataViewCtrl.

Check if the focus event notifies about the focus switching to, or from,
another HWND belonging to the same window, and suppress wx event
generation in this case as they don't make sense because the focus
doesn't change at wx level.

See #17034.
2018-02-04 00:14:31 +01:00
Hartwig Wiesmann
43c1baf1bd Fix wxDataViewColumn::SetSortOrder() under macOS
Don't check if we already sort by the column in SetSortOrder() as this
meant the sort order couldn't be changed programmatically at all.

Closes #15405.
2018-02-04 00:14:31 +01:00
Vadim Zeitlin
6c9ced9be2 Document wxDataViewListCtrl default sort order
Also explain how to change it if the default behaviour of putting all
the container items before all the leaves is undesirable.

Closes #16105.
2018-02-04 00:14:31 +01:00
Vadim Zeitlin
f7e592b335 Use wxVector for storing wxDataViewTreeStoreNodes
Replace the use of wxList macros with wxVector.

Also make wxDataViewTreeStore::Compare() slightly more efficient by
iterating over the children list only once instead of doing it twice.
2018-02-04 00:14:31 +01:00
Vadim Zeitlin
342388a456 Use wxCHECK_MSG() instead of wxLogError in wxDataViewTreeStore
This is a check for a programming error and should never be shown to the
user, so assert that the items being compared in wxDataViewTreeStore are
under the same parent instead of using wxLogError.
2018-02-04 00:14:31 +01:00
Vadim Zeitlin
bb0a2952b1 Replace macros with wxVector<> for wxDataViewModelNotifiers
Don't use deprecated macro-based linked list class, use wxVector<>
instead for m_notifiers.

Also make it private, as it should have been from the beginning.
2018-02-04 00:14:31 +01:00
Vadim Zeitlin
30f73aea6a Make using custom colour for wxDataViewProgressRenderer work again
This used to work in 3.0, but got broken with the switch to using a
native function for rendering the gauge in generic wxDataViewCtrl
86cf756ba9 (see #16406).

Restore it now, even if it requires not one, but two hacks: one at
wxRendererGeneric level to guess whether a custom colour is being used
or not by examining wxDC::GetBackground(), and the other one in
wxDataViewProgressRenderer itself to fall back to wxRendererGeneric if
the colour is specified. But it is arguably worth doing this to fix the
regression, even if it would be nice to provide a better API instead
(see #18076).

Closes #17885.
2018-02-04 00:14:31 +01:00
Vadim Zeitlin
4b69c1a718 Remove m_penExpander from generic wxDataViewCtrl code
This pen was never used as wxRendererNative::DrawTreeItemButton() always
uses its own colours, even in the generic version.
2018-02-04 00:14:31 +01:00
Vadim Zeitlin
2600bc34ff Put column images on the right side in generic wxDataViewCtrl
For consistency with wxListCtrl under MSW (which is the only platform
where this change has any effect, as wxHD_BITMAP_ON_RIGHT is only
supported there), put the column images on the right side in
wxDataViewCtrl too.

Closes #13350.
2018-02-04 00:14:31 +01:00
Vadim Zeitlin
fd73ae1623 Add wxHD_BITMAP_ON_RIGHT style to wxHeaderCtrl
Implement this style for wxMSW to allow putting the column images on the
right side, for consistency with wxMSW wxListCtrl.

See #13350.
2018-02-04 00:14:28 +01:00
Vadim Zeitlin
0b1acae0a7 Fix drawing of expander buttons in wxDataViewCtrl under MSW
The buttons were truncated, making them look ugly, because we didn't
allocate enough space for them. Instead of complicating generic
wxDataViewCtrl code even further with more MSW-specific code, just let
DrawItemTreeButton() center the expander itself in the space allocated
for it.

This still involves guessing the width of the expander, but this doesn't
need to be done as precisely, so it's still an advantage. Note that
previously calculating expander size involved m_lineHeight, for some
reason, but now we use GetCharWidth() for it, which is more appropriate.

Closes #17863.
2018-02-04 00:14:13 +01:00
mikek
f1087d7fd5 Fix missing selection event in generic wxDataViewCtrl
No event was sent if the selection was narrowed by clicking on an
already selected item without any key modifiers pressed.

Fix this by generating an event always on click and not only when
selecting a new item.

Closes #17881.
2018-02-04 00:14:13 +01:00
Vadim Zeitlin
0d14dd8fe0 Test disabling wxDataViewCtrl in the dataview sample
Just make it simple to verify whether disabling the control works as
expected.

See #14186.

See #17887.
2018-02-04 00:14:13 +01:00
mikek
945cec4be1 Refresh generic wxDataViewCtrl after disabling it
Grey the control out immediately, instead of waiting until the next
refresh to do it.

Closes #17887.
2018-02-04 00:14:13 +01:00
Vadim Zeitlin
bfd3f1b33f Fix some typos in wxDataViewCtrl documentation
No real changes.
2018-02-04 00:14:13 +01:00
Vadim Zeitlin
a995af6029 Merge branch 'render-vert-gauge'
Allow using DrawRender() for vertical gauges too #712.

See https://github.com/wxWidgets/wxWidgets/pull/712
2018-02-04 00:12:26 +01:00
Vadim Zeitlin
1148b2e0fe Make GTKHandleDeferredFocusOut() non-static
Slightly simplify the code by making it a member function.

No real changes.
2018-02-03 23:56:44 +01:00
Vadim Zeitlin
f8674c7ff0 Remove unnecessary check for gs_deferredFocusOut
GTKHandleDeferredFocusOut() is only ever called when gs_deferredFocusOut
is non-null, so there is no need to check for it inside this function
again.

No real changes.
2018-02-03 23:30:31 +01:00
Vadim Zeitlin
5f8f60107a Allow using wxRendererNative::DrawGauge() for vertical gauges too
It was unexpected that this method could only be used for horizontal
gauges, so make it work for the vertical ones if wxCONTROL_SPECIAL flag
is specified.

Update MSW and generic implementations and the render sample to show a
vertical gauge as well.
2018-02-03 18:46:17 +01:00
Vadim Zeitlin
fa41d06cce Fix some harmless gcc 7 -Wimplicit-fallthrough warnings
Add wxFALLTHROUGH to avoid the warnings where fall-through is actually
desired.
2018-02-03 18:22:45 +01:00
Vadim Zeitlin
3284420b09 Add a menu option to use generic renderer in the sample
This makes it easier to compare the native and generic implementations
of the functions shown.
2018-02-03 18:14:12 +01:00
Vadim Zeitlin
359eda1359 Make render sample window bigger initially
It wasn't big enough to show all of its contents.
2018-02-03 18:14:12 +01:00
Vadim Zeitlin
65589e8c68 Remove unneeded wxRendererNative::GetDefault() in render sample
This method is used to illustrate the difference between the default and
the overridden GetHeaderButton() implementations, but doesn't need to be
used for any other methods, that are not overridden in MyRenderer.

No real changes, but just make the code shorter and less confusing.
2018-02-03 18:14:12 +01:00
Vadim Zeitlin
879b81aacf Avoid bogus warning when running Expat configure
Skip docbook checks in Expat configure to speed it up a bit and, mainly,
to avoid the harmless but confusing

$wx/src/expat/expat/configure: line 16683: program: command not found

which was given when running it.
2018-02-03 15:29:26 +01:00
Maarten Bent
d3d8778542 Reduce debug warnings of Direct2D Debug Layer 2018-02-02 23:58:52 +01:00
Danny Scott
cf588d7a64 Handle current directory with MSVS 2017 in a better way
Set VSCMD_START_DIR to "%CD%" to prevent MSVS 2017 build scripts from
changing the directory.

See #18075.
2018-02-02 18:17:42 +01:00
Danny Scott
94e201df78 Update batch file for MSW binaries for MSVS 2017
VS2017 environment bat files change the working directory so the build
directory is returned to after calling them.

A warning has been added that the VS150COMNTOOLS environment variable
needs to be set or a VS2017 command prompt needs to be used for VS2017
builds. MS no longer sets this variable on install.

For vc110 and vc120 builds the x64 switch has been changed to x86_amd64.

Closes #18075.
2018-02-02 15:37:10 +01:00
Vadim Zeitlin
92891cee47 Add missing GDI+ adjustments to wxRendererXP
A few methods, notably including DrawFocusRect() and DrawItemText(),
were missing MSWApplyGDIPlusTransform() calls that need to be done
before drawing on an HDC corresponding to a wxGCDC object.

Add them by replacing calls to wxCopyRectToRECT() with the just added
ConvertToRECT() function, which adjusts the coordinates and copies
wxRect to RECT at once.
2018-02-01 17:38:23 +01:00
Vadim Zeitlin
5bfe0fdcc4 Add helper wxRendererMSWBase::ConvertToRECT()
Combine MSWApplyGDIPlusTransform() and wxCopyRectToRECT() into a single
helper function to simplify the code and, importantly, to make it more
difficult to forget call the former function.

No real changes, this is a pure refactoring.
2018-02-01 17:35:02 +01:00
Vadim Zeitlin
0091e2aaab Merge branch 'gtk-tab'
Fixes for TAB navigation when using wxComboCtrl and wxDatePickerCtrl in
wxGTK.

See https://github.com/wxWidgets/wxWidgets/pull/703
2018-01-31 23:13:03 +01:00
Vadim Zeitlin
ad71bbb9ad Fix behaviour of wxTextCtrl without wxTE_PROCESS_TAB in wxGTK
TAB should be used for navigation by default and only should be inserted
into the control as a literal character if wxTE_PROCESS_TAB is specified
for consistency with wxMSW and because this behaviour is much more
useful by default.

Fix this by calling gtk_text_view_set_accepts_tab() as appropriate for
multiline text controls. For single line ones, the behaviour is
unchanged but it's more reasonable as TAB is always handled as if
wxTE_PROCESS_TAB were not specified and it doesn't seem really useful to
try to support wxTE_PROCESS_TAB for them anyhow, so just document this
limitation.

Also remove the outdated/misleading documentation of this style, notably
don't say that it is required to get char events for TAB presses as
these events are generated both with and without this style in both
wxGTK and wxMSW.

Closes https://github.com/wxWidgets/wxWidgets/pull/704
2018-01-31 23:12:56 +01:00
Vadim Zeitlin
193939453e Fix assert due to wrong sizer flags in wxGenericRichMessageDialog
This assert was especially annoying because it could be shown when
showing a previous assert message on the platforms without the native
rich message dialog (i.e. anything but MSW), resulting in reentering the
assert handler and killing the application.
2018-01-31 03:00:51 +01:00
Vadim Zeitlin
06c29a7f20 Document missing ActivateCell() calls in macOS version
Native macOS version of wxDataViewCtrl doesn't support cell activation
currently.

See #17746.
2018-01-31 00:02:54 +01:00
Vadim Zeitlin
caea08e6b2 Generate wxEVT_CONTEXT_MENU everywhere in generic wxTreeCtrl
Clicking outside of the items area didn't generate wxEVT_CONTEXT_MENU in
the generic version, unlike the native MSW one and contrary to
expectations.

Also update the documentation to make it clear when exactly are
wxEVT_TREE_ITEM_MENU and wxEVT_CONTEXT_MENU events generated.

Closes #17361.
2018-01-30 23:34:33 +01:00
Gunter Königsmann
96d9f7361b Document listbox item activation on Enter in wxGTK
Mention that EVT_LISTBOX_DCLICK event can also be generated from
keyboard.

Closes #17577.
2018-01-30 23:10:20 +01:00
Vadim Zeitlin
2ff1e633e9 Use KDE 4 and 5 directories in Unix wxMimeTypesManager too
KDE 3 is throughly outdated, but keep support for it too because it
doesn't cost much.

Closes #16704.
2018-01-30 23:01:39 +01:00
Vadim Zeitlin
a0cc098ef0 Use only existing directories in Unix wxMimeTypesManager
Avoid using directories under /opt if they don't exist anyhow.

This also makes the code easier to modify in the future, see #16704.
2018-01-30 22:58:08 +01:00
Vadim Zeitlin
648cfe0743 Fix TAB navigation for wxDatePickerCtrl in wxGTK
Inherit from wxNavigationEnabled<> to make navigation work correctly in
wxGTK.
2018-01-30 21:35:20 +01:00
Vadim Zeitlin
1de107c037 Derive wxDatePickerCtrlGeneric from wxCompositeWindowSettersOnly
This class doesn't need the extra focus-related features of
wxCompositeWindow.
2018-01-30 19:53:54 +01:00
Vadim Zeitlin
27cad5e04d Fix TAB navigation with wxComboCtrl in non-MSW ports
Derive wxGenericComboCtrl from wxNavigationEnabled<> to make TAB work
correctly when the focus was on it, otherwise it didn't move it
correctly to the next control.

This notably allows TAB to cycle through all the controls in the "combo"
sample whereas previously it stopped on reaching the combo control with
the list popup with wxGTK.
2018-01-30 19:53:54 +01:00