I found the code below:
CLASS mySLE INHERIT SingleLineEdit //Creata a class inherit SingleLineEdit
METHOD init(oOwner, nResourceID) CLASS mySLE // Init the Class SUPER:init(oOwner, nResourceID)
RETURN SELF
METHOD Dispatch(oEvent) CLASS mySLE
IF oEvent:Message == WM_GETDLGCODE
IF SELF:NameSym == #SymName // of your SLE
IF oEvent:wParam == KEYENTER // or any key you want
SELF:Owner:myMethod() //execute your method
RETURN 0L
ENDIF
ENDIF
ENDIF
RETURN SUPER:Dispatch(oEvent)
But the dispatch method never gets called...I am thinking that I need to create a mysle object in the datawindow activate method. Is that right?
David
I found the code below:
CLASS mySLE INHERIT SingleLineEdit //Creata a class inherit SingleLineEdit
METHOD init(oOwner, nResourceID) CLASS mySLE // Init the Class SUPER:init(oOwner, nResourceID)
RETURN SELF
METHOD Dispatch(oEvent) CLASS mySLE
IF oEvent:Message == WM_GETDLGCODE
IF SELF:NameSym == #SymName // of your SLE
IF oEvent:wParam == KEYENTER // or any key you want
SELF:Owner:myMethod() //execute your method
RETURN 0L
ENDIF
ENDIF
ENDIF
RETURN SUPER:Dispatch(oEvent)
But the dispatch method never gets called...I am thinking that I need to create a mysle object in the datawindow activate method. Is that right?
David
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (2 / 14) |
Uptime: | 45:04:07 |
Calls: | 10,392 |
Files: | 14,066 |
Messages: | 6,417,260 |