Page 1 of 1

"Pause" for Notify Event ?

PostPosted: Tue Nov 08, 2022 9:29 pm
by Jimmy
hi,

for TGrid() i use Method Notify to get LVN_KEYDOWN when "Key" is press
now when "load" a big Folder and User press ENTER again it crash ... :roll:

so i want to "block" Notify ... but how ...

i can use a Member (DATA) like this
Code: Select all  Expand view
 IF ::lAllowed
     DO CASE
        CASE nCode == LVN_KEYDOWN

but that seems me not the right Way when i want to release CLASS TGrid() ... how User should know it ...

so i like to ask if Fivewin can "disable Event" which is "documented" so i can point User to it :?:

Re: "Pause" for Notify Event ?

PostPosted: Wed Nov 09, 2022 7:19 am
by Antonio Linares
Dear Jimmy,

Please provide a small and self contained PRG to test it

many thanks

Re: "Pause" for Notify Event ?

PostPosted: Wed Nov 09, 2022 8:21 am
by Jimmy
hi Antonio,
Antonio Linares wrote:Please provide a small and self contained PRG to test it


i use Method Notify in my CLASS TGrid()
it is use by CLASS TExplorer()

from Main i call n-Times CLASS TExplorer() so "smallest" Sample have about 3000 Lines ...

---

it is a General Question how i can "block" Method Notify which seems in almost every Control

under HMG i can use this

DISABLE/ENABLE EVENTS

This commands/function prevents re-entry while processing the events of a control or window
allowing the use of other controls/functions that generate messages of re-called of events

Syntax:

- DISABLE [ CONTROL ] EVENT ControlName OF FormName
- ENABLE [ CONTROL ] EVENT ControlName OF FormName
- StopControlEventProcedure ( cControlName, cFormName, lStop )

- DISABLE [ WINDOW ] EVENT OF FormName
- ENABLE [ WINDOW ] EVENT OF FormName
- StopWindowEventProcedure ( cFormName, lStop )

Re: "Pause" for Notify Event ?

PostPosted: Wed Nov 09, 2022 8:45 am
by Antonio Linares
You may use a logical DATA to enable or disable it, I guess

Re: "Pause" for Notify Event ?

PostPosted: Wed Nov 09, 2022 10:57 am
by Jimmy
hi Antonio,
Antonio Linares wrote:You may use a logical DATA to enable or disable it, I guess

this is what i do now
Code: Select all  Expand view
  CASE nCode == LVN_KEYDOWN
      nKey := LV_GETGRIDVKEY( nPtrNMHDR )
      IF nKey = 13
         IF ::bClick != nil
            IF ::lAllowed = .T.
               EVAL( ::bClick, ::nOption, Self )
            ENDIF
         ENDIF
      ENDIF

but i do not like that User "must set"
Code: Select all  Expand view
METHOD FillGrid() CLASS TExplorer
   ::oGrid:lAllowed = .F.                         // disable Notify
   // Code to fill
   ::oGrid:lAllowed = .T.                         // enable Notify


---

under Xbase++ i can use
Code: Select all  Expand view
CLEAR TYPEAHEAD

or
Code: Select all  Expand view
KEYBOARD  ""

which remove all from Keyboard Buffer and Event from Queue