scrollbar does not display
| Sun, 2008-02-03 20:11 | |
|
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 )Can anybody help please? john John Read |
|






Forum posts: 49
I suspect that this line may cause this problem
layout.iTilingMode=TEikScrollBarFrameLayout::EClientRectConstantForum posts: 10
Thanks for the suggestion but I have tried EInclusiveRectConstant, and it did not change anything
john
John Read
NewNet Marketing
Munich, germany
Forum posts: 49
Do you update iScrollBarFrame size in CscrolltestAppView::SizeChanged() method ??
Forum posts: 54
U follow Up This Link
http://discussion.forum.nokia.com/forum/showthread.php?t=116174&highlight=Scroll+Bar
Regards
Praveen
Forum posts: 10
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
Forum posts: 9
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?
Forum posts: 10
I found that using CEikScrollBarFrame::EDoubleSpan corrected the problem
John Read
NewNet Marketing
Munich, germany
Forum posts: 9
If it's not too much trouble, could you post your working code. Thanks
Forum posts: 10
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