Hi
I have inherited class from CViewColumn. I placed An Add button
over the dialog, When I press Add button, I am adding some new values
to the CLIstView
Say "Tom" and " 20year"
but this doesn't get displayed in my ListView, However when I add next
time say
"Thom" and "30Year"
My List view shows both values as
Tom 20 year
Thom 30year
Here is the code - snippet to add new value in ListView
/*******************************************************/
LView *l_pRowView;
int f_iIX=0;
LStr255 l_strValue;
char l_oBuffer[200];
CViewColumn *l_pDView = dynamic_cast<CViewColumn
*>(GetLWindow()->FindPaneByID(DM_EVIEW));
for(f_iIX = l_pDView->GetPaneCount(); f_iIX > 0; f_iIX--)
{
l_pDView->RemoveSubPane(l_pDView->GetSubPane(f_iIX));
}
l_pDView->Refresh();
std::string l_oName, l_oAge, l_oDescription;
for(f_iIX = 0; f_iIX < m_oObject.GetNumberOfElements(); ++f_iIX)
{
l_pDView->CreateSubPane(f_iIX +1, DM_EVIEW_ROW, Refresh_Yes);
l_pRowView = dynamic_cast<LView *>(l_pDView->GetSubPane(f_iIX +1));
m_oObject.GetName(f_iIX + 1, &l_oName);
m_oObject.GetAge(f_iIX + 1, &l_oAge);
m_oObject.GetDescription(l_oName, l_oAge, &l_oDescription);
dynamic_cast<LStaticText
*>(l_pRowView->FindPaneByID(DM_EDIT_BCD))->SetText((char *)
l_oName.c_str(), l_oName.size());
dynamic_cast<LStaticText
*>(l_pRowView->FindPaneByID(DM_EDIT_SYM))->SetText((char *)
l_oAge.c_str(), l_oAge.size());
dynamic_cast<LStaticText
*>(l_pRowView->FindPaneByID(DM_EDIT_DEC))->SetText((char *)
l_oDescription.c_str(), l_oDescription.size());
}
l_pDView->Refresh();
/*********************************************/
Debugging result shows that the value in l_oName &l_oAge is coming
same, Also the for loop executed first time, so the complete code is
executing but still not showing the result.
Is this the problem of List View or Am I missing some value. Any help
in this regard would be appreciated
Thanks & Regards,


|