Commit Graph

63965 Commits

Author SHA1 Message Date
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
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
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
Vadim Zeitlin
3825baf708 Remove wx/dcbuffer.h dependency from wx/generic/combo.h
This header doesn't really need to be included from here and it was done
solely in order to get the value of wxALWAYS_NATIVE_DOUBLE_BUFFER from
it.

Move the code using this macro in the .cpp file instead.
2018-01-30 19:45:32 +01:00
Vadim Zeitlin
f775501ba0 Don't eat TAB unconditionally in wxComboCtrl
This prevented TAB navigation from doing anything at all when the focus
was on wxComboCtrl in wxGTK and, probably, all the other non-MSW ports
(in wxMSW TAB navigation happens before normal key processing, so this
check was irrelevant there).
2018-01-30 19:40:59 +01:00
Stephen Smith
9f57b6ed20 Explicitly mention "cd" in install.txt configure instructions
Adds one extra shell command instruction (was missing but implied) to
assist newcomers with configure.

Closes https://github.com/wxWidgets/wxWidgets/pull/701
2018-01-30 18:44:16 +01:00
Stefan Csomor
5f21280130 Avoid duplicate wxEVT_SEARCHCTRL_CANCEL_BTN event under macOS
see https://github.com/wxWidgets/wxWidgets/pull/698 , along the idea by commit 1776f136f7d673c8e772c9ca6e1607089a071651, implemented a little bit more defensively
2018-01-30 17:17:47 +01:00
Vadim Zeitlin
ae8bc4e263 Merge branch 'search-events'
Harmonize the behaviour across platforms.

Also fix ChangeValue() for this control.

And finally rename the events to use simpler names.

See https://github.com/wxWidgets/wxWidgets/pull/699
2018-01-30 14:12:30 +01:00
Vadim Zeitlin
7a24cdb861 Merge branch 'cmake-options' of https://github.com/MaartenBent/wxWidgets
See https://github.com/wxWidgets/wxWidgets/pull/694
2018-01-30 13:58:52 +01:00
Vadim Zeitlin
4f9ae9e3e4 Merge branch 'travis-improvements' of https://github.com/MaartenBent/wxWidgets
See https://github.com/wxWidgets/wxWidgets/pull/687
2018-01-30 13:58:07 +01:00
Vadim Zeitlin
8565d8f2fc Set window field of wxEVT_SET_FOCUS events in wxGTK
It is often useful to know where is the focus coming from, for example
to determine if was in another window of the same composite control.

Remember the last focus in yet another global variable in wxGTK code to
allow setting wxFocusEvent::m_window correctly when generating
wxEVT_SET_FOCUS events.
2018-01-30 13:56:51 +01:00
Vadim Zeitlin
94620f6c59 Use simple wxEVT_SEARCH[_CANCEL] names for wxSearchCtrl events
The old wxEVT_SEARCHCTRL_{SEARCH,CANCEL}_BTN event names were unwieldy
and misleading because both of these events can be generated without
using the buttons, but by pressing Enter or Esc (the latter currently
works under macOS only, but this could change in the future).
2018-01-30 02:03:48 +01:00
Vadim Zeitlin
ce43f772a9 Don't erase background of wxSearchCtrl buttons twice
Set background style to indicate that wxSearchButton is painted entirely
by its wxEVT_PAINT handler.

This should eliminate potential flicker under MSW.
2018-01-30 02:03:47 +01:00
Vadim Zeitlin
784a397348 Remove wxEVT_TEXT_URL generation from wxSearchCtrl
This event doesn't make any sense for this control, was never generated
by the native macOS version and couldn't be generated under MSW neither
as it's only supported by the multiline control and not the single-line
version used here, so having this code in wxSearchCtrl just made no
sense at all.
2018-01-30 02:03:47 +01:00
Vadim Zeitlin
ea08b8539a Generate wxEVT_SEARCHCTRL_SEARCH_BTN when Enter is pressed
Make it possible to bind to just wxEVT_SEARCHCTRL_SEARCH_BTN under all
platforms: previously, it was also necessary to bind to wxEVT_TEXT_ENTER
when using the generic implementation, as pressing Enter in the text
control didn't generate the dedicated SEARCH event.

It does now, and, to avoid any confusion, the control does not generate
wxEVT_TEXT_ENTER events at all any more. This is not really
incompatible, as wxOSX never generated these events anyhow and the
generic version only did for a couple of days, since the changes of
9816970797 which were, finally, misguided
and so are undone by this commit.

Closes #17911.
2018-01-30 02:03:47 +01:00
Vadim Zeitlin
1119a44cdd Simplify and make more portable DWrite font weight translation
There doesn't seem to be any need for painstakingly translating STC font
weight to DWRITE_FONT_WEIGHT when they seem to use exactly the same
numeric values anyhow.

This also fixes compilation when using older SDK versions that don't
define DWRITE_FONT_WEIGHT_SEMI_LIGHT constant, which is relatively
recent (and presence of which can't be easily checked, as it's an enum
element and not a preprocessor constant).
2018-01-30 01:21:24 +01:00
Vadim Zeitlin
e5a1931b64 Log wxEVT_TEXT events for wxSearchCtrl in widgets sample
This is useful to check that these events are generated under all
platforms.
2018-01-29 23:14:44 +01:00
Vadim Zeitlin
f079f11736 Log EVT_TEXT_ENTER events for wxSearchCtrl in the widgets sample
This is convenient for checking that the behaviour is consistent among
different platforms.

See #17911.
2018-01-29 19:40:03 +01:00
Vadim Zeitlin
f24872f6f4 Add unit test for wxSearchCtrl::ChangeValue()
Verify that it actually does change the value.

See #16998.
2018-01-29 19:35:10 +01:00
Vadim Zeitlin
58ac3d3690 Fix wxSearchCtrl::ChangeValue() to actually change value
This was broken because wxSearchCtrl inherited the base class version of
ChangeValue() which didn't really work for it due to the poor way in
which wxTextEntry is designed (see #18071).

Closes #16998.
2018-01-29 19:35:09 +01:00
Vadim Zeitlin
05ebeb6bac Get rid of CppUnit compatibility macros in wxSearchCtrl unit test
No real changes, just remove all the CppUnit machinery not needed any
longer and replace it with a simple test function.
2018-01-29 19:08:12 +01:00
Paul Cornett
e1481385c5 Avoid use of uninitialized point size in wxFontInfo
See #18070
2018-01-29 09:49:51 -08:00
Vadim Zeitlin
99dea2e2e0 Remove unnecessary wxSearchCtrl::OnSetFocus()
This was useless as wxCompositeWindow, from which the generic
wxSearchCtrl derives, already sets focus to its first child and, since
the last commit, even harmful as it now resulted in calls to SetFocus()
from inside wxEVT_SET_FOCUS handler which is forbidden at least under
MSW.

See #15569.
2018-01-29 18:45:45 +01:00
Vadim Zeitlin
3b40ff0d41 Send wxEVT_SET_FOCUS for composite window when a child gets focus
wxCompositeWindow already connected to child wxEVT_KILL_FOCUS events and
generated the same event for the composite window itself, but didn't do
it for wxEVT_SET_FOCUS, resulting in not getting these events for the
main window as expected. E.g. this resulted in never getting any
wxEVT_SET_FOCUS events for wxSearchCtrl when using its generic version
(i.e. not under Mac).

Fix this by connecting to wxEVT_SET_FOCUS events for the children too.
Note that this relies on having a correct "previously focused window" in
these events, if this doesn't work reliably for some ports, we might
need to maintain a "bool m_hasFocus" field in wxCompositeWindow itself
instead.

Also note that we might avoid having all this code in wxCompositeWindow
if we translated the underlying native focus event to wxFocusEvents for
both the real window and its GetMainWindowOfCompositeControl() if it's
different. This could potentially be simpler and would definitely be
more efficient, but would require more changes.

Closes #15569.
2018-01-29 18:45:39 +01:00
Vadim Zeitlin
21823bd37a Log focus messages for the search control in the widgets sample
This makes it easier to test various issues related to focus events for
composite controls, such as wxSearchCtrl.
2018-01-29 18:29:34 +01:00
Vadim Zeitlin
72790218cb Fix wrongly restoring clipping region in wxDCClipper
The change of 2a8c290e0d was wrong as it
unconditionally restored m_oldClipRect in dtor, even when it was empty,
indicating that no clipping had been in effect when wxDCClipper was
constructed. This totally broke all the code using wxDCClipper, notably
generic wxListCtrl which wasn't repainted correctly at all.

Fix this by checking if the clipping rectangle is not empty before
restoring it, this should work as well as we can make it without having
GetClippingRegion() that could return an invalid region if no clipping
is in effect.

See #13834.

Closes #18066.
2018-01-29 15:36:21 +01:00