Class Overview
A subclass of LEditText which keeps track of user modifications so it is suitable in documents featuring a Save command. The class will track user changes to the document, but the programmer will need to use the SetDirty method in order to track programmatic changes.
This class does not track programmatic changes to the state of the object. The programmer will need to use the SetDirty method to indicate such changes.
Inheritance
CDirtyEditText is a subclass of the PowerPlant class LEditText.
Requirements
CDirtyEditText requires the PowerPlant classes LEditText and LStream.
Files
- CDirtyEditText.h
- CDirtyEditText.cp
enum {
class_ID = FOUR_CHAR_CODE('Detx')
};
CDirtyEditText(
PowerPlant::LStream* inStream
);
virtual
void
UserChangedText(
void
);
bool
IsDirty(
void
) const;
void
SetDirty(
bool inDirty
);
protected
private
bool
iAmDirty;
Members by Inheritance
statics
The class introduces no new statics.
overrides
virtual
void
UserChangedText(
void
);
is overridden from LEditText.
new virtuals
The class introduces no new virtuals.
Member Data
bool
iAmDirty;
Set to true if the text in the object has been modified.
CDirtyEditText
Constructs a CDirtyEditText. Initially, the view is considered to be clean.
CDirtyEditText(
PowerPlant::LStream* inStream
);
Passes the stream to LEditText.
UserChangedText
Overrriden to set the CDirtyEditText object to dirty and update the command status.
virtual
void
UserChangedText(
void
);
IsDirty
Returns true if the CDirtyEditText object is modified (dirty) and false otherwise.
bool
IsDirty(
void
) const;
SetDirty
Allows the programmer to set the state of the CDirtyEditText. The object to should be set to dirty (true) if the programmer modifies it programmatically and it should be set to clean (false) when the object is saved.
void
SetDirty(
bool inDirty
); |