Discussion Board

Results 1 to 12 of 12
  1. #1
    Registered User PawelDefee's Avatar
    Join Date
    Jul 2003
    Posts
    25
    Hello,

    I have been for a long time using the following code to create a custom floating window that is display on top of all other windows in the phone. This works on S60v2 and v3 devices. The problem is, on devices where multiple screen modes are available (E70 for example), the window is only visible in the first (portrait) mode. When I flip the device, it is not visible. It is also not visible when the application is started from the second (landscape) mode.

    I understand that the windows and/or screen devices have to be manually set to the new screen mode, otherwise the window will not be show, as is described in Symbian documentation:

    "When the screen mode changes, window groups that are incorrectly set up, according to these requirements, are locked out. The windows are notified of the change, and will be displayed if they are updated (according to the current enforcement requirement) to match the new screen mode."

    The question is, how to update current window settings so that it is visible in the new screen mode?

    My code is here, please note that I already do SetScreenSizeAndRotation and SetScreenMode:

    User::LeaveIfError(iWsSession.Connect());
    iWindowGroup = new(ELeave) RWindowGroup(iWsSession);
    User::LeaveIfError(iWindowGroup->Construct((TUint32) iWindowGroup, EFalse));
    iWindowGroup->EnableReceiptOfFocus(EFalse);
    iWindowGroup->SetOrdinalPosition(1, ECoeWinPriorityAlwaysAtFront + 1);
    iWindowGroup->EnableScreenChangeEvents();

    iWindowGroup->SetNonFading(ETrue);
    // Create window handle.
    iWindow = new (ELeave) RWindow(iWsSession);
    User::LeaveIfError(iWindow->Construct(*iWindowGroup, (TUint32) iWindow));
    iWindow->Activate();
    iWindow->SetExtent(UserInterfaceConfigurator::FloatingWindowRect().iTl,UserInterfaceConfigurator::FloatingWindowRect().Size());
    iWindow->SetOrdinalPosition(1, ECoeWinPriorityAlwaysAtFront + 1);
    iWindow->SetNonFading(ETrue);
    iWindow->SetVisible(ETrue);
    iVisible = ETrue;
    // Get the screen device.
    iScreenDevice = new (ELeave) CWsScreenDevice(iWsSession);
    User::LeaveIfError(iScreenDevice->Construct());

    TPixelsTwipsAndRotation defaultSizeAndRotation;
    iScreenDevice->GetDefaultScreenSizeAndRotation( defaultSizeAndRotation);

    iScreenDevice->SetScreenSizeAndRotation( defaultSizeAndRotation );
    iScreenDevice->SetScreenMode( iScreenDevice->CurrentScreenMode() );
    iScreenDevice->SetAppScreenMode( iScreenDevice->CurrentScreenMode() );

    // Create graphics context from the screen device -> to draw splash screen.
    User::LeaveIfError(iScreenDevice->CreateContext(iWindowGc));

  2. #2
    Registered User PawelDefee's Avatar
    Join Date
    Jul 2003
    Posts
    25
    I have made the code available at:

    http://www.chiralion.com/download/Fl....01.2007_2.zip

    This contains the HelloWordBasic application from the SDK with the addition of the floating window class (FloatingWindow.cpp) which will be always drawn on top of all applications.

    This problem is actually visible in all devices (I tested on E70 and 3250). The sample application in the ZIP file has the option "Toggle Orientation" which changes the orientation to landscape. Once this is executed, the floating window disappears. It will reapper if the user goes to other applications (portrait) or toggles the orientation manually to portrait using the menu option.

    Thanks,
    Pawel
    Last edited by PawelDefee; 2007-01-02 at 17:58.

  3. #3
    Registered User vin2ktalks's Avatar
    Join Date
    Jul 2005
    Location
    Bengaluru, India
    Posts
    747
    Hi Pawel,

    I've tried your application on E61 (I don't have either E70 and 3250) but the Toggle orientation doesn't work. By the way one observation on the emulator is that except on 176x208 and 240x320 it was working fine. I'm unaware of the reason behind it.

  4. #4
    Registered User PawelDefee's Avatar
    Join Date
    Jul 2003
    Posts
    25
    To see the problem you have to use a phone that supports multiple orientations (at least E70, E60, 3250 and N93 do).

    I have now updated the sample application (available from the same link and same ZIP file). There is now a second menu option that lists available screen modes, for each screen mode showing size in pixels, size in twips and the rotation flag.

    Here is the information on the number of different modes supported in different models:

    E70: 6 modes
    E60: 6 modes
    3250: 2 modes
    N93 : 4 modes
    5500: 1 mode !

    I suspect, that like the Nokia 5500, the E61 will also list one mode only (I do not have an E61 right now) ? If so, you'd have to try the program on a phone that has multiple modes with the different rotation flags, see the list above ..
    Last edited by PawelDefee; 2007-01-03 at 20:13.

  5. #5
    Registered User PawelDefee's Avatar
    Join Date
    Jul 2003
    Posts
    25
    Ok,

    Thanks to Forum PRO Technical Support, I have a solution now. It is mandatory to create CWsScreenDevice object before any RWindowGroup objects are created for a particular RWsSession. Otherwise, the window will be visible only in the primary screen mode.

    This certainly is a bug in the Window Server but for now the solution is satisfactory.

    Cheers,
    Pawel

  6. #6
    Registered User Jeepy's Avatar
    Join Date
    Mar 2003
    Location
    51°11'4.78"N -|- 2°48'27.05"E (Belgium)
    Posts
    728
    Hi Pawel,

    can you repost your code with the modification ? or the zip file contains already this fix ?

    Thanks in advance,
    Domi.
    ----------------------------------------------------------------------------------
    FExplorer is my baby !

    you can get the FREE version from www.gosymbian.com
    you can get the PRO version from http://store.ovi.com/content/339454

  7. #7
    Registered User PawelDefee's Avatar
    Join Date
    Jul 2003
    Posts
    25
    Hi,

    Just use the code from the first post, creating the ScreenDevice before the WindowGroup object.

    Cheers,
    Pawel

  8. #8
    Registered User Jeepy's Avatar
    Join Date
    Mar 2003
    Location
    51°11'4.78"N -|- 2°48'27.05"E (Belgium)
    Posts
    728
    Thanks Pawel,

    Domi.
    ----------------------------------------------------------------------------------
    FExplorer is my baby !

    you can get the FREE version from www.gosymbian.com
    you can get the PRO version from http://store.ovi.com/content/339454

  9. #9
    Registered User jetair's Avatar
    Join Date
    May 2007
    Posts
    10
    Thank you for your code, it is very useful, but I have a little problem using it in CONSOLE APP.-SYMBIAN9 (In application with GUI it works correctly)
    For ex. I use this code in DrawSplashL():
    iWindowGc->SetBrushStyle( CGraphicsContext::ESolidBrush );
    iWindowGc->SetBrushColor( TRgb(255,0,0) );
    iWindowGc->Clear();
    iWindowGc->SetBrushColor( TRgb(0,255,0) );
    TRect mRect=TRect(iWindow->Size());
    iWindowGc->DrawEllipse(mRect);
    Then I see green ellipse in red rectangle, but if phone screen is deactiveted (screen saver), then after activation I see only white rectangle. What problem can be here?
    Thank you in advance!

  10. #10
    Super Contributor cassioli's Avatar
    Join Date
    Mar 2003
    Posts
    580
    Don't know if Pawel is steel monitoring this thread, anyway...
    Do you think this function could force a display rotation not defined in WSINI.INI file?

  11. #11
    Regular Contributor frank.sunny@163.com's Avatar
    Join Date
    Sep 2007
    Location
    Hangzhou
    Posts
    399
    Quote Originally Posted by jetair View Post
    Thank you for your code, it is very useful, but I have a little problem using it in CONSOLE APP.-SYMBIAN9 (In application with GUI it works correctly)
    For ex. I use this code in DrawSplashL():
    iWindowGc->SetBrushStyle( CGraphicsContext::ESolidBrush );
    iWindowGc->SetBrushColor( TRgb(255,0,0) );
    iWindowGc->Clear();
    iWindowGc->SetBrushColor( TRgb(0,255,0) );
    TRect mRect=TRect(iWindow->Size());
    iWindowGc->DrawEllipse(mRect);
    Then I see green ellipse in red rectangle, but if phone screen is deactiveted (screen saver), then after activation I see only white rectangle. What problem can be here?
    Thank you in advance!

    I met the same problem
    it must to be redraw, but it had not.

  12. #12
    Regular Contributor s3920209's Avatar
    Join Date
    Jul 2008
    Posts
    83
    me too....

Similar Threads

  1. Create a personal window for custom control
    By keanu77 in forum Symbian C++
    Replies: 1
    Last Post: 2006-10-01, 20:46
  2. custom buttons on the idle screen of nokia 6680
    By algiz in forum Symbian C++
    Replies: 0
    Last Post: 2006-07-13, 10:56
  3. About window views
    By thodime_guru in forum Symbian User Interface
    Replies: 1
    Last Post: 2004-06-17, 18:00
  4. Scrolling a window larger then the screen
    By arnobel in forum Symbian User Interface
    Replies: 0
    Last Post: 2002-08-13, 14:09
  5. how to make a full screen window?
    By Nokia_Archive in forum Symbian User Interface
    Replies: 1
    Last Post: 2002-05-29, 15:30

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