×

Discussion Board

Results 1 to 1 of 1
  1. #1
    Registered User
    Join Date
    Feb 2010
    Posts
    1

    scroll bar is not shown in first screen.But later its been shown wen device is tilted

    Hi all,

    I have created an editor page and also a vertical scrollbar along with that text editor page in ConstructL(). But this scrollbar is not shown when this page is viewed for the first time.
    But, when device is tilted, the scrollbar is updated. this update happens from another method with similar code. Tilting back again shows up the scrollbar properly.

    Typically, ConstructL looks like this

    Code:
    ConstructL()
    {
      ......
        CEikonEnv* coeEnv = CEikonEnv::Static();
    
        SizeChanged();
    
        TRect mainPaneRect;
        AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
        SetRect(mainPaneRect);
        iBackGround = CAknsBasicBackgroundControlContext::NewL(KAknsIIDQsnBgAreaMain, Rect(), EFalse);
        
        TResourceReader reader;
    
        iCoeEnv->CreateResourceReaderLC(reader, R_AKNEXEDITOR_VIEW1_EDWIN);
    
        iEditor = new (ELeave) CEikGlobalTextEditor;
        iEditor->SetAknEditorFlags(EAknEditorFlagEnableScrollBars);    // BEFORE CONSTRUCTING !
        iEditor->SetContainerWindowL(*this);
        iEditor->ConstructFromResourceL(reader);
        iEditor->CreateScrollBarFrameL();
        iEditor->ScrollBarFrame()->SetScrollBarVisibilityL(
                       CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOn);
        
        CleanupStack::PopAndDestroy();  // Resource reader
        
        //iEditor->ScrollBarFrame()->DrawScrollBarsNow();
        
        TRect rect(Rect());
        TRect ScrollBarRect =
                 iEditor->ScrollBarFrame()-> VerticalScrollBar()->Rect();
        iEditor->SetExtent(TPoint(0,0), TSize(rect.Width()
                 - ScrollBarRect.Width(), rect.Height()));
    
        iEditor->SetReadOnly(ETrue);
        .......
        .......
        iEditor->UpdateScrollBarsL();
    
    }


    In the method where scrollbar is shown when tilted, the code is shown as follows:


    Code:
    Method()
    {
    
                  TRect mainPaneRect;
                  AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, mainPaneRect);
                  SetRect(mainPaneRect);
                  //iEditor->SetSize(mainPaneRect.Size());
                  //SetBackgroundContextL();
                  
                  TRect rect(Rect());
                  TRect ScrollBarRect =
                           iEditor->ScrollBarFrame()-> VerticalScrollBar()->Rect();
                  iEditor->SetExtent(TPoint(0,0), TSize(rect.Width()
                           - ScrollBarRect.Width(), rect.Height()));
                  
                  if (iBackGround)
                     {
                     delete iBackGround ;
                     iBackGround = NULL ;
                     }
                  TRect mainPane( 0,0,0,0 );
                  AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, mainPane );
                 
                  iBackGround = CAknsBasicBackgroundControlContext::NewL( 
                                     KAknsIIDQsnBgAreaMain, mainPane, EFalse );
                     
                  iEditor->SetSkinBackgroundControlContextL( iBackGround );  
                  
                  CCoeControl::HandleResourceChange(aType);
                 
                  DrawDeferred();
    
    }
    Resource used are shown as follows:

    Code:
    #define qnn_aknexeditor_view4_gtexted_width     165
    #define qnn_aknexeditor_view4_gtexted_height    110
    #define qnn_aknexeditor_view4_gtexted_numlines  5
    #define qnn_aknexeditor_view4_gtexted_textlimit 256
    
    RESOURCE GTXTED r_aknexeditor_view1_edwin
       {
       flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
       width = qnn_aknexeditor_view4_gtexted_width;
       height = qnn_aknexeditor_view4_gtexted_height;
       numlines = qnn_aknexeditor_view4_gtexted_numlines;
       textlimit = qnn_aknexeditor_view4_gtexted_textlimit;
       fontcontrolflags = EGulFontControlAll;
       fontnameflags = EGulNoSymbolFonts;
       }
    Can anyone please tell me, why scrollbar is not getting updated/shown only for the first time ?? i.e., when called in constructL method ??
    Last edited by kiran10182; 2010-02-15 at 13:05. Reason: Wrapping up with [code]...[/code] tags to make it more readable

Similar Threads

  1. Access point Problem using Canvas loading bar while networking on s-60 device
    By vinay_saraswat in forum Mobile Java Networking & Messaging & Security
    Replies: 6
    Last Post: 2010-02-19, 14:46
  2. Create scroll bar on container
    By vineet.jain in forum Symbian User Interface
    Replies: 1
    Last Post: 2009-04-25, 09:28
  3. Replies: 3
    Last Post: 2009-03-19, 12:46
  4. Bluetooth Security: What exactly is an untrusted device?
    By rahulmcs in forum Bluetooth Technology
    Replies: 1
    Last Post: 2005-12-02, 07:26

Posting Permissions

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