View And Controls

Login to reply to this topic.
Sun, 2006-05-07 15:13
Joined: 2005-05-26
Forum posts: 11
Hi Gang:

I have been struggling with this problem for last couple of days. The problem is that I want an application which supports multiple views and one of these views has a listbox. A control having a listbox will inherit from CCoeControl and override interesting operations whereas a control which is a view will inherit from CAknView, which contains methods for switching views etc.

The most obvious way out, aka making this view inherit from both CCoeControl and CAknView does not works. So I was struck with this problem for about a week.

I just finished checking out the multiviews example and there I found a solution to this problem. The idea is to follow the view and container model. The view will inherit from CAknView while the container will inherit from CCoeControl.

Just wanted to ask why exactlt do we need this view-controller model? Why can't we have a simplistic class which derives from both and overrides operations of interest.

TIA
Manu Anand
Hyd'bad, India

Sun, 2006-05-07 19:55
Joined: 2005-11-20
Forum posts: 1246
Re: View And Controls
Interesting question of framework architecture.

I don't know much about S60, but I am just now working on a UIQ application with multiple views, and indeed in such an application views are derived from CCoeControl and implement the MCoeView interface at the same time.

And I can't say that something "feels wrong" by doing so.

René Brunner

Mon, 2006-05-08 06:47
Joined: 2004-05-21
Forum posts: 286
Re: View And Controls
If you have to make use of View server you need to derive your class from MCoeView by which you need to override the pure virtual functions of Mixin class. This you need not do if you dont want multi view feature(just need to use CCoeControl).

So if some one have to develop a simple application (with out view server support) still they need to override the MCoeView pure virtual function by your idea, which is not required

Cheers,
Sri
Mon, 2006-05-08 09:38
Joined: 2005-05-26
Forum posts: 11
Re: View And Controls
Hi Sri:

I understand the framework part of it. I also understand the problems associated with diamond hierarchy and mixins, in general.

The problem is that it isn't intuitive. And for someone like me, who is learning Symbian programming as a hobby, it comes as a showstopper. So I wanted a feedback from the people who designed it the way it is..

Your response is appreciated..

Cheers...
Manu
Mon, 2006-05-08 12:56
Joined: 2005-02-12
Forum posts: 98
Re: View And Controls
As per my knowledge It is not feasible to derive a class from two C Class .Yes you can do multiple inheritance with only one c class and from any number of  of MClasses(observers) that conmtain only pure virtual funtions.
Wed, 2007-03-14 18:04
Joined: 2006-08-09
Forum posts: 49
Re: View And Controls
  • Login to reply to this topic.