FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour "Pause" for Notify Event ?
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
"Pause" for Notify Event ?
Posted: Tue Nov 08, 2022 09:29 PM
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 (fw): Select all Collapse
  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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: "Pause" for Notify Event ?
Posted: Wed Nov 09, 2022 07:19 AM

Dear Jimmy,

Please provide a small and self contained PRG to test it

many thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: "Pause" for Notify Event ?
Posted: Wed Nov 09, 2022 08:21 AM
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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: "Pause" for Notify Event ?
Posted: Wed Nov 09, 2022 08:45 AM

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

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: "Pause" for Notify Event ?
Posted: Wed Nov 09, 2022 10:57 AM
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 (fw): Select all Collapse
   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 (fw): Select all Collapse
METHOD FillGrid() CLASS TExplorer
   ::oGrid:lAllowed = .F.                         // disable Notify
   // Code to fill
   ::oGrid:lAllowed = .T.                         // enable Notify
---

under Xbase++ i can use
Code (fw): Select all Collapse
CLEAR TYPEAHEAD
or
Code (fw): Select all Collapse
KEYBOARD  ""
which remove all from Keyboard Buffer and Event from Queue
greeting,

Jimmy

Continue the discussion