xsharp.eu • Escaping the Font Selector window
Page 1 of 2

Escaping the Font Selector window

Posted: Fri Dec 27, 2024 11:08 am
by Irwin
Hi Chris,

If you click the Font property then it pop ups the Font selector window with the current control set font eg: "Segoe UI", 24.0 but if you press "Cancel" then the control takes "Microsoft Sans Serif, 8.25". It shouldn't change my current control font because I pressed "cancel".

Re: Escaping the Font Selector window

Posted: Fri Dec 27, 2024 12:50 pm
by Chris
Hi Irwin,

Pressing "Cancel" in this case is the way to set the property back to "Auto", so it does not set the font explicitly to something, it just let's windows decide. I know, this is not a good way of doing it, bun couldn't find a better way to specify "Auto" for font properties...

Re: Escaping the Font Selector window

Posted: Fri Dec 27, 2024 1:14 pm
by Irwin
Chris wrote: Fri Dec 27, 2024 12:50 pm Hi Irwin,

Pressing "Cancel" in this case is the way to set the property back to "Auto", so it does not set the font explicitly to something, it just let's windows decide. I know, this is not a good way of doing it, bun couldn't find a better way to specify "Auto" for font properties...
Hi Chris, no problem then. I'll get use to click "Accept" even when nothing has changed :-)

Re: Escaping the Font Selector window

Posted: Fri Dec 27, 2024 1:20 pm
by Chris
Hi Irwin,
Irwin wrote: Fri Dec 27, 2024 1:14 pm
Chris wrote: Fri Dec 27, 2024 12:50 pm Hi Irwin,

Pressing "Cancel" in this case is the way to set the property back to "Auto", so it does not set the font explicitly to something, it just let's windows decide. I know, this is not a good way of doing it, bun couldn't find a better way to specify "Auto" for font properties...
Hi Chris, no problem then. I'll get use to click "Accept" even when nothing has changed :-)
I was actually hoping you might have an idea on how to implement it in a better way :)

Re: Escaping the Font Selector window

Posted: Fri Dec 27, 2024 3:16 pm
by Irwin
Chris wrote: Fri Dec 27, 2024 1:20 pm Hi Irwin,
Irwin wrote: Fri Dec 27, 2024 1:14 pm
Chris wrote: Fri Dec 27, 2024 12:50 pm Hi Irwin,

Pressing "Cancel" in this case is the way to set the property back to "Auto", so it does not set the font explicitly to something, it just let's windows decide. I know, this is not a good way of doing it, bun couldn't find a better way to specify "Auto" for font properties...
Hi Chris, no problem then. I'll get use to click "Accept" even when nothing has changed :-)
I was actually hoping you might have an idea on how to implement it in a better way :)
Maybe you could save the current control (or controls) in a collection and if the user press "Cancel" set the old font settings to the selected controls but I don't know if that could be possible.

Re: Escaping the Font Selector window

Posted: Sat Dec 28, 2024 12:38 pm
by Chris
Hi Irwin,

I mean a different for the user way to select "Auto". Ideal would be to add an "Auto" button in the font selection dialog itself...Will give this some research to see if it is possible..

Re: Escaping the Font Selector window

Posted: Sun Dec 29, 2024 11:16 am
by g.bunzel@domonet.de
Hi Irwin,

do you check the Return-Value of the Show()-Method?


From the VO-Help:

StandardFontDialog:Show() Method


Purpose
Display a standard font dialog. To retrieve the value that the user selected, use the StandardFontDialog:Font access.


Syntax
<oStandardFontDialog>:Show() ---> LOGIC


Returns
TRUE if user chooses a font, FALSE if the user presses CANCEL.


...not checked....

HTH

Gerhard

Re: Escaping the Font Selector window

Posted: Sun Dec 29, 2024 11:27 am
by Chris
Hi Gerhard,

This problem is an issue in how the form designer itself works in XIDE, there is currently no other way for the developer to explicitly set a font property to "Auto" while designing a window. So XIDE at the moment uses the action of closing/canceling the font dialog without pressing OK for setting the property to Auto. When he/she presses OK, then the new font is applied to the options.

Need to find a way for the user to specify 3 possible things, 1) Set the font property to the newly selected font, 2) Set it to <Auto>, 3) Cancel any change to the previously selected option.

Re: Escaping the Font Selector window

Posted: Sun Dec 29, 2024 12:38 pm
by FFF
Chris,
possibly you could inject "<Auto>" to the fontlist?

Re: Escaping the Font Selector window

Posted: Mon Dec 30, 2024 10:36 am
by Chris
Hi Karl,

Unfortunately I can't find a way to adjust anything in the controls of the FontDialog. Maybe only by using WinAPI direct calls to manipulate the dialog, but that's too risky as it can differently in various OS versions. Maybe it's just better to add a small clickable "A" button on the right hand side of the Properties window, when a font property is the selected one.