[Gambas-user] Frame where the first item is not Enabled - focus problem
Benoît Minisini
gambas at ...1...
Fri Nov 27 19:55:45 CET 2009
> bbb888 wrote:
> > In this form I have
> > - several misc controls
> > - a textarea
> > - a frame (with several checkboxes and buttons)
> > - a listview
> > in that order in the heirarchy.
> >
> > In certain conditions, the first item in the frame has it's Enabled
> > property set to false.
> > When this happens and I tab from the textarea to the frame (in actual
> > fact it's done in code using textarea.Next.SetFocus as I have to trap TAB
> > keys), the focus does not go to the first enabled item in the frame. In
> > fact, it seems to disappear* and a second tab moves the focus to the
> > first control in the form, not the listview.
> > * even the listview_GotFocus handler is never invoked.
> >
> > If the first item in the frame is enabled, the form "works".
> >
> > Is this expected behaviour? If not, do you think it is something in
> > gambas or in the KDE style (Highcolor Classic) that I am using ?
> >
> > tia
> > Bruce
> >
> > Update: I've tried changing the Frame to a Panel, but apart from losing
> > my title the problem remains.
>
> OK, Ive solved it with
>
> IF Panel2.Children[0].Enabled THEN
> Panel2.Children[0].SetFocus
> ELSE
> Panel2.Children[1].SetFocus
> ENDIF
>
> but I wouldn't have thought I'd need to go to thgat extreme?
>
Yes, you have to do that, because TextArea.Next is the next control in z-
order, and so in tab order, but the enable status of the control in not taken
into account.
Regards,
--
Benoît Minisini
More information about the User
mailing list