• An SLE that does numbers only?

    From David Linda@21:1/5 to All on Mon Dec 12 08:18:18 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From JohnMartens@21:1/5 to All on Mon Dec 12 18:32:23 2022
    Hi David,

    Why not put a picture clause (like 9999) on the SLE ?

    John


    Op 12-12-2022 om 17:18 schreef David Linda:
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Jamal@21:1/5 to David Linda on Thu Dec 22 18:04:11 2022
    You need to drop an SLE control on the Window, then change the Inherit
    From property to the subclass mySLE. Forget about the Activate method.

    Jamal

    On 12/12/2022 11:18 AM, David Linda wrote:
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)