×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Apr 2003
    Location
    Portugal
    Posts
    23

    Grid and Scrollbars

    Hi.

    I created a view with a grid of icons, following the grid sample, but when I add more items than the grid can show, it scrolls but the scroll arrows don't show up.

    I check the grid sample and there is one view where the arrows appear, so it is possible to have them, but from what I can see in the code there is nothing special to make them appear.

    Anyone with the same problems (and maybe a solution)?

    Regards,
    Vitor Fernandes

  2. #2
    Registered User
    Join Date
    Apr 2003
    Location
    Portugal
    Posts
    23
    Finally got it. I was calling two methods in the wrong order.

    You have to call SetMopParent() before ConstructL() on the container in the view class, i.e.:

    iContainer = new (ELeave) CBTMenuMainContainer(this);
    iContainer->SetMopParent(this);
    iContainer->ConstructL(ClientRect());

    Regards,
    Vitor Fernandes

  3. #3
    Regular Contributor
    Join Date
    Jun 2004
    Posts
    86

    could you please help me?

    hi vitor! and everyone!

    The scrollbars in my grid do not get displayed. I have an AppUi, a View, and a Container. I have SetMopParent on my container but still, no scrollbars.

    In my AppUi, i have:
    Code:
    void CSimpleGridAppUi::ConstructL()
    	{
    	BaseConstructL();
    
    	CSimpleGridView* gridView = new (ELeave) CSimpleGridView();
    	CleanupStack::PushL(gridView);
    	gridView->ConstructL();
    	CleanupStack::Pop();
    	AddViewL(gridView);
    	
    	ActivateLocalViewL(gridView->Id());
    	}
    In my View, i have:
    Code:
    void CSimpleGridView::DoActivateL(const TVwsViewId& /*aPrevViewId*/, TUid /*aCustomMessageId*/, const TDesC8& /*aCustomMessage*/)
    	{
    	if (!iView)
    		{
    		iView = new (ELeave) CSimpleGridContainer;
    		iView->SetMopParent(this);
    		iView->ConstructL(ClientRect());
    		AppUi()->AddToStackL(*this, iView);
    		}
    	}
    In my Container, i have:
    Code:
    void CSimpleGridContainer::ConstructL(const TRect& aRect)
    	{
    	CreateWindowL();
    
    	// Construct the grid
    	iGamesGrid = new (ELeave) CAknGrid;
    	iGamesGrid->SetContainerWindowL(*this);
    	iGamesGrid->UpdateScrollBarsL();
    	// Observe the grid
    	iGridM = new (ELeave) CAknGridM;
    	
    	iGamesGrid->SetModel(iGridM);
    	iGamesGrid->ConstructL(this, EAknListBoxSelectionGrid);
    	iVerticalOrientation = ETrue;
    	iTopToBottom = ETrue;
    	iLeftToRight = ETrue;
    	iNumOfColumns = 3;
    	iNumOfRows = 3;
    	iNumOfItems = -1;
    	iVerticalScrollingType = CAknGridView::EScrollIncrementLineAndLoops;
    	iHorizontalScrollingType = CAknGridView::EScrollIncrementLineAndLoops;
    	
    	TBuf<10> emptyText;
    	emptyText.Copy(_L("Empty!"));
    	iGamesGrid->SetEmptyGridTextL(emptyText);
    	iGamesGrid->SetRect(aRect);
    	iSizeOfItems.iWidth = (aRect.iBr.iX - aRect.iTl.iX) / iNumOfColumns;
    	iSizeOfItems.iHeight = (aRect.iBr.iY - aRect.iTl.iY) / iNumOfRows;
    	SetGridLayoutL();
    	
    	//create resource for grid (do not load from the HRF file)
    	iIcons = new (ELeave) CAknIconArray(8);
    	CleanupStack::PushL(iIcons);
    	iGamesGrid->ItemDrawer()->FormattedCellData()->SetIconArrayL(iIcons);
    	CleanupStack::Pop(iIcons);
    	
    	SetRect(aRect);
    	ActivateL();
    	
    	iGamesGrid->MakeVisible(ETrue);
    	iGamesGrid->SetFocus(ETrue);
    	iGamesGrid->ActivateL();
    	iGamesGrid->DrawNow();
    	
    	iFileSaver = CMdaImageBitmapToFileUtility::NewL(*this);
    	ListFiles(ELoad);
    	}
    
    void CSimpleGridContainer::SizeChanged()
    	{
    	// Do not use MinimumSize() here as it does not work when scrolling
    	// through the grid
    	if (iGamesGrid)
    		{
    		iGamesGrid->SetExtent (KGridPosition,Rect().Size());
    		}
    	}
    Please help, because i have no idea why the scrollbar doesnt get displayed. :( I could send the whole project if you want.. thank you very much..

  4. #4
    Registered User
    Join Date
    May 2004
    Location
    Chicago,USA
    Posts
    18
    Can you mail me the code at gowtham.yemme@sbcglobal.net and i will look into it and let you know since it is not clear from what you mentioned

    Gowtham

  5. #5
    Registered User
    Join Date
    Nov 2004
    Posts
    9

    Scrollbar not showing

    Hi;

    I have the same problem with a scrollbar in a RichTextEditor not showing, althought its configuredb to show the scrollbar.

    I took it directly from the RichTextEditorExample with Series60Ex.

    The only major change was I changed the app to a view-container archtecture instead of traditional.

    Larry

  6. #6
    Regular Contributor
    Join Date
    Jun 2004
    Posts
    86
    that was what i did also, i changed it to a view-container architecture, and then the scrollbar disappeared. i still haven't got a solution to this, by the way.

  7. #7
    Registered User
    Join Date
    Nov 2004
    Posts
    9

    possible help

    Hi,
    thanks for responding to me.

    Its strange that this seems something so difficult to solve. Surely many developers have done the same in the view model?

    anyway, gonna tray some info I found at this thread:
    http://discussion.forum.nokia.com/fo...2AScrollbar%2A

    Else try good old Symbian Hacking... dont feel like rewriting my own Custom Controls though :)

    Larry

  8. #8
    Registered User
    Join Date
    Jan 2005
    Posts
    391
    I have the same problem with a scrollbar in a AknSingleGraphicStyleListBox not showing,.I followed the steps of the listbox example in symbian sdk 6.1 for vc edition that display scrollbar very well . anyone has a idea?

Posting Permissions

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