Originally posted by: dswigger
If you draw the control, then call Reset, the next time the control is drawn it will fail with an assertion. Tracked it to the DrawItem call..
void CPropertyListCtrl::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
// Make sure its a valid item
if( lpDrawItemStruct->itemID == LB_ERR )
return;
----->Start Insert Here
if(m_Items.GetCount() <= 0)
return;
<-----End of insert
Originally posted by: serge desmedt
Nice control, but one error:
It looks as if clicking in the editbox makes the
I've tried to solve it in two ways:
2/ disable the redraw of the value backgroundarea if the
void CPropertyListCtrl::DrawItem(CDC* pDC, CRect ItemRect, BOOL bSelected)
Kind rgards,
Serge Desmedt
Hey,
when you open the control and immediatly press on the line
for the dropdownlist, immedialtly followed by clicking on
the editbox of the dropdownlist, then the expansionbutton
disappears.
propertylistcontrol to be redrawn, and this causes the
button to be overdrawn.
1/ at the end of the redraw of the propertylistcontrol, i
check if it is a selected dropdownlist item which must be
redrawn and then send a message to the expansionbutton to
redraw itself. This does not work (why?)
item is a selected dropdownlist. This works (see following
code)
{
/////////////////////////////////////////
// Paint the Background rectangle (Property Value)
if(m_pCurDrawItem->nType == ID_PROPERTY_COLOR)
pDC->SelectObject(m_pCurDrawItem->pBrush);
else
pDC->SelectObject(m_pBkBrush);
pDC->SelectObject(m_pBorderPen);
ItemRect.left = m_nWidestItem - 1;
ItemRect.top--;
ItemRect.right++;
CRect OrginalRect = ItemRect;
if(!(m_pCurDrawItem->nType == ID_PROPERTY_COMBO_LIST && bSelected))
{
// Draw the Rectangle
pDC->Rectangle(ItemRect);
}
/////////////////////////////////////////
// Draw the Property Text
...
...
...