[Gambas-user] Issue 622 in gambas: ButtonBox does not report its Name property

gambas at ...2524... gambas at ...2524...
Thu May 14 16:36:15 CEST 2015


Updates:
	Status: NeedsInfo

Comment #1 on issue 622 by tabo... at ...626...: ButtonBox does not report its  
Name property
https://code.google.com/p/gambas/issues/detail?id=622

That's because ButtonBox is a compound control from gb.form. If you have a  
look at the source code[0], you see that ButtonBox is itself a UserControl  
(which inherits Container!) and contains a MaskBox (called "TextBox") which  
is used to display the contents of the ButtonBox.

Since ButtonBox inherits UserControl inherits Container, your code inspects  
even the children of the ButtonBox and finds that the contained MaskBox has  
focus -- which is what you get.

One way to fix this in your code is to detect the control which has focus,  
just as you do now, and then to go up the Control.Parent chain to find  
either

   (a) the farthest UserControl above: then take this control or
   (b) no UserControl above at all: then take the control you found.

Does that clear up the situation? I want to mark this bug report "Invalid"  
if you have no objections.

[0]  
http://sourceforge.net/p/gambas/code/HEAD/tree/gambas/trunk/comp/src/gb.form/.src/Button/ButtonBox.class

-- 
You received this message because this project is configured to send all  
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings




More information about the User mailing list