#include "wx/msw/private.h"
+// include <commctrl.h> "properly"
+#include "wx/msw/wrapcctl.h"
+
+#include "wx/msw/missing.h"
+
// Set this to 1 to be _absolutely_ sure that repainting will work for all
// comctl32.dll versions
#define wxUSE_COMCTL32_SAFELY 0
#include "wx/msw/treectrl.h"
#include "wx/msw/dragimag.h"
-// include <commctrl.h> "properly"
-#include "wx/msw/wrapcctl.h"
-
// macros to hide the cast ugliness
// --------------------------------
wstyle |= TVS_CHECKBOXES;
#endif // wxUSE_CHECKBOXES_IN_MULTI_SEL_TREE
-#ifndef __WXWINCE__
+#if !defined(__WXWINCE__) && defined(TVS_INFOTIP)
// Need so that TVN_GETINFOTIP messages will be sent
wstyle |= TVS_INFOTIP;
#endif
WXLRESULT rc = 0;
bool isMultiple = HasFlag(wxTR_MULTIPLE);
-#ifdef WM_CONTEXTMENU
if ( nMsg == WM_CONTEXTMENU )
{
wxTreeEvent event( wxEVT_COMMAND_TREE_ITEM_MENU, GetId() );
processed = true;
//else: continue with generating wxEVT_CONTEXT_MENU in base class code
}
-#endif // WM_CONTEXTMENU
else if ( (nMsg >= WM_MOUSEFIRST) && (nMsg <= WM_MOUSELAST) )
{
// we only process mouse messages here and these parameters have the
if ( nMsg == WM_RBUTTONDOWN )
return 0;
+ // but because of the above we don't get NM_RCLICK which is normally
+ // generated by tree window proc when the modal loop mentioned above ends
+ // because the mouse is released -- synthesize it ourselves instead
+ if ( nMsg == WM_RBUTTONUP )
+ {
+ NMHDR hdr;
+ hdr.hwndFrom = GetHwnd();
+ hdr.idFrom = GetId();
+ hdr.code = NM_RCLICK;
+
+ WXLPARAM rc;
+ MSWOnNotify(GetId(), (LPARAM)&hdr, &rc);
+
+ // continue as usual
+ }
+
if ( nMsg == WM_CHAR )
{
// also don't let the control process Space and Return keys because it
break;
}
+#ifdef TVN_GETINFOTIP
case TVN_GETINFOTIP:
{
eventType = wxEVT_COMMAND_TREE_ITEM_GETTOOLTIP;
break;
}
+#endif
#endif
case TVN_GETDISPINFO:
break;
#ifndef __WXWINCE__
+#ifdef TVN_GETINFOTIP
case TVN_GETINFOTIP:
{
// If the user permitted a tooltip change, change it
}
}
break;
+#endif
#endif
case TVN_SELCHANGING: