Commit d3468dd5 authored by dickelbeck's avatar dickelbeck

Marco's AUI patch, basically

parent 69e3f671
......@@ -23,6 +23,7 @@
#include "trackball.h"
#include <wx/colordlg.h>
#include <wxstruct.h>
Info_3D_Visu g_Parm_3D_Visu;
double g_Draw3d_dx;
......@@ -79,6 +80,30 @@ WinEDA3D_DrawFrame::WinEDA3D_DrawFrame( WinEDA_BasePcbFrame* parent,
// Make a Pcb3D_GLCanvas
m_Canvas = new Pcb3D_GLCanvas( this );
#if KICAD_AUIMANAGER
m_auimgr.SetManagedWindow(this);
wxAuiPaneInfo horiz;
horiz.Gripper(false);
horiz.DockFixed(true);
horiz.Movable(false);
horiz.Floatable(false);
horiz.CloseButton(false);
horiz.CaptionVisible(false);
wxAuiPaneInfo vert(horiz);
vert.TopDockable(false).BottomDockable(false);
horiz.LeftDockable(false).RightDockable(false);
m_auimgr.AddPane(m_HToolBar,
wxAuiPaneInfo(horiz).Name(wxT("m_HToolBar")).Top());
m_auimgr.AddPane(m_Canvas,
wxAuiPaneInfo().Name(wxT("DrawFrame")).CentrePane());
m_auimgr.Update();
#endif
}
......@@ -127,7 +152,7 @@ void WinEDA3D_DrawFrame::GetSettings()
config->Read( wxT( "BgColor_Blue" ),
&g_Parm_3D_Visu.m_BgColor.m_Blue, 0.0 );
}
#ifdef __WXMAC__
#if defined( __WXMAC__ ) && !defined( __WXOSX_COCOA__ )
// for macOSX, the window must be below system (macOSX) toolbar
if( m_FramePos.y < GetMBarHeight() )
......
......@@ -21,9 +21,9 @@ void WinEDA3D_DrawFrame::ReCreateHToolbar()
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
SetToolBar( m_HToolBar );
#if !KICAD_AUIMANAGER
SetToolBar( (wxToolBar*)m_HToolBar );
#endif
// Set up toolbar
m_HToolBar->AddTool( ID_RELOAD3D_BOARD, wxEmptyString,
wxBitmap( import3d_xpm ),
......
......@@ -138,7 +138,6 @@ private:
#if wxCHECK_VERSION( 2, 9, 0 )
wxGLContext* m_glRC;
#endif
public:
Pcb3D_GLCanvas( WinEDA3D_DrawFrame *parent );
~Pcb3D_GLCanvas();
......@@ -178,12 +177,16 @@ class WinEDA3D_DrawFrame: public wxFrame
public:
WinEDA_BasePcbFrame * m_Parent;
Pcb3D_GLCanvas * m_Canvas;
wxToolBar * m_HToolBar;
wxToolBar * m_VToolBar;
WinEDA_Toolbar * m_HToolBar;
WinEDA_Toolbar * m_VToolBar;
int m_InternalUnits;
wxPoint m_FramePos;
wxSize m_FrameSize;
#if KICAD_AUIMANAGER
wxAuiManager m_auimgr;
~WinEDA3D_DrawFrame() { m_auimgr.UnInit(); };
#endif
private:
wxString m_FrameName; // name used for writting and reading setup
// It is "Frame3D"
......
......@@ -54,6 +54,7 @@ WinEDA_BasicFrame::WinEDA_BasicFrame( wxWindow* father,
* zone utilisateur de la fenetre principale */
m_FramePos.x = m_FramePos.y = 0;
m_FrameSize.y -= m_MsgFrameHeight;
}
......@@ -114,7 +115,7 @@ void WinEDA_BasicFrame::LoadSettings()
}
// Ensure Window title bar is visible
#ifdef __WXMAC__
#if defined( __WXMAC__ ) && !defined( __WXOSX_COCOA__ )
// for macOSX, the window must be below system (macOSX) toolbar
Ypos_min = GetMBarHeight();
......
......@@ -116,6 +116,9 @@ WinEDA_DrawFrame::~WinEDA_DrawFrame()
{
if( m_CurrentScreen != NULL )
delete m_CurrentScreen;
#if KICAD_AUIMANAGER
m_auimgr.UnInit();
#endif
}
......@@ -322,6 +325,10 @@ void WinEDA_DrawFrame::SetToolbars()
/***************************************/
{
DisplayUnitsMsg();
#if KICAD_AUIMANAGER
if(m_auimgr.GetManagedWindow())
m_auimgr.Update();
#endif
}
......@@ -391,6 +398,7 @@ void WinEDA_DrawFrame::OnSize( wxSizeEvent& SizeEv )
m_FrameSize = size;
size.y -= m_MsgFrameHeight;
#if !KICAD_AUIMANAGER
if( MsgPanel ) // Positionnement en bas d'ecran
{
MsgPanel->SetSize( 0, size.y, size.x, m_MsgFrameHeight );
......@@ -446,7 +454,7 @@ void WinEDA_DrawFrame::OnSize( wxSizeEvent& SizeEv )
size.y - opt_size.y - 1 );
DrawPanel->Move( opt_size.x, opt_size.y + Auxtoolbar_size.y + 1 );
}
#endif
SizeEv.Skip();
}
......
......@@ -15,8 +15,13 @@
WinEDA_Toolbar::WinEDA_Toolbar( id_toolbar type, wxWindow * parent,
wxWindowID id, bool horizontal ):
#if KICAD_AUITOOLBAR
wxAuiToolBar( parent, id, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | (horizontal ? wxAUI_TB_HORZ_LAYOUT : wxAUI_TB_VERTICAL))
#else
wxToolBar( parent, id, wxPoint( -1,-1 ), wxSize( -1,-1 ),
horizontal ? wxTB_HORIZONTAL : wxTB_VERTICAL )
#endif
{
m_Parent = parent;
Pnext = NULL;
......
......@@ -181,6 +181,33 @@ WinEDA_CvpcbFrame::WinEDA_CvpcbFrame( const wxString& title, long style ) :
// Framesize and position
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
#if KICAD_AUIMANAGER
m_auimgr.SetManagedWindow(this);
wxAuiPaneInfo horiz;
horiz.Gripper(false);
horiz.DockFixed(true);
horiz.Movable(false);
horiz.Floatable(false);
horiz.CloseButton(false);
horiz.CaptionVisible(false);
wxAuiPaneInfo vert(horiz);
vert.TopDockable(false).BottomDockable(false);
horiz.LeftDockable(false).RightDockable(false);
m_auimgr.AddPane(m_HToolBar,
wxAuiPaneInfo(horiz).Name(wxT("m_HToolBar")).Top());
m_auimgr.AddPane(m_FootprintList,
wxAuiPaneInfo(horiz).Name(wxT("m_FootprintList")).Left().BestSize(m_FrameSize.x * 0.3 ,m_FrameSize.y * 0.9));
m_auimgr.AddPane(m_ListCmp,
wxAuiPaneInfo().Name(wxT("m_ListCmp")).CentrePane());
m_auimgr.Update();
#endif
}
......@@ -196,6 +223,10 @@ WinEDA_CvpcbFrame::~WinEDA_CvpcbFrame()
ID_CVPCB_FOOTPRINT_DISPLAY_FILTERED_LIST );
config->Write( wxT( FILTERFOOTPRINTKEY ), state );
}
#if KICAD_AUIMANAGER
m_auimgr.UnInit();
#endif
}
......
......@@ -126,7 +126,7 @@ void WinEDA_DisplayFrame::ReCreateHToolbar()
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
SetToolBar( m_HToolBar );
SetToolBar( (wxToolBar*) m_HToolBar );
m_HToolBar->AddTool( ID_OPTIONS_SETUP, wxEmptyString,
wxBitmap( display_options_xpm ),
......
......@@ -23,8 +23,9 @@ void WinEDA_CvpcbFrame::ReCreateHToolbar()
return;
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
SetToolBar( m_HToolBar );
#if !KICAD_AUIMANAGER
SetToolBar( (wxToolBar *)m_HToolBar );
#endif
m_HToolBar->AddTool( ID_CVPCB_READ_INPUT_NETLIST, wxEmptyString,
wxBitmap( open_xpm ),
_( "Open a NetList file" ) );
......
......@@ -187,6 +187,36 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father,
UpdatePartSelectList();
Zoom_Automatique( false );
Show( true );
#if KICAD_AUIMANAGER
m_auimgr.SetManagedWindow(this);
wxAuiPaneInfo horiz;
horiz.Gripper(false);
horiz.DockFixed(true);
horiz.Movable(false);
horiz.Floatable(false);
horiz.CloseButton(false);
horiz.CaptionVisible(false);
wxAuiPaneInfo vert(horiz);
vert.TopDockable(false).BottomDockable(false);
horiz.LeftDockable(false).RightDockable(false);
m_auimgr.AddPane(m_HToolBar,
wxAuiPaneInfo(horiz).Name(wxT("m_HToolBar")).Top().Row(0));
m_auimgr.AddPane(m_VToolBar,
wxAuiPaneInfo(vert).Name(wxT("m_VToolBar")).Right());
m_auimgr.AddPane(DrawPanel,
wxAuiPaneInfo().Name(wxT("DrawFrame")).CentrePane());
m_auimgr.AddPane(MsgPanel,
wxAuiPaneInfo(horiz).Name(wxT("MsgPanel")).Bottom());
m_auimgr.Update();
#endif
}
......
......@@ -187,6 +187,41 @@ WinEDA_SchematicFrame::WinEDA_SchematicFrame( wxWindow* father,
ReCreateHToolbar();
ReCreateVToolbar();
ReCreateOptToolbar();
#if KICAD_AUIMANAGER
m_auimgr.SetManagedWindow(this);
wxAuiPaneInfo horiz;
horiz.Gripper(false);
horiz.DockFixed(true);
horiz.Movable(false);
horiz.Floatable(false);
horiz.CloseButton(false);
horiz.CaptionVisible(false);
wxAuiPaneInfo vert(horiz);
vert.TopDockable(false).BottomDockable(false);
horiz.LeftDockable(false).RightDockable(false);
m_auimgr.AddPane(m_HToolBar,
wxAuiPaneInfo(horiz).Name(wxT("m_HToolBar")).Top().Row(0));
m_auimgr.AddPane(m_VToolBar,
wxAuiPaneInfo(vert).Name(wxT("m_VToolBar")).Right());
m_auimgr.AddPane(m_OptionsToolBar,
wxAuiPaneInfo(vert).Name(wxT("m_OptionsToolBar")).Left());
m_auimgr.AddPane(DrawPanel,
wxAuiPaneInfo().Name(wxT("DrawFrame")).CentrePane());
m_auimgr.AddPane(MsgPanel,
wxAuiPaneInfo(horiz).Name(wxT("MsgPanel")).Bottom());
m_auimgr.Update();
#endif
}
......
......@@ -94,8 +94,9 @@ void WinEDA_LibeditFrame::ReCreateHToolbar()
return;
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, true );
SetToolBar( m_HToolBar );
#if !KICAD_AUIMANAGER
SetToolBar( (wxToolBar*)m_HToolBar );
#endif
// Set up toolbar
m_HToolBar->AddTool( ID_LIBEDIT_SAVE_CURRENT_LIB, wxEmptyString,
wxBitmap( save_library_xpm ),
......
......@@ -27,8 +27,9 @@ void WinEDA_SchematicFrame::ReCreateHToolbar()
wxString msg;
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
SetToolBar( m_HToolBar );
#if !KICAD_AUIMANAGER
SetToolBar( (wxToolBar*)m_HToolBar );
#endif
// Set up toolbar
m_HToolBar->AddTool( ID_NEW_PROJECT, wxEmptyString, wxBitmap( new_xpm ),
_( "New schematic project" ) );
......
......@@ -27,7 +27,10 @@ void WinEDA_ViewlibFrame::ReCreateHToolbar()
{
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR,
true );
SetToolBar( m_HToolBar );
#if !KICAD_AUIMANAGER
SetToolBar( (wxToolBar*)m_HToolBar );
#endif
// Set up toolbar
m_HToolBar->AddTool( ID_LIBVIEW_SELECT_LIB, wxEmptyString,
......
......@@ -121,6 +121,7 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father,
m_LibListSize.y = size.y;
wxPoint win_pos( 0, 0 );
#if !KICAD_AUIMANAGER
if( Library == NULL )
{
// Creates the libraries window display
......@@ -165,7 +166,30 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father,
m_CmpListWindow->GetClientSize() -
wxSize( EXTRA_BORDER_SIZE * 2, 0 ),
0, NULL, wxLB_HSCROLL );
#else
if( Library == NULL )
{
m_LibList =
new wxListBox( this, ID_LIBVIEW_LIB_LIST,
wxPoint( 0, 0 ),
wxDefaultSize,
0, NULL, wxLB_HSCROLL );
}
else
{
m_libraryName = Library->GetName();
m_entryName.Clear();
m_unit = 1;
m_convert = 1;
m_LibListSize.x = 0;
}
m_CmpList = new wxListBox( this , ID_LIBVIEW_CMP_LIST,
wxPoint( 0, 0 ),
wxDefaultSize,
0, NULL, wxLB_HSCROLL );
#endif
if( m_LibList )
ReCreateListLib();
DisplayLibInfos();
......@@ -173,6 +197,40 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father,
DrawPanel->SetAcceleratorTable( table );
Zoom_Automatique( false );
Show( TRUE );
#if KICAD_AUIMANAGER
m_auimgr.SetManagedWindow(this);
wxAuiPaneInfo horiz;
horiz.Gripper(false);
horiz.DockFixed(true);
horiz.Movable(false);
horiz.Floatable(false);
horiz.CloseButton(false);
horiz.CaptionVisible(false);
wxAuiPaneInfo vert(horiz);
vert.TopDockable(false).BottomDockable(false);
horiz.LeftDockable(false).RightDockable(false);
m_auimgr.AddPane(m_HToolBar,
wxAuiPaneInfo(horiz).Name(wxT("m_HToolBar")).Top().Row(0));
m_auimgr.AddPane(m_LibList,
wxAuiPaneInfo(vert).Name(wxT("m_LibList")).Left().Row(0));
m_auimgr.AddPane(m_CmpList,
wxAuiPaneInfo(vert).Name(wxT("m_CmpList")).Left().Row(1));
m_auimgr.AddPane(DrawPanel,
wxAuiPaneInfo(vert).Name(wxT("DrawFrame")).Center());
m_auimgr.AddPane(MsgPanel,
wxAuiPaneInfo(horiz).Name(wxT("MsgPanel")).Bottom());
m_auimgr.Update();
#endif
}
......@@ -281,7 +339,10 @@ void WinEDA_ViewlibFrame::OnSize( wxSizeEvent& SizeEv )
m_CmpList->SetSize( m_CmpListWindow->GetClientSize() -
wxSize( EXTRA_BORDER_SIZE * 2, 0 ) );
}
#if KICAD_AUIMANAGER
if(m_auimgr.GetManagedWindow())
m_auimgr.Update();
#endif
SizeEv.Skip();
}
......
......@@ -156,6 +156,39 @@ WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father,
ReCreateHToolbar();
ReCreateVToolbar();
ReCreateOptToolbar();
#if KICAD_AUIMANAGER
m_auimgr.SetManagedWindow(this);
wxAuiPaneInfo horiz;
horiz.Gripper(false);
horiz.DockFixed(true);
horiz.Movable(false);
horiz.Floatable(false);
horiz.CloseButton(false);
horiz.CaptionVisible(false);
wxAuiPaneInfo vert(horiz);
vert.TopDockable(false).BottomDockable(false);
horiz.LeftDockable(false).RightDockable(false);
m_auimgr.AddPane(m_HToolBar,
wxAuiPaneInfo(horiz).Name(wxT("m_HToolBar")).Top().Row(0));
m_auimgr.AddPane(m_VToolBar,
wxAuiPaneInfo(vert).Name(wxT("m_VToolBar")).Right());
m_auimgr.AddPane(m_OptionsToolBar,
wxAuiPaneInfo(vert).Name(wxT("m_OptionsToolBar")).Left());
m_auimgr.AddPane(DrawPanel,
wxAuiPaneInfo().Name(wxT("DrawFrame")).CentrePane());
m_auimgr.AddPane(MsgPanel,
wxAuiPaneInfo(horiz).Name(wxT("MsgPanel")).Bottom());
m_auimgr.Update();
#endif
}
......@@ -288,6 +321,10 @@ void WinEDA_GerberFrame::SetToolbars()
}
DisplayUnitsMsg();
#if KICAD_AUIMANAGER
if(m_auimgr.GetManagedWindow())
m_auimgr.Update();
#endif
}
......
......@@ -161,8 +161,9 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void )
}
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
SetToolBar( m_HToolBar );
#if !KICAD_AUIMANAGER
SetToolBar( (wxToolBar*)m_HToolBar );
#endif
// Set up toolbar
m_HToolBar->AddTool( ID_NEW_BOARD, wxEmptyString,
wxBitmap( new_xpm ),
......
......@@ -6,6 +6,12 @@
#ifndef WXSTRUCT_H
#define WXSTRUCT_H
// @todo: these 2 defines need to be moved into the top most CMakeLists.txt as a CMake OPTION.
// and they need to be boiled down to a single OPTION, not 2, and we need to add the wxWidgets aui
// library to the link image under these circumstances. I volunteer, but need a day or so. Dick
//#define KICAD_AUITOOLBAR 1
//#define KICAD_AUIMANAGER 1
#include <vector>
......@@ -15,6 +21,10 @@
#include <wx/wxhtml.h>
#include <wx/laywin.h>
#if defined(KICAD_AUIMANAGER)
#include <wx/aui/aui.h>
#endif
//C++ guarantees that operator delete checks its argument for null-ness
#ifndef SAFE_DELETE
......@@ -101,6 +111,10 @@ public:
// It is "SchematicFrame", "PcbFrame" ....
wxString m_AboutTitle; // Name of program displayed in About.
#ifdef KICAD_AUIMANAGER
wxAuiManager m_auimgr;
#endif
public:
// Constructor and destructor
......@@ -642,7 +656,11 @@ public:
/* class WinEDA_Toolbar */
/*************************/
#if KICAD_AUITOOLBAR
class WinEDA_Toolbar : public wxAuiToolBar
#else
class WinEDA_Toolbar : public wxToolBar
#endif
{
public:
wxWindow* m_Parent;
......@@ -655,6 +673,21 @@ public:
WinEDA_Toolbar( id_toolbar type, wxWindow* parent,
wxWindowID id, bool horizontal );
WinEDA_Toolbar* Next() { return Pnext; }
#if KICAD_AUITOOLBAR
bool GetToolState(int toolId) {return GetToolToggled(toolId); };
void AddRadioTool(int toolid, const wxString& label, const wxBitmap& bitmap,
const wxBitmap& bmpDisabled = wxNullBitmap,
const wxString& shortHelp = wxEmptyString,
const wxString& longHelp = wxEmptyString,
wxObject *data = NULL) {
AddTool( toolid, label, bitmap, bmpDisabled, wxITEM_CHECK, shortHelp, longHelp, data);
};
void SetToolNormalBitmap(int id, const wxBitmap& bitmap) {};
void SetRows(int nRows) {};
#endif
};
......
......@@ -19,12 +19,12 @@ BEGIN_EVENT_TABLE( WinEDA_MainFrame, WinEDA_BasicFrame )
/* Window events */
EVT_SIZE( WinEDA_MainFrame::OnSize )
EVT_CLOSE( WinEDA_MainFrame::OnCloseWindow )
#if !KICAD_AUIMANAGER
/* Sash drag events */
EVT_SASH_DRAGGED( ID_LEFT_FRAME, WinEDA_MainFrame::OnSashDrag )
EVT_SASH_DRAGGED( ID_BOTTOM_FRAME, WinEDA_MainFrame::OnSashDrag )
EVT_SASH_DRAGGED( ID_MAIN_COMMAND, WinEDA_MainFrame::OnSashDrag )
#endif
/* Toolbar events */
EVT_TOOL( ID_NEW_PROJECT, WinEDA_MainFrame::OnLoadProject )
EVT_TOOL( ID_LOAD_PROJECT, WinEDA_MainFrame::OnLoadProject )
......@@ -253,8 +253,9 @@ void WinEDA_MainFrame::RecreateBaseHToolbar()
// Allocate memory for m_HToolBar
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
SetToolBar( m_HToolBar );
#if !KICAD_AUIMANAGER
SetToolBar( (wxToolBar*)m_HToolBar );
#endif
// Set up toolbar
m_HToolBar->AddTool( ID_NEW_PROJECT, wxEmptyString,
wxBitmap( new_project_xpm ),
......
/***********************************************************/
/* mdiframe.cpp - WinEDA_MainFrame is the kicad main frame */
/***********************************************************/
......@@ -69,6 +70,7 @@ WinEDA_MainFrame::WinEDA_MainFrame( wxWindow* parent,
m_LeftWin->SetSashVisible( wxSASH_RIGHT, TRUE );
m_LeftWin->SetExtraBorderSize( 2 );
#if !KICAD_AUIMANAGER
// Bottom Window: box to display messages
m_BottomWin = new wxSashLayoutWindow( this, ID_BOTTOM_FRAME,
wxDefaultPosition, wxDefaultSize,
......@@ -83,7 +85,11 @@ WinEDA_MainFrame::WinEDA_MainFrame( wxWindow* parent,
m_DialogWin = new wxTextCtrl( m_BottomWin, wxID_ANY, wxEmptyString,
wxDefaultPosition, wxDefaultSize,
wxTE_MULTILINE | wxNO_BORDER | wxTE_READONLY );
#else
m_DialogWin = new wxTextCtrl( this, wxID_ANY, wxEmptyString,
wxDefaultPosition, wxDefaultSize,
wxTE_MULTILINE | wxNO_BORDER | wxTE_READONLY );
#endif
// m_CommandWin is the box with buttons which launch eechema, pcbnew ...
m_CommandWin = new WinEDA_CommandFrame( this, ID_MAIN_COMMAND,
wxPoint( m_LeftWin_Width, 0 ),
......@@ -98,6 +104,38 @@ WinEDA_MainFrame::WinEDA_MainFrame( wxWindow* parent,
#ifdef KICAD_PYTHON
PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::LoadProject" ) );
#endif
#if KICAD_AUIMANAGER
RecreateBaseHToolbar();
m_auimgr.SetManagedWindow(this);
wxAuiPaneInfo horiz;
horiz.Gripper(false);
horiz.DockFixed(true);
horiz.Movable(false);
horiz.Floatable(false);
horiz.CloseButton(false);
horiz.CaptionVisible(false);
wxAuiPaneInfo vert(horiz);
vert.TopDockable(false).BottomDockable(false);
horiz.LeftDockable(false).RightDockable(false);
m_auimgr.AddPane(m_HToolBar,
wxAuiPaneInfo(horiz).Name(wxT("m_HToolBar")).Top());
m_auimgr.AddPane(m_DialogWin,
wxAuiPaneInfo(horiz).Name(wxT("m_DialogWin")).Center());
m_auimgr.AddPane(m_CommandWin,
wxAuiPaneInfo().Name(wxT("m_CommandWin")).CentrePane());
m_auimgr.AddPane(m_LeftWin,
wxAuiPaneInfo(horiz).Name(wxT("m_LeftWin")).Left().BestSize(clientsize.x/3,clientsize.y));
m_auimgr.Update();
#endif
}
......@@ -105,6 +143,9 @@ WinEDA_MainFrame::WinEDA_MainFrame( wxWindow* parent,
WinEDA_MainFrame::~WinEDA_MainFrame()
/*****************************************************************************/
{
#if KICAD_AUIMANAGER
m_auimgr.UnInit();
#endif
}
......@@ -195,7 +236,10 @@ void WinEDA_MainFrame::OnSize( wxSizeEvent& event )
layout.LayoutFrame( this );
if( m_CommandWin )
m_CommandWin->Refresh( TRUE );
#if KICAD_AUIMANAGER
if(m_auimgr.GetManagedWindow())
m_auimgr.Update();
#endif
event.Skip();
}
......
......@@ -277,6 +277,7 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event )
break;
case ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR1:
#if !KICAD_AUIMANAGER
if( m_OptionsToolBar->GetToolState( id ) ) // show aux V toolbar (Microwave tool)
ReCreateAuxVToolbar();
else
......@@ -289,6 +290,10 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event )
OnSize( SizeEv );
}
#else
m_auimgr.GetPane(wxT("m_AuxVToolBar")).Show( m_OptionsToolBar->GetToolState( id ) );
m_auimgr.Update();
#endif
break;
default:
......@@ -298,4 +303,5 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event )
}
SetToolbars();
}
......@@ -192,6 +192,43 @@ WinEDA_ModuleEditFrame::WinEDA_ModuleEditFrame( wxWindow* father,
if( DrawPanel )
DrawPanel->m_Block_Enable = TRUE;
#if KICAD_AUIMANAGER
m_auimgr.SetManagedWindow(this);
wxAuiPaneInfo horiz;
horiz.Gripper(false);
horiz.DockFixed(true);
horiz.Movable(false);
horiz.Floatable(false);
horiz.CloseButton(false);
horiz.CaptionVisible(false);
wxAuiPaneInfo vert(horiz);
vert.TopDockable(false).BottomDockable(false);
horiz.LeftDockable(false).RightDockable(false);
m_auimgr.AddPane(m_HToolBar,
wxAuiPaneInfo(horiz).Name(wxT("m_HToolBar")).Top().Row(0));
m_auimgr.AddPane(m_AuxiliaryToolBar,
wxAuiPaneInfo(horiz).Name(wxT("m_AuxiliaryToolBar")).Top().Row(1));
m_auimgr.AddPane(m_VToolBar,
wxAuiPaneInfo(vert).Name(wxT("m_VToolBar")).Right());
m_auimgr.AddPane(m_OptionsToolBar,
wxAuiPaneInfo(vert).Name(wxT("m_OptionsToolBar")).Left());
m_auimgr.AddPane(DrawPanel,
wxAuiPaneInfo().Name(wxT("DrawFrame")).CentrePane());
m_auimgr.AddPane(MsgPanel,
wxAuiPaneInfo(horiz).Name(wxT("MsgPanel")).Bottom());
m_auimgr.Update();
#endif
}
......@@ -370,6 +407,10 @@ void WinEDA_ModuleEditFrame::SetToolbars()
}
DisplayUnitsMsg();
#if KICAD_AUIMANAGER
if(m_auimgr.GetManagedWindow())
m_auimgr.Update();
#endif
}
......
......@@ -263,6 +263,46 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father,
if( m_show_microwave_tools )
ReCreateAuxVToolbar();
#if KICAD_AUIMANAGER
m_auimgr.SetManagedWindow(this);
wxAuiPaneInfo horiz;
horiz.Gripper(false);
horiz.DockFixed(true);
horiz.Movable(false);
horiz.Floatable(false);
horiz.CloseButton(false);
horiz.CaptionVisible(false);
wxAuiPaneInfo vert(horiz);
vert.TopDockable(false).BottomDockable(false);
horiz.LeftDockable(false).RightDockable(false);
m_auimgr.AddPane(m_HToolBar,
wxAuiPaneInfo(horiz).Name(wxT("m_HToolBar")).Top().Row(0));
m_auimgr.AddPane(m_AuxiliaryToolBar,
wxAuiPaneInfo(horiz).Name(wxT("m_AuxiliaryToolBar")).Top().Row(1));
m_auimgr.AddPane(m_AuxVToolBar,
wxAuiPaneInfo(vert).Name(wxT("m_AuxVToolBar")).Right().Row(1).Hide());
m_auimgr.AddPane(m_VToolBar,
wxAuiPaneInfo(vert).Name(wxT("m_VToolBar")).Right());
m_auimgr.AddPane(m_OptionsToolBar,
wxAuiPaneInfo(vert).Name(wxT("m_OptionsToolBar")).Left());
m_auimgr.AddPane(DrawPanel,
wxAuiPaneInfo().Name(wxT("DrawFrame")).CentrePane());
m_auimgr.AddPane(MsgPanel,
wxAuiPaneInfo(horiz).Name(wxT("MsgPanel")).Bottom());
m_auimgr.Update();
#endif
}
......
......@@ -33,9 +33,9 @@ void WinEDA_ModuleEditFrame::ReCreateHToolbar()
wxString msg;
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
SetToolBar( m_HToolBar );
#if !KICAD_AUIMANAGER
SetToolBar( (wxToolBar*) m_HToolBar );
#endif
// Set up toolbar
m_HToolBar->AddTool( ID_MODEDIT_SELECT_CURRENT_LIB, wxEmptyString,
wxBitmap( open_library_xpm ),
......
......@@ -196,9 +196,9 @@ void WinEDA_PcbFrame::ReCreateHToolbar()
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, true );
m_HToolBar->SetRows( 1 );
SetToolBar( m_HToolBar );
#if !KICAD_AUIMANAGER
SetToolBar( (wxToolBar*)m_HToolBar );
#endif
// Set up toolbar
m_HToolBar->AddTool( ID_NEW_BOARD, wxEmptyString, wxBitmap( new_xpm ),
_( "New board" ) );
......
......@@ -275,8 +275,13 @@ void WinEDA_PcbFrame::SetToolbars()
_( "Hide invisible text" ) :
_( "Show invisible text" ) );
#if !KICAD_AUIMANAGER
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR1,
m_AuxVToolBar ? true : false );
#else
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR1,
m_auimgr.GetPane(wxT("m_AuxVToolBar")).IsShown() );
#endif
}
if( m_AuxiliaryToolBar )
......@@ -285,4 +290,8 @@ void WinEDA_PcbFrame::SetToolbars()
UpdateToolbarLayerInfo();
PrepareLayerIndicator();
DisplayUnitsMsg();
#if KICAD_AUIMANAGER
if(m_auimgr.GetManagedWindow())
m_auimgr.Update();
#endif
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment