Page 2 of 2

Re: PushButton can perform 2 diferent actions?

Posted: Fri Jun 28, 2019 11:43 pm
by hz_scotty
Now it works!
Thank you

Re: PushButton can perform 2 diferent actions?

Posted: Mon Jul 01, 2019 7:58 am
by PedroAlex
Roger.
Thanks for this new feature.
I've tried and done what I need.
I simply replaces the PRG (_dcgetbx.pr, _dcxbrow.prg, _dcxbutt.prg) and compiled.
But now I have a new problem:
The Enter does not change the field cursor.
Could you see what's going on?
Attached Small sample.

xBase 2.0.1095.

best regards

Re: PushButton can perform 2 diferent actions?

Posted: Mon Jul 01, 2019 8:29 am
by rdonnay
1467. In build 265, 2 new Get-Set functions were added due to complaints from
eXpress++ users that they wanted to control the behavior of the
SetInputFocus and KillInputFocus behaviors of DCGET objects. Those
functions are DC_XbpGetSetInputFocusBlock() and
DC_XbpGetKillInputFocusBlock(). They are used to set a code block for
the entire application's DCGET behavior. Now there has been some
complaints that when this was implemented the default behavior also
changed. If you want the same behavior as in builds 264 and earlier
then add the following to the beginning of your application:

Code: Select all

     DC_XbpGetSetInputFocusBlock(;
           {|x,y,o| IIF(o:isGetDataOnLostFocus,o:getData(),nil), ;
               IIF(!Empty(o:get:buffer),o:get:pos := o:savePos,nil), ;
               o:DateFlag := .T., ;
               o:home(), ;
               DC_HiliteGets(o,1,o:getList:getOptions[nGETOPT_HILITECOLOR]), ;
               DC_ColorGets(o,1,o:getList:getOptions[aGETOPT_COLORGETS]), ;
               DC_PopupButtonShow(o,.t.)})

       DC_XbpGetKillInputFocusBlock(;
           {|x,y,o| o:savePos := o:get:pos, ;
               o:DateFlag := .T., ;
               IIF(o:isGetDataOnLostFocus,o:getData(),nil), ;
               IIF(o:isGetDataOnLostFocus,o:setData(),nil), ;
               o:Home(), ;
               DC_HiliteGets(o,1,o:getList:getOptions[nGETOPT_HILITECOLOR]), ;
               DC_ColorGets(o,1,o:getList:getOptions[aGETOPT_COLORGETS])}, ;
               DC_PopupButtonShow(o,.f.)})

Re: PushButton can perform 2 diferent actions?

Posted: Thu Jan 12, 2023 3:27 am
by skiman
Hi,

While experimenting with the latest version, i came to a little problem in the above sample.

Code: Select all

DC_XbpGetKillInputFocusBlock(;
           {|x,y,o| o:savePos := o:get:pos, ;
               o:DateFlag := .T., ;
               IIF(o:isGetDataOnLostFocus,o:getData(),nil), ;
               IIF(o:isGetDataOnLostFocus,o:setData(),nil), ;
               o:Home(), ;
               DC_HiliteGets(o,1,o:getList:getOptions[nGETOPT_HILITECOLOR]), ;
               DC_ColorGets(o,1,o:getList:getOptions[aGETOPT_COLORGETS])}, ;     <---------- } gives an error
               DC_PopupButtonShow(o,.f.)})
These is a } which shouldn't be there.

Code: Select all

DC_XbpGetKillInputFocusBlock(;
           {|x,y,o| o:savePos := o:get:pos, ;
               o:DateFlag := .T., ;
               IIF(o:isGetDataOnLostFocus,o:getData(),nil), ;
               IIF(o:isGetDataOnLostFocus,o:setData(),nil), ;
               o:Home(), ;
               DC_HiliteGets(o,1,o:getList:getOptions[nGETOPT_HILITECOLOR]), ;
               DC_ColorGets(o,1,o:getList:getOptions[aGETOPT_COLORGETS]), ;      <----------- } has to be deleted
               DC_PopupButtonShow(o,.f.)})

Re: PushButton can perform 2 diferent actions?

Posted: Thu Jan 12, 2023 9:06 am
by rdonnay
Chris -

Thanks for finding and reporting that sample code error in README.TXT.