"Pause" for Notify Event ?

Post Reply
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

"Pause" for Notify Event ?

Post 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

  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 :?:
greeting,
Jimmy
User avatar
Antonio Linares
Site Admin
Posts: 42521
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 75 times
Contact:

Re: "Pause" for Notify Event ?

Post by Antonio Linares »

Dear Jimmy,

Please provide a small and self contained PRG to test it

many thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: "Pause" for Notify Event ?

Post 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 )
greeting,
Jimmy
User avatar
Antonio Linares
Site Admin
Posts: 42521
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 31 times
Been thanked: 75 times
Contact:

Re: "Pause" for Notify Event ?

Post by Antonio Linares »

You may use a logical DATA to enable or disable it, I guess
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Jimmy
Posts: 1740
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany
Has thanked: 2 times

Re: "Pause" for Notify Event ?

Post 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

   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

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

CLEAR TYPEAHEAD
or

Code: Select all | Expand

KEYBOARD  ""
which remove all from Keyboard Buffer and Event from Queue
greeting,
Jimmy
Post Reply