Skip to content

Commit

Permalink
Modernize implementation of wxFormBuilder based components
Browse files Browse the repository at this point in the history
Enable internationalization, use dynamic wxWindowsID's, update project
property `first_id` to recommended value.
  • Loading branch information
sodevel committed May 28, 2024
1 parent e9c16a2 commit aebdbda
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 26 deletions.
2 changes: 1 addition & 1 deletion forms/sdk/wizard.fbp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<property name="embedded_files_path">res</property>
<property name="encoding">UTF-8</property>
<property name="file">wizardbase</property>
<property name="first_id">1000</property>
<property name="first_id">6000</property>
<property name="internationalize">1</property>
<property name="lua_skip_events">1</property>
<property name="lua_ui_table">UI</property>
Expand Down
10 changes: 5 additions & 5 deletions forms/src/GenInheritedDlg.fbp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<property name="embedded_files_path">res</property>
<property name="encoding">UTF-8</property>
<property name="file">geninhertclass_gui</property>
<property name="first_id">1000</property>
<property name="internationalize">0</property>
<property name="first_id">6000</property>
<property name="internationalize">1</property>
<property name="lua_skip_events">1</property>
<property name="lua_ui_table">UI</property>
<property name="name">GenInheretedClass</property>
Expand Down Expand Up @@ -173,7 +173,7 @@
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">ID_FORMS_CHECK_LIST</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size">-1,-1</property>
Expand Down Expand Up @@ -312,7 +312,7 @@
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">ID_CLASS_NAME_TEXT_CTRL</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
Expand Down Expand Up @@ -440,7 +440,7 @@
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">ID_FILE_NAME_TEXT_CTRL</property>
<property name="id">wxID_ANY</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
Expand Down
2 changes: 1 addition & 1 deletion sdk/plugin_interface/forms/wizardbase.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 4.1.0-112-g3f2172f2)
// C++ code generated with wxFormBuilder (version 4.1.0-113-ge9c16a2d)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
Expand Down
2 changes: 1 addition & 1 deletion sdk/plugin_interface/forms/wizardbase.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 4.1.0-112-g3f2172f2)
// C++ code generated with wxFormBuilder (version 4.1.0-113-ge9c16a2d)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
Expand Down
18 changes: 9 additions & 9 deletions src/rad/geninheritclass/geninhertclass_gui.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 4.1.0-112-g3f2172f2)
// C++ code generated with wxFormBuilder (version 4.1.0-113-ge9c16a2d)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
Expand All @@ -17,36 +17,36 @@ GenInheritedClassDlgBase::GenInheritedClassDlgBase( wxWindow* parent, wxWindowID
mainSizer = new wxBoxSizer( wxVERTICAL );

wxStaticBoxSizer* instructionsSbSizer;
instructionsSbSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Instructions") ), wxVERTICAL );
instructionsSbSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Instructions") ), wxVERTICAL );

m_instructionsStaticText = new wxStaticText( instructionsSbSizer->GetStaticBox(), wxID_ANY, wxT("1. Check the forms you would like to create the inherited class for.\n2. You can edit individual class details by clicking on their names in the list\nand then:\n\t2a. Edit the 'Class Name:' as required.\n\t2b. Edit the 'File Names: (.h/.cpp)' as required.\n3. Click 'OK'."), wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE );
m_instructionsStaticText = new wxStaticText( instructionsSbSizer->GetStaticBox(), wxID_ANY, _("1. Check the forms you would like to create the inherited class for.\n2. You can edit individual class details by clicking on their names in the list\nand then:\n\t2a. Edit the 'Class Name:' as required.\n\t2b. Edit the 'File Names: (.h/.cpp)' as required.\n3. Click 'OK'."), wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE );
m_instructionsStaticText->Wrap( -1 );
instructionsSbSizer->Add( m_instructionsStaticText, 0, wxALL|wxEXPAND, 5 );


mainSizer->Add( instructionsSbSizer, 0, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 );

wxArrayString m_formsCheckListChoices;
m_formsCheckList = new wxCheckListBox( this, ID_FORMS_CHECK_LIST, wxDefaultPosition, wxDefaultSize, m_formsCheckListChoices, 0 );
m_formsCheckList = new wxCheckListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_formsCheckListChoices, 0 );
m_formsCheckList->SetMinSize( wxSize( 350,150 ) );

mainSizer->Add( m_formsCheckList, 0, wxALL|wxEXPAND, 5 );

wxStaticBoxSizer* classDescriptionSbSizer;
classDescriptionSbSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Class Details") ), wxVERTICAL );
classDescriptionSbSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Class Details") ), wxVERTICAL );

m_classNameStaticText = new wxStaticText( classDescriptionSbSizer->GetStaticBox(), wxID_ANY, wxT("Class Name:"), wxDefaultPosition, wxDefaultSize, 0 );
m_classNameStaticText = new wxStaticText( classDescriptionSbSizer->GetStaticBox(), wxID_ANY, _("Class Name:"), wxDefaultPosition, wxDefaultSize, 0 );
m_classNameStaticText->Wrap( -1 );
classDescriptionSbSizer->Add( m_classNameStaticText, 0, wxLEFT|wxRIGHT|wxTOP, 5 );

m_classNameTextCtrl = new wxTextCtrl( classDescriptionSbSizer->GetStaticBox(), ID_CLASS_NAME_TEXT_CTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_classNameTextCtrl = new wxTextCtrl( classDescriptionSbSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
classDescriptionSbSizer->Add( m_classNameTextCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );

m_fileNameStaticText = new wxStaticText( classDescriptionSbSizer->GetStaticBox(), wxID_ANY, wxT("File Names: (.cpp/.h)"), wxDefaultPosition, wxDefaultSize, 0 );
m_fileNameStaticText = new wxStaticText( classDescriptionSbSizer->GetStaticBox(), wxID_ANY, _("File Names: (.cpp/.h)"), wxDefaultPosition, wxDefaultSize, 0 );
m_fileNameStaticText->Wrap( -1 );
classDescriptionSbSizer->Add( m_fileNameStaticText, 0, wxLEFT|wxRIGHT|wxTOP, 5 );

m_fileNameTextCtrl = new wxTextCtrl( classDescriptionSbSizer->GetStaticBox(), ID_FILE_NAME_TEXT_CTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_fileNameTextCtrl = new wxTextCtrl( classDescriptionSbSizer->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
classDescriptionSbSizer->Add( m_fileNameTextCtrl, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 );


Expand Down
12 changes: 3 additions & 9 deletions src/rad/geninheritclass/geninhertclass_gui.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 4.1.0-112-g3f2172f2)
// C++ code generated with wxFormBuilder (version 4.1.0-113-ge9c16a2d)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
Expand All @@ -9,6 +9,7 @@

#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
Expand All @@ -32,13 +33,6 @@ class GenInheritedClassDlgBase : public wxDialog
private:

protected:
enum
{
ID_FORMS_CHECK_LIST = 1000,
ID_CLASS_NAME_TEXT_CTRL,
ID_FILE_NAME_TEXT_CTRL,
};

wxStaticText* m_instructionsStaticText;
wxCheckListBox* m_formsCheckList;
wxStaticText* m_classNameStaticText;
Expand All @@ -58,7 +52,7 @@ class GenInheritedClassDlgBase : public wxDialog

public:

GenInheritedClassDlgBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Generate Inherited Class"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE );
GenInheritedClassDlgBase( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Generate Inherited Class"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE );

~GenInheritedClassDlgBase();

Expand Down

0 comments on commit aebdbda

Please sign in to comment.