Using Code::Blocks with wxSmith, when I click on a wxFontPickerCtrl, I get following assert failure:
./src/propgrid/propgridpagestate.cpp(1693): assert "Assert failure" failed in PrepareToAddItem(): wxPropertyGrid item with name "Font" already exists
Then in the wxFontPickerCtrl properties window, I can see 'Font' property twice. First 'Font' is the very first property in the window, second is between 'BackGround' and 'Tooltip'.
I reproduced this only with an old project I had laying around. I don't remember how I added the wxFontPickerCtrl, and now I can't find it in wxSmith buttons. In the .wxs file it looks like this:
<object variable="font_picker" member="yes" class="wxFontPickerCtrl" name="ID_FONTPICKERCTRL1">
<handler function="OnFontPicker" entry="EVT_FONTPICKER_CHANGED">
</handler></object>
I can reproduce this. Will look into it
Here is a patch.
This patch probably breaks old wxs files with the font picker in it that uses a predefined font.
This never should have worked properly, because there are two font sections in the font picker control: One pre selected font and one font for the control.
In previous versions, both had the same xml tag so it was not possible to differentiate between them... This patch uses now <font_sel> for the preselected font. So the incompatibility with previous versions is simple, that the pre selected font is ignored/not set...</font_sel>
How does this look in a xrc file?
You were right. According https://docs.wxwidgets.org/stable/overview_xrcformat.html#xrc_wxfontpickerctrl the xml property name should be <value>. So this code never worked for xrc files. I use now value for the xrc and wxs name. This will break loading of old files, but as i mentioned top, it never worked the right way (or only random). I think this was a copy and paste error....
fixed in [r12069]</value>
Related
Commit: [r12069]