Adding CEikScrollBarFrame to a container

Login to reply to this topic.
Fri, 2007-04-27 22:05
Anonymous
Forum posts: 2018
Hi all,

I have a problem to using CEikScrollBarFrame.  I would like to add scrolling to my container control.  I had carbide generate a GUI application and updated ConstructL to add scroll bars to it.  CScrollableViewContainerView has a pointer to CScrollableViewContainer. There is nothing special there.  It is just the standard automatically generated code.  The problem is that no scroll bar shows up! Any idea?


class CScrollableViewContainerView : public CAknView

class CScrollableViewContainer : public CCoeControl, public MEikScrollBarObserver

void CScrollableViewContainer::ConstructL(
      const TRect& aRect,
      const CCoeControl* aParent,
      MEikCommandObserver* aCommandObserver )
   {
   if ( aParent == NULL )
   Â    {
      CreateWindowL();
   Â    }
   else
   Â    {
   Â    SetContainerWindowL( *aParent );
   Â    }
   iFocusControl = NULL;
   iCommandObserver = aCommandObserver;
   InitializeControlsL();
   
    m_scrollBarFrame = new (ELeave) CEikScrollBarFrame( this, NULL, ETrue );
    m_scrollBarFrame->SetScrollBarVisibilityL( CEikScrollBarFrame::EOn, CEikScrollBarFrame::EOn/*EOn*/ );
 
   TEikScrollBarModel&    modelV = GetScrollBarModelV();
   TEikScrollBarModel&    modelH = GetScrollBarModelH();

   modelV.iThumbSpan       = aRect.Height()/2+1; /** Entire range of integers for this model. */
   modelV.iThumbPosition    = 0;   /** Position of the low edge of the thumb within 0...@c iScrollSpan. */
   modelV.iScrollSpan       = aRect.Height()*10;    /** Range spanned by the thumb. */

   modelH.iThumbSpan       = aRect.Width()/2+1;  /** Entire range of integers for this model. */
   modelH.iThumbPosition    = 0;   /** Position of the low edge of the thumb within 0...@c iScrollSpan. */
   modelH.iScrollSpan       = aRect.Width()*10;   /** Range spanned by the thumb. */
   
   m_scrollBarFrame->Tile(&modelH, &modelV);
   m_scrollBarFrame->MoveHorizThumbTo(modelH.iThumbPosition);
   m_scrollBarFrame->MoveVertThumbTo(modelV.iThumbPosition);
   m_scrollBarFrame->DrawScrollBarsNow();
   
   SetRect( aRect );   
   ActivateL();
   // [[[ begin generated region: do not modify [Post-ActivateL initializations]
   // ]]] end generated region [Post-ActivateL initializations]
   
   }

Wed, 2007-09-19 13:26
Joined: 2007-08-31
Forum posts: 54
Re: Adding CEikScrollBarFrame to a container

i am also looking for this if u get any solution please let me know

Wed, 2007-09-19 13:34
Joined: 2006-10-05
Forum posts: 80
Re: Adding CEikScrollBarFrame to a container


If you want an alternate solution, use a Rich text Editor or a Global text editor in your container. Scroll bars are available in both of them. I am using Rich text Editor to display text.

Wed, 2007-09-19 13:34
Joined: 2006-10-05
Forum posts: 80
Re: Adding CEikScrollBarFrame to a container


If you want an alternate solution, use a Rich text Editor or a Global text editor in your container. Scroll bars are available in both of them. I am using Rich text Editor to display text.

Thu, 2007-09-20 05:52
Joined: 2007-08-31
Forum posts: 54
Re: Adding CEikScrollBarFrame to a container

Actually i am having the 5 Different controls in my container 2 ListBoxs and 3 Edit boxs i am able to see the control which are in the client area only, so if i want to See the other controlls i need to scroll down the window. for that how i will add the scroll bar to the Container

Thu, 2007-09-20 09:40
Joined: 2006-10-05
Forum posts: 80
Re: Adding CEikScrollBarFrame to a container

I am not sure how you can do something like that. Maybe you have to redraw your screen with the other controls which will make the user feel that scrolling is occurring.

You can provide such a functionality by doing the redrawing on the click of "down arrow key". But i think that will be quite an effort.

Ideally you should use more than one view and hence divide your controls into more than one screen. That will be a better solution according to me.

  • Login to reply to this topic.