From 5cd42634a30884507da0e8812369192c3882bc0a Mon Sep 17 00:00:00 2001 From: Steve Brokenshire Date: Wed, 25 Nov 2015 11:55:13 +0000 Subject: [PATCH] Fixed tabs on certain forms so that they show the first tab and added QuitApp to OnClose of frmMain. --- source/AppXestiaAddrBk.cpp | 31 +++++++++++-------------------- source/AppXestiaAddrBk.h | 8 ++++---- 2 files changed, 15 insertions(+), 24 deletions(-) diff --git a/source/AppXestiaAddrBk.cpp b/source/AppXestiaAddrBk.cpp index 63e06ce..e754057 100644 --- a/source/AppXestiaAddrBk.cpp +++ b/source/AppXestiaAddrBk.cpp @@ -183,20 +183,9 @@ frmMainADT::frmMainADT( wxWindow* parent, wxWindowID id, const wxString& title, m_splitter13->SetMinimumPaneSize( 1 ); m_panel19 = new wxPanel( m_splitter13, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - szrContactList = new wxFlexGridSizer( 0, 1, 0, 0 ); - szrContactList->AddGrowableCol( 0 ); - szrContactList->AddGrowableRow( 1 ); - szrContactList->SetFlexibleDirection( wxBOTH ); - szrContactList->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + szrContactList = new wxBoxSizer( wxVERTICAL ); - szrAccList = new wxFlexGridSizer( 0, 2, 0, 0 ); - szrAccList->SetFlexibleDirection( wxVERTICAL ); - szrAccList->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - - szrContactList->Add( szrAccList, 0, 0, 5 ); - - lstContacts = new wxListCtrl( m_panel19, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_NO_HEADER|wxLC_REPORT|wxSUNKEN_BORDER ); + lstContacts = new wxListCtrl( m_panel19, wxID_ANY, wxDefaultPosition, wxSize( 50,-1 ), wxLC_NO_HEADER|wxLC_REPORT|wxSUNKEN_BORDER ); szrContactList->Add( lstContacts, 1, wxALL|wxEXPAND, 5 ); @@ -214,7 +203,7 @@ frmMainADT::frmMainADT( wxWindow* parent, wxWindowID id, const wxString& title, m_panel20->SetSizer( bSizer12 ); m_panel20->Layout(); bSizer12->Fit( m_panel20 ); - m_splitter13->SplitVertically( m_panel19, m_panel20, 314 ); + m_splitter13->SplitVertically( m_panel19, m_panel20, 201 ); szrMain->Add( m_splitter13, 1, wxEXPAND, 5 ); @@ -225,6 +214,7 @@ frmMainADT::frmMainADT( wxWindow* parent, wxWindowID id, const wxString& title, this->Centre( wxBOTH ); // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( frmMainADT::QuitApp ) ); this->Connect( mnuNewAB->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( frmMainADT::OpenNewABDialog ) ); this->Connect( mnuRefreshAB->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( frmMainADT::RefreshAddressBook ) ); this->Connect( mnuImport->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( frmMainADT::OpenImportDialog ) ); @@ -259,6 +249,7 @@ frmMainADT::frmMainADT( wxWindow* parent, wxWindowID id, const wxString& title, frmMainADT::~frmMainADT() { // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( frmMainADT::QuitApp ) ); this->Disconnect( ID_MANAGE_NEWAB, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( frmMainADT::OpenNewABDialog ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( frmMainADT::RefreshAddressBook ) ); this->Disconnect( ID_IMPORT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( frmMainADT::OpenImportDialog ) ); @@ -542,7 +533,7 @@ frmPreferencesADT::frmPreferencesADT( wxWindow* parent, wxWindowID id, const wxS tabGeneral->SetSizer( szrChecks ); tabGeneral->Layout(); szrChecks->Fit( tabGeneral ); - NbtPreferences->AddPage( tabGeneral, wxT("General"), false ); + NbtPreferences->AddPage( tabGeneral, wxT("General"), true ); tabTheme = new wxPanel( NbtPreferences, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); tabTheme->Hide(); @@ -581,7 +572,7 @@ frmPreferencesADT::frmPreferencesADT( wxWindow* parent, wxWindowID id, const wxS tabTheme->SetSizer( szrTheme ); tabTheme->Layout(); szrTheme->Fit( tabTheme ); - NbtPreferences->AddPage( tabTheme, wxT("Themes"), true ); + NbtPreferences->AddPage( tabTheme, wxT("Themes"), false ); tabAccounts = new wxPanel( NbtPreferences, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxGridSizer* szrAccounts; szrAccounts = new wxGridSizer( 1, 1, 0, 0 ); @@ -3868,7 +3859,7 @@ frmContactEditorAddressADT::frmContactEditorAddressADT( wxWindow* parent, wxWind tabGeneral->SetSizer( fgSizer6 ); tabGeneral->Layout(); fgSizer6->Fit( tabGeneral ); - nbkAddress->AddPage( tabGeneral, wxT("General"), false ); + nbkAddress->AddPage( tabGeneral, wxT("General"), true ); tabLabel = new wxPanel( nbkAddress, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bSizer253; bSizer253 = new wxBoxSizer( wxVERTICAL ); @@ -3884,7 +3875,7 @@ frmContactEditorAddressADT::frmContactEditorAddressADT( wxWindow* parent, wxWind tabLabel->SetSizer( bSizer253 ); tabLabel->Layout(); bSizer253->Fit( tabLabel ); - nbkAddress->AddPage( tabLabel, wxT("Label"), true ); + nbkAddress->AddPage( tabLabel, wxT("Label"), false ); tabOther = new wxPanel( nbkAddress, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxFlexGridSizer* fgSizer61; fgSizer61 = new wxFlexGridSizer( 0, 2, 0, 0 ); @@ -6967,7 +6958,7 @@ frmSSLCertificateADT::frmSSLCertificateADT( wxWindow* parent, wxWindowID id, con tabSummary->SetSizer( bSizer386 ); tabSummary->Layout(); bSizer386->Fit( tabSummary ); - m_notebook28->AddPage( tabSummary, wxT("Summary"), false ); + m_notebook28->AddPage( tabSummary, wxT("Summary"), true ); tabDetail = new wxPanel( m_notebook28, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bSizer3891; bSizer3891 = new wxBoxSizer( wxVERTICAL ); @@ -7010,7 +7001,7 @@ frmSSLCertificateADT::frmSSLCertificateADT( wxWindow* parent, wxWindowID id, con tabHierarchy->SetSizer( bSizer390 ); tabHierarchy->Layout(); bSizer390->Fit( tabHierarchy ); - m_notebook28->AddPage( tabHierarchy, wxT("Hierarchy"), true ); + m_notebook28->AddPage( tabHierarchy, wxT("Hierarchy"), false ); bSizer384->Add( m_notebook28, 1, wxEXPAND|wxLEFT|wxRIGHT|wxTOP, 5 ); diff --git a/source/AppXestiaAddrBk.h b/source/AppXestiaAddrBk.h index 04e23b7..97dba60 100644 --- a/source/AppXestiaAddrBk.h +++ b/source/AppXestiaAddrBk.h @@ -96,14 +96,14 @@ class frmMainADT : public wxFrame wxComboCtrl* AccCtrl; wxSplitterWindow* m_splitter13; wxPanel* m_panel19; - wxFlexGridSizer* szrContactList; - wxFlexGridSizer* szrAccList; + wxBoxSizer* szrContactList; wxListCtrl* lstContacts; wxPanel* m_panel20; wxHtmlWindow* htmContactData; wxStatusBar* stbBottom; // Virtual event handlers, overide them in your derived class + virtual void QuitApp( wxCloseEvent& event ) { event.Skip(); } virtual void OpenNewABDialog( wxCommandEvent& event ) { event.Skip(); } virtual void RefreshAddressBook( wxCommandEvent& event ) { event.Skip(); } virtual void OpenImportDialog( wxCommandEvent& event ) { event.Skip(); } @@ -136,13 +136,13 @@ class frmMainADT : public wxFrame public: - frmMainADT( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Xestia Address Book"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 500,300 ), long style = wxDEFAULT_FRAME_STYLE ); + frmMainADT( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxT("Xestia Address Book"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 745,476 ), long style = wxDEFAULT_FRAME_STYLE ); ~frmMainADT(); void m_splitter13OnIdle( wxIdleEvent& ) { - m_splitter13->SetSashPosition( 314 ); + m_splitter13->SetSashPosition( 201 ); m_splitter13->Disconnect( wxEVT_IDLE, wxIdleEventHandler( frmMainADT::m_splitter13OnIdle ), NULL, this ); } -- 2.39.5