- Subclassing is not a good idea with base classes
- How does it work with the transporter generated Control_external_class, is this an easier way
Moderator: wriedmann
Code: Select all
STATIC CLASS ControlExtensions
STATIC METHOD PostFocus()
PostMessage( GetParent(SELF:Handle()) , WM_NextDlgCtl , DWORD( _CAST , SELF:Handle() ) , 1L )
IF IsInstanceOf(SELF,#SingleLineEdit)
PostMessage(SELF:Handle(), EM_SETSEL, 0, LONG(_CAST,SLen(RTrim(SELF:TextValue))))
PostMessage(SELF:Handle(), EM_SCROLLCARET, 0, 0L )
ELSEIF IsInstanceOf(SELF,#MultiLineEdit)
PostMessage(SELF:Handle(), EM_SETSEL, 0, 0L )
PostMessage(SELF:Handle(), EM_SCROLLCARET, 0, 0L )
ENDIF
RETURN NIL
END CLASS
Code: Select all
STATIC CLASS ControlExtensions
STATIC METHOD PostFocus( self oControl as Control ) as void
PostMessage( GetParent(oControl:Handle()) , WM_NextDlgCtl , DWORD( _CAST , oControl:Handle() ) , 1L )
IF IsInstanceOf(oControl,#SingleLineEdit)
PostMessage(oControl:Handle(), EM_SETSEL, 0, LONG(_CAST,SLen(RTrim(oControl:TextValue))))
PostMessage(oControl:Handle(), EM_SCROLLCARET, 0, 0L )
ELSEIF IsInstanceOf(oControl,#MultiLineEdit)
PostMessage(oControl:Handle(), EM_SETSEL, 0, 0L )
PostMessage(Control:Handle(), EM_SCROLLCARET, 0, 0L )
ENDIF
RETURN
END CLASS