scrolling bar with browser control api

Login to reply to this topic.
Mon, 2007-05-14 18:26
Joined: 2006-10-17
Forum posts: 85
Hi,

I'm using browser control api, to push web content in my app, but I can't scrolling the loaded page.
I tried to write something on the screen to verify that callback is called, but with no success

Code:
class CMyContainer : public CCoeControl

class CBrCtlSampleAppLayoutObserver : public CBase, public MBrCtlLayoutObserver
{
public:   
CBrCtlSampleAppLayoutObserver(CMyContainer*);   
     
public: // New functions
     
// MBrCtlLayoutObserver interface
virtual void UpdateBrowserVScrollBarL (TInt aDocumentHeight, TInt aDisplayHeight, TInt aDisplayPosY);

private:
      CMyContainer* iMyContainer;
     }


CMyContainer::CMyContainer(CMyView* aView)
{
iLayoutObserver = new  CBrCtlSampleAppLayoutObserver(this);
}

void CMyContainer::ConstructL(const TRect& aRect)
{
CreateWindowL();
SetRect(aRect);
ActivateL();
   
iCommandBase = TBrCtlDefs::ECommandIdBase;
iBrCtlCapabilities = TBrCtlDefs::ECapabilityLoadHttpFw | TBrCtlDefs::ECapabilityDisplayScrollBar;
TRect rect(Position(), Size());
iBrCtlInterface = CreateBrowserControlL( this, aRect, iBrCtlCapabilities, iCommandBase, NULL, NULL, NULL, iLayoutObserver, NULL);
iBrCtlInterface->ActivateL();
....
}


void CBrCtlSampleAppLayoutObserver::UpdateBrowserVScrollBarL (TInt aDocumentHeight, TInt aDisplayHeight, TInt aDisplayPosY)
{
TPoint point(0, 100);
iMyContainer->SetPoint(point);
iMyContainer->DrawNow();
}

void CMyContainer::Draw(const TRect& /*aRect*/) const
{
    // Get the standard graphics context
    CWindowGc& gc = SystemGc();
   
    // Gets the control's extent
    TRect drawRect( Rect());
    gc.Clear( drawRect );   
    const CFont* font;
    font=iEikonEnv->TitleFont();
    gc.UseFont(font);
    _LIT(KText, "ciao");
    gc.DrawText(KText, iPoint);

    // Clears the screen
}


void CMyContainer::SetPoint(TPoint aPoint)
{
iPoint = p;
}

I write text on view container when I try to scroll down the page, but without success. It seem like UpdateBrowserVScrollBarL is never called.
Could anybody suggest to me a clue?

Thanks a lot
  • Login to reply to this topic.