Another wxFormBuilder question

I found a weird problem with wxFormBuilder. I overrode the font on a button widget before realizing I really wanted to override it at the Frame level. So I did that, but now I can’t find a way to “un-override” it. I reset it to the same defaults as the fonts on new buttons that were never overridden, but the code generator refuses to stop calling .SetFont on that button.

Is there some place I haven’t found to reset whatever flag it’s using to decide what properties it needs to generate code to set, and which can be left at the defaults? Or is this a (hopefully known) bug (with a workaround, hopefully?)

You are right, once the font has been modified, there’s apparently no way to go back.
However, there’s a workaround. wxFormbuilder saves files with .fbp extension. These files contain pure xml that you can edit manually (before doing so, exit wxFormBuilder).
A button is described like this :

                    <object class="wxButton" expanded="1">
                        <property name="BottomDockable">1</property>
                        <property name="LeftDockable">1</property>
                        <property name="RightDockable">1</property>
                        <property name="TopDockable">1</property>
                        <property name="aui_layer"></property>
                        <property name="aui_name"></property>
                        <property name="aui_position"></property>
                        <property name="aui_row"></property>
                        <property name="best_size"></property>
                        <property name="bg"></property>
                        <property name="bitmap"></property>
                        <property name="caption"></property>
                        <property name="caption_visible">1</property>
                        <property name="center_pane">0</property>
                        <property name="close_button">1</property>
                        <property name="context_help"></property>
                        <property name="context_menu">1</property>
                        <property name="current"></property>
                        <property name="default">0</property>
                        <property name="default_pane">0</property>
                        <property name="disabled"></property>
                        <property name="dock">Dock</property>
                        <property name="dock_fixed">0</property>
                        <property name="docking">Left</property>
                        <property name="enabled">1</property>
                        <property name="fg"></property>
                        <property name="floatable">1</property>
                        <property name="focus"></property>
                        <property name="font"></property>
                        <property name="gripper">0</property>
                        <property name="hidden">0</property>
                        <property name="id">wxID_ANY</property>
                        <property name="label">This is my Button</property>
                        <property name="margins"></property>
                        <property name="markup">0</property>
                        <property name="max_size"></property>
                        <property name="maximize_button">0</property>
                        <property name="maximum_size"></property>
                        <property name="min_size"></property>
                        <property name="minimize_button">0</property>
                        <property name="minimum_size"></property>
                        <property name="moveable">1</property>
                        <property name="name">m_button1</property>
                        <property name="pane_border">1</property>
                        <property name="pane_position"></property>
                        <property name="pane_size"></property>
                        <property name="permission">protected</property>
                        <property name="pin_button">1</property>
                        <property name="pos"></property>
                        <property name="position"></property>
                        <property name="pressed"></property>
                        <property name="resize">Resizable</property>
                        <property name="show">1</property>
                        <property name="size"></property>
                        <property name="style"></property>
                        <property name="subclass">; ; forward_declare</property>
                        <property name="toolbar_pane">0</property>
                        <property name="tooltip"></property>
                        <property name="validator_data_type"></property>
                        <property name="validator_style">wxFILTER_NONE</property>
                        <property name="validator_type">wxDefaultValidator</property>
                        <property name="validator_variable"></property>
                        <property name="window_extra_style"></property>
                        <property name="window_name"></property>
                        <property name="window_style"></property>

You can see the font parameter is like the following when not edited :
<property name="font"></property>

You just have to find the problematic font parameter (use the button name or label) in your .fbp file and correct it manually.


Cool - I should have looked at those files to see if they were just readable. For something complicated it could be less of a pain than just deleting and re-creating the button objects was, but even that wasn’t a big deal once I figured out what was going on.