×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Regular Contributor
    Join Date
    Apr 2007
    Location
    Netherlands
    Posts
    115

    Wrong NaviPaneText after orientation change

    Using the UI designer I made 3 views for my application, each with its own Navigation Pane Text (subtitle): "Main" (default, initial view), "History" and "Settings".

    This works fine; every view shows its correct subtitle. However, the N95 can switch between portrait and landscape layout on-the-fly, and after changing this orientation, the subtitle is always set to "History", irregarding the current view. Only after switching the view, the correct subtitle is displayed again.

    I can't figure out why only the subtitle is set incorrectly and the rest of the view is rotated properly. Do I need to do anything in my application to handle the orientation change? I did notice the view's HandleStatusPaneSizeChange and AppUI's HandleResourceChangeL get called...
    IDE: Carbide.c++ 1.3 / 2.0beta
    SDK: S60 3rd edition MP / FP1
    V2.10.013 (15-09-06) @ Nokia N91
    V20.0.058 (21-10-06) @ Nokia N93
    V30.0.015 (15-07-08) @ Nokia N95

  2. #2
    Registered User
    Join Date
    Oct 2004
    Location
    Singapore
    Posts
    36

    Re: Wrong NaviPaneText after orientation change

    Could you provide some more info. some code snippets would be good.

  3. #3
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    67

    Re: Wrong NaviPaneText after orientation change

    Hi,
    I'm having the same trouble with a CAknForm class.

    I handle the device orienation change like this:

    Code:
    void Take3FormNewForm::HandleResourceChange(TInt aType)
    {
        CAknForm::HandleResourceChange(aType);
    
        //call base class implementation
    
       if ( aType==KEikDynamicLayoutVariantSwitch )
       {
    	TRect rect;
    
    	AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane,rect);
    
    	SetRect(rect);	
    
    	CAknForm::DrawDeferred();
       }
    }
    The form gets updated just fine with the screen orienation EXCEPT for the TitlePane which retains some of the older orienation on it (same goes for the bottom bar sometimes) with what was there before, in the background.

    To illustrate this, I've uploaded an image which you can see a *before* and *after* screenshot:

    http://forums.sbsh.net/uploads/month...1185487945.jpg

    Please help me as I've sat on this for several hours without success :(
    Last edited by m00gl3; 2007-07-27 at 09:22.

  4. #4
    Registered User
    Join Date
    Oct 2004
    Location
    Singapore
    Posts
    36

    Re: Wrong NaviPaneText after orientation change

    Hi. Here is a code snippet of what I have been doing to handle the screen orientation change. Hope it helps.

    void CMyAppUi::HandleResourceChangeL(TInt aType)
    {
    CAknAppUi::HandleResourceChangeL(aType);
    if(aType == EEikDynamicLayoutVariantSwitch)
    {
    iMyView->HandleClientRectChange();
    }
    }

    void CMyView::iMyView->HandleClientRectChange()
    {
    if(iMyContainer) iMyContainer->SetRect(ClientRect());
    }

    void CMyContainer::Draw(const TRect& aRect) const
    {
    CWindowGc& gc = SystemGc();
    /// Now you can either clear the screen or draw the back ground.
    }

  5. #5
    Regular Contributor
    Join Date
    Apr 2007
    Location
    Netherlands
    Posts
    115

    Re: Wrong NaviPaneText after orientation change

    Still having problems :(

    My application currently has 4 views, say, view1, view2, view3, view4, each with similarly-named title.

    Views view1 and view2 are part of a AppUi tab group (they inherit the navigation pane from application.uidesign), view3 and view4 are separate settings screens accessible via menu options (they have a navigation title that overrides the application.uidesign).

    I start in view1 and the 2 tabs are displayed properly in the navigation pane.

    Next, I change the orientation to landscape using the N95's slidable display.
    The view is properly updated, controls are properly aligned again, but the 2 tabs in the navigation pane have been replaced by the title "view4". Also when going back to portrait mode, the title "view4" remains visible, even when switching between tabs with the left/right button.
    Even stranger: when I then go to view4 via the menu and return to view1, it uses the title "view3". When I then go to view3 and return to view1, it properly reverts to the tabs "view1" and "view2".

    My questions: Where does it dig up the title "view4"? Can I manually refresh the navigation pane somehow? Could this be a bug in the generated code by the UI designer?
    Last edited by dracula78; 2007-10-19 at 11:54.
    IDE: Carbide.c++ 1.3 / 2.0beta
    SDK: S60 3rd edition MP / FP1
    V2.10.013 (15-09-06) @ Nokia N91
    V20.0.058 (21-10-06) @ Nokia N93
    V30.0.015 (15-07-08) @ Nokia N95

  6. #6
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    67

    Re: Wrong NaviPaneText after orientation change

    Quote Originally Posted by jinishakya View Post
    Hi. Here is a code snippet of what I have been doing to handle the screen orientation change. Hope it helps.

    void CMyAppUi::HandleResourceChangeL(TInt aType)
    {
    CAknAppUi::HandleResourceChangeL(aType);
    if(aType == EEikDynamicLayoutVariantSwitch)
    {
    iMyView->HandleClientRectChange();
    }
    }

    void CMyView::iMyView->HandleClientRectChange()
    {
    if(iMyContainer) iMyContainer->SetRect(ClientRect());
    }

    void CMyContainer::Draw(const TRect& aRect) const
    {
    CWindowGc& gc = SystemGc();
    /// Now you can either clear the screen or draw the back ground.
    }
    Hi Jini,
    Can you please show me how to "draw the background"?

    This is something that I've never learned how to do.
    I currently save the background to a bitmap in the startup of the program, and draw that as the background when I need to.

    Is there an easier way to do this?
    Can you show me some code snippets?

  7. #7
    Registered User
    Join Date
    Dec 2004
    Posts
    12

    Re: Wrong NaviPaneText after orientation change

    Hi Dracula

    I have a similar problem on N95 firmware v 12.0.013 (19-06-07)

    Application in landscape mode : NaviPaneText OK
    Switch portrait mode : NaviPaneText OK
    Re-switch landscape mode : NaviPaneText KO

    The NaviPaneText (bottom left rect) area seems filled with a previous video memory scrolled a little

    Your post is old so, do you find a solution ?

    BR,
    Sylvain

  8. #8
    Regular Contributor
    Join Date
    Mar 2006
    Posts
    67

    Re: Wrong NaviPaneText after orientation change

    Hi Alexia,
    You can contact me at roy_at_sbsh.net

  9. #9
    Regular Contributor
    Join Date
    Apr 2007
    Location
    Netherlands
    Posts
    115

    Re: Wrong NaviPaneText after orientation change

    Quote Originally Posted by Altexia View Post
    Hi Dracula
    I have a similar problem on N95 firmware v 12.0.013 (19-06-07)

    Application in landscape mode : NaviPaneText OK
    Switch portrait mode : NaviPaneText OK
    Re-switch landscape mode : NaviPaneText KO

    The NaviPaneText (bottom left rect) area seems filled with a previous video memory scrolled a little

    Your post is old so, do you find a solution ?
    Still looking for a solution myself, but my problem seems different: the navigation pane is properly refreshed, but simply contains the title of the wrong view after an orientation change.

    I realize my example posted above was a bit overcomplicated, that's why I posted a simple complete project in another thread.
    IDE: Carbide.c++ 1.3 / 2.0beta
    SDK: S60 3rd edition MP / FP1
    V2.10.013 (15-09-06) @ Nokia N91
    V20.0.058 (21-10-06) @ Nokia N93
    V30.0.015 (15-07-08) @ Nokia N95

  10. #10
    Registered User
    Join Date
    Feb 2008
    Location
    USA
    Posts
    17

    Talking Re: Wrong NaviPaneText after orientation change

    Looks like this problem was fixed in Carbide 1.3 UI Designer. The carbide 1.3 creates the following code which fixes the problem:

    Code:
    void ::HandleStatusPaneSizeChange()
    {
       CAknView::HandleStatusPaneSizeChange();
    
       // this may fail, but we're not able to propagate exceptions 
       TVwsViewId view;
       AppUi()->GetActiveViewId(view);
       if (view.iViewUid == Id() )
       {
       TInt result;
       TRAP( result, SetupStatusPaneL() );
       }
    }

Similar Threads

  1. How to change menubar or menupane?
    By ahsp83 in forum Symbian User Interface
    Replies: 19
    Last Post: 2009-01-29, 13:52
  2. Can't change application UI orientation
    By SamoylovBoris in forum Symbian
    Replies: 5
    Last Post: 2007-07-25, 16:23
  3. Displayable change (again)
    By Wontar in forum Mobile Java General
    Replies: 0
    Last Post: 2007-01-13, 16:14
  4. [Theme Creation] Change IM-Icon
    By danielku15 in forum General Development Questions
    Replies: 0
    Last Post: 2006-04-30, 23:25
  5. change focus
    By f_alonso_1 in forum Symbian
    Replies: 0
    Last Post: 2003-07-17, 13:34

Posting Permissions

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