[wxPython] wxFontDialog Style

Thanks for the feedback on the wxFontDialog.

The word "style" was a bit misleading in my previous note.

Under Windows there is list in the middle of the Dialog box which is labeled
"Font Style" which provides a selection list of Regular, Bold, Italic, etc.
These are useful parameters to defined the font.

There are methods for the Dialog to get the FontName, Point Size, and
Colour, but I don't see a method of getting at the selected Style i.e.
Regular, Bold, etc.

If would also be useful to get at the Effects parameters i.e. Underline and
Strikeout.

Lorne White

The word "style" was a bit misleading in my previous note.

Under Windows there is list in the middle of the Dialog box which is

labeled

"Font Style" which provides a selection list of Regular, Bold, Italic,

etc.

These are useful parameters to defined the font.

There are methods for the Dialog to get the FontName, Point Size, and
Colour, but I don't see a method of getting at the selected Style i.e.
Regular, Bold, etc.

Yes there is, just not directly. As I said you should be able to get it
from the font that was selected, like this:

    bold = (dlg.GetFontData().GetChosenFont().GetWeight() == wxBOLD)

If would also be useful to get at the Effects parameters i.e. Underline

and

Strikeout.

Underline you can get the same way with GetUnderlined. Strikout is MSW
specific and doesn't seem to be supported yet in wxWindows.

ยทยทยท

--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters?
http://wxPython.org Relax with wxPython!