From 51f1b65e2b03856fd09fc784f5dfee515b9c44f1 Mon Sep 17 00:00:00 2001 From: Mark Ross <6730333+krazkidd@users.noreply.github.com> Date: Sun, 11 Aug 2024 16:55:55 -0700 Subject: [PATCH] Don't use two-step creation for MainFrame. --- src/wxfb/App.cpp | 18 +----------------- src/wxfb/App.fbp | 2 +- src/wxfb/App.h | 2 -- 3 files changed, 2 insertions(+), 20 deletions(-) diff --git a/src/wxfb/App.cpp b/src/wxfb/App.cpp index b5e7810..2b63084 100644 --- a/src/wxfb/App.cpp +++ b/src/wxfb/App.cpp @@ -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 ) { -} - -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; @@ -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() diff --git a/src/wxfb/App.fbp b/src/wxfb/App.fbp index 62d506c..add5f74 100644 --- a/src/wxfb/App.fbp +++ b/src/wxfb/App.fbp @@ -55,7 +55,7 @@ ; ; forward_declare - 1 + 0 wxTAB_TRAVERSAL diff --git a/src/wxfb/App.h b/src/wxfb/App.h index c4de319..613fab1 100644 --- a/src/wxfb/App.h +++ b/src/wxfb/App.h @@ -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();