This page was last modified 11:36, 15 February 2008.
CS000823 - Adding scrollbars to a rich text editor
From Forum Nokia Wiki
| ID | CS000823 | Creation date | February 15, 2008 |
| Platform | S60 3rd Edition S60 3rd Edition, FP1 S60 3rd Edition, FP2 | Tested on devices | Nokia E90 Communicator Nokia N95 8GB |
| Category | Symbian C++ | Subcategory | UI |
| APIs | None | Classes | CEikScrollBarFrame CEikRichTextEditor |
| Methods | None |
Overview
This code snippet demonstrates how to add scrollbars to a rich text editor.
This snippet can be self-signed.
Header file
CEikRichTextEditor* iEditor; CEikScrollBarFrame* iScrollBarFrame;
Source file
// Second phase construction.
void CClientAppView::ConstructL(const TRect& aRect)
{
// Create the rich text editor (iEditor)
// (left out for brevity)
// Create the scrollbar for the editor
iScrollBarFrame = iEditor->CreateScrollBarFrameL();
// Set horizontal scrollbar invisible (EOff) and vertical scrollbar
// visible (EOn)
iScrollBarFrame->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,
CEikScrollBarFrame::EOn);
}
Note: Scrollbars are not included in the inner region of the editor. This must be taken into account when drawing the editor on the screen:
// Called whenever SetExtent(), SetSize(), SetRect(),
// SetCornerAndSize(), or SetExtentToWholeScreen() is
// called on the control.
void CAppView::SizeChanged()
{
TRect r = Rect();
TInt scrollbarWidth = iEditor->ScrollBarFrame()->
ScrollBarBreadth(CEikScrollBar::EVertical);
TInt editorWidth = r.Width() - scrollbarWidth;
TPoint upperLeftCorner = TPoint(0, 0);
iEditor->SetExtent(upperLeftCorner, TSize(editorWidth, r.Height()));
}
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 在CEikRichTextEditor的文字給弄重疊了 | windalfred0 | Symbian | 0 | 2004-10-20 08:46 |
| Drawing over CEikGlobalTextEditor | tottivv | General Symbian C++ | 0 | 2003-07-16 13:33 |
| How to assign an icon to to my application | gowthamgowtham | General Symbian C++ | 3 | 2007-11-12 16:36 |
| Text message editor navipane? | rkeskine | Symbian User Interface | 5 | 2007-08-31 09:07 |
| CRichText and pictures | rburgst | Symbian User Interface | 8 | 2004-01-22 13:34 |

