Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor NevenS's Avatar
    Join Date
    Aug 2008
    Posts
    62
    Hello,

    I'm trying get my application to run in fullscreen. That means no status pane, no title pane, but I DO want the menu buttons ("Options" + "Exit", the CBA) to be visible. Can somebeody please tell me how to do it?

    Firstly, what I have done so far.
    The GUI architecture uses derived CAknViewAppUi, CAknView and CCoeControl (each in an own class, as Carbide with GUI support would create it).
    It all runs on Symbian 9.2 (N82) in landscape mode.

    There seem to be many ways to achieve "fullscreennes".
    I have experimented with (all done in ConstructL of CCoeControl derivation): SetExtentToWholeScreen(), SetRect(), SetExtent(), SetCanDrawOutsideRect().
    A combination of these functions results in fullscreen.

    I know that I can hide the status pane, title pane and cba, but there is no need to. I draw over them.

    Still, I would like the CBA to be visible.
    Since my main CCoeControl is periodically drawn (the camera's viewfinder), in Draw( const TRect& aRect ) const, I tried to Draw the Cba there:
    AppUi()->Cba()->DrawDeffered (DrawNow crashes).
    I hoped that the Cba() would be drawn after the CCoeControl has been drawn, but that didn't help.


    An example of what I want to do would be the standard Camera application - it has fullscreen with "Options" and "Exit" visible. Do I have to draw them extra as Bitmaps or using some type of DrawText, or can I make the CBA be drawn over my CCoeControl (the viewfinder)?

    Or can I change the drawing order (z-buffer like)? To make first my CCoeControl be drawn, then CBA. I would probbably have to hide status pane then.

    I have even tried setting the Extent and/or Rect of my CCoeControl so that it excludes the CBA buttons (which are on the right side).
    The CBA buttons are then visible, but the right half of the viewfinder was not visible, as expected.
    My hope was that after setting SetCanDrawOutsideRect() I would be able to draw the right half, but that was not the case - it wasn't visible.

    e.g.
    000000000022
    000000000011
    000000000011
    000000000011
    000000000022

    where 0 is the area set by SetRect / SetExtent, 1 is the area I thought would be renderable if I set SetCanDrawOutsideRect(), 2 is the area of the CBA buttons.
    But as mentioned, area 1 was not rendered. Note that the upper-most and lower-most 0 line covers the title / status pane.

    Thanks in advance

  2. #2
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    Try if AknLayoutUtils::LayoutMetricsRect with EControlPane can help you (basically you should "subtract" this rectangle from full screen)

  3. #3
    Regular Contributor NevenS's Avatar
    Join Date
    Aug 2008
    Posts
    62
    How can I subtract the rectangle from fullscreen?
    Is there a "layout-mask" that I can update? How do I do that?

    And shouldn't there be two rectangles, one for the "Options" and one for the "Exit" button?

  4. #4
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    You have to determine where the CBA is located, and indent that side of your view rectangle. Something like
    Code:
    // screen and cba are TRect-s
    if(cba.Width()==screen.Width()) // cba is horizontal, screen sized
        if(cba.iTl.iY==0) // cba is on the top
            screen.iTl.iY=cba.iBr.iY; // screen's top is moved to cba-s bottom
        else // cba is on the bottom
            screen.iBr.iY=cba.iTl.iY; // screen's bottom is moved to cba's top
    else // cba is vertical
        if(cba.iTl.iX==0) // cba is on the left
            screen.iTl.iX=cba.iBr.iX;
        else
            screen.iBr.iX=cba.iTl.iX;
    it may work or may not work, I have not tried actually.

  5. #5
    Regular Contributor NevenS's Avatar
    Join Date
    Aug 2008
    Posts
    62
    ah, but that would make my right half of the viewfinder not be displayed, even that part where there are no buttons.

    If we look at the screen's layout, I want to achieve
    000000000022
    000000000000
    000000000000
    000000000000
    000000000022

    where 0 is the viewfinder and 2 is the CBA.
    If I do it just by setting the rightmost x coord of screen (viewfinder) to the leftmost of x coord of CBA, I would get:

    00000000022
    000000000..
    000000000..
    000000000..
    00000000022

    where .. is not rendered (not updated by GUI).


    My idea was that even if I set the viewfinder's ccoecontrol right-most x to left-most x of CBA, that I would be able to render outside of the rectangle
    if I set SetCanDrawOutsideRect() and render the . part explictily. But it was culled anyway.



    Can I at least change the drawing order? First render the viewfinder and then the CBA on top?
    And if yes, how?


    Another solution (more of a hack) would be to display the "Options" and "Exit" as text (DrawText).
    And when I press "Options" the whole StatusPane and Menu moves into focus and is rendered on top of the viewfinder anyway (the way I want it).

  6. #6
    Regular Contributor alav's Avatar
    Join Date
    Mar 2007
    Posts
    119
    Hi NevenS,

    I faced the same problem a couple of months ago and spent a lot of time trying to solve it. Finally I 'invented' something which may not be very elegant, but does work.

    Code:
    CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
    iPrevOrdinalPos = cba->DrawableWindow()->OrdinalPosition();
    cba->DrawableWindow()->SetOrdinalPosition(0);
    I restore CBA's ordinal position when the control gets destroyed, that's what iPrevOrdinalPos is for.

    This trick works for me, I hope it helps.

    Cheers,
    Maciej

Similar Threads

  1. How to use cba with LaunchPopupMenuL?
    By larrydb in forum Symbian User Interface
    Replies: 6
    Last Post: 2008-11-03, 09:24
  2. Get the CBA buttons position?
    By tinka_83 in forum Symbian User Interface
    Replies: 5
    Last Post: 2008-03-27, 12:32
  3. Form and CBA Buttons?
    By tqchcm in forum Symbian User Interface
    Replies: 5
    Last Post: 2007-10-25, 05:24
  4. slide menu in j2me
    By afka in forum Mobile Java General
    Replies: 4
    Last Post: 2006-09-04, 09:10
  5. CBA, menu and key events
    By joker_pl in forum Symbian User Interface
    Replies: 1
    Last Post: 2005-09-19, 10:27

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved