Need help with CViewColumn Class

Need help with CViewColumn Class

Post by Neel » Fri, 25 Nov 2005 20:17:56


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,
 
 
 

Need help with CViewColumn Class

Post by David Phil » Sat, 26 Nov 2005 15:33:40

In article < XXXX@XXXXX.COM >,



I am the original author of CViewColumn, and I am not able to reproduce
your problem.

Have you double checked the layout of your items in Constructor?

Have you installed PowerPlant's DebugMenu code, and used it to look at
the view hierarchy at the point you are having a problem?

 
 
 

Need help with CViewColumn Class

Post by Neel » Sun, 27 Nov 2005 00:13:05


I have double checked with the code and layout of all views in
constructor also.
Please have a look at the code i have attached in above message, and if
you
find any missing information then please let me know.
Also let me know about DebugMeny Code, I am not aware.
Thanks a lot in advance.
 
 
 

Need help with CViewColumn Class

Post by Neel » Sun, 27 Nov 2005 00:25:32

I have double checked with layout and code, but didnt find any pointer.
Please have a look at the attached code, and if you find any missing
informtion then let me know.

Also let me know about DebugMenu Code ?

Thanks in advance.
 
 
 

Need help with CViewColumn Class

Post by David Phil » Sun, 27 Nov 2005 04:49:45

In article < XXXX@XXXXX.COM >,



I see no attachment here.


Look in the PowerPlant source code.

"..../Metrowerks CodeWarrior/MacOS Support/PowerPlant/_In
Progress/_Debugging Classes/"
 
 
 

Need help with CViewColumn Class

Post by Neel » Wed, 30 Nov 2005 18:46:23

I have sent you attachement, where i am facing problem with CViewColumn
class. Please have a look at it, and let me know where did i make
mistake.

Thanks,
 
 
 

Need help with CViewColumn Class

Post by David Phil » Thu, 01 Dec 2005 02:43:29

In article < XXXX@XXXXX.COM >,



I've received it in email, but I have limited time to look at it, and I
have not yet gotten the headers to precompile.

I did modify the CViewColumn example that I'd posted to the Metrowerks
Contributed Class Archive
< http://www.yqcomputer.com/ ;
to add "Add Item" and "Remove Item" menu commands, and was not able to
reproduce the problem you reported.
 
 
 

Need help with CViewColumn Class

Post by Neel » Tue, 06 Dec 2005 14:32:22

I tried with creating single object and also check for NULL, and use
the same object to add and modify the records, but still i could not
solve the first field empty (does not display in ListView).
Is there any solution/work-around, will you please suggest !
 
 
 

Need help with CViewColumn Class

Post by David Phil » Tue, 06 Dec 2005 14:47:21

In article < XXXX@XXXXX.COM >,



As I explained to you privately, your problem is that when you call
CreateSubPane(), you are calling on the wrong ListView. If you called
CreateSubPane() on the visible ListView, you'd see the subpane display.