Hi to all,
I'm using an edit box as a protected user input. The edit box is by default
read-only and it allows only digits to be entered.
When the user wants to write into the edit box, he has to double click on it
to enable writing (read-only = FALSE). When he finishes entering his info, he
has to double click on the edit box again to apply the entered value. The
edit box will then switch back to read-only.
I'm doing this by creating a new class CRoEdit (for read-only) derived from
CEdit which all it does is catch the double click and set the read-only
accordingly. Here's the only member function in CRoEdit:
void CRoEdit::OnLButtonDblClk(UINT nFlags, CPoint point)
{
if ((GetStyle() & ES_READONLY) == ES_READONLY)
SetReadOnly(FALSE);
else
{
// The user has finished entering his value. Set the edit box back
to read-only
// and inform the parent dialog of a change in the value.
SetReadOnly(TRUE);
}
CEdit::OnLButtonDblClk(nFlags, point);
}
My problem is that I don't know how can I make the CRoEdit class notify the
CDialog class (which contains the edit control) that a new value has been
entered so that CDialog could read it with "m_roEdit.GetWindowText()" to get
the value entered.
I appreciate any help or suggestions.
Thanks,
Geo