// headers
// ----------------------------------------------------------------------------
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "treectrl.h"
#endif
#include "wx/msw/treectrl.h"
#include "wx/msw/dragimag.h"
-#ifdef __GNUWIN32_OLD__
- #include "wx/msw/gnuwin32/extra.h"
-#endif
-
-#if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) && !defined(__CYGWIN10__))
- #include <commctrl.h>
-#endif
-
-// Bug in headers, sometimes
-#ifndef TVIS_FOCUSED
- #define TVIS_FOCUSED 0x0001
-#endif
-
-#ifndef TV_FIRST
- #define TV_FIRST 0x1100
-#endif
-
-#ifndef TVS_CHECKBOXES
- #define TVS_CHECKBOXES 0x0100
-#endif
-
-#ifndef TVS_FULLROWSELECT
- #define TVS_FULLROWSELECT 0x1000
-#endif
-
-// old headers might miss these messages (comctl32.dll 4.71+ only)
-#ifndef TVM_SETBKCOLOR
- #define TVM_SETBKCOLOR (TV_FIRST + 29)
- #define TVM_SETTEXTCOLOR (TV_FIRST + 30)
-#endif
+// include <commctrl.h> "properly"
+#include "wx/msw/wrapcctl.h"
// macros to hide the cast ugliness
// --------------------------------
private:
wxArrayTreeItemIds& m_selections;
+
+ DECLARE_NO_COPY_CLASS(TraverseSelections)
};
// internal class for counting tree items
private:
size_t m_count;
+
+ DECLARE_NO_COPY_CLASS(TraverseCounter)
};
// ----------------------------------------------------------------------------
// wxWin macros
// ----------------------------------------------------------------------------
+#if wxUSE_EXTENDED_RTTI
+IMPLEMENT_DYNAMIC_CLASS_XTI(wxTreeCtrl, wxControl,"wx/treectrl.h")
+
+WX_BEGIN_PROPERTIES_TABLE(wxTreeCtrl)
+WX_END_PROPERTIES_TABLE()
+
+WX_BEGIN_HANDLERS_TABLE(wxTreeCtrl)
+WX_END_HANDLERS_TABLE()
+
+WX_CONSTRUCTOR_5( wxTreeCtrl , wxWindow* , Parent , wxWindowID , Id , wxPoint , Position , wxSize , Size , long , WindowStyle )
+#else
IMPLEMENT_DYNAMIC_CLASS(wxTreeCtrl, wxControl)
+#endif
// ----------------------------------------------------------------------------
// constants
case wxTreeItemIcon_Normal:
{
const int imageNormalOld = GetItemImage(item);
- const int imageSelOld = GetItemSelectedImage(item);
+ const int imageSelOld =
+ GetItemImage(item, wxTreeItemIcon_Selected);
// always set the normal image
imageNormal = image;
// the wxTreeItemIndirectData GetItemXXXImage() will use it to
// get the images
imageNormal = GetItemImage(item);
- imageSel = GetItemSelectedImage(item);
+ imageSel = GetItemImage(item, wxTreeItemIcon_Selected);
// if it doesn't have it yet, add it
wxTreeItemIndirectData *data = new
DoExpand(item, TVE_TOGGLE);
}
+#if WXWIN_COMPATIBILITY_2_4
void wxTreeCtrl::ExpandItem(const wxTreeItemId& item, int action)
{
DoExpand(item, action);
}
+#endif
void wxTreeCtrl::Unselect()
{
}
break;
-#if defined(_WIN32_IE) && _WIN32_IE >= 0x300 && !wxUSE_COMCTL32_SAFELY && !( defined(__GNUWIN32__) && !wxCHECK_W32API_VERSION( 1, 0 ) )
+ // instead of explicitly checking for _WIN32_IE, check if the
+ // required symbols are available in the headers
+#if defined(CDDS_PREPAINT) && !wxUSE_COMCTL32_SAFELY
case NM_CUSTOMDRAW:
{
LPNMTVCUSTOMDRAW lptvcd = (LPNMTVCUSTOMDRAW)lParam;
// we always process it
return true;
-#endif // _WIN32_IE >= 0x300
+#endif // have owner drawn support in headers
case NM_CLICK:
{