Fix some issues with Infobar sizing.
This also commits to the new strategy as it wasn't really compatible with if-def-ing anymore.
This commit is contained in:
parent
525934881f
commit
73b7b104cd
|
@ -89,11 +89,9 @@ PANEL_PREV_3D::PANEL_PREV_3D( wxWindow* aParent, PCB_BASE_FRAME* aFrame, FOOTPRI
|
||||||
m_dummyFootprint = new FOOTPRINT( *aFootprint );
|
m_dummyFootprint = new FOOTPRINT( *aFootprint );
|
||||||
m_dummyBoard->Add( m_dummyFootprint );
|
m_dummyBoard->Add( m_dummyFootprint );
|
||||||
|
|
||||||
// Create the infobar
|
|
||||||
m_infobar = new WX_INFOBAR( this );
|
|
||||||
|
|
||||||
// Create the 3D canvas
|
// Create the 3D canvas
|
||||||
m_previewPane = new EDA_3D_CANVAS( this, COGL_ATT_LIST::GetAttributesList( ANTIALIASING_MODE::AA_8X ),
|
m_previewPane = new EDA_3D_CANVAS( this,
|
||||||
|
COGL_ATT_LIST::GetAttributesList( ANTIALIASING_MODE::AA_8X ),
|
||||||
m_dummyBoard, m_boardAdapter, m_currentCamera,
|
m_dummyBoard, m_boardAdapter, m_currentCamera,
|
||||||
aFrame->Prj().Get3DCacheManager() );
|
aFrame->Prj().Get3DCacheManager() );
|
||||||
|
|
||||||
|
@ -119,8 +117,7 @@ PANEL_PREV_3D::PANEL_PREV_3D( wxWindow* aParent, PCB_BASE_FRAME* aFrame, FOOTPRI
|
||||||
m_SizerPanelView->Add( m_infobar, 0, wxEXPAND, 0 );
|
m_SizerPanelView->Add( m_infobar, 0, wxEXPAND, 0 );
|
||||||
m_SizerPanelView->Add( m_previewPane, 1, wxEXPAND, 5 );
|
m_SizerPanelView->Add( m_previewPane, 1, wxEXPAND, 5 );
|
||||||
|
|
||||||
// Tell the canvas about the infobar
|
m_infobar = new WX_INFOBAR( this );
|
||||||
if( m_infobar )
|
|
||||||
m_previewPane->SetInfoBar( m_infobar );
|
m_previewPane->SetInfoBar( m_infobar );
|
||||||
|
|
||||||
for( wxEventType eventType : { wxEVT_MENU_OPEN, wxEVT_MENU_CLOSE, wxEVT_MENU_HIGHLIGHT } )
|
for( wxEventType eventType : { wxEVT_MENU_OPEN, wxEVT_MENU_CLOSE, wxEVT_MENU_HIGHLIGHT } )
|
||||||
|
|
|
@ -141,31 +141,19 @@ EDA_3D_VIEWER::EDA_3D_VIEWER( KIWAY *aKiway, PCB_BASE_FRAME *aParent, const wxSt
|
||||||
CreateMenuBar();
|
CreateMenuBar();
|
||||||
ReCreateMainToolbar();
|
ReCreateMainToolbar();
|
||||||
|
|
||||||
// Create the infobar
|
|
||||||
m_infoBar = new WX_INFOBAR( this, &m_auimgr );
|
|
||||||
|
|
||||||
m_auimgr.SetManagedWindow( this );
|
m_auimgr.SetManagedWindow( this );
|
||||||
|
|
||||||
m_auimgr.AddPane( m_mainToolBar,
|
m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" )
|
||||||
EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer( 6 ) );
|
.Top().Layer( 6 ) );
|
||||||
m_auimgr.AddPane( m_infoBar,
|
m_auimgr.AddPane( m_canvas, EDA_PANE().Canvas().Name( "DrawFrame" )
|
||||||
EDA_PANE().InfoBar().Name( "InfoBar" ).Top().Layer(1) );
|
.Center() );
|
||||||
m_auimgr.AddPane( m_canvas,
|
|
||||||
EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
|
|
||||||
|
|
||||||
// Call Update() to fix all pane default sizes, especially the "InfoBar" pane before
|
// Call Update() to fix all pane default sizes.
|
||||||
// hidding it.
|
|
||||||
m_auimgr.Update();
|
m_auimgr.Update();
|
||||||
|
|
||||||
// We don't want the infobar displayed right away
|
m_infoBar = new WX_INFOBAR( m_canvas );
|
||||||
m_auimgr.GetPane( "InfoBar" ).Hide();
|
|
||||||
m_auimgr.Update();
|
|
||||||
|
|
||||||
if( m_canvas )
|
|
||||||
{
|
|
||||||
m_canvas->SetInfoBar( m_infoBar );
|
m_canvas->SetInfoBar( m_infoBar );
|
||||||
m_canvas->SetStatusBar( status_bar );
|
m_canvas->SetStatusBar( status_bar );
|
||||||
}
|
|
||||||
|
|
||||||
// Fixes bug in Windows (XP and possibly others) where the canvas requires the focus
|
// Fixes bug in Windows (XP and possibly others) where the canvas requires the focus
|
||||||
// in order to receive mouse events. Otherwise, the user has to click somewhere on
|
// in order to receive mouse events. Otherwise, the user has to click somewhere on
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
#include <id.h>
|
#include <id.h>
|
||||||
#include <widgets/infobar.h>
|
#include <widgets/infobar.h>
|
||||||
#include "wx/artprov.h"
|
#include "wx/artprov.h"
|
||||||
#include <wx/aui/framemanager.h>
|
|
||||||
#include <wx/debug.h>
|
#include <wx/debug.h>
|
||||||
#include <wx/infobar.h>
|
#include <wx/infobar.h>
|
||||||
#include <wx/sizer.h>
|
#include <wx/sizer.h>
|
||||||
|
@ -41,23 +40,16 @@ BEGIN_EVENT_TABLE( WX_INFOBAR, wxInfoBarGeneric )
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
|
||||||
WX_INFOBAR::WX_INFOBAR( wxWindow* aParent, wxAuiManager* aMgr, wxWindowID aWinid )
|
WX_INFOBAR::WX_INFOBAR( wxWindow* aParent, wxWindowID aWinid )
|
||||||
: wxInfoBarGeneric( aParent, aWinid ),
|
: wxInfoBarGeneric( aParent, aWinid ),
|
||||||
m_showTime( 0 ),
|
m_showTime( 0 ),
|
||||||
m_updateLock( false ),
|
m_updateLock( false ),
|
||||||
m_showTimer( nullptr ),
|
m_showTimer( nullptr )
|
||||||
m_auiManager( aMgr )
|
|
||||||
{
|
{
|
||||||
m_showTimer = new wxTimer( this, ID_CLOSE_INFOBAR );
|
m_showTimer = new wxTimer( this, ID_CLOSE_INFOBAR );
|
||||||
|
|
||||||
#if 1
|
|
||||||
m_auiManager = nullptr;
|
|
||||||
SetShowHideEffects( wxSHOW_EFFECT_ROLL_TO_BOTTOM, wxSHOW_EFFECT_ROLL_TO_TOP );
|
SetShowHideEffects( wxSHOW_EFFECT_ROLL_TO_BOTTOM, wxSHOW_EFFECT_ROLL_TO_TOP );
|
||||||
SetEffectDuration( 300 );
|
SetEffectDuration( 300 );
|
||||||
#else
|
|
||||||
// Don't use any effects since they leave the sizer area visible under the infobar
|
|
||||||
SetShowHideEffects( wxSHOW_EFFECT_NONE, wxSHOW_EFFECT_NONE );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// The infobar seems to start too small, so increase its height
|
// The infobar seems to start too small, so increase its height
|
||||||
int sx, sy;
|
int sx, sy;
|
||||||
|
@ -78,6 +70,8 @@ WX_INFOBAR::WX_INFOBAR( wxWindow* aParent, wxAuiManager* aMgr, wxWindowID aWinid
|
||||||
RemoveAllButtons();
|
RemoveAllButtons();
|
||||||
|
|
||||||
Layout();
|
Layout();
|
||||||
|
|
||||||
|
m_parent->Bind( wxEVT_SIZE, &WX_INFOBAR::onSize, this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -133,9 +127,6 @@ void WX_INFOBAR::ShowMessage( const wxString& aMessage, int aFlags )
|
||||||
|
|
||||||
wxInfoBarGeneric::ShowMessage( aMessage, aFlags );
|
wxInfoBarGeneric::ShowMessage( aMessage, aFlags );
|
||||||
|
|
||||||
if( m_auiManager )
|
|
||||||
UpdateAuiLayout( true );
|
|
||||||
|
|
||||||
if( m_showTime > 0 )
|
if( m_showTime > 0 )
|
||||||
m_showTimer->StartOnce( m_showTime );
|
m_showTimer->StartOnce( m_showTime );
|
||||||
|
|
||||||
|
@ -153,30 +144,19 @@ void WX_INFOBAR::Dismiss()
|
||||||
|
|
||||||
wxInfoBarGeneric::Dismiss();
|
wxInfoBarGeneric::Dismiss();
|
||||||
|
|
||||||
if( m_auiManager )
|
|
||||||
UpdateAuiLayout( false );
|
|
||||||
|
|
||||||
m_updateLock = false;
|
m_updateLock = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WX_INFOBAR::UpdateAuiLayout( bool aShow )
|
void WX_INFOBAR::onSize( wxSizeEvent& aEvent )
|
||||||
{
|
{
|
||||||
wxASSERT( m_auiManager );
|
int barWidth = GetSize().GetWidth();
|
||||||
|
int parentWidth = m_parent->GetSize().GetWidth();
|
||||||
|
|
||||||
wxAuiPaneInfo& pane = m_auiManager->GetPane( this );
|
if( barWidth != parentWidth )
|
||||||
|
SetSize( parentWidth, GetSize().GetHeight() );
|
||||||
|
|
||||||
// If the infobar is in a pane, then show/hide the pane
|
aEvent.Skip();
|
||||||
if( pane.IsOk() )
|
|
||||||
{
|
|
||||||
if( aShow )
|
|
||||||
pane.Show();
|
|
||||||
else
|
|
||||||
pane.Hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update the AUI manager regardless
|
|
||||||
m_auiManager->Update();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -127,24 +127,21 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( KIWAY* aKiway, wxWindow* aPa
|
||||||
ReCreateVToolbar();
|
ReCreateVToolbar();
|
||||||
ReCreateOptToolbar();
|
ReCreateOptToolbar();
|
||||||
|
|
||||||
// Create the infobar
|
|
||||||
m_infoBar = new WX_INFOBAR( this, &m_auimgr );
|
|
||||||
|
|
||||||
m_auimgr.SetManagedWindow( this );
|
m_auimgr.SetManagedWindow( this );
|
||||||
|
|
||||||
m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer(6) );
|
m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" )
|
||||||
m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" ).Left().Layer(3) );
|
.Top().Layer( 6 ) );
|
||||||
m_auimgr.AddPane( m_infoBar, EDA_PANE().InfoBar().Name( "InfoBar" ).Top().Layer(1) );
|
m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" )
|
||||||
m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
|
.Left().Layer( 3 ) );
|
||||||
m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ).Bottom().Layer(6) );
|
m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" )
|
||||||
|
.Center() );
|
||||||
|
m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" )
|
||||||
|
.Bottom().Layer( 6 ) );
|
||||||
|
|
||||||
// Call Update() to fix all pane default sizes, especially the "InfoBar" pane before
|
// Call Update() to fix all pane default sizes.
|
||||||
// hidding it.
|
|
||||||
m_auimgr.Update();
|
m_auimgr.Update();
|
||||||
|
|
||||||
// We don't want the infobar displayed right away
|
m_infoBar = new WX_INFOBAR( GetCanvas() );
|
||||||
m_auimgr.GetPane( "InfoBar" ).Hide();
|
|
||||||
m_auimgr.Update();
|
|
||||||
|
|
||||||
auto& galOpts = GetGalDisplayOptions();
|
auto& galOpts = GetGalDisplayOptions();
|
||||||
galOpts.m_axesEnabled = true;
|
galOpts.m_axesEnabled = true;
|
||||||
|
|
|
@ -241,9 +241,6 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||||
ReCreateVToolbar();
|
ReCreateVToolbar();
|
||||||
ReCreateOptToolbar();
|
ReCreateOptToolbar();
|
||||||
|
|
||||||
// Create the infobar
|
|
||||||
m_infoBar = new WX_INFOBAR( this, &m_auimgr );
|
|
||||||
|
|
||||||
// Initialize common print setup dialog settings.
|
// Initialize common print setup dialog settings.
|
||||||
m_pageSetupData.GetPrintData().SetPrintMode( wxPRINT_MODE_PRINTER );
|
m_pageSetupData.GetPrintData().SetPrintMode( wxPRINT_MODE_PRINTER );
|
||||||
m_pageSetupData.GetPrintData().SetQuality( wxPRINT_QUALITY_MEDIUM );
|
m_pageSetupData.GetPrintData().SetQuality( wxPRINT_QUALITY_MEDIUM );
|
||||||
|
@ -252,26 +249,21 @@ SCH_EDIT_FRAME::SCH_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||||
|
|
||||||
m_auimgr.SetManagedWindow( this );
|
m_auimgr.SetManagedWindow( this );
|
||||||
|
|
||||||
m_auimgr.AddPane( m_mainToolBar,
|
m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" )
|
||||||
EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer(6) );
|
.Top().Layer( 6 ) );
|
||||||
m_auimgr.AddPane( m_optionsToolBar,
|
m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" )
|
||||||
EDA_PANE().VToolbar().Name( "OptToolbar" ).Left().Layer(3) );
|
.Left().Layer( 3 ) );
|
||||||
m_auimgr.AddPane( m_drawToolBar,
|
m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( "ToolsToolbar" )
|
||||||
EDA_PANE().VToolbar().Name( "ToolsToolbar" ).Right().Layer(2) );
|
.Right().Layer( 2 ) );
|
||||||
m_auimgr.AddPane( m_infoBar,
|
m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" )
|
||||||
EDA_PANE().InfoBar().Name( "InfoBar" ).Top().Layer(1) );
|
.Center() );
|
||||||
m_auimgr.AddPane( GetCanvas(),
|
m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" )
|
||||||
EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
|
.Bottom().Layer( 6 ) );
|
||||||
m_auimgr.AddPane( m_messagePanel,
|
|
||||||
EDA_PANE().Messages().Name( "MsgPanel" ).Bottom().Layer(6) );
|
|
||||||
|
|
||||||
// Call Update() to fix all pane default sizes, especially the "InfoBar" pane before
|
// Call Update() to fix all pane default sizes.
|
||||||
// hidding it.
|
|
||||||
m_auimgr.Update();
|
m_auimgr.Update();
|
||||||
|
|
||||||
// We don't want the infobar displayed right away
|
m_infoBar = new WX_INFOBAR( GetCanvas() );
|
||||||
m_auimgr.GetPane( "InfoBar" ).Hide();
|
|
||||||
m_auimgr.Update();
|
|
||||||
|
|
||||||
resolveCanvasType();
|
resolveCanvasType();
|
||||||
SwitchCanvas( m_canvasType );
|
SwitchCanvas( m_canvasType );
|
||||||
|
|
|
@ -145,32 +145,29 @@ SYMBOL_EDIT_FRAME::SYMBOL_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||||
DisplaySymbolDatasheet();
|
DisplaySymbolDatasheet();
|
||||||
RebuildSymbolUnitsList();
|
RebuildSymbolUnitsList();
|
||||||
|
|
||||||
// Create the infobar
|
|
||||||
m_infoBar = new WX_INFOBAR( this, &m_auimgr );
|
|
||||||
|
|
||||||
m_auimgr.SetManagedWindow( this );
|
m_auimgr.SetManagedWindow( this );
|
||||||
|
|
||||||
m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer(6) );
|
m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" )
|
||||||
m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ).Bottom().Layer(6) );
|
.Top().Layer( 6 ) );
|
||||||
|
m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" )
|
||||||
|
.Bottom().Layer( 6 ) );
|
||||||
|
|
||||||
m_auimgr.AddPane( m_optionsToolBar,
|
m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" )
|
||||||
EDA_PANE().VToolbar().Name( "OptToolbar" ).Left().Layer(3) );
|
.Left().Layer( 3 ) );
|
||||||
m_auimgr.AddPane( m_treePane, EDA_PANE().Palette().Name( "ComponentTree" ).Left().Layer(2)
|
m_auimgr.AddPane( m_treePane, EDA_PANE().Palette().Name( "ComponentTree" )
|
||||||
.Caption( _( "Libraries" ) ).MinSize( 250, -1 ).BestSize( 250, -1 ) );
|
.Left().Layer( 2 )
|
||||||
m_auimgr.AddPane( m_drawToolBar,
|
.Caption( _( "Libraries" ) )
|
||||||
EDA_PANE().VToolbar().Name( "ToolsToolbar" ).Right().Layer(2) );
|
.MinSize( 250, -1 ).BestSize( 250, -1 ) );
|
||||||
m_auimgr.AddPane( m_infoBar,
|
m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( "ToolsToolbar" )
|
||||||
EDA_PANE().InfoBar().Name( "InfoBar" ).Top().Layer(1) );
|
.Right().Layer( 2 ) );
|
||||||
|
|
||||||
m_auimgr.AddPane( GetCanvas(), wxAuiPaneInfo().Name( "DrawFrame" ).CentrePane() );
|
m_auimgr.AddPane( GetCanvas(), wxAuiPaneInfo().Name( "DrawFrame" )
|
||||||
|
.CentrePane() );
|
||||||
|
|
||||||
// Call Update() to fix all pane default sizes, especially the "InfoBar" pane before
|
// Call Update() to fix all pane default sizes.
|
||||||
// hidding it.
|
|
||||||
m_auimgr.Update();
|
m_auimgr.Update();
|
||||||
|
|
||||||
// We don't want the infobar displayed right away
|
m_infoBar = new WX_INFOBAR( GetCanvas() );
|
||||||
m_auimgr.GetPane( "InfoBar" ).Hide();
|
|
||||||
m_auimgr.Update();
|
|
||||||
|
|
||||||
if( m_settings->m_LibWidth > 0 )
|
if( m_settings->m_LibWidth > 0 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
#include <wx/wx.h>
|
#include <wx/wx.h>
|
||||||
|
|
||||||
|
|
||||||
class wxAuiManager;
|
|
||||||
class wxHyperlinkCtrl;
|
class wxHyperlinkCtrl;
|
||||||
|
|
||||||
|
|
||||||
|
@ -77,7 +76,7 @@ public:
|
||||||
* @param aMgr is the AUI manager that this infobar is added to
|
* @param aMgr is the AUI manager that this infobar is added to
|
||||||
* @param aWinId is the ID for this infobar object
|
* @param aWinId is the ID for this infobar object
|
||||||
*/
|
*/
|
||||||
WX_INFOBAR( wxWindow* aParent, wxAuiManager* aMgr = nullptr, wxWindowID aWinid = wxID_ANY );
|
WX_INFOBAR( wxWindow* aParent, wxWindowID aWinid = wxID_ANY );
|
||||||
|
|
||||||
~WX_INFOBAR();
|
~WX_INFOBAR();
|
||||||
|
|
||||||
|
@ -199,17 +198,12 @@ protected:
|
||||||
*/
|
*/
|
||||||
void OnTimer( wxTimerEvent& aEvent );
|
void OnTimer( wxTimerEvent& aEvent );
|
||||||
|
|
||||||
/**
|
void onSize( wxSizeEvent& aEvent );
|
||||||
* Update the AUI pane to show or hide this infobar.
|
|
||||||
*
|
|
||||||
* @param aShow is true to show the pane
|
|
||||||
*/
|
|
||||||
void UpdateAuiLayout( bool aShow );
|
|
||||||
|
|
||||||
|
protected:
|
||||||
int m_showTime; ///< The time to show the infobar. 0 = don't auto hide
|
int m_showTime; ///< The time to show the infobar. 0 = don't auto hide
|
||||||
bool m_updateLock; ///< True if this infobar requested the UI update
|
bool m_updateLock; ///< True if this infobar requested the UI update
|
||||||
wxTimer* m_showTimer; ///< The timer counting the autoclose period
|
wxTimer* m_showTimer; ///< The timer counting the autoclose period
|
||||||
wxAuiManager* m_auiManager; ///< The AUI manager that contains this infobar
|
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
|
|
@ -118,9 +118,6 @@ PL_EDITOR_FRAME::PL_EDITOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||||
ReCreateVToolbar();
|
ReCreateVToolbar();
|
||||||
ReCreateOptToolbar();
|
ReCreateOptToolbar();
|
||||||
|
|
||||||
// Create the infobar
|
|
||||||
m_infoBar = new WX_INFOBAR( this, &m_auimgr );
|
|
||||||
|
|
||||||
wxWindow* stsbar = GetStatusBar();
|
wxWindow* stsbar = GetStatusBar();
|
||||||
int dims[] = {
|
int dims[] = {
|
||||||
|
|
||||||
|
@ -155,34 +152,33 @@ PL_EDITOR_FRAME::PL_EDITOR_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||||
|
|
||||||
m_propertiesPagelayout = new PROPERTIES_FRAME( this );
|
m_propertiesPagelayout = new PROPERTIES_FRAME( this );
|
||||||
|
|
||||||
// Horizontal items; layers 4 - 6
|
// Rows; layers 4 - 6
|
||||||
m_auimgr.AddPane( m_mainToolBar,
|
m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" )
|
||||||
EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer(6) );
|
.Top().Layer( 6 ) );
|
||||||
m_auimgr.AddPane( m_optionsToolBar,
|
m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" )
|
||||||
EDA_PANE().VToolbar().Name( "OptToolbar" ).Left().Layer(3) );
|
.Left().Layer( 3 ) );
|
||||||
m_auimgr.AddPane( m_messagePanel,
|
m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" )
|
||||||
EDA_PANE().Messages().Name( "MsgPanel" ).Bottom().Layer(6) );
|
.Bottom().Layer( 6 ) );
|
||||||
m_auimgr.AddPane( m_infoBar,
|
|
||||||
EDA_PANE().InfoBar().Name( "InfoBar" ).Top().Layer(1) );
|
|
||||||
|
|
||||||
// Vertical items; layers 1 - 3
|
// Columns; layers 1 - 3
|
||||||
m_auimgr.AddPane( m_drawToolBar,
|
m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( "ToolsToolbar" )
|
||||||
EDA_PANE().VToolbar().Name( "ToolsToolbar" ).Right().Layer(2) );
|
.Right().Layer( 2 ) );
|
||||||
|
|
||||||
m_auimgr.AddPane( m_propertiesPagelayout, EDA_PANE().Palette().Name( "Props" ).Right().Layer(3)
|
m_auimgr.AddPane( m_propertiesPagelayout, EDA_PANE().Palette().Name( "Props" )
|
||||||
.Caption( _( "Properties" ) ).MinSize( m_propertiesPagelayout->GetMinSize() )
|
.Right().Layer( 3 )
|
||||||
|
.Caption( _( "Properties" ) )
|
||||||
|
.MinSize( m_propertiesPagelayout->GetMinSize() )
|
||||||
.BestSize( m_propertiesFrameWidth, -1 ) );
|
.BestSize( m_propertiesFrameWidth, -1 ) );
|
||||||
|
|
||||||
m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
|
// Center
|
||||||
|
m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" )
|
||||||
|
.Center() );
|
||||||
|
|
||||||
|
|
||||||
// Call Update() to fix all pane default sizes, especially the "InfoBar" pane before
|
// Call Update() to fix all pane default sizes.
|
||||||
// hidding it.
|
|
||||||
m_auimgr.Update();
|
m_auimgr.Update();
|
||||||
|
|
||||||
// We don't want the infobar displayed right away
|
m_infoBar = new WX_INFOBAR( GetCanvas() );
|
||||||
m_auimgr.GetPane( "InfoBar" ).Hide();
|
|
||||||
m_auimgr.Update();
|
|
||||||
|
|
||||||
resolveCanvasType();
|
resolveCanvasType();
|
||||||
SwitchCanvas( m_canvasType );
|
SwitchCanvas( m_canvasType );
|
||||||
|
|
|
@ -197,44 +197,49 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent,
|
||||||
|
|
||||||
SetActiveLayer( F_SilkS );
|
SetActiveLayer( F_SilkS );
|
||||||
|
|
||||||
// Create the infobar
|
|
||||||
m_infoBar = new WX_INFOBAR( this, &m_auimgr );
|
|
||||||
|
|
||||||
m_auimgr.SetManagedWindow( this );
|
m_auimgr.SetManagedWindow( this );
|
||||||
|
|
||||||
unsigned int auiFlags = wxAUI_MGR_DEFAULT;
|
unsigned int auiFlags = wxAUI_MGR_DEFAULT;
|
||||||
#if !defined( _WIN32 )
|
#if !defined( _WIN32 )
|
||||||
// Windows cannot redraw the UI fast enough during a live resize and may lead to all kinds of graphical glitches
|
// Windows cannot redraw the UI fast enough during a live resize and may lead to all kinds
|
||||||
|
// of graphical glitches
|
||||||
auiFlags |= wxAUI_MGR_LIVE_RESIZE;
|
auiFlags |= wxAUI_MGR_LIVE_RESIZE;
|
||||||
#endif
|
#endif
|
||||||
m_auimgr.SetFlags( auiFlags );
|
m_auimgr.SetFlags( auiFlags );
|
||||||
|
|
||||||
// Horizontal items; layers 4 - 6
|
// Rows; layers 4 - 6
|
||||||
m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer( 6 ) );
|
m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" )
|
||||||
m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" ).Bottom().Layer( 6 ) );
|
.Top().Layer( 6 ) );
|
||||||
m_auimgr.AddPane( m_infoBar,
|
m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" )
|
||||||
EDA_PANE().InfoBar().Name( "InfoBar" ).Top().Layer(1) );
|
.Bottom().Layer( 6 ) );
|
||||||
|
|
||||||
// Vertical items; layers 1 - 3
|
// Columns; layers 1 - 3
|
||||||
m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" ).Left().Layer( 3 ) );
|
m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" )
|
||||||
m_auimgr.AddPane( m_treePane, EDA_PANE().Palette().Name( "Footprints" ).Left().Layer(2)
|
.Left().Layer( 3 ) );
|
||||||
.Caption( _( "Libraries" ) ).MinSize( 250, 400 ).Resizable() );
|
m_auimgr.AddPane( m_treePane, EDA_PANE().Palette().Name( "Footprints" )
|
||||||
|
.Left().Layer(2)
|
||||||
|
.Caption( _( "Libraries" ) )
|
||||||
|
.MinSize( 250, 400 ).Resizable() );
|
||||||
|
|
||||||
m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( "ToolsToolbar" ).Right().Layer(2) );
|
m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( "ToolsToolbar" )
|
||||||
|
.Right().Layer(2) );
|
||||||
|
|
||||||
m_auimgr.AddPane( m_appearancePanel, EDA_PANE().Name( "LayersManager" ).Right().Layer( 3 )
|
m_auimgr.AddPane( m_appearancePanel, EDA_PANE().Name( "LayersManager" )
|
||||||
|
.Right().Layer( 3 )
|
||||||
.Caption( _( "Appearance" ) ).PaneBorder( false )
|
.Caption( _( "Appearance" ) ).PaneBorder( false )
|
||||||
.MinSize( 180, -1 ).BestSize( 180, -1 ) );
|
.MinSize( 180, -1 ).BestSize( 180, -1 ) );
|
||||||
m_auimgr.AddPane( m_selectionFilterPanel,
|
m_auimgr.AddPane( m_selectionFilterPanel, EDA_PANE().Palette().Name( "SelectionFilter" )
|
||||||
EDA_PANE().Palette().Name( "SelectionFilter" ).Right().Layer( 3 )
|
.Right().Layer( 3 ).Position( 2 )
|
||||||
.Caption( _( "Selection Filter" ) ).PaneBorder( false ).Position( 2 )
|
.Caption( _( "Selection Filter" ) ).PaneBorder( false )
|
||||||
.MinSize( 160, -1 ).BestSize( m_selectionFilterPanel->GetBestSize() ) );
|
.MinSize( 160, -1 ).BestSize( m_selectionFilterPanel->GetBestSize() ) );
|
||||||
|
|
||||||
|
// Center
|
||||||
|
m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" )
|
||||||
|
.Center() );
|
||||||
|
|
||||||
// The selection filter doesn't need to grow in the vertical direction when docked
|
// The selection filter doesn't need to grow in the vertical direction when docked
|
||||||
m_auimgr.GetPane( "SelectionFilter" ).dock_proportion = 0;
|
m_auimgr.GetPane( "SelectionFilter" ).dock_proportion = 0;
|
||||||
|
|
||||||
m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
|
|
||||||
|
|
||||||
ActivateGalCanvas();
|
ActivateGalCanvas();
|
||||||
|
|
||||||
m_auimgr.GetArtProvider()->SetColour( wxAUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR,
|
m_auimgr.GetArtProvider()->SetColour( wxAUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR,
|
||||||
|
@ -242,13 +247,10 @@ FOOTPRINT_EDIT_FRAME::FOOTPRINT_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent,
|
||||||
m_auimgr.GetArtProvider()->SetColour( wxAUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR,
|
m_auimgr.GetArtProvider()->SetColour( wxAUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR,
|
||||||
wxSystemSettings::GetColour( wxSYS_COLOUR_BTNTEXT ) );
|
wxSystemSettings::GetColour( wxSYS_COLOUR_BTNTEXT ) );
|
||||||
|
|
||||||
// Call Update() to fix all pane default sizes, especially the "InfoBar" pane before
|
// Call Update() to fix all pane default sizes.
|
||||||
// hidding it.
|
|
||||||
m_auimgr.Update();
|
m_auimgr.Update();
|
||||||
|
|
||||||
// We don't want the infobar displayed right away
|
m_infoBar = new WX_INFOBAR( GetCanvas() );
|
||||||
m_auimgr.GetPane( "InfoBar" ).Hide();
|
|
||||||
m_auimgr.Update();
|
|
||||||
|
|
||||||
if( m_settings->m_LibWidth > 0 )
|
if( m_settings->m_LibWidth > 0 )
|
||||||
{
|
{
|
||||||
|
|
|
@ -221,9 +221,6 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||||
|
|
||||||
m_selectionFilterPanel = new PANEL_SELECTION_FILTER( this );
|
m_selectionFilterPanel = new PANEL_SELECTION_FILTER( this );
|
||||||
|
|
||||||
// Create the infobar
|
|
||||||
m_infoBar = new WX_INFOBAR( this, &m_auimgr );
|
|
||||||
|
|
||||||
m_appearancePanel = new APPEARANCE_CONTROLS( this, GetCanvas() );
|
m_appearancePanel = new APPEARANCE_CONTROLS( this, GetCanvas() );
|
||||||
|
|
||||||
m_auimgr.SetManagedWindow( this );
|
m_auimgr.SetManagedWindow( this );
|
||||||
|
@ -235,34 +232,34 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||||
#endif
|
#endif
|
||||||
m_auimgr.SetFlags( auiFlags );
|
m_auimgr.SetFlags( auiFlags );
|
||||||
|
|
||||||
// Horizontal items; layers 4 - 6
|
// Rows; layers 4 - 6
|
||||||
m_auimgr.AddPane( m_mainToolBar,
|
m_auimgr.AddPane( m_mainToolBar, EDA_PANE().HToolbar().Name( "MainToolbar" )
|
||||||
EDA_PANE().HToolbar().Name( "MainToolbar" ).Top().Layer(6) );
|
.Top().Layer( 6 ) );
|
||||||
m_auimgr.AddPane( m_auxiliaryToolBar,
|
m_auimgr.AddPane( m_auxiliaryToolBar, EDA_PANE().HToolbar().Name( "AuxToolbar" )
|
||||||
EDA_PANE().HToolbar().Name( "AuxToolbar" ).Top().Layer(5) );
|
.Top().Layer( 5 ) );
|
||||||
m_auimgr.AddPane( m_messagePanel,
|
m_auimgr.AddPane( m_messagePanel, EDA_PANE().Messages().Name( "MsgPanel" )
|
||||||
EDA_PANE().Messages().Name( "MsgPanel" ).Bottom().Layer(6) );
|
.Bottom().Layer( 6 ) );
|
||||||
m_auimgr.AddPane( m_infoBar,
|
|
||||||
EDA_PANE().InfoBar().Name( "InfoBar" ).Top().Layer(1) );
|
|
||||||
|
|
||||||
// Vertical items; layers 1 - 3
|
// Columns; layers 1 - 3
|
||||||
m_auimgr.AddPane( m_optionsToolBar,
|
m_auimgr.AddPane( m_optionsToolBar, EDA_PANE().VToolbar().Name( "OptToolbar" )
|
||||||
EDA_PANE().VToolbar().Name( "OptToolbar" ).Left().Layer(3) );
|
.Left().Layer( 3 ) );
|
||||||
|
|
||||||
m_auimgr.AddPane( m_drawToolBar,
|
m_auimgr.AddPane( m_drawToolBar, EDA_PANE().VToolbar().Name( "ToolsToolbar" )
|
||||||
EDA_PANE().VToolbar().Name( "ToolsToolbar" ).Right().Layer(3) );
|
.Right().Layer( 3 ) );
|
||||||
|
|
||||||
m_auimgr.AddPane( m_appearancePanel,
|
m_auimgr.AddPane( m_appearancePanel, EDA_PANE().Name( "LayersManager" )
|
||||||
EDA_PANE().Name( "LayersManager" ).Right().Layer( 4 )
|
.Right().Layer( 4 )
|
||||||
.Caption( _( "Appearance" ) ).PaneBorder( false )
|
.Caption( _( "Appearance" ) ).PaneBorder( false )
|
||||||
.MinSize( 180, -1 ).BestSize( 180, -1 ) );
|
.MinSize( 180, -1 ).BestSize( 180, -1 ) );
|
||||||
|
|
||||||
m_auimgr.AddPane( m_selectionFilterPanel,
|
m_auimgr.AddPane( m_selectionFilterPanel, EDA_PANE().Name( "SelectionFilter" )
|
||||||
EDA_PANE().Name( "SelectionFilter" ).Right().Layer( 4 )
|
.Right().Layer( 4 ).Position( 2 )
|
||||||
.Caption( _( "Selection Filter" ) ).PaneBorder( false ).Position( 2 )
|
.Caption( _( "Selection Filter" ) ).PaneBorder( false )
|
||||||
.MinSize( 180, -1 ).BestSize( 180, -1 ) );
|
.MinSize( 180, -1 ).BestSize( 180, -1 ) );
|
||||||
|
|
||||||
m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" ).Center() );
|
// Center
|
||||||
|
m_auimgr.AddPane( GetCanvas(), EDA_PANE().Canvas().Name( "DrawFrame" )
|
||||||
|
.Center() );
|
||||||
|
|
||||||
m_auimgr.GetPane( "LayersManager" ).Show( m_show_layer_manager_tools );
|
m_auimgr.GetPane( "LayersManager" ).Show( m_show_layer_manager_tools );
|
||||||
m_auimgr.GetPane( "SelectionFilter" ).Show( m_show_layer_manager_tools );
|
m_auimgr.GetPane( "SelectionFilter" ).Show( m_show_layer_manager_tools );
|
||||||
|
@ -275,10 +272,11 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||||
m_auimgr.GetArtProvider()->SetColour( wxAUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR,
|
m_auimgr.GetArtProvider()->SetColour( wxAUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR,
|
||||||
wxSystemSettings::GetColour( wxSYS_COLOUR_BTNTEXT ) );
|
wxSystemSettings::GetColour( wxSYS_COLOUR_BTNTEXT ) );
|
||||||
|
|
||||||
// Call Update() to fix all pane default sizes, especially the "InfoBar" pane before
|
// Call Update() to fix all pane default sizes.
|
||||||
// hidding it.
|
|
||||||
m_auimgr.Update();
|
m_auimgr.Update();
|
||||||
|
|
||||||
|
m_infoBar = new WX_INFOBAR( GetCanvas() );
|
||||||
|
|
||||||
if( PCBNEW_SETTINGS* settings = dynamic_cast<PCBNEW_SETTINGS*>( config() ) )
|
if( PCBNEW_SETTINGS* settings = dynamic_cast<PCBNEW_SETTINGS*>( config() ) )
|
||||||
{
|
{
|
||||||
if( settings->m_AuiPanels.right_panel_width > 0 )
|
if( settings->m_AuiPanels.right_panel_width > 0 )
|
||||||
|
@ -300,10 +298,6 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
||||||
m_appearancePanel->SetTabIndex( settings->m_AuiPanels.appearance_panel_tab );
|
m_appearancePanel->SetTabIndex( settings->m_AuiPanels.appearance_panel_tab );
|
||||||
}
|
}
|
||||||
|
|
||||||
// We don't want the infobar displayed right away
|
|
||||||
m_auimgr.GetPane( "InfoBar" ).Hide();
|
|
||||||
m_auimgr.Update();
|
|
||||||
|
|
||||||
GetToolManager()->RunAction( ACTIONS::zoomFitScreen, false );
|
GetToolManager()->RunAction( ACTIONS::zoomFitScreen, false );
|
||||||
|
|
||||||
// This is used temporarily to fix a client size issue on GTK that causes zoom to fit
|
// This is used temporarily to fix a client size issue on GTK that causes zoom to fit
|
||||||
|
|
|
@ -762,7 +762,8 @@ int ROUTER_TOOL::handleLayerSwitch( const TOOL_EVENT& aEvent, bool aForceVia )
|
||||||
{
|
{
|
||||||
WX_INFOBAR* infobar = frame()->GetInfoBar();
|
WX_INFOBAR* infobar = frame()->GetInfoBar();
|
||||||
wxHyperlinkCtrl* button = new wxHyperlinkCtrl( infobar, wxID_ANY,
|
wxHyperlinkCtrl* button = new wxHyperlinkCtrl( infobar, wxID_ANY,
|
||||||
_( "Show board setup" ), wxEmptyString );
|
_( "Show board setup" ),
|
||||||
|
wxEmptyString );
|
||||||
|
|
||||||
button->Bind( wxEVT_COMMAND_HYPERLINK, std::function<void( wxHyperlinkEvent& aEvent )>(
|
button->Bind( wxEVT_COMMAND_HYPERLINK, std::function<void( wxHyperlinkEvent& aEvent )>(
|
||||||
[&]( wxHyperlinkEvent& aEvent )
|
[&]( wxHyperlinkEvent& aEvent )
|
||||||
|
|
Loading…
Reference in New Issue