[Classes] [Prev] [Next] [Methods]

CValidatorInterface

Methods Index

Heritage
Description
Protected Data Members
Public Methods
Override

CValidatorInterface


Heritage

Superclass: None

Subclasses: None


Description

This class mixes in a CValidatorInterface for classes supporting field formatting and validation. It supports setting and retrieving a CValidator associated with an object. After setting and retrieving the object, you can then modify the object to use the associated CValidator when processing key strokes. (See CNativeTextEdit::Key().) You need this class only if you are writing your own text-edit classes.


Protected Data Members

CValidator itsValidator;


Public Methods

virtual void SetValidator(
CValidator theValidator);
virtual CValidator GetValidator() const;

Override

Override SetValidator() to apply the passed validator to your object. Your SetValidator() should call CValidatorInterface:: SetValidator() to set itsValidator properly. You can override GetValidator(), but it should be sufficient for most purposes. For examples of mixing in a CValidatorInterface, see the source code for NEditControl and NLineText.

Note that CValidator is a small proxy object, so it should be passed and returned by value. Let the reference counting handle ownership and allocation issues.




[Classes] [Prev] [Next] [Methods]

support@xvt.com


Visit our online help desk for tech support

Copyright © 2009, Providence Software Solutions Inc. All rights reserved.