cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

XUI dialog focus-related highlighting

naglists
1-Newbie

XUI dialog focus-related highlighting

Hiya,
A weird one. I'm loading a XUI dialog and many of the controls are
dynamically generated. The last button to load is getting focus by default.
I don't want it there so I set it directly using:

dlgitem_set_focus($win, "idofitemthatshouldgetfocus")

And the focus moves as requested. HOWEVER, the highlighting around the last
loaded button doesn't disappear and it doesn't appear as it should on the
set button. Tab will move both focus and focus-related highlighting.

Anyone seen / solved this? Am I not understanding the difference between
programmatic and in-dlgitem highlighting and the highlighting
(drop-shadow-looking) around the dlgitem?

--
Paul Nagai
3 REPLIES 3

I believe you can see the behavior I'm talking about by loading the Modify
Attributes dialog box. This will obviously be dependent on DTD and cursor
location, but when I press ctrl-d, the Modify Attributes dialog opens. My
cursor is in the first text entry box (which happens in my case to accept
CDATA). The OK button has "focus-dropshadow" even though it does not have
programmatic focus or the "interior" highlighting (a dashed box-ish looking
rectangle inside the button). If I tab through all the attributes,
programmatic focus/hightlighting and drop-shodow highlighting will "meet"
on the OK button and then travel together (assuming I keep on tabbing) to
Cancel, Help, etc. etc. etc.

I would like to force all the focus to my preferred button.

That said, now that I'm seeing the "odd" behavior in system dialogs ... I'm
assuming there is no real control over this and that it's a limitation of
XUI.

And fwiw: I didn't notice this ... my OCD runs in different directions ...
AND my Win7 theme uses black for the drop-shadow. The author that reported
it gets blue drop-shadow and it is much more pronounced in that them.


Paul,

I've not noticed this behavior, but I do know there's a difference between the control that has focus and the button acting as the default button. In XUI, the button with type="accept" s the default ('OK') button - the button that will be activated if you press 'Enter' regardless of which control has focus. If you tab through multiple buttons, the 'default' button may change to the focused button, I'm not sure. Also, if you have more than one 'accept'-type button, I'm not sure what will happen. Could that be what you're seeing?

Chris


Thank you, Chris. That is it, exactly. I've been copy/pasting XUI buttons
forever and a day without managing the type="accept"
setting.


On Wed, Feb 6, 2013 at 1:19 PM, Chris Nitchie
<chris.nitchie@oberontech.com>wrote:

> Paul,
>
> I've not noticed this behavior, but I do know there's a difference between
> the control that has focus and the button acting as the default button. In
> XUI, the button with type="accept" s the default ('OK') button - the button
> that will be activated if you press 'Enter' regardless of which control has
> focus. If you tab through multiple buttons, the 'default' button may change
> to the focused button, I'm not sure. Also, if you have more than one
> 'accept'-type button, I'm not sure what will happen. Could that be what
> you're seeing?
>
> Chris
>
>
>
Top Tags