学习htmlcontrol的一点总结

1 http://code.google.com/p/htmlcontrol-for-symbian/;
2 解压,将inc中的html放到include中。htmlcontrol.lib放到对应的文件夹中,例如:C:/Symbian/9.2/S60_3rd_FP1/Epoc32/release/winscw/udeb;
3 在.cpp 的constructL中

iControl = CHtmlControl::NewL(this); iControl->SetMopParent(this); iControl->SetRect(Rect()); iControl->SetEventObserver(this); ActivateL(); // ((CAknViewAppUi*) CCoeEnv::Static()->AppUi())->AddToStackL(iControl); _LIT(KHtml, "<body style="overflow:auto" mce_style="overflow:auto"><p align='center'>" "<font size='large' color='#FF0000'>Hello World!</font><br>" "<font size='20'><b><i>Hello World!</i></b></font><br>" "<text res='"MAKESTR(R_COMMAND1_TEXT)"'><br>" "<div style="line-height:+30" mce_style="line-height:+30">Hello World!</div><br>" "<a href="http://www.baidu.com" mce_href="http://www.baidu.com">Hello World!</a><br>" "<a href="#abc" mce_href="#abc"><text res='"MAKESTR(R_COMMAND1_TEXT)"'></a><br>" "</p>" ); iControl->AppendContentL(KHtml); iControl->RefreshAndDraw();


   即可
4 由于它是control,所以记得修改
CountComponentControls()和ComponentControl(TInt aIndex)函数。

 


5 OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)中添加
if (iControl) { return iControl->OfferKeyEventL(aKeyEvent, aType); }     即可。

 

 

你可能感兴趣的:(html,c,command,div,include,FP)