![]() Rogue Wave Views 5.5.1 |
Rogue Wave Views |
Rogue Wave Views Documentation Home |
Reports the modifications made to a document. More...
#include <ilviews/base/command.h>
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. | |
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.
| IlvModifiedFlagObserver::IlvModifiedFlagObserver | ( | IlvCommandHistory * | h | ) |
Constructor.
| h | The command history to which the observer will be attached to track any changes in its "modified" status. |
| 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.
| 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.
| 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. |
IlvActionMessage for an example of use of this parameter. Reimplemented from IlvObserver.
© 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.