+ case TVN_ITEMEXPANDED:
+ // the item is not refreshed properly after expansion when it has
+ // an image depending on the expanded/collapsed state - bug in
+ // comctl32.dll or our code?
+ {
+ NM_TREEVIEW* tv = (NM_TREEVIEW*)lParam;
+ if ( tv->action == TVE_EXPAND )
+ {
+ wxTreeItemId id = (WXHTREEITEM)tv->itemNew.hItem;
+
+ int image = GetItemImage(id, wxTreeItemIcon_Expanded);
+ if ( image != -1 )
+ {
+ RefreshItem(id);
+ }
+ }
+ }
+ break;
+