Skip to content

Commit

Permalink
Don't use two-step creation for MainFrame.
Browse files Browse the repository at this point in the history
  • Loading branch information
krazkidd committed Aug 11, 2024
1 parent 8d499d4 commit 51f1b65
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 20 deletions.
18 changes: 1 addition & 17 deletions src/wxfb/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,8 @@
///////////////////////////////////////////////////////////////////////////
using namespace kdeck::wxfb;

MainFrame::MainFrame()
MainFrame::MainFrame( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style )

Check warning on line 13 in src/wxfb/App.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

src/wxfb/App.cpp:13:1 [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 )
{
this->Create( parent, id, title, pos, size, style );
}

bool MainFrame::Create( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style )
{
if ( !wxFrame::Create( parent, id, title, pos, size, style ) )
{
return false;
}

this->SetSizeHints( wxDefaultSize, wxDefaultSize );

wxBoxSizer* vszrRoot;

Check warning on line 17 in src/wxfb/App.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

src/wxfb/App.cpp:17:14 [cppcoreguidelines-init-variables]

variable 'vszrRoot' is not initialized
Expand Down Expand Up @@ -110,8 +96,6 @@ bool MainFrame::Create( wxWindow* parent, wxWindowID id, const wxString& title,
mnuExchange->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnMenuItemSelected ), this, mnuItemExchangeStatus->GetId());
mnuView->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnMenuItemSelected ), this, mnuShowClosedPositions->GetId());
mnuHelp->Bind(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainFrame::OnMenuItemSelected ), this, mnuAbout->GetId());

return true;
}

MainFrame::~MainFrame()

Check warning on line 101 in src/wxfb/App.cpp

View workflow job for this annotation

GitHub Actions / cpp-linter

src/wxfb/App.cpp:101:12 [modernize-use-equals-default]

use '= default' to define a trivial destructor
Expand Down
2 changes: 1 addition & 1 deletion src/wxfb/App.fbp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
<property name="subclass">; ; forward_declare</property>
<property name="title"></property>
<property name="tooltip"></property>
<property name="two_step_creation">1</property>
<property name="two_step_creation">0</property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
Expand Down
2 changes: 0 additions & 2 deletions src/wxfb/App.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,7 @@ namespace kdeck

public:

MainFrame();
MainFrame( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 800,600 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL );
bool Create( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 800,600 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL );

~MainFrame();

Expand Down

0 comments on commit 51f1b65

Please sign in to comment.