Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 20 AUG 1998 01:05:15PM Greg James, ISIS, Inc. wrote:

The current application we are working on contains numerous forms with controls that may or may not have OPTIONS functionality associated with them. I would like to be able to display a label in the bottom of the form when a control that has OPTIONS functionality has focus. Does anyone know of a good way to accomplish this? Thanks.


At 20 AUG 1998 01:55PM Dave Pociu wrote:

Yes,

My application is doing this for any control that has the GOTFOCUS event.

Basically, I have a global application GOTFOCUS event ( APPLICATIONNAME*GOTFOCUS* ) that checks if the respective control has a quickevent or a script defined for it. If so it puts up a message. Also, the first time a control gets focus in a window, all controls that have options defined, along with a white background have their background color turned a light beige. This gives the entire application a very consistent look with no extra work.

The only caveat is that there are controls that do not issue a GOTFOCUS so there it would be your decision how to handle them.

I hope this is the idea that you were after.

Dave


At 20 AUG 1998 04:14PM Greg James, ISIS, Inc. wrote:

Dave,

Thanks for the tip. What property do you use to tell if a control has a QuickEvent or a script associated with it?

Greg


At 20 AUG 1998 08:40PM Dave Pociu wrote:

Here's the relevant piece of code that identifies the controls that have OPTIONS. If you need more help, e-mail me at [email protected]

EntID=@appid:"*OIWIN":(@window1,'F*') WinID=@appid:"":(@window1,'F*')

Events=get(@window,"@EVENTS")

if Events=' then

w=XLATE("SYSREPOSWINS" , WinID , '' , 'X')
w=field(w , @rm , 3)
num_li=fieldcount(w , @fm )
q='
for i=1 to num_li
	locate "OPTIONS" in w using @svm setting pos then
		q=@appid:"*OIEVENT*OPTIONS*":(@window1,'F*'):".":w
	end
next i
Events=Repository("GETSUB",EntID)
if Events # '' then
	Events := @fm
	Events := q
end else
	Events=q
end
= set(@window,"@EVENTS",Events)
num_events =count(Events,@fm) + (Events # '')
for i=1 to num_events
	Type=field(Events[i],'*',3)
	if Type _EQC "Options" then
		ControlID=field(Events[i],'*',4)
		ControlID=@window:".":field(ControlID, '.' , 2)
	end
next i

end

Enjoy!


At 23 AUG 1998 11:52PM Don Bakke wrote:

Hi Greg,

Dave gave you a pretty thorough piece of code that can provide a lot of information. If you are looking for a quick way to tell if a control has an OPTIONS event, the following is what we use:


Events=Get_Property(CtrlEntId, "ORIG_STRUCT")

If Index(Events, "OPTIONS*", 1) then

   /* Control has an OPTIONS event */

end else

   /* Control does not have an OPTIONS event */

end

[email protected]

SRP Computer Solutions


At 24 AUG 1998 01:28PM Dave Pociu wrote:

Don,

The reason why I use that code is so I can identify all the controls with Options the first time a window is started (and GOTFOCUS fired) and change their backcolor. I also store those control ids in an @ property of the window at that time and look in there afterwards.

But you are 100% correct: if all there's needed is a "This control has options" message when the control gets FOCUS, then your code is definitely the one to use.


At 27 OCT 1998 02:55PM GCJ wrote:

  • third_party_content/community/commentary/forums_nonworks/ba513a1f673a596d85256666005ddd80.txt
  • Last modified: 2024/01/04 21:00
  • by 127.0.0.1