rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Application Framework Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvDvTextView Class Reference

Application Framework text document view. More...

#include <ilviews/appframe/viewgadg.h>

Inheritance diagram for IlvDvTextView:
IlvText IlvDvDocViewInterface IlvScrolledGadget IlvDvSerializable IlvDvInterface IlvGadget IlvSimpleGraphic IlvGraphic

List of all members.

Public Member Functions

 IlvDvTextView (IlvDisplay *display)
 Constructs an IlvDvTextView object.
virtual IlvGraphicgetGraphic ()
 Gets the graphic object of the document view.
virtual void initializeView ()
 Initializes the text view.

Detailed Description

Application Framework text document view.

Library: ilvappframe

IlvDvTextView is a subclass of IlvText that implements the IlvDvDocViewInterface interface. It is used for displaying the text of the document in an IlvText gadget.
Classes that inherit from the IlvDvTextView class must be declared and implemented with specific macros, which allow instances of these classes to be created automatically by the document templates.
The following code sample shows how to derive from IlvDvTextView:

 class MyTextView
 : public IlvDvTextView * {
     IlvDvDeclareGadgetViewCreate();
 public:
     MyTextView(IlvDisplay* display) : IlvDvTextView(display) {}
     virtual void initializeView();
     ...
 };

 // Implementation file
 void
 MyTextView::initializeView()
 {
     IlvDvTextView::initializeView();
     // My initialization code here
 }
 ...
 IlvDvPreRegisterGadgetViewClass(MyTextView, IlvDvTextView);
 IL_BEGINMODULEINITDEF(mymodule)
     IlvDvPostRegisterDocIlvViewClass(MyTextView, IlvDvTextView);
 IL_ENDMODULEINITDEF(mymodule)

Constructor & Destructor Documentation

IlvDvTextView::IlvDvTextView ( IlvDisplay display  ) 

Constructs an IlvDvTextView object.

This constructor creates an instance of IlvDvTextView whose display is given by the parameter display.


Member Function Documentation

virtual IlvGraphic* IlvDvTextView::getGraphic (  )  [virtual]

Gets the graphic object of the document view.

Must be redefined by the class that implements the interface if the class inherits from the IlvGraphic class. In this case, the redefined method only returns this object. For example, the IlvDvTextView class redefines this method to return (IlvText*)this object. By default, the method returns 0.

Returns:
The graphic object of the document view.

Reimplemented from IlvDvDocViewInterface.

virtual void IlvDvTextView::initializeView (  )  [virtual]

Initializes the text view.

Called by the document associated with the view to initialize its contents. By default, this method sends the generic message GetText to the document in order to retrieve the document text. If the document class inherits from the IlvDvTextDocument class, this message is processed automatically. Otherwise, the method defined for processing this generic message must return a const char* value. This is illustrated in the following code sample:

 IlvDvBeginInterface(MyTextDocument)
        TypedMethod(GetText, getText, const char*)
 IlvDvEndInterface1(IlvDvDocument)
 ...
 const char*
 MyTextDocument::getText() const
 {
        return _myText;
 }

Reimplemented from IlvDvDocViewInterface.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.