From e721a2a2a41393346e0c86965cfd04f056196c2a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 11 Jan 2009 00:57:08 +0000 Subject: [PATCH] added wxUSE_HEADERCTRL git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58009 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- configure | 56 +++++++++++++++++++++++++++++++++++- configure.in | 7 +++++ include/wx/chkconf.h | 39 ++++++++++++++++++++++--- include/wx/headercol.h | 5 ++++ include/wx/headerctrl.h | 4 +++ include/wx/motif/setup0.h | 1 + include/wx/msw/setup0.h | 1 + include/wx/msw/wince/setup.h | 1 + include/wx/os2/setup0.h | 1 + include/wx/osx/setup0.h | 1 + include/wx/palmos/setup0.h | 1 + include/wx/setup_inc.h | 1 + include/wx/univ/setup0.h | 1 + setup.h.in | 1 + src/common/headercolcmn.cpp | 4 +-- src/common/headerctrlcmn.cpp | 4 +++ src/generic/headerctrlg.cpp | 5 ++-- src/msw/headerctrl.cpp | 4 +++ 18 files changed, 128 insertions(+), 9 deletions(-) diff --git a/configure b/configure index 9fbca53ce4..fcefb14a05 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Id: configure.in 57865 2009-01-06 22:28:16Z VS . +# From configure.in Id: configure.in 58007 2009-01-11 00:46:55Z VZ . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for wxWidgets 2.9.0. # @@ -1805,6 +1805,7 @@ Optional Features: --enable-fontpicker use wxFontPickerCtrl class --enable-gauge use wxGauge class --enable-grid use wxGrid class + --enable-headerctrl use wxHeaderCtrl class --enable-hyperlink use wxHyperlinkCtrl class --enable-imaglist use wxImageList class --enable-listbook use wxListbook class @@ -9440,6 +9441,7 @@ if test "$wxUSE_CONTROLS" = "no"; then DEFAULT_wxUSE_FONTPICKERCTRL=no DEFAULT_wxUSE_GAUGE=no DEFAULT_wxUSE_GRID=no + DEFAULT_wxUSE_HEADERCTRL=no DEFAULT_wxUSE_HYPERLINKCTRL=no DEFAULT_wxUSE_IMAGLIST=no DEFAULT_wxUSE_LISTBOOK=no @@ -10616,6 +10618,50 @@ fi 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}-headerctrl" >&5 +echo $ECHO_N "checking for --${enablestring:-enable}-headerctrl... $ECHO_C" >&6; } + # Check whether --enable-headerctrl was given. +if test "${enable_headerctrl+set}" = set; then + enableval=$enable_headerctrl; + if test "$enableval" = yes; then + wx_cv_use_headerctrl='wxUSE_HEADERCTRL=yes' + else + wx_cv_use_headerctrl='wxUSE_HEADERCTRL=no' + fi + +else + + wx_cv_use_headerctrl='wxUSE_HEADERCTRL=${'DEFAULT_wxUSE_HEADERCTRL":-$defaultval}" + +fi + + + eval "$wx_cv_use_headerctrl" + + if test x"$enablestring" = xdisable; then + if test $wxUSE_HEADERCTRL = yes; then + result=no + else + result=yes + fi + else + result=$wxUSE_HEADERCTRL + fi + + { echo "$as_me:$LINENO: result: $result" >&5 +echo "${ECHO_T}$result" >&6; } + + enablestring= defaultval=$wxUSE_ALL_FEATURES if test -z "$defaultval"; then @@ -45814,6 +45860,14 @@ _ACEOF SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS grid" fi +if test "$wxUSE_HEADERCTRL" = "yes"; then + cat >>confdefs.h <<\_ACEOF +#define wxUSE_HEADERCTRL 1 +_ACEOF + + USES_CONTROLS=1 +fi + if test "$wxUSE_HYPERLINKCTRL" = "yes"; then cat >>confdefs.h <<\_ACEOF #define wxUSE_HYPERLINKCTRL 1 diff --git a/configure.in b/configure.in index 25143fd236..6d8db5e0d3 100644 --- a/configure.in +++ b/configure.in @@ -817,6 +817,7 @@ if test "$wxUSE_CONTROLS" = "no"; then DEFAULT_wxUSE_FONTPICKERCTRL=no DEFAULT_wxUSE_GAUGE=no DEFAULT_wxUSE_GRID=no + DEFAULT_wxUSE_HEADERCTRL=no DEFAULT_wxUSE_HYPERLINKCTRL=no DEFAULT_wxUSE_IMAGLIST=no DEFAULT_wxUSE_LISTBOOK=no @@ -875,6 +876,7 @@ WX_ARG_FEATURE(filepicker, [ --enable-filepicker use wxFilePickerCtrl clas WX_ARG_FEATURE(fontpicker, [ --enable-fontpicker use wxFontPickerCtrl class], wxUSE_FONTPICKERCTRL) WX_ARG_FEATURE(gauge, [ --enable-gauge use wxGauge class], wxUSE_GAUGE) WX_ARG_FEATURE(grid, [ --enable-grid use wxGrid class], wxUSE_GRID) +WX_ARG_FEATURE(headerctrl, [ --enable-headerctrl use wxHeaderCtrl class], wxUSE_HEADERCTRL) WX_ARG_FEATURE(hyperlink, [ --enable-hyperlink use wxHyperlinkCtrl class], wxUSE_HYPERLINKCTRL) WX_ARG_FEATURE(imaglist, [ --enable-imaglist use wxImageList class], wxUSE_IMAGLIST) WX_ARG_FEATURE(listbook, [ --enable-listbook use wxListbook class], wxUSE_LISTBOOK) @@ -6604,6 +6606,11 @@ if test "$wxUSE_GRID" = "yes"; then SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS grid" fi +if test "$wxUSE_HEADERCTRL" = "yes"; then + AC_DEFINE(wxUSE_HEADERCTRL) + USES_CONTROLS=1 +fi + if test "$wxUSE_HYPERLINKCTRL" = "yes"; then AC_DEFINE(wxUSE_HYPERLINKCTRL) USES_CONTROLS=1 diff --git a/include/wx/chkconf.h b/include/wx/chkconf.h index bf19048ba5..21497874b1 100644 --- a/include/wx/chkconf.h +++ b/include/wx/chkconf.h @@ -619,6 +619,14 @@ # endif #endif /* !defined(wxUSE_GRID) */ +#ifndef wxUSE_HEADERCTRL +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_HEADERCTRL must be defined." +# else +# define wxUSE_HEADERCTRL 0 +# endif +#endif /* !defined(wxUSE_HEADERCTRL) */ + #ifndef wxUSE_HELP # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_HELP must be defined." @@ -627,6 +635,14 @@ # endif #endif /* !defined(wxUSE_HELP) */ +#ifndef wxUSE_HEADERCTRL +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxUSE_HEADERCTRL must be defined." +# else +# define wxUSE_HEADERCTRL 0 +# endif +#endif /* !defined(wxUSE_HEADERCTRL) */ + #ifndef wxUSE_HYPERLINKCTRL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_HYPERLINKCTRL must be defined." @@ -1305,11 +1321,13 @@ wxUSE_CHOICE || \ wxUSE_GAUGE || \ wxUSE_GRID || \ + wxUSE_HEADERCTRL || \ wxUSE_LISTBOX || \ wxUSE_LISTCTRL || \ wxUSE_NOTEBOOK || \ wxUSE_RADIOBOX || \ wxUSE_RADIOBTN || \ + wxUSE_REARRANGECTRL || \ wxUSE_SCROLLBAR || \ wxUSE_SLIDER || \ wxUSE_SPINBTN || \ @@ -1407,13 +1425,26 @@ #if !wxUSE_ODCOMBOBOX # if wxUSE_BITMAPCOMBOBOX -# error "wxBitmapComboBox requires wxOwnerDrawnComboBox" -# else -# undef wxUSE_BITMAPCOMBOBOX -# define wxUSE_BITMAPCOMBOBOX 0 +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxBitmapComboBox requires wxOwnerDrawnComboBox" +# else +# undef wxUSE_BITMAPCOMBOBOX +# define wxUSE_BITMAPCOMBOBOX 0 +# endif # endif #endif /* !wxUSE_ODCOMBOBOX */ +#if !wxUSE_HEADERCTRL +# if wxUSE_DATAVIEWCTRL || wxUSE_GRID +# ifdef wxABORT_ON_CONFIG_ERROR +# error "wxDataViewCtrl and wxGrid require wxHeaderCtrl" +# else +# undef wxUSE_HEADERCTRL +# define wxUSE_HEADERCTRL 1 +# endif +# endif +#endif /* !wxUSE_HEADERCTRL */ + /* don't attempt to use native status bar on the platforms not having it */ #ifndef wxUSE_NATIVE_STATUSBAR # define wxUSE_NATIVE_STATUSBAR 0 diff --git a/include/wx/headercol.h b/include/wx/headercol.h index a84c175858..a52713d228 100644 --- a/include/wx/headercol.h +++ b/include/wx/headercol.h @@ -13,6 +13,8 @@ #include "wx/bitmap.h" +#if wxUSE_HEADERCTRL + // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- @@ -268,5 +270,8 @@ private: bool m_sort, m_sortAscending; }; + +#endif // wxUSE_HEADERCTRL + #endif // _WX_HEADERCOL_H_ diff --git a/include/wx/headerctrl.h b/include/wx/headerctrl.h index c774162bde..d1d0e4c176 100644 --- a/include/wx/headerctrl.h +++ b/include/wx/headerctrl.h @@ -13,6 +13,8 @@ #include "wx/control.h" +#if wxUSE_HEADERCTRL + #include "wx/dynarray.h" #include "wx/vector.h" @@ -461,4 +463,6 @@ typedef void (wxEvtHandler::*wxHeaderCtrlEventFunction)(wxHeaderCtrlEvent&); #define EVT_HEADER_DRAGGING_CANCELLED(id, fn) wx__DECLARE_HEADER_EVT(DRAGGING_CANCELLED, id, fn) +#endif // wxUSE_HEADERCTRL + #endif // _WX_HEADERCTRL_H_ diff --git a/include/wx/motif/setup0.h b/include/wx/motif/setup0.h index db9c472c78..451b18c538 100644 --- a/include/wx/motif/setup0.h +++ b/include/wx/motif/setup0.h @@ -691,6 +691,7 @@ #define wxUSE_FILEPICKERCTRL 1 // wxFilePickerCtrl #define wxUSE_FONTPICKERCTRL 1 // wxFontPickerCtrl #define wxUSE_GAUGE 1 // wxGauge +#define wxUSE_HEADERCTRL 1 // wxHeaderCtrl #define wxUSE_HYPERLINKCTRL 1 // wxHyperlinkCtrl #define wxUSE_LISTBOX 1 // wxListBox #define wxUSE_LISTCTRL 1 // wxListCtrl diff --git a/include/wx/msw/setup0.h b/include/wx/msw/setup0.h index d71d0b69ff..a3471b7dc3 100644 --- a/include/wx/msw/setup0.h +++ b/include/wx/msw/setup0.h @@ -691,6 +691,7 @@ #define wxUSE_FILEPICKERCTRL 1 // wxFilePickerCtrl #define wxUSE_FONTPICKERCTRL 1 // wxFontPickerCtrl #define wxUSE_GAUGE 1 // wxGauge +#define wxUSE_HEADERCTRL 1 // wxHeaderCtrl #define wxUSE_HYPERLINKCTRL 1 // wxHyperlinkCtrl #define wxUSE_LISTBOX 1 // wxListBox #define wxUSE_LISTCTRL 1 // wxListCtrl diff --git a/include/wx/msw/wince/setup.h b/include/wx/msw/wince/setup.h index 1d56ed7442..300eecc4e9 100644 --- a/include/wx/msw/wince/setup.h +++ b/include/wx/msw/wince/setup.h @@ -691,6 +691,7 @@ #define wxUSE_FILEPICKERCTRL 1 // wxFilePickerCtrl #define wxUSE_FONTPICKERCTRL 1 // wxFontPickerCtrl #define wxUSE_GAUGE 1 // wxGauge +#define wxUSE_HEADERCTRL 1 // wxHeaderCtrl #define wxUSE_HYPERLINKCTRL 1 // wxHyperlinkCtrl #define wxUSE_LISTBOX 1 // wxListBox #define wxUSE_LISTCTRL 1 // wxListCtrl diff --git a/include/wx/os2/setup0.h b/include/wx/os2/setup0.h index 4befbfd0fc..04b27f059d 100644 --- a/include/wx/os2/setup0.h +++ b/include/wx/os2/setup0.h @@ -691,6 +691,7 @@ #define wxUSE_FILEPICKERCTRL 1 // wxFilePickerCtrl #define wxUSE_FONTPICKERCTRL 1 // wxFontPickerCtrl #define wxUSE_GAUGE 1 // wxGauge +#define wxUSE_HEADERCTRL 1 // wxHeaderCtrl #define wxUSE_HYPERLINKCTRL 1 // wxHyperlinkCtrl #define wxUSE_LISTBOX 1 // wxListBox #define wxUSE_LISTCTRL 1 // wxListCtrl diff --git a/include/wx/osx/setup0.h b/include/wx/osx/setup0.h index b498e66a52..ccf753d9fd 100644 --- a/include/wx/osx/setup0.h +++ b/include/wx/osx/setup0.h @@ -692,6 +692,7 @@ #define wxUSE_FILEPICKERCTRL 1 // wxFilePickerCtrl #define wxUSE_FONTPICKERCTRL 1 // wxFontPickerCtrl #define wxUSE_GAUGE 1 // wxGauge +#define wxUSE_HEADERCTRL 1 // wxHeaderCtrl #define wxUSE_HYPERLINKCTRL 1 // wxHyperlinkCtrl #define wxUSE_LISTBOX 1 // wxListBox #define wxUSE_LISTCTRL 1 // wxListCtrl diff --git a/include/wx/palmos/setup0.h b/include/wx/palmos/setup0.h index 4cfc3d0a08..04917f436f 100644 --- a/include/wx/palmos/setup0.h +++ b/include/wx/palmos/setup0.h @@ -691,6 +691,7 @@ #define wxUSE_FILEPICKERCTRL 1 // wxFilePickerCtrl #define wxUSE_FONTPICKERCTRL 1 // wxFontPickerCtrl #define wxUSE_GAUGE 1 // wxGauge +#define wxUSE_HEADERCTRL 1 // wxHeaderCtrl #define wxUSE_HYPERLINKCTRL 1 // wxHyperlinkCtrl #define wxUSE_LISTBOX 1 // wxListBox #define wxUSE_LISTCTRL 1 // wxListCtrl diff --git a/include/wx/setup_inc.h b/include/wx/setup_inc.h index bafac5cdd8..4f21e8a492 100644 --- a/include/wx/setup_inc.h +++ b/include/wx/setup_inc.h @@ -687,6 +687,7 @@ #define wxUSE_FILEPICKERCTRL 1 // wxFilePickerCtrl #define wxUSE_FONTPICKERCTRL 1 // wxFontPickerCtrl #define wxUSE_GAUGE 1 // wxGauge +#define wxUSE_HEADERCTRL 1 // wxHeaderCtrl #define wxUSE_HYPERLINKCTRL 1 // wxHyperlinkCtrl #define wxUSE_LISTBOX 1 // wxListBox #define wxUSE_LISTCTRL 1 // wxListCtrl diff --git a/include/wx/univ/setup0.h b/include/wx/univ/setup0.h index 50efe043bb..3e8f5754a2 100644 --- a/include/wx/univ/setup0.h +++ b/include/wx/univ/setup0.h @@ -690,6 +690,7 @@ #define wxUSE_FILEPICKERCTRL 1 // wxFilePickerCtrl #define wxUSE_FONTPICKERCTRL 1 // wxFontPickerCtrl #define wxUSE_GAUGE 1 // wxGauge +#define wxUSE_HEADERCTRL 1 // wxHeaderCtrl #define wxUSE_HYPERLINKCTRL 1 // wxHyperlinkCtrl #define wxUSE_LISTBOX 1 // wxListBox #define wxUSE_LISTCTRL 1 // wxListCtrl diff --git a/setup.h.in b/setup.h.in index db432fca59..0ee1a1b882 100644 --- a/setup.h.in +++ b/setup.h.in @@ -341,6 +341,7 @@ #define wxUSE_FILEPICKERCTRL 0 #define wxUSE_FONTPICKERCTRL 0 #define wxUSE_GAUGE 0 +#define wxUSE_HEADERCTRL 0 #define wxUSE_HYPERLINKCTRL 0 #define wxUSE_LISTBOX 0 #define wxUSE_LISTCTRL 0 diff --git a/src/common/headercolcmn.cpp b/src/common/headercolcmn.cpp index 27e4843300..8537970fa5 100644 --- a/src/common/headercolcmn.cpp +++ b/src/common/headercolcmn.cpp @@ -23,8 +23,7 @@ #pragma hdrstop #endif -#ifndef WX_PRECOMP -#endif // WX_PRECOMP +#if wxUSE_HEADERCTRL #include "wx/headercol.h" @@ -91,4 +90,5 @@ void wxSettableHeaderColumn::ToggleFlag(int flag) SetFlags(flags); } +#endif // wxUSE_HEADERCTRL diff --git a/src/common/headerctrlcmn.cpp b/src/common/headerctrlcmn.cpp index 991dc7b710..a7a197afeb 100644 --- a/src/common/headerctrlcmn.cpp +++ b/src/common/headerctrlcmn.cpp @@ -23,6 +23,8 @@ #pragma hdrstop #endif +#if wxUSE_HEADERCTRL + #ifndef WX_PRECOMP #include "wx/menu.h" #endif // WX_PRECOMP @@ -485,3 +487,5 @@ const wxEventType wxEVT_COMMAND_HEADER_BEGIN_REORDER = wxNewEventType(); const wxEventType wxEVT_COMMAND_HEADER_END_REORDER = wxNewEventType(); const wxEventType wxEVT_COMMAND_HEADER_DRAGGING_CANCELLED = wxNewEventType(); + +#endif // wxUSE_HEADERCTRL diff --git a/src/generic/headerctrlg.cpp b/src/generic/headerctrlg.cpp index 37d848fc18..90afc8de8f 100644 --- a/src/generic/headerctrlg.cpp +++ b/src/generic/headerctrlg.cpp @@ -23,8 +23,7 @@ #pragma hdrstop #endif -#ifndef WX_PRECOMP -#endif // WX_PRECOMP +#if wxUSE_HEADERCTRL #include "wx/headerctrl.h" @@ -714,3 +713,5 @@ void wxHeaderCtrl::OnMouse(wxMouseEvent& mevent) } #endif // wxHAS_GENERIC_HEADERCTRL + +#endif // wxUSE_HEADERCTRL diff --git a/src/msw/headerctrl.cpp b/src/msw/headerctrl.cpp index 7ab562e2ba..21d83f6388 100644 --- a/src/msw/headerctrl.cpp +++ b/src/msw/headerctrl.cpp @@ -23,6 +23,8 @@ #pragma hdrstop #endif +#if wxUSE_HEADERCTRL + #ifndef WX_PRECOMP #include "wx/log.h" #endif // WX_PRECOMP @@ -660,3 +662,5 @@ bool wxHeaderCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) } #endif // wxHAS_GENERIC_HEADERCTRL + +#endif // wxUSE_HEADERCTRL -- 2.45.2