×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Oct 2006
    Posts
    37

    Problems with layout

    My app crashes every time when I change the screen size in emulator. AppUi is constructed with flag EAknEnableSkin. Here is the dynamic layout code from view container:

    Code:
    void CMyContainer::HandleResourceChange(TInt aType)
        {
        // Scalable UI support
    
        if ( aType == KEikDynamicLayoutVariantSwitch )
            {
            TRect rect;
            AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, rect);
            SetRect(rect);
            }
            
        CCoeControl::HandleResourceChange(aType);
        }
    Now, when I'm checking this in debug mode, the processing never goes inside the aType == KEikDynamicLayoutVariantSwitch-if after I've changed the screen size. Debugger gives me a value to aType as 268457924. I have no idea what this is. I think the crash results from the fact that the actual rect-setting isn't done, although I can't be completely certain of this, as I can't trace the bug.

    Epocwind.out says I'm getting a KERN-EXEC 3 and a couple of comments after this it also says "Client with active view removed while screen device change request outstanding", although I don't know if this is related.

    Any ideas on how to fix this?

  2. #2
    Super Contributor
    Join Date
    Aug 2005
    Location
    india
    Posts
    2,078

    Re: Problems with layout

    hi,

    Try this way .. and The following code works fine in my containers

    in .h
    virtual void HandleResourceChange(TInt aType);
    in .cpp file

    void CMyContainer::HandleResourceChange(TInt aType)
    {
    CCoeControl::HandleResourceChange(aType);

    // ADDED FOR SCALABLE UI SUPPORT
    // *****************************
    if ( aType==KEikDynamicLayoutVariantSwitch )
    {
    TRect rect;
    AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, rect);
    SetRect(rect);
    }
    }
    Thanks and Regards,
    Mateen Maldar M
    "Whatever the mind can conceive and believe, the mind can achieve"

  3. #3
    Registered User
    Join Date
    Oct 2006
    Posts
    37

    Re: Problems with layout

    Nopes. Doesn't help.

  4. #4
    Super Contributor
    Join Date
    Aug 2005
    Location
    india
    Posts
    2,078

    Re: Problems with layout

    hi,

    did u check it in the appui with the HandleResourceChangeL in ur appui..

    I think ur making some mistake..

    First check the virtual behaviour for the Layout change in the ur appui. cpp

    void CMyAppUi::HandleResourceChangeL( TInt aType )
    {

    CAknAppUi::HandleResourceChangeL(aType);
    if(aType == KEikDynamicLayoutVariantSwitch)
    {
    //do your own code here - forward call to the container etc.
    }

    }
    in .h of ur appui


    private:
    virtual void HandleResourceChangeL(TInt aType);

    Debug with this code and check whether ur application is recognising for the layour change or not ,implementing in the ur appui source and header and then u can implement it in the other containers...

    Thanks and Regards,
    Mateen Maldar M
    "Whatever the mind can conceive and believe, the mind can achieve"

  5. #5
    Registered User
    Join Date
    Oct 2006
    Posts
    37

    Re: Problems with layout

    Execution reaches CAknAppUi::HandleResourceChangeL(aType)-line in AppUi (CAknViewAppui btw) and that is as far as it goes before crashing and burning. I am not quite sure how to proceed. I have no pointers to containers in AppUi, just pointers to views. It's a view-based UI. Am I supposed to somehow send the resource change from AppUI to view's container through the view, or do I need to get the pointer to a container (which would totally mess with the design, though).

    The error Epocwind.out points to is still KERN-EXEC 3. I have no idea about what NULL-pointer, if any, this refers to, though.
    Last edited by tsippa; 2006-11-06 at 11:05.

  6. #6
    Regular Contributor
    Join Date
    May 2005
    Location
    Brasov, Romania
    Posts
    431

    Re: Problems with layout

    Do you have an implementation in your container's SizeChanged() member? If yes, check that code.

    Also check your container's Draw() member content.

  7. #7
    Registered User
    Join Date
    Oct 2006
    Posts
    37

    Re: Problems with layout

    Quote Originally Posted by iulian_moldovan
    Do you have an implementation in your container's SizeChanged() member? If yes, check that code.

    Also check your container's Draw() member content.
    Well, in the original form as shown in my first post SetRect never gets called, as the execution never goes inside the aType == KEikDynamicLayoutVariantSwitch-if. As SetRect isn't called, neither is Sizechanged nor Draw.

    With the additions proposed by mateen_maldar to AppUI, the execution crashes at this line: CAknAppUi::HandleResourceChangeL(aType); and never reaches container's Sizechanged / Draw.

  8. #8
    Registered User
    Join Date
    Oct 2006
    Posts
    37

    Re: Problems with layout

    Figured it out. Suddenly struck me, that as size is changed so is statuspane and I was missing HandleStatusPaneSizeChange (which is called from HandleResourceChangeL) from AppUi. Newbie mistake.

  9. #9
    Regular Contributor
    Join Date
    Oct 2004
    Posts
    321

    Re: Problems with layout

    Hi please give me some tips to solve scable UI issue

    this is my querry


    http://discussion.forum.nokia.com/fo...d.php?t=158323

    help me

Similar Threads

  1. Stair case Layout in wtk(2.2)
    By saqib_ch in forum Mobile Java General
    Replies: 0
    Last Post: 2006-04-04, 08:28
  2. Several problems with NMIT 4.1 MMS
    By jtalviva in forum General Messaging
    Replies: 0
    Last Post: 2006-03-10, 11:03
  3. Several problems with NMIT 4.1
    By jtalviva in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2006-03-10, 10:59
  4. Problems with Nokia carkit CK-1W
    By Batunas in forum General Development Questions
    Replies: 1
    Last Post: 2004-02-09, 18:18

Posting Permissions

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