Problem with Multiviews and SetModParent ... Help !!!

Login to reply to this topic.
Fri, 2003-10-31 17:27
Joined: 2003-10-14
Forum posts: 50
Hi all !
I have created an application with 2 views.
I am using a ListBox in one of this view. I used "OfferKeyEventL" in the container of this view but I can´t scroll the ListBox ...
I think the problem might come from SetModParent.
I´ve tried :
Code:
// ---- View1.cpp ----
// iContainer = Only container from view 1
// iContainer contains my ListBox, which I want to scroll ...
iContainer->SetMopParent(iAppUi()); // doesn´t work
If I give a reference of my AppUi to my View, I got an error:
'SetMopParent' : cannot convert parameter 1 from 'class CAppUi *' to 'class MObjectProvider *'

Thanx for your help !!!!!

Fri, 2003-10-31 21:02
Joined: 2003-10-27
Forum posts: 5
Problem with Multiviews and SetModParent ... Help !!!
I hope these couple of lines help you with your problem:

I am not sure if you are using the view architecture in your application.
Anyway, when you construct the control, you can do something like this:
1. construct your control, which contains the list box with the default constructor
2. use SetMopParent(this) // "this" can refer to the instance of the view or the appui.
3. complete the second phase construction.

In the view architecture, these steps are done in the DoActivateL() function.
Otherwise, use it in the appui second phase construction.
Mon, 2003-11-03 09:20
Joined: 2003-10-14
Forum posts: 50
Thanx ...
Thanx for your help ...

I do use multiviews ...
Thus I created my listbox and used SetMopParent(this) in my DoActivateL function ...
But it doesn´t work Sad
How could I test, whether the problem comes from the listbox or from any control in my app ?

Thanx again ...
Mon, 2003-11-03 09:46
Joined: 2003-10-14
Forum posts: 50
Answer !
Hi !
I´ve realised that I totally forgot to use this in my DoActivate :

Code:
// ( In DoActivate from View1.cpp ):
AppUi()->AddToViewStackL(*this, iContainer);

And one still has to remove it from Stack in the DoDeactivate() ...

Cheers,
Valentin
  • Login to reply to this topic.