Using LEdit with MFC
LEdit has free MFC wrapper. This wrapper may be equally well used
in 16-bit (MSVC++ 1.5) or 32-bit (MSVC++ 2.0, 4.0, 5.0 and 6.0) environment.
Anybody may get the source code for MFC wrapper for free from
Shareware package.
LEdit MFC wrapper includes two classes - CLEdit and
CLEditView.
CLEdit includes only basic LEdit functionality.
CLEdit has methods for nearly all LEdit control messages, but
he doesn't track any messages coming from LEdit window, because
it assumes that his parent window will be designed to do so. Also it
doesn't have any state variables. This is done to allow any object
inherited from CWnd be safely typecasted to CLEdit. This feature is
used in CLEditView object to expose full LEdit functionality
by just typecasting CLEditView to CLEdit by means of
CLEditView::GetLEditCtrl() member function. You may act the
same way if you are sure the object wraps LEdit window.
|
CLEditView has much more functionality than CLEdit.
It binds all LEdit messages to itself and call corresponding
virtual functions, so if you need to control some functionality of
LEdit like syntax highlight or
background drawing, you just overrides
these virtual functions rather than handling messages.
CLEditView has basic CView functinality. However, some cool features
like printing support, are not included. If you want to extend
CLEditView functinality and don't mind to share your experience
(or your code) with others, just tell us
and we'll do all my best to help you with it.
CLEditView can be used in nearly any place where CLEdit
can, so you are encouraged to use CLEditView instead of CLEdit
everywhere.
|
MFC stans very close to Windows API, so if you're MFC programmer,
you'll find useful some basic information on using LEdit
at Windows API level.
Thank you for your interest in LEdit
|