Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » CExtGridCellString Masked Input Collapse All
Subject Author Date
Eric Semle Jul 14, 2008 - 11:10 AM

My current project requires masked user input. The user enters data in a location format (latitude, longitude) and I want to mask the input.


The project uses a CExtPropertyGridCtrl. The data is typed into a CExtGridCellString. I understand how to get the data from "Apply", but I want updates while the user is typing. I tried to inherit the function CExtGridCell::OnKey, but it does not work. What do I need to do?

Eric Semle Jul 21, 2008 - 10:22 AM

Perfect. Thanks!

Technical Support Jul 19, 2008 - 12:09 PM

You should create and use your own CExtGridCellString-derived class which implements the following virtual method:

	virtual bool OnInplaceControlTextInputVerify(
		HWND hWndInplaceControl,
		CExtGridWnd & wndGrid,
		LONG nVisibleColNo,
		LONG nVisibleRowNo,
		LONG nColNo,
		LONG nRowNo,
		INT nColType,
		INT nRowType,
		__EXT_MFC_SAFE_LPCTSTR sTextInitial,
		__EXT_MFC_SAFE_LPCTSTR sTextPrevious,
		CExtSafeString & sTextNew,
		bool bEndEdit
		) const;

This method allows you to control text typing on-the-fly. It’s invoked during text input on each text changing with the bEndEdit parameter set to false. In this case you can return false to cancel last text changing. It’s invoked once immediately before in-place activated editor window becomes destroyed with the bEndEdit parameter set to true.