Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wxFormBuilder project #72

Merged
merged 26 commits into from
Aug 11, 2024
Merged

Add wxFormBuilder project #72

merged 26 commits into from
Aug 11, 2024

Conversation

krazkidd
Copy link
Owner

@krazkidd krazkidd commented Aug 11, 2024

This adds two wxFormBuilder projects (.fbp files) and generated C++ classes.

Existing frames and dialogs now inherit from these generated types, hiding initial construction and initialization of child components and separating them from business logic. PortfolioPanel is also implemented in wxFormBuilder, which allows you to create panels as stand-alone types as well as frames and dialogs.

In order to break a circular dependency between generated types and custom types, PortfolioPanel had to be separated into its own wxFormBuilder project. To facilitate this and to aid future refactoring, three of the existing custom widgets were merged with PortfolioPanel.

@krazkidd krazkidd linked an issue Aug 11, 2024 that may be closed by this pull request
1 task
@krazkidd krazkidd self-assigned this Aug 11, 2024
Copy link

github-actions bot commented Aug 11, 2024

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-format reports: 16 file(s) not formatted
  • include/ui/ExchangeAnnouncementsDialog.hpp
  • include/ui/ExchangeScheduleDialog.hpp
  • include/ui/ExchangeStatusDialog.hpp
  • include/ui/LoginDialog.hpp
  • include/ui/MainFrame.hpp
  • include/ui/PortfolioPanel.hpp
  • src/ui/ExchangeAnnouncementsDialog.cpp
  • src/ui/ExchangeScheduleDialog.cpp
  • src/ui/ExchangeStatusDialog.cpp
  • src/ui/LoginDialog.cpp
  • src/ui/MainFrame.cpp
  • src/ui/PortfolioPanel.cpp
  • src/wxfb/App.cpp
  • src/wxfb/App.h
  • src/wxfb/PortfolioPanel.cpp
  • src/wxfb/PortfolioPanel.h
clang-tidy reports: 73 concern(s)
  • include/ui/ExchangeAnnouncementsDialog.hpp:4:10: error: [clang-diagnostic-error]

    'wx/wx.h' file not found

    #include <wx/wx.h>
             ^
  • include/ui/ExchangeScheduleDialog.hpp:4:10: error: [clang-diagnostic-error]

    'wx/wx.h' file not found

    #include <wx/wx.h>
             ^
  • include/ui/ExchangeStatusDialog.hpp:4:10: error: [clang-diagnostic-error]

    'wx/wx.h' file not found

    #include <wx/wx.h>
             ^
  • include/ui/LoginDialog.hpp:4:10: error: [clang-diagnostic-error]

    'wx/wx.h' file not found

    #include <wx/wx.h>
             ^
  • include/ui/LoginDialog.hpp:19:21: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            std::string GetEmail() const;
                        ^
  • include/ui/LoginDialog.hpp:20:21: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            std::string GetPassword() const;
                        ^
  • include/ui/LoginDialog.hpp:22:14: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

            bool GetRememberMe() const;
            ~~~~ ^
            auto                       -> bool
  • include/ui/MainFrame.hpp:4:10: error: [clang-diagnostic-error]

    'wx/wx.h' file not found

    #include <wx/wx.h>
             ^
  • include/ui/PortfolioPanel.hpp:4:10: error: [clang-diagnostic-error]

    'wx/wx.h' file not found

    #include <wx/wx.h>
             ^
  • src/ui/ExchangeAnnouncementsDialog.cpp:1:10: error: [clang-diagnostic-error]

    'wx/wx.h' file not found

    #include <wx/wx.h>
             ^
  • src/ui/ExchangeScheduleDialog.cpp:1:10: error: [clang-diagnostic-error]

    'wx/string.h' file not found

    #include <wx/string.h>
             ^
  • src/ui/ExchangeStatusDialog.cpp:1:10: error: [clang-diagnostic-error]

    'wx/wx.h' file not found

    #include <wx/wx.h>
             ^
  • src/ui/LoginDialog.cpp:1:10: error: [clang-diagnostic-error]

    'wx/wx.h' file not found

    #include <wx/wx.h>
             ^
  • src/ui/MainFrame.cpp:3:10: error: [clang-diagnostic-error]

    'wx/string.h' file not found

    #include <wx/string.h>
             ^
  • src/ui/PortfolioPanel.cpp:1:10: error: [clang-diagnostic-error]

    'wx/wx.h' file not found

    #include <wx/wx.h>
             ^
  • src/wxfb/App.cpp:13:1: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: pnlRoot, pnlPortfolio, mnuBar, mnuFile, mnuLogin, mnuLogout, mnuExchange, mnuView, mnuShowClosedPositions, mnuHelp, statusBar

    MainFrame::MainFrame()
    ^
  • src/wxfb/App.cpp:13:12: warning: [modernize-use-equals-default]

    use '= default' to define a trivial default constructor

    MainFrame::MainFrame()
               ^
  • src/wxfb/App.cpp:17:1: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: pnlRoot, pnlPortfolio, mnuBar, mnuFile, mnuLogin, mnuLogout, mnuExchange, mnuView, mnuShowClosedPositions, mnuHelp, statusBar

    MainFrame::MainFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style )
    ^
  • src/wxfb/App.cpp:22:17: warning: [modernize-use-trailing-return-type]

    use a trailing return type for this function

    bool MainFrame::Create( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style )
    ~~~~            ^
    auto                                                                                                                                 -> bool
  • src/wxfb/App.cpp:31:14: warning: [cppcoreguidelines-init-variables]

    variable 'vszrRoot' is not initialized

            wxBoxSizer* vszrRoot;
                        ^
                                 = nullptr
  • src/wxfb/App.cpp:35:14: warning: [cppcoreguidelines-init-variables]

    variable 'vszrContent' is not initialized

            wxBoxSizer* vszrContent;
                        ^
                                    = nullptr
  • src/wxfb/App.cpp:61:14: warning: [cppcoreguidelines-init-variables]

    variable 'mnuExit' is not initialized

            wxMenuItem* mnuExit;
                        ^
                                = nullptr
  • src/wxfb/App.cpp:68:14: warning: [cppcoreguidelines-init-variables]

    variable 'mnuItemExchangeAnnouncements' is not initialized

            wxMenuItem* mnuItemExchangeAnnouncements;
                        ^
                                                     = nullptr
  • src/wxfb/App.cpp:72:14: warning: [cppcoreguidelines-init-variables]

    variable 'mnuItemExchangeSchedule' is not initialized

            wxMenuItem* mnuItemExchangeSchedule;
                        ^
                                                = nullptr
  • src/wxfb/App.cpp:76:14: warning: [cppcoreguidelines-init-variables]

    variable 'mnuItemExchangeStatus' is not initialized

            wxMenuItem* mnuItemExchangeStatus;
                        ^
                                              = nullptr
  • src/wxfb/App.cpp:90:14: warning: [cppcoreguidelines-init-variables]

    variable 'mnuAbout' is not initialized

            wxMenuItem* mnuAbout;
                        ^
                                 = nullptr
  • src/wxfb/App.cpp:117:12: warning: [modernize-use-equals-default]

    use '= default' to define a trivial destructor

    MainFrame::~MainFrame()
               ^
  • src/wxfb/App.cpp:121:1: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: txtEmail, txtPassword, chkRememberMe

    LoginDialog::LoginDialog( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
    ^
  • src/wxfb/App.cpp:125:14: warning: [cppcoreguidelines-init-variables]

    variable 'vszrContent' is not initialized

            wxBoxSizer* vszrContent;
                        ^
                                    = nullptr
  • src/wxfb/App.cpp:128:15: warning: [cppcoreguidelines-init-variables]

    variable 'gszrInputs' is not initialized

            wxGridSizer* gszrInputs;
                         ^
                                    = nullptr
  • src/wxfb/App.cpp:131:16: warning: [cppcoreguidelines-init-variables]

    variable 'lblEmail' is not initialized

            wxStaticText* lblEmail;
                          ^
                                   = nullptr
  • src/wxfb/App.cpp:139:16: warning: [cppcoreguidelines-init-variables]

    variable 'lblPassword' is not initialized

            wxStaticText* lblPassword;
                          ^
                                      = nullptr
  • src/wxfb/App.cpp:153:26: warning: [cppcoreguidelines-init-variables]

    variable 'szrStandardButtons' is not initialized

            wxStdDialogButtonSizer* szrStandardButtons;
                                    ^
                                                       = nullptr
  • src/wxfb/App.cpp:154:12: warning: [cppcoreguidelines-init-variables]

    variable 'szrStandardButtonsOK' is not initialized

            wxButton* szrStandardButtonsOK;
                      ^
                                           = nullptr
  • src/wxfb/App.cpp:155:12: warning: [cppcoreguidelines-init-variables]

    variable 'szrStandardButtonsCancel' is not initialized

            wxButton* szrStandardButtonsCancel;
                      ^
                                               = nullptr
  • src/wxfb/App.cpp:173:14: warning: [modernize-use-equals-default]

    use '= default' to define a trivial destructor

    LoginDialog::~LoginDialog()
                 ^
  • src/wxfb/App.cpp:177:1: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: fgszrAnnouncements, lblNoAnnouncements

    ExchangeAnnouncementsDialog::ExchangeAnnouncementsDialog( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
    ^
  • src/wxfb/App.cpp:181:14: warning: [cppcoreguidelines-init-variables]

    variable 'vszrContent' is not initialized

            wxBoxSizer* vszrContent;
                        ^
                                    = nullptr
  • src/wxfb/App.cpp:196:26: warning: [cppcoreguidelines-init-variables]

    variable 'szrStandardButtons' is not initialized

            wxStdDialogButtonSizer* szrStandardButtons;
                                    ^
                                                       = nullptr
  • src/wxfb/App.cpp:197:12: warning: [cppcoreguidelines-init-variables]

    variable 'szrStandardButtonsOK' is not initialized

            wxButton* szrStandardButtonsOK;
                      ^
                                           = nullptr
  • src/wxfb/App.cpp:213:30: warning: [modernize-use-equals-default]

    use '= default' to define a trivial destructor

    ExchangeAnnouncementsDialog::~ExchangeAnnouncementsDialog()
                                 ^
  • src/wxfb/App.cpp:217:1: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: lblSundaySchedule, lblMondaySchedule, lblTuesdaySchedule, lblWednesdaySchedule, lblThursdaySchedule, lblFridaySchedule, lblSaturdaySchedule, lblScheduledMaintenance, gszrMaintenanceScheduleColumns, gszrMaintenanceSchedule, lblNoScheduledMaintenance

    ExchangeScheduleDialog::ExchangeScheduleDialog( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
    ^
  • src/wxfb/App.cpp:221:14: warning: [cppcoreguidelines-init-variables]

    variable 'vszrContent' is not initialized

            wxBoxSizer* vszrContent;
                        ^
                                    = nullptr
  • src/wxfb/App.cpp:224:15: warning: [cppcoreguidelines-init-variables]

    variable 'gszrSchedule' is not initialized

            wxGridSizer* gszrSchedule;
                         ^
                                      = nullptr
  • src/wxfb/App.cpp:227:16: warning: [cppcoreguidelines-init-variables]

    variable 'lblSunday' is not initialized

            wxStaticText* lblSunday;
                          ^
                                    = nullptr
  • src/wxfb/App.cpp:236:16: warning: [cppcoreguidelines-init-variables]

    variable 'lblMonday' is not initialized

            wxStaticText* lblMonday;
                          ^
                                    = nullptr
  • src/wxfb/App.cpp:245:16: warning: [cppcoreguidelines-init-variables]

    variable 'lblTuesday' is not initialized

            wxStaticText* lblTuesday;
                          ^
                                     = nullptr
  • src/wxfb/App.cpp:254:16: warning: [cppcoreguidelines-init-variables]

    variable 'lblWednesday' is not initialized

            wxStaticText* lblWednesday;
                          ^
                                       = nullptr
  • src/wxfb/App.cpp:263:16: warning: [cppcoreguidelines-init-variables]

    variable 'lblThursday' is not initialized

            wxStaticText* lblThursday;
                          ^
                                      = nullptr
  • src/wxfb/App.cpp:272:16: warning: [cppcoreguidelines-init-variables]

    variable 'lblFriday' is not initialized

            wxStaticText* lblFriday;
                          ^
                                    = nullptr
  • src/wxfb/App.cpp:281:16: warning: [cppcoreguidelines-init-variables]

    variable 'lblSaturday' is not initialized

            wxStaticText* lblSaturday;
                          ^
                                      = nullptr
  • src/wxfb/App.cpp:299:16: warning: [cppcoreguidelines-init-variables]

    variable 'lblStart' is not initialized

            wxStaticText* lblStart;
                          ^
                                   = nullptr
  • src/wxfb/App.cpp:304:16: warning: [cppcoreguidelines-init-variables]

    variable 'm_staticText118' is not initialized

            wxStaticText* m_staticText118;
                          ^
                                          = nullptr
  • src/wxfb/App.cpp:321:26: warning: [cppcoreguidelines-init-variables]

    variable 'szrStandardButtons' is not initialized

            wxStdDialogButtonSizer* szrStandardButtons;
                                    ^
                                                       = nullptr
  • src/wxfb/App.cpp:322:12: warning: [cppcoreguidelines-init-variables]

    variable 'szrStandardButtonsOK' is not initialized

            wxButton* szrStandardButtonsOK;
                      ^
                                           = nullptr
  • src/wxfb/App.cpp:338:25: warning: [modernize-use-equals-default]

    use '= default' to define a trivial destructor

    ExchangeScheduleDialog::~ExchangeScheduleDialog()
                            ^
  • src/wxfb/App.cpp:342:1: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: lblExchangeStatus, lblTradingStatus

    ExchangeStatusDialog::ExchangeStatusDialog( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
    ^
  • src/wxfb/App.cpp:346:14: warning: [cppcoreguidelines-init-variables]

    variable 'vszrContent' is not initialized

            wxBoxSizer* vszrContent;
                        ^
                                    = nullptr
  • src/wxfb/App.cpp:349:15: warning: [cppcoreguidelines-init-variables]

    variable 'gszrStatus' is not initialized

            wxGridSizer* gszrStatus;
                         ^
                                    = nullptr
  • src/wxfb/App.cpp:352:16: warning: [cppcoreguidelines-init-variables]

    variable 'lblExchange' is not initialized

            wxStaticText* lblExchange;
                          ^
                                      = nullptr
  • src/wxfb/App.cpp:361:16: warning: [cppcoreguidelines-init-variables]

    variable 'lblTrading' is not initialized

            wxStaticText* lblTrading;
                          ^
                                     = nullptr
  • src/wxfb/App.cpp:373:26: warning: [cppcoreguidelines-init-variables]

    variable 'szrStandardButtons' is not initialized

            wxStdDialogButtonSizer* szrStandardButtons;
                                    ^
                                                       = nullptr
  • src/wxfb/App.cpp:374:12: warning: [cppcoreguidelines-init-variables]

    variable 'szrStandardButtonsOK' is not initialized

            wxButton* szrStandardButtonsOK;
                      ^
                                           = nullptr
  • src/wxfb/App.cpp:390:23: warning: [modernize-use-equals-default]

    use '= default' to define a trivial destructor

    ExchangeStatusDialog::~ExchangeStatusDialog()
                          ^
  • src/wxfb/App.h:10:10: error: [clang-diagnostic-error]

    'wx/artprov.h' file not found

    #include <wx/artprov.h>
             ^
  • src/wxfb/App.h:35:11: warning: [cppcoreguidelines-avoid-non-const-global-variables]

    variable 'kdeck' is non-const and globally accessible, consider making it const

    namespace kdeck
              ^
  • src/wxfb/PortfolioPanel.cpp:13:1: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: lblBalanceAmount, pnlPositions, fgszrPositions

    PortfolioPanel::PortfolioPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name )
    ^
  • src/wxfb/PortfolioPanel.cpp:15:14: warning: [cppcoreguidelines-init-variables]

    variable 'vszrContent' is not initialized

            wxBoxSizer* vszrContent;
                        ^
                                    = nullptr
  • src/wxfb/PortfolioPanel.cpp:18:14: warning: [cppcoreguidelines-init-variables]

    variable 'hszrPortfolioInfo' is not initialized

            wxBoxSizer* hszrPortfolioInfo;
                        ^
                                          = nullptr
  • src/wxfb/PortfolioPanel.cpp:24:16: warning: [cppcoreguidelines-init-variables]

    variable 'lblBalance' is not initialized

            wxStaticText* lblBalance;
                          ^
                                     = nullptr
  • src/wxfb/PortfolioPanel.cpp:53:17: warning: [modernize-use-equals-default]

    use '= default' to define a trivial destructor

    PortfolioPanel::~PortfolioPanel()
                    ^
  • src/wxfb/PortfolioPanel.h:10:10: error: [clang-diagnostic-error]

    'wx/artprov.h' file not found

    #include <wx/artprov.h>
             ^
  • src/wxfb/PortfolioPanel.h:26:11: warning: [cppcoreguidelines-avoid-non-const-global-variables]

    variable 'kdeck' is non-const and globally accessible, consider making it const

    namespace kdeck
              ^

Have any feedback or feature suggestions? Share it here.

This is required due to interdependencies that were breaking includes in the generated files.
To prevent confusion, namespaces are explicitly added in some places.
@krazkidd krazkidd marked this pull request as ready for review August 11, 2024 20:39
@krazkidd krazkidd merged commit 45cf214 into main Aug 11, 2024
1 check failed
@krazkidd krazkidd deleted the 12-wxformbuilder branch August 11, 2024 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use a designer for building UI
1 participant