Add wxUSE_NATIVE_DATAVIEWCTRL build option

It defaults to 1, but can be set to 0 to force using the generic version
of the control even under GTK or Mac, where the native version is used
by default.

This can, unfortunately, be useful to work around various but multiple
native control limitations.
This commit is contained in:
Vadim Zeitlin 2019-12-15 16:23:47 +01:00
parent f3217573d7
commit 028afa194a
15 changed files with 118 additions and 2 deletions

View File

@ -411,6 +411,8 @@
#cmakedefine01 wxUSE_TREECTRL
#cmakedefine01 wxUSE_TREELISTCTRL
#cmakedefine01 wxUSE_NATIVE_DATAVIEWCTRL
#cmakedefine01 wxUSE_STATUSBAR
#cmakedefine01 wxUSE_NATIVE_STATUSBAR

36
configure vendored
View File

@ -1249,6 +1249,7 @@ enable_combobox
enable_comboctrl
enable_commandlinkbutton
enable_dataviewctrl
enable_nativedvc
enable_datepick
enable_detect_sm
enable_dirpicker
@ -2203,6 +2204,7 @@ Optional Features:
--enable-comboctrl use wxComboCtrl class
--enable-commandlinkbutton use wxCommmandLinkButton class
--enable-dataviewctrl use wxDataViewCtrl class
--disable-nativedvc disable use of native wxDataViewCtrl even if available
--enable-datepick use wxDatePickerCtrl class
--enable-detect_sm use code to detect X11 session manager
--enable-dirpicker use wxDirPickerCtrl class
@ -9719,6 +9721,35 @@ fi
eval "$wx_cv_use_dataviewctrl"
enablestring=disable
defaultval=
if test -z "$defaultval"; then
if test x"$enablestring" = xdisable; then
defaultval=yes
else
defaultval=no
fi
fi
# Check whether --enable-nativedvc was given.
if test "${enable_nativedvc+set}" = set; then :
enableval=$enable_nativedvc;
if test "$enableval" = yes; then
wx_cv_use_nativedvc='wxUSE_NATIVE_DATAVIEWCTRL=yes'
else
wx_cv_use_nativedvc='wxUSE_NATIVE_DATAVIEWCTRL=no'
fi
else
wx_cv_use_nativedvc='wxUSE_NATIVE_DATAVIEWCTRL=${'DEFAULT_wxUSE_NATIVE_DATAVIEWCTRL":-$defaultval}"
fi
eval "$wx_cv_use_nativedvc"
enablestring=
defaultval=$wxUSE_ALL_FEATURES
if test -z "$defaultval"; then
@ -35900,6 +35931,11 @@ if test "$wxUSE_DATAVIEWCTRL" = "yes"; then
USES_CONTROLS=1
SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dataview"
if test "$wxUSE_NATIVE_DATAVIEWCTRL" = "yes"; then
$as_echo "#define wxUSE_NATIVE_DATAVIEWCTRL 1" >>confdefs.h
fi
fi
if test "$wxUSE_IMAGLIST" = "yes"; then

View File

@ -922,6 +922,7 @@ WX_ARG_FEATURE(combobox, [ --enable-combobox use wxComboBox class], wx
WX_ARG_FEATURE(comboctrl, [ --enable-comboctrl use wxComboCtrl class], wxUSE_COMBOCTRL)
WX_ARG_FEATURE(commandlinkbutton, [ --enable-commandlinkbutton use wxCommmandLinkButton class], wxUSE_COMMANDLINKBUTTON)
WX_ARG_FEATURE(dataviewctrl,[ --enable-dataviewctrl use wxDataViewCtrl class], wxUSE_DATAVIEWCTRL)
WX_ARG_DISABLE(nativedvc, [ --disable-nativedvc disable use of native wxDataViewCtrl even if available], wxUSE_NATIVE_DATAVIEWCTRL)
WX_ARG_FEATURE(datepick, [ --enable-datepick use wxDatePickerCtrl class], wxUSE_DATEPICKCTRL)
WX_ARG_FEATURE(detect_sm, [ --enable-detect_sm use code to detect X11 session manager], wxUSE_DETECT_SM)
WX_ARG_FEATURE(dirpicker, [ --enable-dirpicker use wxDirPickerCtrl class], wxUSE_DIRPICKERCTRL)
@ -6834,6 +6835,10 @@ if test "$wxUSE_DATAVIEWCTRL" = "yes"; then
AC_DEFINE(wxUSE_DATAVIEWCTRL)
USES_CONTROLS=1
SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dataview"
if test "$wxUSE_NATIVE_DATAVIEWCTRL" = "yes"; then
AC_DEFINE(wxUSE_NATIVE_DATAVIEWCTRL)
fi
fi
if test "$wxUSE_IMAGLIST" = "yes"; then

View File

@ -185,6 +185,7 @@ Currently the following symbols exist:
decide whether some function should be overloaded for both
<code>long</code> and <code>long long</code> types.}
@itemdef{wxHAS_MULTIPLE_FILEDLG_FILTERS, Defined if wxFileDialog supports multiple ('|'-separated) filters.}
@itemdef{wxHAS_NATIVE_DATAVIEWCTRL, Defined if native wxDataViewCtrl class is being used (this symbol only exists in wxWidgets 3.1.4 and later).}
@itemdef{wxHAS_NATIVE_WINDOW, Defined if wxNativeWindow class is available.}
@itemdef{wxHAS_IMAGES_IN_RESOURCES, Defined if <a href="http://en.wikipedia.org/wiki/Resource_(Windows)">
Windows resource files</a> or OS/2 resource files are available on the current platform.}

View File

@ -175,6 +175,7 @@ library:
@itemdef{wxUSE_MINIFRAME, Use wxMiniFrame class.}
@itemdef{wxUSE_MOUSEWHEEL, Support mouse wheel events.}
@itemdef{wxUSE_MSGDLG, Use wxMessageDialog class and wxMessageBox function.}
@itemdef{wxUSE_NATIVE_DATAVIEWCTRL, Use native wxDataViewCtrl class (this option is new since wxWidgets 3.1.4).}
@itemdef{wxUSE_NATIVE_STATUSBAR, Use native wxStatusBar class.}
@itemdef{wxUSE_NOTEBOOK, Use wxNotebook and related classes.}
@itemdef{wxUSE_NUMBERDLG, Use wxNumberEntryDialog class.}

View File

@ -907,6 +907,14 @@
#define wxUSE_TREECTRL 1 // wxTreeCtrl
#define wxUSE_TREELISTCTRL 1 // wxTreeListCtrl
// Use generic version of wxDataViewCtrl even if a native one is available?
//
// Default is 0.
//
// Recommended setting: 0, but can be set to 1 if your program is affected by
// the native control limitations.
#define wxUSE_NATIVE_DATAVIEWCTRL 1
// Use a status bar class? Depending on the value of wxUSE_NATIVE_STATUSBAR
// below either wxStatusBar95 or a generic wxStatusBar will be used.
//

View File

@ -649,6 +649,14 @@
# endif
#endif /* !defined(wxUSE_DATAVIEWCTRL) */
#ifndef wxUSE_NATIVE_DATAVIEWCTRL
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_NATIVE_DATAVIEWCTRL must be defined, please read comment near the top of this file."
# else
# define wxUSE_NATIVE_DATAVIEWCTRL 1
# endif
#endif /* !defined(wxUSE_NATIVE_DATAVIEWCTRL) */
#ifndef wxUSE_DATEPICKCTRL
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_DATEPICKCTRL must be defined, please read comment near the top of this file."

View File

@ -33,8 +33,13 @@ class WXDLLIMPEXP_FWD_CORE wxImageList;
class wxItemAttr;
class WXDLLIMPEXP_FWD_CORE wxHeaderCtrl;
#if !(defined(__WXGTK20__) || defined(__WXOSX__) ) || defined(__WXUNIVERSAL__)
// #if !(defined(__WXOSX__)) || defined(__WXUNIVERSAL__)
#if wxUSE_NATIVE_DATAVIEWCTRL && !defined(__WXUNIVERSAL__)
#if defined(__WXGTK20__) || defined(__WXOSX__)
#define wxHAS_NATIVE_DATAVIEWCTRL
#endif
#endif
#ifndef wxHAS_NATIVE_DATAVIEWCTRL
#define wxHAS_GENERIC_DATAVIEWCTRL
#endif

View File

@ -908,6 +908,14 @@
#define wxUSE_TREECTRL 1 // wxTreeCtrl
#define wxUSE_TREELISTCTRL 1 // wxTreeListCtrl
// Use generic version of wxDataViewCtrl even if a native one is available?
//
// Default is 0.
//
// Recommended setting: 0, but can be set to 1 if your program is affected by
// the native control limitations.
#define wxUSE_NATIVE_DATAVIEWCTRL 1
// Use a status bar class? Depending on the value of wxUSE_NATIVE_STATUSBAR
// below either wxStatusBar95 or a generic wxStatusBar will be used.
//

View File

@ -908,6 +908,14 @@
#define wxUSE_TREECTRL 1 // wxTreeCtrl
#define wxUSE_TREELISTCTRL 1 // wxTreeListCtrl
// Use generic version of wxDataViewCtrl even if a native one is available?
//
// Default is 0.
//
// Recommended setting: 0, but can be set to 1 if your program is affected by
// the native control limitations.
#define wxUSE_NATIVE_DATAVIEWCTRL 1
// Use a status bar class? Depending on the value of wxUSE_NATIVE_STATUSBAR
// below either wxStatusBar95 or a generic wxStatusBar will be used.
//

View File

@ -908,6 +908,14 @@
#define wxUSE_TREECTRL 1 // wxTreeCtrl
#define wxUSE_TREELISTCTRL 1 // wxTreeListCtrl
// Use generic version of wxDataViewCtrl even if a native one is available?
//
// Default is 0.
//
// Recommended setting: 0, but can be set to 1 if your program is affected by
// the native control limitations.
#define wxUSE_NATIVE_DATAVIEWCTRL 1
// Use a status bar class? Depending on the value of wxUSE_NATIVE_STATUSBAR
// below either wxStatusBar95 or a generic wxStatusBar will be used.
//

View File

@ -914,6 +914,14 @@
#define wxUSE_TREECTRL 1 // wxTreeCtrl
#define wxUSE_TREELISTCTRL 1 // wxTreeListCtrl
// Use generic version of wxDataViewCtrl even if a native one is available?
//
// Default is 0.
//
// Recommended setting: 0, but can be set to 1 if your program is affected by
// the native control limitations.
#define wxUSE_NATIVE_DATAVIEWCTRL 1
// Use a status bar class? Depending on the value of wxUSE_NATIVE_STATUSBAR
// below either wxStatusBar95 or a generic wxStatusBar will be used.
//

View File

@ -904,6 +904,14 @@
#define wxUSE_TREECTRL 1 // wxTreeCtrl
#define wxUSE_TREELISTCTRL 1 // wxTreeListCtrl
// Use generic version of wxDataViewCtrl even if a native one is available?
//
// Default is 0.
//
// Recommended setting: 0, but can be set to 1 if your program is affected by
// the native control limitations.
#define wxUSE_NATIVE_DATAVIEWCTRL 1
// Use a status bar class? Depending on the value of wxUSE_NATIVE_STATUSBAR
// below either wxStatusBar95 or a generic wxStatusBar will be used.
//

View File

@ -907,6 +907,14 @@
#define wxUSE_TREECTRL 1 // wxTreeCtrl
#define wxUSE_TREELISTCTRL 1 // wxTreeListCtrl
// Use generic version of wxDataViewCtrl even if a native one is available?
//
// Default is 0.
//
// Recommended setting: 0, but can be set to 1 if your program is affected by
// the native control limitations.
#define wxUSE_NATIVE_DATAVIEWCTRL 1
// Use a status bar class? Depending on the value of wxUSE_NATIVE_STATUSBAR
// below either wxStatusBar95 or a generic wxStatusBar will be used.
//

View File

@ -411,6 +411,8 @@
#define wxUSE_TREECTRL 0
#define wxUSE_TREELISTCTRL 0
#define wxUSE_NATIVE_DATAVIEWCTRL 0
#define wxUSE_STATUSBAR 0
#define wxUSE_NATIVE_STATUSBAR 0