×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    Sep 2008
    Location
    Finland
    Posts
    38

    Calendar doesn't occupy the whole screen

    I have a problem: My calendar (CAknCaleMonthStyleGrid) doesn't expand to the whole rectangle AND SetExtentToWholeScreen() doesn't do it either. In reality the latter seem to mess up the calendar view!

    void CMonthContainer::ConstructL(const TRect& aRect, TTime& aDate)
    {
    SetDate(aDate);
    CreateWindowL();
    iGrid = new (ELeave) CAknCaleMonthStyleGrid;
    iGrid->SetContainerWindowL(*this);
    LoadTheCalendarL(ETrue); //First time
    SetRect(aRect);
    // iGrid->SetExtentToWholeScreen();
    // iGrid->DrawNow();
    ActivateL();
    }

    KR, Dick

  2. #2
    Registered User
    Join Date
    Dec 2005
    Posts
    1,236

    Re: Calendar doesn't occupy the whole screen

    Hi,

    That is becuase your CMonthContainer is not of the whole screen size so try doing sth like this

    Code:
    void CMonthContainer::ConstructL(const TRect& aRect, TTime& aDate) 
    {
    SetDate(aDate);
    CreateWindowL();
    iGrid = new (ELeave) CAknCaleMonthStyleGrid;
    iGrid->SetContainerWindowL(*this);
    LoadTheCalendarL(ETrue); //First time
    SetExtentToWholeScreen();
    iGrid->SetExtentToWholeScreen();
    iGrid->DrawNow();
    ActivateL();
    }
    Make sure that in the size changed api you set the same sizes or call SetExtentToWholeScreen() on the CMonthContainer and your grid.
    Regards,
    Sriky

  3. #3
    Registered User
    Join Date
    Sep 2008
    Location
    Finland
    Posts
    38

    Re: Calendar doesn't occupy the whole screen

    No help with:
    void CMonthContainer::ConstructL(const TRect& aRect, TTime& aDate)
    {
    SetDate(aDate);
    CreateWindowL();
    iGrid = new (ELeave) CAknCaleMonthStyleGrid;
    iGrid->SetContainerWindowL(*this);
    LoadTheCalendarL(ETrue); //First time
    // SetRect(aRect);
    SetExtentToWholeScreen();
    iGrid->SetExtentToWholeScreen();
    iGrid->DrawNow();
    ActivateL();
    }

    It seems to transpose the rows and columns somehow!

    Adding something here:
    void CMonthContainer::SizeChanged()
    {
    iGrid->SetRect(Rect());
    // Apply layout
    TRAPD(err, iGrid->SetLayoutL(EFalse, ETrue, ETrue, KCalendarColumns,
    KCalendarRows, TSize(KCalCellW, KCalCellH), KCalCellBorder, KCalCellBorder));
    }
    results mostly in "KERN EXEC 3"
    Last edited by kalastaja; 2008-10-14 at 11:35. Reason: layout

  4. #4
    Registered User
    Join Date
    Dec 2005
    Posts
    1,236

    Re: Calendar doesn't occupy the whole screen

    hmm I think it is considering it as Landscape mode might be. What happens if you dont set anything in the size changed
    Regards,
    Sriky

  5. #5
    Registered User
    Join Date
    Sep 2008
    Location
    Finland
    Posts
    38

    Re: Calendar doesn't occupy the whole screen

    If I don't set "iGrid->SetRect(Rect());" I get a big grey box.
    If I don't set "SetLayoutL()" I get a transposed calendar.
    If I only set these in SizeChanged:
    {
    SetExtentToWholeScreen();
    iGrid->SetExtentToWholeScreen();
    iGrid->DrawNow();
    }

    the emulator crashes!

    ... / Dick

  6. #6
    Registered User
    Join Date
    Dec 2005
    Posts
    1,236

    Wink Re: Calendar doesn't occupy the whole screen

    Hi,

    I was able to make the Calender you could find the cpp in the attachment. I hope it solves your problem. I have passed the application rect to the container using

    Code:
        iContainer = new ( ELeave ) CMyCalendarContainer;
        
        TRect applicationWindow;
        
        AknLayoutUtils::LayoutMetricsRect(
        AknLayoutUtils::EApplicationWindow, applicationWindow );
        iContainer->ConstructL( applicationWindow );
    My rss
    Code:
    //------------------------------------------------------------------------------
    //
    //    r_mycalendar_calemonth_grid
    //    for CAknCaleMonthStyleGrid
    //
    //------------------------------------------------------------------------------
    //
    RESOURCE GRID r_mycalendar_calemonth_grid
        {
        flags = EAknListBoxSelectionGrid;
        array_id = r_mycalendar_calemonth_grid_array;
        }        
    
    RESOURCE ARRAY r_mycalendar_calemonth_grid_array
        {
        items =
            {
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item1;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item2;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item3;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item4;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item5;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item6;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item7;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item8;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item9;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item10;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item11;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item12;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item13;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item14;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item15;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item16;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item17;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item18;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item19;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item20;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item21;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item22;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item23;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item24;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item25;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item26;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item27;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item28;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item29;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item30;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item31;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item32;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item33;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item34;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item35;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item36;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item37;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item38;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item39;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item40;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item41;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item42;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item43;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item44;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item45;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item46;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item47;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item48;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item49;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item50;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item51;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item52;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item53;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item54;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item55;},
            LBUF { txt = qtn_mycalendar_calemonth_grid_array_item56;}
            };
        }
    Attached Files Attached Files
    Last edited by sriky27; 2008-10-15 at 09:59.
    Regards,
    Sriky

  7. #7
    Registered User
    Join Date
    Sep 2008
    Location
    Finland
    Posts
    38

    Re: Calendar doesn't occupy the whole screen

    Thank you for your interest in my problem - but it just persists! You made the icons bigger in the cpp file, so now the area is bigger than the screen, BUT it doesn't downsize to the available area!

    This is what is now done in DoActivateL:
    :::
    iContainer = new (ELeave) CMonthContainer;
    iContainer->SetMopParent(this);
    TRect applicationWindow;
    AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EApplicationWindow, applicationWindow);
    iContainer->ConstructL(applicationWindow, iDate);
    AppUi()->AddToStackL(*this, iContainer);
    :::

    KR, Dick

  8. #8
    Registered User
    Join Date
    Dec 2005
    Posts
    1,236

    Re: Calendar doesn't occupy the whole screen

    Hi,

    I figured out that the grid size is based on the cell size and the distance between the cells if we don't increase it the calendar would be same and yeah Even I have noticed if I don't increase the size of the cell there is a grey patch at the bottom. I am not sure I guess you have to come up with a equation which includes the size of the cell and distance between the cells proportianiate to application window. Let me see if i could come up with any.
    Regards,
    Sriky

  9. #9
    Registered User
    Join Date
    Dec 2005
    Posts
    1,236

    Re: Calendar doesn't occupy the whole screen

    Hi,

    This might not be a best solution perhaps you could try this for fitting your calender to your application rectangle

    Code:
     TRAPD(err, iGrid->SetLayoutL( EFalse, ETrue, ETrue, 8, 7, TSize( Rect().Width()/8, Rect().Height()/7 ), 0,  0 ) );
    Regards,
    Sriky

  10. #10
    Registered User
    Join Date
    Sep 2008
    Location
    Finland
    Posts
    38

    Re: Calendar doesn't occupy the whole screen

    Yes, I've thought of that to BUT the problem remains the icons which are 19*21....

    KR, Dick

  11. #11
    Registered User
    Join Date
    Aug 2007
    Posts
    311

    Re: Calendar doesn't occupy the whole screen

    Can you send you LoadTheCalendarL()function to me, i need the function.
    my email is lmyuanhang@163.com
    thank you very much!

Similar Threads

  1. Custom window in ALL screen modes
    By PawelDefee in forum Symbian
    Replies: 11
    Last Post: 2009-02-11, 09:19
  2. Problem with E90 and secondary screen
    By Tatanka.nbr1 in forum Symbian
    Replies: 5
    Last Post: 2008-06-27, 10:01
  3. Replies: 1
    Last Post: 2006-03-21, 02:19
  4. UI: Full Screen Mode
    By GENERAL_INFO in forum Symbian User Interface
    Replies: 3
    Last Post: 2004-11-22, 06:27
  5. occupy nokia7650 screen on incoming call?
    By dkoppenho in forum Symbian
    Replies: 1
    Last Post: 2003-03-06, 12:55

Posting Permissions

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