#include "wx/settings.h"
#endif
+#include "wx/dynlib.h"
#include "wx/msw/private.h"
// Set this to 1 to be _absolutely_ sure that repainting will work for all
// the real client data
wxTreeItemData *m_data;
- DECLARE_NO_COPY_CLASS(wxTreeItemParam)
+ wxDECLARE_NO_COPY_CLASS(wxTreeItemParam);
};
// wxVirutalNode is used in place of a single root when 'hidden' root is
private:
wxTreeItemParam *m_param;
- DECLARE_NO_COPY_CLASS(wxVirtualNode)
+ wxDECLARE_NO_COPY_CLASS(wxVirtualNode);
};
#ifdef __VISUALC__
const wxTreeCtrl *m_tree;
- DECLARE_NO_COPY_CLASS(wxTreeTraversal)
+ wxDECLARE_NO_COPY_CLASS(wxTreeTraversal);
};
// internal class for getting the selected items
private:
wxArrayTreeItemIds& m_selections;
- DECLARE_NO_COPY_CLASS(TraverseSelections)
+ wxDECLARE_NO_COPY_CLASS(TraverseSelections);
};
// internal class for counting tree items
private:
size_t m_count;
- DECLARE_NO_COPY_CLASS(TraverseCounter)
+ wxDECLARE_NO_COPY_CLASS(TraverseCounter);
};
// ----------------------------------------------------------------------------
{
wxCHECK_MSG( item.IsOk(), false, wxT("invalid tree item") );
+ if ( IS_VIRTUAL_ROOT(item) )
+ {
+ wxTreeItemIdValue cookie;
+ return GetFirstChild(item, cookie).IsOk();
+ }
+
wxTreeViewItem tvItem(item, TVIF_CHILDREN);
DoGetItem(&tvItem);
// delete it (in POSTPAINT notify)
if (m_imageListState && m_imageListState->GetImageCount() > 0)
{
- #define hImageList (HIMAGELIST)m_imageListState->GetHIMAGELIST()
+ typedef BOOL (wxSTDCALL *ImageList_Copy_t)
+ (HIMAGELIST, int, HIMAGELIST, int, UINT);
+ static ImageList_Copy_t s_pfnImageList_Copy = NULL;
+ static bool loaded = false;
+
+ if ( !loaded )
+ {
+ wxLoadedDLL dllComCtl32(_T("comctl32.dll"));
+ if ( dllComCtl32.IsLoaded() )
+ wxDL_INIT_FUNC(s_pfn, ImageList_Copy, dllComCtl32);
+ }
+
+ if ( !s_pfnImageList_Copy )
+ {
+ // this code is broken with ImageList_Copy()
+ // but I don't care enough about Win95 support
+ // to write it now -- if anybody does, please
+ // do it
+ wxFAIL_MSG("TODO: implement this for Win95");
+ break;
+ }
+
+ const HIMAGELIST
+ hImageList = GetHimagelistOf(m_imageListState);
// add temporary image
int width, height;
{
// move images to right
for ( int i = index; i > 0; i-- )
- ::ImageList_Copy(hImageList, i, hImageList, i-1, 0);
+ {
+ (*s_pfnImageList_Copy)(hImageList, i,
+ hImageList, i-1,
+ ILCF_MOVE);
+ }
// we must remove the image in POSTPAINT notify
*result |= CDRF_NOTIFYPOSTPAINT;
}
-
- #undef hImageList
}
break;
switch ( hdr->code )
{
case NM_DBLCLK:
- // we translate NM_DBLCLK into ACTIVATED event, so don't interpret
- // the return code of this event handler as the return value for
- // NM_DBLCLK - otherwise, double clicking the item to toggle its
- // expanded status would never work
- *result = false;
+ // we translate NM_DBLCLK into ACTIVATED event and if the user
+ // handled the activation of the item we shouldn't proceed with
+ // also using the same double click for toggling the item expanded
+ // state -- but OTOH do let the user to expand/collapse the item by
+ // double clicking on it if the activation is not handled specially
+ *result = processed;
break;
case NM_RCLICK: