bb.donnay-software.com

Donnay Software Web Forums
It is currently Mon Dec 18, 2017 11:15 am

All times are UTC - 7 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Wed Oct 11, 2017 6:13 am 
Offline

Joined: Sun Oct 08, 2017 3:57 pm
Posts: 1
Hi

I tried variations of the code below and I can not get it to set focus on the available list when dcpicklist gets focus.

Can you help?

Thanks.


#INCLUDE "ALL.CH"

FUNCTION Main()
// Try to set focus on available items on a dcpicklist.
LOCAL GetList:={}, lOk:=.F., oPick
LOCAL aAvail:={"ONE", "TWO", "THREE", "FOUR"}, aSel:={}

@02,05 DCPICKLIST aSel LIST aAvail;
CAPTION "Available", "Selected" ;
OBJECT oPick;
EVAL {|o| o:keyboard := {|a,b,o| _Keyboard(a, b, o)}};
SIZE 35,12;
IMMEDIATE

DCREAD GUI ;
TITLE "Picklist KEYBOARD test" ;
ADDBUTTONS;
SETFOCUS @oPick;
TO lOk

IF lOk
DC_ARRAYVIEW(aSel)
ENDIF

RETURN(NIL)
*******************************************************************************
STATIC FUNCTION _Keyboard(a, b, o)

o:keyboard(xbeK_TAB)
o:keyboard(xbeK_DOWN)
o:keyboard(xbeK_UP)

RETURN(NIL)

*******************************************************************************
PROCEDURE AppSys()
RETURN
*******************************************************************************
PROCEDURE DbeSys()
RETURN
*******************************************************************************


Top
 Profile  
 
PostPosted: Thu Oct 12, 2017 9:01 am 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 3524
Location: Boise, Idaho USA
Do this:
Code:
DCREAD GUI ;
TITLE "Picklist KEYBOARD test" ;
ADDBUTTONS;
SETFOCUS @oPick;
TO lOk ;
EVAL {|o|SetAppFocus(oPick:leftListBox)}

_________________
The eXpress train is coming - and it has more cars.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group