Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tgetlist.prg #217

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update tgetlist.prg #217

wants to merge 1 commit into from

Conversation

Hazaels
Copy link

@Hazaels Hazaels commented Nov 29, 2020

Removed reference to K_LBUTTONDOWN to avoid the weird problem of the 1002nd item of a long list in GET LISTBOX DROPDOWN
To test just use it with an array of more than 1000 items
I really do not know for what it was there ( K_LBUTTONDOWN ) but removing it will cause the code to work properly.

Note: To test you need to use something like GTWVT/WVG and mouse clicks between fields. When you click on a GET LISTBOX field with an array of more than 1000 items you will see the error: It always point to the 1002nd element doesn't matter which one was previously selected on the GET variable.

Build the following test with hbmk2 -gtwvt option:

#include 'inkey.ch'

ANNOUNCE HB_GTSYS
REQUEST HB_GT_WVT_DEFAULT

REQUEST HB_CODEPAGE_FRISO

PROCEDURE MAIN()

LOCAL i
LOCAL aList := {}
LOCAL c1 := 'test'
LOCAL c2 := '1000'

hb_cdpSelect( 'FRISO' )

SET EVENTMASK TO INKEY_ALL + HB_INKEY_GTEVENT - INKEY_MOVE

FOR i := 1 TO 1030
AADD( aList, { STRZERO(i,4) + '-xxxxx', STRZERO(i,4) } )
NEXT i

DO WHILE .T.
CLS

  @ 6,0 GET c1
  @ 8,0,23,50 GET c2 LISTBOX aList DROPDOWN SCROLLBAR
  
  READ

  IF LASTKEY() == K_ESC
     EXIT
  ENDIF

ENDDO

RETURN

Removed reference to  K_LBUTTONDOWN  to avoid the weird problem of the 1002nd item of a long list in GET LISTBOX DROPDOWN
To test just use it with an array of more than 1000 items
I really do not know for what it was there ( K_LBUTTONDOWN ) but removing it will cause the code to work properly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant