diff --git a/common/widgets/bitmap_button.cpp b/common/widgets/bitmap_button.cpp index 9f98d9ac08..dd3d397bd8 100644 --- a/common/widgets/bitmap_button.cpp +++ b/common/widgets/bitmap_button.cpp @@ -42,8 +42,10 @@ BITMAP_BUTTON::BITMAP_BUTTON( wxWindow* aParent, wxWindowID aId, const wxPoint& Bind( wxEVT_PAINT, &BITMAP_BUTTON::OnPaint, this ); Bind( wxEVT_LEFT_UP, &BITMAP_BUTTON::OnLeftButtonUp, this ); Bind( wxEVT_LEFT_DOWN, &BITMAP_BUTTON::OnLeftButtonDown, this ); - Bind( wxEVT_LEAVE_WINDOW, &BITMAP_BUTTON::OnMouseLeave, this ); - Bind( wxEVT_ENTER_WINDOW, &BITMAP_BUTTON::OnMouseEnter, this ); + Bind( wxEVT_LEAVE_WINDOW, &BITMAP_BUTTON::OnLeave, this ); + Bind( wxEVT_ENTER_WINDOW, &BITMAP_BUTTON::OnEnter, this ); + Bind( wxEVT_KILL_FOCUS, &BITMAP_BUTTON::OnLeave, this ); + Bind( wxEVT_SET_FOCUS, &BITMAP_BUTTON::OnEnter, this ); } @@ -74,7 +76,7 @@ void BITMAP_BUTTON::SetDisabledBitmap( const wxBitmap& aBmp ) } -void BITMAP_BUTTON::OnMouseLeave( wxMouseEvent& aEvent ) +void BITMAP_BUTTON::OnLeave( wxEvent& aEvent ) { clearFlag( wxCONTROL_CURRENT ); Refresh(); @@ -83,7 +85,7 @@ void BITMAP_BUTTON::OnMouseLeave( wxMouseEvent& aEvent ) } -void BITMAP_BUTTON::OnMouseEnter( wxMouseEvent& aEvent ) +void BITMAP_BUTTON::OnEnter( wxEvent& aEvent ) { setFlag( wxCONTROL_CURRENT ); Refresh(); diff --git a/include/widgets/bitmap_button.h b/include/widgets/bitmap_button.h index 4ff0ed9eca..1abde2945c 100644 --- a/include/widgets/bitmap_button.h +++ b/include/widgets/bitmap_button.h @@ -80,8 +80,8 @@ public: void Check( bool aCheck = true ); protected: - void OnMouseLeave( wxMouseEvent& aEvent ); - void OnMouseEnter( wxMouseEvent& aEvent ); + void OnLeave( wxEvent& aEvent ); + void OnEnter( wxEvent& aEvent ); void OnLeftButtonUp( wxMouseEvent& aEvent ); void OnLeftButtonDown( wxMouseEvent& aEvent ); void OnPaint( wxPaintEvent& aEvent ); diff --git a/kicad/dialogs/panel_kicad_launcher.h b/kicad/dialogs/panel_kicad_launcher.h index 5e42d6d012..71d74ef413 100644 --- a/kicad/dialogs/panel_kicad_launcher.h +++ b/kicad/dialogs/panel_kicad_launcher.h @@ -33,8 +33,6 @@ public: void CreateLaunchers(); - wxTextCtrl* GetMessagesBox() const { return m_messagesBox; } - private: TOOL_MANAGER* m_toolManager; diff --git a/kicad/dialogs/panel_kicad_launcher_base.cpp b/kicad/dialogs/panel_kicad_launcher_base.cpp index 4de218e3cf..905b3eb928 100644 --- a/kicad/dialogs/panel_kicad_launcher_base.cpp +++ b/kicad/dialogs/panel_kicad_launcher_base.cpp @@ -11,6 +11,9 @@ PANEL_KICAD_LAUNCHER_BASE::PANEL_KICAD_LAUNCHER_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) : wxPanel( parent, id, pos, size, style, name ) { + wxBoxSizer* bSizer2; + bSizer2 = new wxBoxSizer( wxVERTICAL ); + m_mainSizer = new wxBoxSizer( wxVERTICAL ); m_toolsSizer = new wxGridBagSizer( 5, 20 ); @@ -23,21 +26,13 @@ PANEL_KICAD_LAUNCHER_BASE::PANEL_KICAD_LAUNCHER_BASE( wxWindow* parent, wxWindow m_mainSizer->Add( 0, 20, 0, wxEXPAND, 5 ); - wxStaticBoxSizer* sbSizerMessages; - sbSizerMessages = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Messages") ), wxVERTICAL ); - m_messagesBox = new wxTextCtrl( sbSizerMessages->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY ); - m_messagesBox->SetMinSize( wxSize( -1,60 ) ); - - sbSizerMessages->Add( m_messagesBox, 1, wxALL|wxEXPAND, 5 ); + bSizer2->Add( m_mainSizer, 1, wxEXPAND|wxLEFT, 50 ); - m_mainSizer->Add( sbSizerMessages, 1, wxEXPAND|wxLEFT|wxRIGHT, 5 ); - - - this->SetSizer( m_mainSizer ); + this->SetSizer( bSizer2 ); this->Layout(); - m_mainSizer->Fit( this ); + bSizer2->Fit( this ); } PANEL_KICAD_LAUNCHER_BASE::~PANEL_KICAD_LAUNCHER_BASE() diff --git a/kicad/dialogs/panel_kicad_launcher_base.fbp b/kicad/dialogs/panel_kicad_launcher_base.fbp index 34b2d843be..94efd23d98 100644 --- a/kicad/dialogs/panel_kicad_launcher_base.fbp +++ b/kicad/dialogs/panel_kicad_launcher_base.fbp @@ -51,110 +51,43 @@ wxTAB_TRAVERSAL - m_mainSizer + bSizer2 wxVERTICAL - protected + none - 5 - wxALL|wxEXPAND - 0 - - - wxBOTH - - - 20 - - m_toolsSizer - wxFLEX_GROWMODE_NONE - protected - 5 - - - - 5 - wxEXPAND - 0 - - 20 - protected - 0 - - - - 5 - wxEXPAND|wxLEFT|wxRIGHT + 50 + wxEXPAND|wxLEFT 1 - - wxID_ANY - Messages + - sbSizerMessages + m_mainSizer wxVERTICAL - 1 - none + protected 5 wxALL|wxEXPAND - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - - 0 - -1,60 - 1 - m_messagesBox - 1 - - + 0 + + + wxBOTH + + + 20 + + m_toolsSizer + wxFLEX_GROWMODE_NONE protected - 1 - - Resizable - 1 - - wxTE_MULTILINE|wxTE_READONLY - ; ; forward_declare - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - + 5 + + + + 5 + wxEXPAND + 0 + + 20 + protected + 0 diff --git a/kicad/dialogs/panel_kicad_launcher_base.h b/kicad/dialogs/panel_kicad_launcher_base.h index 4aed681e84..c7990b3529 100644 --- a/kicad/dialogs/panel_kicad_launcher_base.h +++ b/kicad/dialogs/panel_kicad_launcher_base.h @@ -12,14 +12,12 @@ #include #include #include -#include -#include +#include +#include #include #include #include -#include -#include -#include +#include /////////////////////////////////////////////////////////////////////////// @@ -34,7 +32,6 @@ class PANEL_KICAD_LAUNCHER_BASE : public wxPanel protected: wxBoxSizer* m_mainSizer; wxGridBagSizer* m_toolsSizer; - wxTextCtrl* m_messagesBox; public: diff --git a/kicad/files-io.cpp b/kicad/files-io.cpp index adb92e401a..078a5fad89 100644 --- a/kicad/files-io.cpp +++ b/kicad/files-io.cpp @@ -85,7 +85,7 @@ void KICAD_MANAGER_FRAME::OnUnarchiveFiles( wxCommandEvent& event ) return; } - WX_TEXT_CTRL_REPORTER reporter( m_launcher->GetMessagesBox() ); + STATUSBAR_REPORTER reporter( GetStatusBar() ); PROJECT_ARCHIVER archiver; @@ -126,8 +126,7 @@ void KICAD_MANAGER_FRAME::OnArchiveFiles( wxCommandEvent& event ) if( !dir.IsOpened() ) // wxWidgets display a error message on issue. return; - WX_TEXT_CTRL_REPORTER reporter( m_launcher->GetMessagesBox() ); - + STATUSBAR_REPORTER reporter( GetStatusBar() ); PROJECT_ARCHIVER archiver; archiver.Archive( currdirname, zipFile.GetFullPath(), reporter, true, true ); diff --git a/kicad/import_project.cpp b/kicad/import_project.cpp index e109d195dc..335db998db 100644 --- a/kicad/import_project.cpp +++ b/kicad/import_project.cpp @@ -55,8 +55,6 @@ void KICAD_MANAGER_FRAME::ImportNonKiCadProject( wxString aWindowTitle, wxString wxString default_dir = GetMruPath(); int style = wxFD_OPEN | wxFD_FILE_MUST_EXIST; - ClearMsg(); - wxFileDialog schdlg( this, aWindowTitle, default_dir, wxEmptyString, aFilesWildcard, style ); if( schdlg.ShowModal() == wxID_CANCEL ) diff --git a/kicad/kicad_manager_frame.cpp b/kicad/kicad_manager_frame.cpp index 8c2193ccba..b2732897d2 100644 --- a/kicad/kicad_manager_frame.cpp +++ b/kicad/kicad_manager_frame.cpp @@ -106,10 +106,10 @@ KICAD_MANAGER_FRAME::KICAD_MANAGER_FRAME( wxWindow* parent, const wxString& titl m_aboutTitle = "KiCad"; // Create the status line (bottom of the frame) - static const int dims[3] = { -1, -1, 100 }; + static const int dims[1] = { -1 }; - CreateStatusBar( 3 ); - SetStatusWidths( 3, dims ); + CreateStatusBar( 1 ); + SetStatusWidths( 1, dims ); // Give an icon wxIcon icon; @@ -152,7 +152,8 @@ KICAD_MANAGER_FRAME::KICAD_MANAGER_FRAME( wxWindow* parent, const wxString& titl .MinSize( m_leftWinWidth, -1 ).BestSize( m_leftWinWidth, -1 ) ); m_auimgr.AddPane( m_launcher, - EDA_PANE().Canvas().PaneBorder( false ).Name( "Launcher" ).Center() ); + EDA_PANE().Canvas().PaneBorder( false ).Name( "Launcher" ).Center() + .MinSize( m_launcher->GetBestSize() ) ); m_auimgr.Update(); @@ -164,6 +165,9 @@ KICAD_MANAGER_FRAME::KICAD_MANAGER_FRAME( wxWindow* parent, const wxString& titl // Do not let the messages window have initial focus m_leftWin->SetFocus(); + // Do not let our size hide the launcher + SetMinSize( GetBestSize() ); + // Ensure the window is on top Raise(); } @@ -311,12 +315,6 @@ wxString KICAD_MANAGER_FRAME::help_name() } -void KICAD_MANAGER_FRAME::PrintMsg( const wxString& aText ) -{ - m_launcher->GetMessagesBox()->AppendText( aText ); -} - - void KICAD_MANAGER_FRAME::OnSize( wxSizeEvent& event ) { if( m_auimgr.GetManagedWindow() ) @@ -402,7 +400,7 @@ bool KICAD_MANAGER_FRAME::CloseProject( bool aSave ) mgr.UnloadProject( &Prj() ); } - ClearMsg(); + SetStatusText( "" ); m_leftWin->EmptyTreePrj(); @@ -619,12 +617,6 @@ void KICAD_MANAGER_FRAME::ProjectChanged() } -void KICAD_MANAGER_FRAME::ClearMsg() -{ - m_launcher->GetMessagesBox()->Clear(); -} - - void KICAD_MANAGER_FRAME::LoadSettings( APP_SETTINGS_BASE* aCfg ) { EDA_BASE_FRAME::LoadSettings( aCfg ); @@ -658,8 +650,7 @@ void KICAD_MANAGER_FRAME::InstallPreferences( PAGED_DIALOG* aParent, void KICAD_MANAGER_FRAME::PrintPrjInfo() { - wxString msg = wxString::Format( _( "Project name:\n%s\n" ), GetProjectFileName() ); - PrintMsg( msg ); + SetStatusText( wxString::Format( _( "Project: %s" ), Prj().GetProjectFullName() ) ); } diff --git a/kicad/kicad_manager_frame.h b/kicad/kicad_manager_frame.h index c234205227..ffb70010ce 100644 --- a/kicad/kicad_manager_frame.h +++ b/kicad/kicad_manager_frame.h @@ -95,23 +95,11 @@ public: */ void OnImportEagleFiles( wxCommandEvent& event ); - /** - * Displays \a aText in the text panel. - * - * @param aText The text to display. - */ - void PrintMsg( const wxString& aText ); - /** * Prints the current working directory name and the project name on the text panel. */ void PrintPrjInfo(); - /** - * Erase the text panel. - */ - void ClearMsg(); - void RefreshProjectTree(); /** diff --git a/kicad/tools/kicad_manager_control.cpp b/kicad/tools/kicad_manager_control.cpp index 3d5859f93e..74891e55cd 100644 --- a/kicad/tools/kicad_manager_control.cpp +++ b/kicad/tools/kicad_manager_control.cpp @@ -232,8 +232,6 @@ int KICAD_MANAGER_CONTROL::NewFromTemplate( const TOOL_EVENT& aEvent ) return -1; } - m_frame->ClearMsg(); - // Make sure we are not overwriting anything in the destination folder. std::vector< wxFileName > destFiles;