@ DCPICKLIST GOTFOCUS

This forum is for eXpress++ general support.
Post Reply
Message
Author
reganc
Posts: 259
Joined: Thu Jan 28, 2010 3:08 am
Location: Hersham, Surrey, UK
Contact:

@ DCPICKLIST GOTFOCUS

#1 Post by reganc »

Roger

Does the GOTFOCUS clause on a DCPICKLIST actually do anything?

I have a DCPICKLIST that is a child of a STATIC. I was trying to change the background color of the static when the DCPICKLIST object got focus but nthing happened.

I understand that this 'object' is actually made up of other objects so I was wondering which object the got focus is actually applied to?

Thanks
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: @ DCPICKLIST GOTFOCUS

#2 Post by rdonnay »

DC_XbpPicklist() is a complex dialog made of several Xbase parts.

The XbpStatic() portion never receives focus no matter what you do, therefore the GOTFOCUS clause really can't work.

I cannot think of an easy workaround for this problem.
It will take several setInputFocus and killInputFocus code blocks to get the behavior you want.

This would be a good learning exercise for you to look at the events that are occurring when you click around in your application.
From those events you may be able to discern a pattern that will work for you.

You would need to use a HANDLER clause and a WTF DC_AppEventDefine(nEvent) in your handler to observe the events.
The eXpress train is coming - and it has more cars.

User avatar
rdonnay
Site Admin
Posts: 4813
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: @ DCPICKLIST GOTFOCUS

#3 Post by rdonnay »

You may want to try this:

Code: Select all

@ .. DCPICKLIST .. ;
      EVAL {|o|o:leftListBox:killInputFocus := {||oMyStatic:setColorBG(GRA_CLR_BLUE)}, ;
               o:leftListBox:setInputFocus := {||oMyStatic:setColorBG(GRA_CLR_WHITE)}, ;
               o:rightListBox:killInputFocus := {||oMyStatic:setColorBG(GRA_CLR_BLUE)}, ;
               o:rightListBox:setInputFocus := {||oMyStatic:setColorBG(GRA_CLR_WHITE)} }
The eXpress train is coming - and it has more cars.

reganc
Posts: 259
Joined: Thu Jan 28, 2010 3:08 am
Location: Hersham, Surrey, UK
Contact:

Re: @ DCPICKLIST GOTFOCUS

#4 Post by reganc »

rdonnay wrote:You may want to try this:

Code: Select all

@ .. DCPICKLIST .. ;
      EVAL {|o|o:leftListBox:killInputFocus := {||oMyStatic:setColorBG(GRA_CLR_BLUE)}, ;
               o:leftListBox:setInputFocus := {||oMyStatic:setColorBG(GRA_CLR_WHITE)}, ;
               o:rightListBox:killInputFocus := {||oMyStatic:setColorBG(GRA_CLR_BLUE)}, ;
               o:rightListBox:setInputFocus := {||oMyStatic:setColorBG(GRA_CLR_WHITE)} }
I will certainly try that.

It is sort of what I was expecting, I just wanted to make sure I wasn't missing anything.

We use the COLORGETS clause so we can see which entry field is in focus and we lose that ability when using DCPICKLIST (although we don['t use it in very many places).

Thanks.
Regan Cawkwell
Real Business Applications Ltd
http://www.rbauk.com

Post Reply