rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Application Framework Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvDvFormView Class Reference

Application Framework form document view. More...

#include <ilviews/appframe/dialog/formvw.h>

Inheritance diagram for IlvDvFormView:
IlvGadgetContainerRectangle IlvDvDocViewInterface IlvContainerRectangle IlvDvSerializable IlvDvInterface IlvViewRectangle IlvFilledRectangle IlvRectangle IlvSimpleGraphic IlvGraphic

List of all members.

Public Member Functions

 IlvDvFormView (IlvDisplay *, const IlSymbol *inspectorName=0)
 Constructs an IlvDvFormView object.
IlvAbstractViewgetDvView ()
 Gets the IlvAbstractView of the document view.
virtual IlvGraphicgetGraphic ()
 Gets the graphic object of the document view.
virtual void initializeView ()
 Initializes the document view.

Detailed Description

Application Framework form document view.

Library: ilvappframe

IlvDvFormView is a subclass of IlvGadgetContainerRectangle and implements the IlvDvDocViewInterface interface. It is used for displaying and editing the data of the document, within a form that is a set of gadgets contained in the view.

Gadgets of the view are built by specifying a Rogue Wave Views .ilv file using the method IlvGadgetContainerRectangle::setFilename. It can be invoked either in the constructor of the view or in the overridden initializeView method.

Classes that inherit from the IlvDvFormView 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 the IlvDvFormView class:

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

 // Implementation file
 IlvDvBeginInterface(MyFormView)
 IlvDvEndInterface1(IlvDvFormView)

 void
 MyFormView::MyFormView()
 {
    // Specify here your ILV file
    setFilename("myform.ilv");
 }

 void
 MyFormView::initializeView()
 {
     IlvDvFormView::initializeView();
     // My initialization code here
 }
 ...
 IlvDvPreRegisterGadgetViewClass(MyFormView, IlvDvFormView);
 IL_BEGINMODULEINITDEF(mymodule)
     IlvDvPostRegisterGadgetViewClass(MyFormView, IlvDvFormView);
 IL_ENDMODULEINITDEF(mymodule)

Application Framework provides two macros that allow a form view to easily manage its gadgets:

These macros must be used in the interface declaration of the view, between macros IlvDvBeginInterface and IlvDvEndInterface1, as shown in the following example:

Suppose that a form view contains a text field of name "name" and a button with a callback of name "EraseCB". We want the text field to be initialized with the text "Default Name" and we want this text to be erased when the user clicks the button. This is shown here:

 IlvDvBeginInterface(MyFormView)
    CallbackNotification("EraseCB", eraseName)
    InitializeGadget("name", initializeName, IlvTextField)
 IlvDvEndInterface1(IlvDvFormView)
 
 void
 MyFormView::eraseName()
 {
    IlvTextField* fd = (IlvTextField*)getContainer()->getObject("name");
    fd->setLabel("");
    fd->reDraw();
 }
 void
 MyView::initializeName(IlvTextField* fd)
 {
    fd->setLabel("Default Name");
    fd->reDraw();
 }
See also:
CallbackNotification, InitializeGadget

Constructor & Destructor Documentation

IlvDvFormView::IlvDvFormView ( IlvDisplay ,
const IlSymbol inspectorName = 0 
)

Constructs an IlvDvFormView object.

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


Member Function Documentation

IlvAbstractView* IlvDvFormView::getDvView (  )  [virtual]

Gets the IlvAbstractView of the document view.

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

Returns:
The abstract view of the document view.

Reimplemented from IlvDvDocViewInterface.

virtual IlvGraphic* IlvDvFormView::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 IlvDvFormView::initializeView (  )  [virtual]

Initializes the document view.

Called by the document associated with the view to initialize its contents. Typically, gadget classes that implement the IlvDvDocViewInterface interface initialize the gadget using the associated document data.

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.