Hi,
When I create a segmented control and run the app - the default segment has an unwanted blue focus ring around it.
When I edit the segmented control - tick all the segments, and then untick them all, and then rerun my app - it works as expected (without the focus ring).
As soon as I run my app again - the focus ring reappears.
This means that every-other time I run my app - I need to tick and untick ALL segment controls in the editor.
This is really annoying, so I would like to ask if there is any way to force NO FOCUS to the segmented control.
In desperation I looked in the LF for an unsetFocus property - but as expected - it does not exist
[quote=130176:@Richard Summers]Michel - where is ClearFocus in the LR?
I have looked at the properties etc. for Segmented Control, and see nothing of that description?
This literally makes it so NO control has the focus - so shortcuts like pressing return or the space bar when a button has focus may not work (because nothing has focus).
Anything that depends or works because a control HAS focus won’t work if you call this.
Not drawing the focus ring is slightly different than calling clear focus
Ok,
I know everyone usually claims there is a bug, when in fact it is a coding error - but this must be a bug in Xojo.
My app is for OS X, and even if I set the focus to a text field, my segmented control still gets a focus ring around the selected segment. If I edit the segment control in the inspector, and select all segments, and then deselect them again, and then compile, it works as expected.
The next time I compile - the focus ring returns, and I have to go through the whole process again.
I am using the latest version of Xojo, and my previous version 2013 r3.1 also had the same problem.
[quote=130250:@Richard Summers]Ok,
I know everyone usually claims there is a bug, when in fact it is a coding error - but this must be a bug in Xojo.
My app is for OS X, and even if I set the focus to a text field, my segmented control still gets a focus ring around the selected segment. If I edit the segment control in the inspector, and select all segments, and then deselect them again, and then compile, it works as expected.
The next time I compile - the focus ring returns, and I have to go through the whole process again.
I am using the latest version of Xojo, and my previous version 2013 r3.1 also had the same problem.
Hope that made it clearer.[/quote]
What you call focus ring must be a segment painted blue, right ?
If I did not understand, can you be so kind to post a screen grab ?
No - the segment becomes blue (just like a default button), but it also gets a blurry focus ring (like a text field).
I say this must be a bug because it only happens every other time I compile.
[quote=130253:@Richard Summers]No - the segment becomes blue (just like a default button), but it also gets a blurry focus ring (like a text field).
I say this must be a bug because it only happens every other time I compile.[/quote]
You can set the control to keep buttons unselected by putting this in the Open event :
me.SelectionType = 2
As for the focus ring, next time you see it, press cmd-shift-4 and copy the screen to a file. It will help for an eventual bug report.
Does it happen in a new project with a segmented control if you just run ?
I’m not seeing a blue ring so I’m trying to figure out how to reproduce this at all