
TreeView "cut" not exactly right
I created a tree control with 16-bit bitmapped icons:
if( !m_Tree.Create( WS_VISIBLE | WS_BORDER
| TVS_HASLINES | TVS_LINESATROOT | TVS_SHOWSELALWAYS
| TVS_HASBUTTONS,
CRect( 0, 0, 100, 100 ), this, ID_TREE ))
return -1;
m_ilIcons.Create( 16, 15, ILC_COLOR16 | ILC_MASK, TREE_ICON_COUNT, 1);
m_bmpIcons.LoadBitmap( IDB_16BIT_ICONS);
m_ilIcons.Add( &m_bmpIcons, RGB(255,255,255));
ASSERT( m_ilIcons.GetImageCount() == TREE_ICON_COUNT);
m_Tree.SetImageList( &m_ilIcons, TVSIL_NORMAL);
So now I have real color (instead of dithered) faded icons when I put an
item into the cut state, just like Windows
Explorer.
m_Tree.SetItemState( p_hItem, TVIS_CUT, TVIS_CUT);
Everything works great until I click on the item that was cut. The faded
image is redrawn with its original colors so
that it no longer looks cut--until I select a different item, at which time
it is drawn faded again. Changing the
selection with the keyboard does not exhibit this behavior; only the mouse
has this effect.
Actually, it takes two clicks to get the image to redraw with the real
original colors. The first click makes the faded
image darker, while a second click makes it even darker.