×

Discussion Board

Results 1 to 13 of 13

Hybrid View

  1. #1
    Registered User
    Join Date
    Sep 2008
    Location
    Vancouver, Canada
    Posts
    588

    is it possible to create an application only with containers and no views??

    Hi,

    I am going to create a multiview application. Its going to be a fully custom controls application. Nothing would be from default ui. That is why i was thinking if its possible to skip creating CAknViews from the application. As the CAknView is responsible for handling view specific commands but my app is going to handle commands from the container itself. Its going to be a touch only application. In this case would it be possible to switch views without CAknView in the application? I was trying and got confused at the following:

    To create a screen this is enough:
    Code:
    iContainer = CSplashContainer::NewL(ClientRect());
    but after that we need to add this control to stack to be able to receive commands like this
    Code:
    AddToStackL(iSplashView)
    So screen would be visible and take user commands. But what if i have to switch to another view. In that case, i should remove the current view from the stack right?
    But there is no method to do this if i don't use CAknView in the application. Its possible only if i use CAknView. May be i don't know yet. To switch view it should be something like this
    Code:
    AppUi()->RemoveFromViewStack(*this, iContainer);
    but here pointer this should be a CAknView and not a CCoeControl!

    Can i do without CAknViews and still able to remove CCoeControls from the stack??

    Please suggest.

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: is it possible to create an application only with containers and no views??

    I actually stopped using Views right after they were introduced with S60, so you could indeed use the good old way, and handle Commands in your AppUI command handling, and us CCoeControl based containers directly in AppUI class.

    just remember to change the base class for AppUI class, otherwise you'll end up having some visibility issues with command buttons.

  3. #3
    Registered User
    Join Date
    Sep 2008
    Location
    Vancouver, Canada
    Posts
    588

    Re: is it possible to create an application only with containers and no views??

    Ok but how do i switch between screens? Is control stack not required in this case? I might have to switch to another screen from the current screen. I should delete the current one and create the second one. But what about control stack??

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: is it possible to create an application only with containers and no views??

    in general, you would add the CCoeControl based container to the stack with AddToStackL, and then when setting another one there, you would use RemoveFromStack to remove the previous. note that it is stack indeed, and you do need to remember what was added last so you know what's coming out.

    Deleting would be an option, it would make it easier to handle the adding/removing from the stack, since you would only have one valid view, and it would be the only one in the stack at any time.

  5. #5
    Registered User
    Join Date
    Sep 2008
    Location
    Vancouver, Canada
    Posts
    588

    Re: is it possible to create an application only with containers and no views??

    Ok i tried and found that AddToStackL and RemoveFromStack isn't working. App crashes with Kern-Exec 3 when removing the old CCoeControl from stack. I think simple deletion and creation of CCoeControls is easy to go with.

  6. #6
    Registered User
    Join Date
    Sep 2008
    Location
    Vancouver, Canada
    Posts
    588

    Re: is it possible to create an application only with containers and no views??

    Following is not working from the current CCoeControl
    Code:
    			iAppUi->RemoveFromStack(this);
    			iLoginView = CLoginContainer::NewL(CEikonEnv::Static()->EikAppUi()->ApplicationRect());
    			iAppUi->AddToStackL(iLoginView);
    Also if i try to simple delete the current CCoeControl and create sencond, it gives CONE 44 panic (control still on stack)
    Code:
    			delete this;
    			iLoginView = CLoginContainer::NewL(CEikonEnv::Static()->EikAppUi()->ApplicationRect());
    Am i not using them correctly??

Similar Threads

  1. Views, Containers, changing between them.
    By szeldon in forum Symbian User Interface
    Replies: 2
    Last Post: 2008-01-01, 17:12
  2. Views, containers and dialogs
    By _fox in forum Symbian
    Replies: 5
    Last Post: 2004-06-25, 04:31
  3. Views, containers and dialogs
    By _fox in forum Symbian User Interface
    Replies: 0
    Last Post: 2004-06-21, 11:37
  4. switching views, without using containers
    By alokkumarsingh in forum Symbian User Interface
    Replies: 2
    Last Post: 2004-06-07, 09:03
  5. switching views, without using containers
    By s3ni in forum Symbian User Interface
    Replies: 13
    Last Post: 2003-07-23, 05:17

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×