Zdeno -
I'm going to need more time to figure out a solution.
Roger
dcget keyblock
Re: dcget keyblock
The eXpress train is coming - and it has more cars.
Re: dcget keyblock
Hi Jack,
Nice solution for the keyblock.
I don't know if you are aware that there is an undocumented milliseconds() function in Xbase++? Maybe it could be of help to make your timer class with less code?
Nice solution for the keyblock.
I don't know if you are aware that there is an undocumented milliseconds() function in Xbase++? Maybe it could be of help to make your timer class with less code?
Re: dcget keyblock
is that millisec() the same as sleep() except in 1/1000 instead of 1/00?
There are only 10 kinds of people - those who understand binary and those who don't 

Re: dcget keyblock
Hi,
No, it is the same as seconds(), except it gives you the milliseconds() since midnight.
No, it is the same as seconds(), except it gives you the milliseconds() since midnight.
-
- Posts: 147
- Joined: Thu Jan 28, 2010 9:24 am
- Location: Nitra, Slovakia
- Contact:
Re: dcget keyblock
Hi Jack,jdsoft wrote:In your keyblock, insert the code: ....
please, can you compile and run attached example and tell me, where is problem?
It looks it still works how I don't want, all code after stoped time is executed N times...
so different is only that it is not running immediatelly after each character is typing, but at once N times after delay.
Zdeno
- Attachments
-
- test.zip
- (1.82 KiB) Downloaded 857 times
Re: dcget keyblock
Here is a sample that appears to be doing what you want:
Code: Select all
#INCLUDE "dcdialog.CH"
#INCLUDE "appevent.CH"
FUNCTION Main()
LOCAL GetList[0], cGet := Space(50), aDir := Directory(), oBrowse, bAction
bAction := {|oGet|MyKeyboard(oBrowse,oGet)}
@ 0,0 DCGET cGet KEYBLOCK {|n,x,oGet|MyKeyDelay(n,0.8,oGet)}
@ 2,0 DCBROWSE oBrowse DATA aDir SIZE 60,25
DCBROWSECOL ELEMENT 1 HEADER 'File Name' WIDTH 50 PARENT oBrowse
DCUSEREVENT xbeP_User + 10 ACTION bAction
DCREAD GUI FIT
RETURN nil
* ----------
FUNCTION MyKeyDelay( nKey, nDelay, oGet, bBlock )
LOCAL nEvent, oXbp, mp1, mp2, nSeconds := Seconds()
DEFAULT nDelay := 0
IF nDelay > 0
DO WHILE Seconds() - nSeconds < nDelay .AND. ( nKey < 60000 )
nEvent := AppEvent(@mp1,@mp2,@oXbp,.1)
IF Valtype(oXbp) == 'O'
oXbp:handleEvent(nEvent,mp1,mp2)
ENDIF
ENDDO
ENDIF
PostAppEvent( xbeP_User + 10, oGet )
RETURN nil
* -------------
STATIC FUNCTION MyKeyboard( oBrowse, oGet )
LOCAL cBuffer := Trim(oGet:get:buffer), nArrayElement
nArrayElement := AScan(oBrowse:dataSource,{|a|Upper(a[1])=Upper(cBuffer)})
IF nArrayElement > 0
oBrowse:arrayElement := nArrayElement
ENDIF
oBrowse:refreshAll()
DC_ClearEvents()
RETURN nil
* -------------
PROC appsys ; return
The eXpress train is coming - and it has more cars.
-
- Posts: 147
- Joined: Thu Jan 28, 2010 9:24 am
- Location: Nitra, Slovakia
- Contact:
Re: dcget keyblock
Roger,
thank you!!! thank you!!! thank you!!!
It looks it is OK now, super!!!
Zdeno
thank you!!! thank you!!! thank you!!!



It looks it is OK now, super!!!

Zdeno