rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Foundation Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvModifiedFlagObserver Class Reference

Reports the modifications made to a document. More...

#include <ilviews/base/command.h>

Inheritance diagram for IlvModifiedFlagObserver:
IlvObserver

List of all members.

Public Member Functions

 IlvModifiedFlagObserver (IlvCommandHistory *h)
 Constructor.
virtual void flagChanged (IlBoolean b)
 Indicates whether the state of the document has changed.
void update (IlvObservable *, IlAny)
 Notifying member function called by observables.

Detailed Description

Reports the modifications made to a document.

Library: views

In many applications, an asterisk (*) is added to the title of a window to indicate that the document it contains is different from its image stored to a file, and that it needs to be saved when the user quits the application.
The class IlvModifiedFlagObserver defines an observer that reports any changes in the "modified" status of a document attached to an IlvCommandHistory object. This functionality is implemented by redefining the flagChanged method in a subclass. When the flagChanged method is called with IlTrue, the title of the window displaying the associated document is modified to include an asterisk. When it is called with IlFalse, the asterisk is removed.
This observer works by watching all the IlvCommand objects attached to a command history. If these commands are IlvPseudoCommand objects, they do not modify the document, and flagChanged is not affected.

See also:
IlvCommand, IlvCommandHistory, IlvManager

Constructor & Destructor Documentation

IlvModifiedFlagObserver::IlvModifiedFlagObserver ( IlvCommandHistory h  ) 

Constructor.

Parameters:
h The command history to which the observer will be attached to track any changes in its "modified" status.

Member Function Documentation

virtual void IlvModifiedFlagObserver::flagChanged ( IlBoolean  b  )  [virtual]

Indicates whether the state of the document has changed.

You should implement this method in a subclass to define the visual cue that will reflect any modifications made to the document attached to the command history.

Parameters:
b The new value of the flag. Is IlFalse if the document has not changed, and IlTrue otherwise.
void IlvModifiedFlagObserver::update ( IlvObservable o,
IlAny  arg 
) [virtual]

Notifying member function called by observables.

Must be defined in subclasses to implement the notification mechanism.

Parameters:
o Observable whose state has changed.
arg Any argument commonly agreed between the observer and the observable that should help the observer in determining what exactly in the state of the observable has changed.
See also:
IlvActionMessage for an example of use of this parameter.

Reimplemented from IlvObserver.

 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.