scrollbar does not display

Login to reply to this topic.
Sun, 2008-02-03 20:11
Joined: 2005-01-15
Forum posts: 10

The scrollbar frame does not adjust the rectangle or display on the S60 3rd Edition. This example code does not work - it has on previous platforms..

void CscrolltestAppView::ConstructL( const TRect& aRect )
        {
        // Create a window for this application view
        CreateWindowL();

        iScrollBarFrame = new(ELeave) CEikScrollBarFrame(this, this, ETrue);
        iScrollBarFrame->SetTypeOfHScrollBar(CEikScrollBarFrame::EArrowHead);
        iScrollBarFrame->SetTypeOfVScrollBar(CEikScrollBarFrame::EArrowHead);
        iScrollBarFrame->SetScrollBarVisibilityL
                        (CEikScrollBarFrame::EOn, CEikScrollBarFrame::EOn);

        TEikScrollBarFrameLayout layout;
        TEikScrollBarModel       myModel;
        myModel.iThumbSpan=255;
        myModel.iThumbPosition=0;
        myModel.iScrollSpan =500;

        layout.iTilingMode=TEikScrollBarFrameLayout::EClientRectConstant;
        layout.SetInclusiveMargin(10);
        layout.SetClientMargin(10);
        layout.iClientAreaGranularity = TSize(1, 1);
               
        TRect fullRect = aRect;
        TRect inclRect = aRect;

        iScrollBarFrame->TileL(&myModel, &myModel, fullRect, inclRect, layout);

        // Set the windows size
        SetRect( inclRect );

        // Activate the window, which makes it ready to be drawn
        ActivateL();
        }

Can anybody help please?

john


John Read
NewNet Marketing
Munich, germany


Mon, 2008-02-04 00:04
Joined: 2007-12-19
Forum posts: 49
Re: scrollbar does not display

I suspect that this line may cause this problem

layout.iTilingMode=TEikScrollBarFrameLayout::EClientRectConstant

Mon, 2008-02-04 19:02
Joined: 2005-01-15
Forum posts: 10
Re: scrollbar does not display

Thanks for the suggestion but I have tried EInclusiveRectConstant, and it did not change anything

john


John Read
NewNet Marketing
Munich, germany

Tue, 2008-02-05 10:36
Joined: 2007-12-19
Forum posts: 49
Re: scrollbar does not display

Do you update iScrollBarFrame size in CscrolltestAppView::SizeChanged() method ??

Tue, 2008-02-05 10:51
Joined: 2007-08-31
Forum posts: 54
Re: scrollbar does not display
Wed, 2008-02-06 16:50
Joined: 2005-01-15
Forum posts: 10
Re: scrollbar does not display

I Have checked the discussions and have implemented the changes they refer to, but the scrollbar still does not display. I see in the example below that the tileL does not produce the expected results

        CreateWindowL();
        ... etc
        iScrollBarFrame = new(ELeave) CEikScrollBarFrame(this, NULL, EFalse);
                       
        TEikScrollBarFrameLayout layout;
        TEikScrollBarModel       myModel;
        TEikScrollBarModel       myModel2;
        myModel.iThumbSpan=6;
        myModel.iThumbPosition=0;
        myModel.iScrollSpan =250;
        TBool useful = myModel.ScrollBarUseful();   //returns ETrue
       
        layout.iClientAreaGranularity = TSize(1, 1);
        layout.iTilingMode=TEikScrollBarFrameLayout::EInclusiveRectConstant;
        TRect fullRect = Rect();
        TRect inclRect = fullRect;
        TBool stat = iScrollBarFrame->TileL(&myModel2, &myModel, fullRect, inclRect, layout);
        // returns EFalse

The TileL never readjusts the rects, and always returns EFalse whatever it has in the model and layout parameters.
The real code is part of an application that I am migrating from previous versions, where the scrollbars have worked without problems. It is all extremely strange.

Any ideas?
john


John Read
NewNet Marketing
Munich, germany

Fri, 2008-06-13 19:15
Joined: 2007-07-13
Forum posts: 9
Re: scrollbar does not display

Did anyone ever figure out how to fix this issue? I am having the same issue. It works on all v2 devices, and works on some v3 devices and doesn't work on some others. For example, it works on N73, but not on the N95. Any ideas?

Fri, 2008-06-13 20:27
Joined: 2005-01-15
Forum posts: 10
Re: scrollbar does not display

I found that using CEikScrollBarFrame::EDoubleSpan corrected the problem


John Read
NewNet Marketing
Munich, germany

Fri, 2008-06-13 21:51
Joined: 2007-07-13
Forum posts: 9
Re: scrollbar does not display

If it's not too much trouble, could you post your working code. Thanks

Sat, 2008-06-14 12:09
Joined: 2005-01-15
Forum posts: 10
Re: scrollbar does not display

Here is part of the code that I used forexperimenting and testing it. There is nothing here to move the scrollbar thumb.

void CscrolltestContainer::ConstructL( const TRect& aRect, CscrolltestAppUi* /*aAppUi*/ )
        {
        // Create a window for this application view
        CreateWindowL();
        iScrollBarFrame = new(ELeave) CEikScrollBarFrame(this, NULL);
        iScrollBarFrame->CreateDoubleSpanScrollBarsL( ETrue, EFalse);
        iScrollBarFrame->SetTypeOfVScrollBar(CEikScrollBarFrame::EDoubleSpan);
        iScrollBarFrame->SetScrollBarVisibilityL
                        (CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOn);
               
        TRect fullRect = aRect;
        TRect inclRect = fullRect;

        // Set the windows size
        SetRect( fullRect );
        SetFocus(ETrue);
        ActivateL();
        }
void CscrolltestContainer::SizeChanged()
        { 
        TEikScrollBarFrameLayout layout;
        TEikScrollBarModel       myModel;
        TEikScrollBarModel       myModel2;
        myModel.iThumbSpan=6;
        myModel.iThumbPosition=0;
        myModel.iScrollSpan =20;
       
        layout.iTilingMode=TEikScrollBarFrameLayout::EInclusiveRectConstant;
               
        TRect fullRect = Rect();
        TRect inclRect = fullRect;
        TBool stat = iScrollBarFrame->TileL(&myModel2, &myModel, fullRect, inclRect, layout);
        iScrollBarFrame->DrawScrollBarsNow();
        }

Basically the only thing that I changed to make it work was to set the type to DoubleSpan.

john


John Read
NewNet Marketing
Munich, germany

  • Login to reply to this topic.