Add wxUSE_HOTKEY support to configure.

Add --enable-hotkey switch to allow enabling hot keys support and enable it by
default under MSW and OS X that do support them but disable it elsewhere to
avoid unnecessary warnings about them being unsupported.

See #12354.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68968 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-09-01 18:43:03 +00:00
parent b8702c673a
commit 97e477c557
2 changed files with 80 additions and 0 deletions

64
configure vendored
View File

@@ -1896,6 +1896,7 @@ Optional Features:
--enable-mousewheel use mousewheel --enable-mousewheel use mousewheel
--enable-validators use wxValidator and derived classes --enable-validators use wxValidator and derived classes
--enable-busyinfo use wxBusyInfo --enable-busyinfo use wxBusyInfo
--enable-hotkey use wxWindow::RegisterHotKey()
--enable-joystick use wxJoystick --enable-joystick use wxJoystick
--enable-metafiles use wxMetaFile (Win32 only) --enable-metafiles use wxMetaFile (Win32 only)
--enable-dragimage use wxDragImage --enable-dragimage use wxDragImage
@@ -2996,6 +2997,7 @@ DEFAULT_wxUSE_UNICODE_UTF8=auto
DEFAULT_wxUSE_OPENGL=auto DEFAULT_wxUSE_OPENGL=auto
DEFAULT_wxUSE_MEDIACTRL=auto DEFAULT_wxUSE_MEDIACTRL=auto
DEFAULT_wxUSE_COMPILER_TLS=auto DEFAULT_wxUSE_COMPILER_TLS=auto
DEFAULT_wxUSE_HOTKEY=auto
DEFAULT_wxUSE_UNICODE_UTF8_LOCALE=no DEFAULT_wxUSE_UNICODE_UTF8_LOCALE=no
@@ -13880,6 +13882,50 @@ fi
echo "${ECHO_T}$result" >&6; } echo "${ECHO_T}$result" >&6; }
enablestring=
defaultval=$wxUSE_ALL_FEATURES
if test -z "$defaultval"; then
if test x"$enablestring" = xdisable; then
defaultval=yes
else
defaultval=no
fi
fi
{ echo "$as_me:$LINENO: checking for --${enablestring:-enable}-hotkey" >&5
echo $ECHO_N "checking for --${enablestring:-enable}-hotkey... $ECHO_C" >&6; }
# Check whether --enable-hotkey was given.
if test "${enable_hotkey+set}" = set; then
enableval=$enable_hotkey;
if test "$enableval" = yes; then
wx_cv_use_hotkey='wxUSE_HOTKEY=yes'
else
wx_cv_use_hotkey='wxUSE_HOTKEY=no'
fi
else
wx_cv_use_hotkey='wxUSE_HOTKEY=${'DEFAULT_wxUSE_HOTKEY":-$defaultval}"
fi
eval "$wx_cv_use_hotkey"
if test x"$enablestring" = xdisable; then
if test $wxUSE_HOTKEY = no; then
result=yes
else
result=no
fi
else
result=$wxUSE_HOTKEY
fi
{ echo "$as_me:$LINENO: result: $result" >&5
echo "${ECHO_T}$result" >&6; }
enablestring= enablestring=
defaultval=$wxUSE_ALL_FEATURES defaultval=$wxUSE_ALL_FEATURES
if test -z "$defaultval"; then if test -z "$defaultval"; then
@@ -45123,6 +45169,24 @@ _ACEOF
fi fi
if test "$wxUSE_HOTKEY" = "yes"; then
if test "$wxUSE_MSW" != 1 -a "$wxUSE_OSX_COCOA" != 1 -a "$wxUSE_OSX_CARBON" != 1; then
{ echo "$as_me:$LINENO: WARNING: Hot keys not supported by the current toolkit, disabled" >&5
echo "$as_me: WARNING: Hot keys not supported by the current toolkit, disabled" >&2;}
wxUSE_HOTKEY=no
fi
elif test "$wxUSE_HOTKEY" = "auto"; then
if test "$wxUSE_MSW" = 1 -o "$wxUSE_OSX_COCOA" = 1 -o "$wxUSE_OSX_CARBON" = 1; then
wxUSE_HOTKEY=yes
fi
fi
if test "$wxUSE_HOTKEY" = "yes"; then
cat >>confdefs.h <<\_ACEOF
#define wxUSE_HOTKEY 1
_ACEOF
fi
if test "$wxUSE_STD_CONTAINERS" = "yes"; then if test "$wxUSE_STD_CONTAINERS" = "yes"; then
cat >>confdefs.h <<\_ACEOF cat >>confdefs.h <<\_ACEOF
#define wxUSE_STD_CONTAINERS 1 #define wxUSE_STD_CONTAINERS 1

View File

@@ -395,6 +395,7 @@ DEFAULT_wxUSE_UNICODE_UTF8=auto
DEFAULT_wxUSE_OPENGL=auto DEFAULT_wxUSE_OPENGL=auto
DEFAULT_wxUSE_MEDIACTRL=auto DEFAULT_wxUSE_MEDIACTRL=auto
DEFAULT_wxUSE_COMPILER_TLS=auto DEFAULT_wxUSE_COMPILER_TLS=auto
DEFAULT_wxUSE_HOTKEY=auto
DEFAULT_wxUSE_UNICODE_UTF8_LOCALE=no DEFAULT_wxUSE_UNICODE_UTF8_LOCALE=no
@@ -1039,6 +1040,7 @@ WX_ARG_FEATURE(splines, [ --enable-splines use spline drawing code],
WX_ARG_FEATURE(mousewheel, [ --enable-mousewheel use mousewheel], wxUSE_MOUSEWHEEL) WX_ARG_FEATURE(mousewheel, [ --enable-mousewheel use mousewheel], wxUSE_MOUSEWHEEL)
WX_ARG_FEATURE(validators, [ --enable-validators use wxValidator and derived classes], wxUSE_VALIDATORS) WX_ARG_FEATURE(validators, [ --enable-validators use wxValidator and derived classes], wxUSE_VALIDATORS)
WX_ARG_FEATURE(busyinfo, [ --enable-busyinfo use wxBusyInfo], wxUSE_BUSYINFO) WX_ARG_FEATURE(busyinfo, [ --enable-busyinfo use wxBusyInfo], wxUSE_BUSYINFO)
WX_ARG_FEATURE(hotkey, [ --enable-hotkey use wxWindow::RegisterHotKey()], wxUSE_HOTKEY)
WX_ARG_FEATURE(joystick, [ --enable-joystick use wxJoystick], wxUSE_JOYSTICK) WX_ARG_FEATURE(joystick, [ --enable-joystick use wxJoystick], wxUSE_JOYSTICK)
WX_ARG_FEATURE(metafile, [ --enable-metafiles use wxMetaFile (Win32 only)], wxUSE_METAFILE) WX_ARG_FEATURE(metafile, [ --enable-metafiles use wxMetaFile (Win32 only)], wxUSE_METAFILE)
WX_ARG_FEATURE(dragimage, [ --enable-dragimage use wxDragImage], wxUSE_DRAGIMAGE) WX_ARG_FEATURE(dragimage, [ --enable-dragimage use wxDragImage], wxUSE_DRAGIMAGE)
@@ -5985,6 +5987,20 @@ if test "$wxUSE_BUSYINFO" = "yes"; then
AC_DEFINE(wxUSE_BUSYINFO) AC_DEFINE(wxUSE_BUSYINFO)
fi fi
if test "$wxUSE_HOTKEY" = "yes"; then
if test "$wxUSE_MSW" != 1 -a "$wxUSE_OSX_COCOA" != 1 -a "$wxUSE_OSX_CARBON" != 1; then
AC_MSG_WARN([Hot keys not supported by the current toolkit, disabled])
wxUSE_HOTKEY=no
fi
elif test "$wxUSE_HOTKEY" = "auto"; then
if test "$wxUSE_MSW" = 1 -o "$wxUSE_OSX_COCOA" = 1 -o "$wxUSE_OSX_CARBON" = 1; then
wxUSE_HOTKEY=yes
fi
fi
if test "$wxUSE_HOTKEY" = "yes"; then
AC_DEFINE(wxUSE_HOTKEY)
fi
if test "$wxUSE_STD_CONTAINERS" = "yes"; then if test "$wxUSE_STD_CONTAINERS" = "yes"; then
AC_DEFINE(wxUSE_STD_CONTAINERS) AC_DEFINE(wxUSE_STD_CONTAINERS)
fi fi