How to set focus after POPUP

This forum is for eXpress++ general support.
Post Reply
Message
Author
User avatar
jdsoft
Posts: 113
Joined: Thu Jan 28, 2010 1:13 pm
Location: Overberg
Contact:

How to set focus after POPUP

#1 Post by jdsoft »

Hello,

How to set focus to the next input field when POPUP returns?.
I tryed as folows:

Code: Select all

@ nLine++,KASSA_TAB2   DCGET oKassaBon:nKortingperc;
           PICTURE "999.99" ;
           VALID bRecalc ;
           POPUP {|n,o,r|r := Touch_NumPad(o),Dc_ReadGuiEvent(DCGUI_MOVE_UP,GetList),r} 
@ nLine++,KASSA_TAB2   DCGET oKassaBon:nBetaald ;
           PICTURE "999.99" 
Unfortunaly, the focus remains on the current DCGET, the VALID is not executed.
How to get focus on field "oKassaBon:nbetaald" if the POPUP is finished?

Regards,
Jack Duijf
Regards,
Jack Duijf

User avatar
RDalzell
Posts: 205
Joined: Thu Jan 28, 2010 6:57 am
Location: Alsip, Illinois USA

Re: How to set focus after POPUP

#2 Post by RDalzell »

Hi Jack

Add :
GETID "Get_GerVar" within your desired DCGET parameters

Add :
SetAppFocus(DC_GetObject(GetList,"Get_GetVar")) at the end of your VALID function

Rick

Wolfgang Ciriack
Posts: 481
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: How to set focus after POPUP

#3 Post by Wolfgang Ciriack »

Or your codeblock returns an array with two Elements, first element the value, second the object to receive focus.
_______________________
Best Regards
Wolfgang

User avatar
RDalzell
Posts: 205
Joined: Thu Jan 28, 2010 6:57 am
Location: Alsip, Illinois USA

Re: How to set focus after POPUP

#4 Post by RDalzell »

Or, if you did not want to define specifically, but for general use...

DC_ReadGuiEvent(DCGUI_MOVE_DOWN_PAR,GetList) // Set focus to next object in Get List that
has the same parent as the current object.

User avatar
jdsoft
Posts: 113
Joined: Thu Jan 28, 2010 1:13 pm
Location: Overberg
Contact:

Re: How to set focus after POPUP

#5 Post by jdsoft »

Hello Rick,

Thank you for the suggestions.
The use of DC_ReadGuiEvent(DCGUI_MOVE_DOWN_PAR,GetList) does not work in the POPUP code-block.
The one that mentioned the return of a array, helped me in the right direction.
Because it was a generic numeric touchscreen entry, i needed to go to the next data-entry (whatever that was).
Below the code i put in the popup codeblock.
I investigate the GetList, and locate the next entryfield (if possible).

Thanks again.
Jack Duijf

Code: Select all

@ 1,1 DCGET nInput PICTURE "999.99"  POPUP {|n,o|Touch_NumPad(o,GetList)} VALID {||myvalid(....)}

Function Touch_NumPad(oInput,aParentGetlist)
Locals .....

if ValType(aParentGetlist) = "A"
   nPos := AScan(aParentGetlist,{|a|a[oGETLIST_OBJECT]==oInput})
   if nPos > 0
      nPos++
      do while nPos <= Len(aParentGetlist)
         oNextFocus        := aParentGetlist[nPos,oGETLIST_OBJECT]
         if ValType(oNextFocus) = "O"
            if oNextFocus:isDerivedFrom("xbpSle") .or. ;
               oNextFocus:isDerivedFrom("xbpMle")
               exit
            endif
         endif
         oNextFocus        := nil
         nPos++
      Enddo
   endif
endif
.. 
.. My touchcreen code..
..
DCREAD GUI TO lOk MODAL OPTIONS GetOptions EVAL {|o| setappwindow(o) } ENTEREXIT FIT OWNER oAppWindow
if lOk
   uRet                 := oInput:Getdata()
   if ValType(oNextFocus) = "O"
      uRet              := {uRet,oNextFocus}
   endif
endif
Return uRet

Regards,
Jack Duijf

Post Reply