Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

left click and achoice behaviour

47 views
Skip to first unread message

Claudio Herszage

unread,
May 23, 2013, 6:13:26 PM5/23/13
to
Hi
Why is mouse left button press limites in ACHOICE?
If you single click on any element of the array, that element is highlighted, cursos is moved to that element, but the udf function is not called.
Is there a reason for this or is it a bug?
Below is part of achoice.prg code where keys are evaluated.
Thanks
Claudio H

///// code /////
CASE K_LDBLCLK // Double click mouse button
CASE K_LBUTTONDOWN // Click mouse button
nAux := ::HitTest( MRow(), MCol() )
IF nAux != 0 .AND. IsAvailableItem( ::nFirstRow + nAux - 1 )
::MoveCursor( ::nFirstRow + nAux - 1 - ::nOption, 1, 0 )
IF nKey == K_LDBLCLK
IF ::lUserFunc
// EMULATE ENTER
hb_SetLastKey( K_ENTER )
ELSE
nUserMode := AC_NO_USER_FUNCTION
nMode := AC_SELECT
ENDIF
ELSE
nUserMode := AC_NO_USER_FUNCTION
ENDIF
ENDIF
EXIT
END
///// endcode /////

Enrico Maria Giordano

unread,
Apr 15, 2014, 10:55:47 AM4/15/14
to


Claudio,

> Why is mouse left button press limites in ACHOICE?
> If you single click on any element of the array, that
> element is highlighted, cursos is moved to that
> element, but the udf function is not called.
> Is there a reason for this or is it a bug?

This sample works fine here:

#include "Achoice.ch"
#include "Inkey.ch"


FUNCTION MAIN()

SET EVENTMASK TO INKEY_ALL

CLS

? ACHOICE( 0, 0, 10, 20, { "1", "2", "3" }, , "TEST" )

RETURN NIL


FUNCTION TEST( nMode, nElement, nRow )

@ 30, 20 SAY nMode
@ 31, 20 SAY nElement
@ 32, 20 SAY nRow

IF LASTKEY() = K_ESC
RETURN AC_ABORT
ENDIF

RETURN AC_CONT

EMG

--
EMAG Software Homepage: http://www.emagsoftware.it
The EMG Music page: http://www.emagsoftware.it/emgmusic
The EMG's ZX-Spectrum Page: http://www.emagsoftware.it/spectrum
The Best of Spectrum Games: http://www.emagsoftware.it/tbosg
0 new messages