"Pause" for Notify Event ?

"Pause" for Notify Event ?

Postby Jimmy » Tue Nov 08, 2022 9: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: 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 :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1590
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: "Pause" for Notify Event ?

Postby Antonio Linares » Wed Nov 09, 2022 7:19 am

Dear Jimmy,

Please provide a small and self contained PRG to test it

many thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41381
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: "Pause" for Notify Event ?

Postby Jimmy » Wed Nov 09, 2022 8: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
User avatar
Jimmy
 
Posts: 1590
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: "Pause" for Notify Event ?

Postby Antonio Linares » Wed Nov 09, 2022 8:45 am

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

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41381
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: "Pause" for Notify Event ?

Postby Jimmy » 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: 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
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1590
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], Willi Quintana and 71 guests