| Methods Index |
NEditControlSubclass: None
CPasswordEdit provides a native password-type text control. It uses a special validator (see CValidatorFactory and CValidator to filter keystrokes at the PTK level. Use GetTitle() to get the password or use TDI, as in the example below, to continually advise an object of the password. You can specify a character as the password character (by default: "*"). This is the character that appears in the edit control as the user types the password. You can also specify the maximum length of the password. If the user exceeds this length, the extra characters are ignored. CPasswordEdit is copy/paste safe; the user cannot copy the password from the edit field and paste it somewhere else where it might be visible.
#include CPasswordEdit_i
CRect aFrame( 5, 110, 5 + 95, 110 + 30 );
// Create password control
itsCPasswordEdit = new CPasswordEdit( this, aFrame );
// Static text
aFrame += CPoint( aFrame.Width() + 10, 0 );
aFrame.Width( 50 );
new NText( this, aFrame, "Shhh! >" );
// Edit field to show the password as its typed
aFrame += CPoint( aFrame.Width() + 10, 0 );
aFrame.Width( 95 );
NEditControl *itsEditControl = new NEditControl( this, aFrame );
// Hook them up w/ TDI
CTdiConnection( itsCPasswordEdit, itsEditControl );
CPasswordEdit(CSubview* theEnclosure,
const CRect& theRegion, // As in NEditControl
const CStringRW& theSubstitute = "*", // Password character
int theMaxLength = 8, // Max length of password
const CStringRW& theTitle = NULLString, // Prompt string
long theAttributes = 0L); // As in NEditControl
theSubstitute should be a single character string.
CPasswordEdit(CSubview* theEnclosure,
long theContainerId,
long theId,
const CStringRW& theSubstitute = "*", // Password character
int theMaxLength = 8); // Max length of password
NTextEdit. theSubstitute should be a single character string.
CPasswordEdit(const CPasswordEdit& theEditControl);
theEditControl.
virtual ~CPasswordEdit();
CPasswordEdit& operator=(const CPasswordEdit& theEditControl);
CPasswordEdit like theEditControl.
virtual const CStringRW GetTitle( ) const;