AUI support into topmost CMakeLists.txt

This commit is contained in:
dickelbeck 2009-11-05 08:52:41 +00:00
parent b2f9d5bd74
commit 56995b3359
27 changed files with 87 additions and 62 deletions

View File

@ -78,7 +78,7 @@ WinEDA3D_DrawFrame::WinEDA3D_DrawFrame( WinEDA_BasePcbFrame* parent,
// Make a Pcb3D_GLCanvas
m_Canvas = new Pcb3D_GLCanvas( this );
#if KICAD_AUIMANAGER
#if defined(KICAD_AUIMANAGER)
m_auimgr.SetManagedWindow( this );
wxAuiPaneInfo horiz;

View File

@ -21,7 +21,7 @@ void WinEDA3D_DrawFrame::ReCreateHToolbar()
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
#if !KICAD_AUIMANAGER
#if !defined(KICAD_AUIMANAGER)
SetToolBar( (wxToolBar*) m_HToolBar );
#endif

View File

@ -185,7 +185,7 @@ public:
wxPoint m_FramePos;
wxSize m_FrameSize;
#if KICAD_AUIMANAGER
#if defined(KICAD_AUIMANAGER)
wxAuiManager m_auimgr;
~WinEDA3D_DrawFrame() { m_auimgr.UnInit(); };
#endif

View File

@ -4,6 +4,13 @@ KiCad ChangeLog 2009
Please add newer entries at the top, list the date and your name with
email address.
2009-Nov-5 UPDATE Dick Hollenbeck <dick@softplc.com>
================================================================================
++all
CMakeLists.txt support for AUI.
2009-Nov-04 UPDATE Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
================================================================================
++pcbnew

View File

@ -19,6 +19,16 @@ option(KICAD_CYRILLIC "enable/disable building using cyrillic (needs unicode) (d
option(wxUSE_UNICODE "enable/disable building unicode (default OFF)")
option(KICAD_GOST "enable/disable building using GOST notation for multiple gates per package (default OFF)")
if(APPLE)
option(KICAD_AUIMANAGER "Enable use of wxAuiManager (default ON)" ON)
option(KICAD_AUITOOLBAR "Enable use of wxAuiToolBar (default ON)" ON)
else(APPLE)
option(KICAD_AUIMANAGER "Enable use of wxAuiManager (default OFF)" OFF)
option(KICAD_AUITOOLBAR "Enable use of wxAuiToolBar (default OFF)" OFF)
endif(APPLE)
# Comment this out if you don't want to build with Python support.
# OPTION(KICAD_PYTHON "enable/disable building with Python support (default OFF)")
@ -119,7 +129,12 @@ check_find_package_result(OPENGL_FOUND "OpenGL")
# Here you can define what libraries of wxWidgets you need for your
# application. You can figure out what libraries you need here;
# http://www.wxwidgets.org/manuals/2.8/wx_librarieslist.html
find_package(wxWidgets COMPONENTS gl html adv core net base QUIET)
if( KICAD_AUIMANAGER OR KICAD_AUITOOLBAR )
find_package(wxWidgets COMPONENTS gl html adv core net base aui QUIET)
else( KICAD_AUIMANAGER OR KICAD_AUITOOLBAR )
find_package(wxWidgets COMPONENTS gl html adv core net base QUIET)
endif( KICAD_AUIMANAGER OR KICAD_AUITOOLBAR )
check_find_package_result(wxWidgets_FOUND "wxWidgets")
@ -129,6 +144,7 @@ include(${wxWidgets_USE_FILE})
# Include MinGW resource compiler.
include(MinGWResourceCompiler)
# Generate build system specific header file.
include(PerformFeatureChecks)
perform_feature_checks()

View File

@ -49,4 +49,8 @@
#define strnicmp _strnicmp
#endif
#cmakedefine KICAD_AUIMANAGER 1
#cmakedefine KICAD_AUITOOLBAR 1
#endif /* __CONFIG_H__ */

View File

@ -116,7 +116,8 @@ WinEDA_DrawFrame::~WinEDA_DrawFrame()
{
if( m_CurrentScreen != NULL )
delete m_CurrentScreen;
#if KICAD_AUIMANAGER
#if defined(KICAD_AUIMANAGER)
m_auimgr.UnInit();
#endif
}
@ -325,9 +326,10 @@ void WinEDA_DrawFrame::SetToolbars()
/***************************************/
{
DisplayUnitsMsg();
#if KICAD_AUIMANAGER
if(m_auimgr.GetManagedWindow())
m_auimgr.Update();
#if defined(KICAD_AUIMANAGER)
if( m_auimgr.GetManagedWindow() )
m_auimgr.Update();
#endif
}
@ -398,7 +400,7 @@ void WinEDA_DrawFrame::OnSize( wxSizeEvent& SizeEv )
m_FrameSize = size;
size.y -= m_MsgFrameHeight;
#if !KICAD_AUIMANAGER
#if !defined(KICAD_AUIMANAGER)
if( MsgPanel ) // Positionnement en bas d'ecran
{
MsgPanel->SetSize( 0, size.y, size.x, m_MsgFrameHeight );

View File

@ -15,7 +15,7 @@
WinEDA_Toolbar::WinEDA_Toolbar( id_toolbar type, wxWindow * parent,
wxWindowID id, bool horizontal ):
#if KICAD_AUITOOLBAR
#if defined(KICAD_AUITOOLBAR)
wxAuiToolBar( parent, id, wxDefaultPosition, wxDefaultSize,
wxAUI_TB_DEFAULT_STYLE | (horizontal ? wxAUI_TB_HORZ_LAYOUT : wxAUI_TB_VERTICAL))
#else

View File

@ -181,9 +181,10 @@ 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
#if defined(KICAD_AUIMANAGER)
m_auimgr.SetManagedWindow(this);
wxAuiPaneInfo horiz;
horiz.Gripper(false);
horiz.DockFixed(true);
@ -191,15 +192,15 @@ WinEDA_CvpcbFrame::WinEDA_CvpcbFrame( const wxString& title, long style ) :
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));
@ -224,9 +225,9 @@ WinEDA_CvpcbFrame::~WinEDA_CvpcbFrame()
config->Write( wxT( FILTERFOOTPRINTKEY ), state );
}
#if KICAD_AUIMANAGER
#if defined(KICAD_AUIMANAGER)
m_auimgr.UnInit();
#endif
#endif
}

View File

@ -23,7 +23,7 @@ void WinEDA_CvpcbFrame::ReCreateHToolbar()
return;
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
#if !KICAD_AUIMANAGER
#if !defined(KICAD_AUIMANAGER)
SetToolBar( (wxToolBar *)m_HToolBar );
#endif
m_HToolBar->AddTool( ID_CVPCB_READ_INPUT_NETLIST, wxEmptyString,

View File

@ -188,7 +188,7 @@ WinEDA_LibeditFrame::WinEDA_LibeditFrame( wxWindow* father,
Zoom_Automatique( false );
Show( true );
#if KICAD_AUIMANAGER
#if defined(KICAD_AUIMANAGER)
m_auimgr.SetManagedWindow( this );
wxAuiPaneInfo horiz;

View File

@ -190,7 +190,7 @@ WinEDA_SchematicFrame::WinEDA_SchematicFrame( wxWindow* father,
ReCreateVToolbar();
ReCreateOptToolbar();
#if KICAD_AUIMANAGER
#if defined(KICAD_AUIMANAGER)
m_auimgr.SetManagedWindow( this );
wxAuiPaneInfo horiz;

View File

@ -94,7 +94,7 @@ void WinEDA_LibeditFrame::ReCreateHToolbar()
return;
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, true );
#if !KICAD_AUIMANAGER
#if !defined(KICAD_AUIMANAGER)
SetToolBar( (wxToolBar*)m_HToolBar );
#endif
// Set up toolbar

View File

@ -25,7 +25,7 @@ void WinEDA_SchematicFrame::ReCreateHToolbar()
wxString msg;
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
#if !KICAD_AUIMANAGER
#if !defined(KICAD_AUIMANAGER)
SetToolBar( (wxToolBar*)m_HToolBar );
#endif

View File

@ -28,7 +28,7 @@ void WinEDA_ViewlibFrame::ReCreateHToolbar()
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR,
true );
#if !KICAD_AUIMANAGER
#if !defined(KICAD_AUIMANAGER)
SetToolBar( (wxToolBar*)m_HToolBar );
#endif

View File

@ -123,7 +123,7 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father,
wxPoint win_pos( 0, 0 );
#if !KICAD_AUIMANAGER
#if !defined(KICAD_AUIMANAGER)
if( Library == NULL )
{
// Creates the libraries window display
@ -201,7 +201,7 @@ WinEDA_ViewlibFrame::WinEDA_ViewlibFrame( wxWindow* father,
Zoom_Automatique( false );
Show( TRUE );
#if KICAD_AUIMANAGER
#if defined(KICAD_AUIMANAGER)
m_auimgr.SetManagedWindow( this );
wxAuiPaneInfo horiz;
@ -343,7 +343,7 @@ void WinEDA_ViewlibFrame::OnSize( wxSizeEvent& SizeEv )
wxSize( EXTRA_BORDER_SIZE * 2, 0 ) );
}
#if KICAD_AUIMANAGER
#if defined(KICAD_AUIMANAGER)
if( m_auimgr.GetManagedWindow() )
m_auimgr.Update();
#endif

View File

@ -156,7 +156,7 @@ WinEDA_GerberFrame::WinEDA_GerberFrame( wxWindow* father,
ReCreateHToolbar();
ReCreateVToolbar();
ReCreateOptToolbar();
#if KICAD_AUIMANAGER
#if defined(KICAD_AUIMANAGER)
m_auimgr.SetManagedWindow(this);
wxAuiPaneInfo horiz;
@ -321,7 +321,7 @@ void WinEDA_GerberFrame::SetToolbars()
}
DisplayUnitsMsg();
#if KICAD_AUIMANAGER
#if defined(KICAD_AUIMANAGER)
if(m_auimgr.GetManagedWindow())
m_auimgr.Update();
#endif

View File

@ -161,7 +161,7 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void )
}
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
#if !KICAD_AUIMANAGER
#if !defined(KICAD_AUIMANAGER)
SetToolBar( (wxToolBar*)m_HToolBar );
#endif
// Set up toolbar

View File

@ -6,12 +6,6 @@
#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>
@ -21,7 +15,7 @@
#include <wx/wxhtml.h>
#include <wx/laywin.h>
#if defined(KICAD_AUIMANAGER)
#if defined(KICAD_AUIMANAGER) || defined(KICAD_AUITOOLBAR)
#include <wx/aui/aui.h>
#endif
@ -656,7 +650,7 @@ public:
/* class WinEDA_Toolbar */
/*************************/
#if KICAD_AUITOOLBAR
#if defined(KICAD_AUITOOLBAR)
class WinEDA_Toolbar : public wxAuiToolBar
#else
class WinEDA_Toolbar : public wxToolBar
@ -674,19 +668,20 @@ public:
wxWindowID id, bool horizontal );
WinEDA_Toolbar* Next() { return Pnext; }
#if KICAD_AUITOOLBAR
bool GetToolState(int toolId) {return GetToolToggled(toolId); };
#if defined(KICAD_AUITOOLBAR)
bool GetToolState( int toolId ) { return GetToolToggled(toolId); };
void AddRadioTool(int toolid, const wxString& label, const wxBitmap& bitmap,
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);
wxObject *data = NULL )
{
AddTool( toolid, label, bitmap, bmpDisabled, wxITEM_CHECK, shortHelp, longHelp, data );
};
void SetToolNormalBitmap(int id, const wxBitmap& bitmap) {};
void SetRows(int nRows) {};
void SetToolNormalBitmap( int id, const wxBitmap& bitmap ) {};
void SetRows( int nRows ) {};
#endif
};

View File

@ -19,7 +19,7 @@ BEGIN_EVENT_TABLE( WinEDA_MainFrame, WinEDA_BasicFrame )
/* Window events */
EVT_SIZE( WinEDA_MainFrame::OnSize )
EVT_CLOSE( WinEDA_MainFrame::OnCloseWindow )
#if !KICAD_AUIMANAGER
#if !defined(KICAD_AUIMANAGER)
/* Sash drag events */
EVT_SASH_DRAGGED( ID_LEFT_FRAME, WinEDA_MainFrame::OnSashDrag )
EVT_SASH_DRAGGED( ID_BOTTOM_FRAME, WinEDA_MainFrame::OnSashDrag )
@ -253,7 +253,7 @@ void WinEDA_MainFrame::RecreateBaseHToolbar()
// Allocate memory for m_HToolBar
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
#if !KICAD_AUIMANAGER
#if !defined(KICAD_AUIMANAGER)
SetToolBar( (wxToolBar*)m_HToolBar );
#endif
// Set up toolbar

View File

@ -70,7 +70,7 @@ WinEDA_MainFrame::WinEDA_MainFrame( wxWindow* parent,
m_LeftWin->SetSashVisible( wxSASH_RIGHT, TRUE );
m_LeftWin->SetExtraBorderSize( 2 );
#if !KICAD_AUIMANAGER
#if !defined(KICAD_AUIMANAGER)
// Bottom Window: box to display messages
m_BottomWin = new wxSashLayoutWindow( this, ID_BOTTOM_FRAME,
wxDefaultPosition, wxDefaultSize,
@ -105,7 +105,7 @@ WinEDA_MainFrame::WinEDA_MainFrame( wxWindow* parent,
PyHandler::GetInstance()->DeclareEvent( wxT( "kicad::LoadProject" ) );
#endif
#if KICAD_AUIMANAGER
#if defined(KICAD_AUIMANAGER)
RecreateBaseHToolbar();
m_auimgr.SetManagedWindow(this);
@ -143,7 +143,7 @@ WinEDA_MainFrame::WinEDA_MainFrame( wxWindow* parent,
WinEDA_MainFrame::~WinEDA_MainFrame()
/*****************************************************************************/
{
#if KICAD_AUIMANAGER
#if defined(KICAD_AUIMANAGER)
m_auimgr.UnInit();
#endif
}
@ -236,7 +236,7 @@ void WinEDA_MainFrame::OnSize( wxSizeEvent& event )
layout.LayoutFrame( this );
if( m_CommandWin )
m_CommandWin->Refresh( TRUE );
#if KICAD_AUIMANAGER
#if defined(KICAD_AUIMANAGER)
if(m_auimgr.GetManagedWindow())
m_auimgr.Update();
#endif

View File

@ -277,7 +277,7 @@ void WinEDA_PcbFrame::OnSelectOptionToolbar( wxCommandEvent& event )
break;
case ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR1:
#if !KICAD_AUIMANAGER
#if !defined(KICAD_AUIMANAGER)
if( m_OptionsToolBar->GetToolState( id ) ) // show aux V toolbar (Microwave tool)
ReCreateAuxVToolbar();
else

View File

@ -192,7 +192,7 @@ WinEDA_ModuleEditFrame::WinEDA_ModuleEditFrame( wxWindow* father,
if( DrawPanel )
DrawPanel->m_Block_Enable = TRUE;
#if KICAD_AUIMANAGER
#if defined(KICAD_AUIMANAGER)
m_auimgr.SetManagedWindow(this);
wxAuiPaneInfo horiz;
@ -407,7 +407,7 @@ void WinEDA_ModuleEditFrame::SetToolbars()
}
DisplayUnitsMsg();
#if KICAD_AUIMANAGER
#if defined(KICAD_AUIMANAGER)
if(m_auimgr.GetManagedWindow())
m_auimgr.Update();
#endif

View File

@ -264,9 +264,9 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father,
if( m_show_microwave_tools )
ReCreateAuxVToolbar();
#if KICAD_AUIMANAGER
#if defined(KICAD_AUIMANAGER)
m_auimgr.SetManagedWindow(this);
wxAuiPaneInfo horiz;
horiz.Gripper(false);
horiz.DockFixed(true);
@ -295,10 +295,10 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father,
m_auimgr.AddPane(m_OptionsToolBar,
wxAuiPaneInfo(vert).Name(wxT("m_OptionsToolBar")).Left());
m_auimgr.AddPane(DrawPanel,
m_auimgr.AddPane(DrawPanel,
wxAuiPaneInfo().Name(wxT("DrawFrame")).CentrePane());
m_auimgr.AddPane(MsgPanel,
m_auimgr.AddPane(MsgPanel,
wxAuiPaneInfo(horiz).Name(wxT("MsgPanel")).Bottom());
m_auimgr.Update();

View File

@ -33,7 +33,7 @@ void WinEDA_ModuleEditFrame::ReCreateHToolbar()
wxString msg;
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE );
#if !KICAD_AUIMANAGER
#if !defined(KICAD_AUIMANAGER)
SetToolBar( (wxToolBar*) m_HToolBar );
#endif
// Set up toolbar

View File

@ -196,7 +196,7 @@ void WinEDA_PcbFrame::ReCreateHToolbar()
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, true );
m_HToolBar->SetRows( 1 );
#if !KICAD_AUIMANAGER
#if !defined(KICAD_AUIMANAGER)
SetToolBar( (wxToolBar*)m_HToolBar );
#endif
// Set up toolbar

View File

@ -275,7 +275,7 @@ void WinEDA_PcbFrame::SetToolbars()
_( "Hide invisible text" ) :
_( "Show invisible text" ) );
#if !KICAD_AUIMANAGER
#if !defined(KICAD_AUIMANAGER)
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_EXTRA_VERTICAL_TOOLBAR1,
m_AuxVToolBar ? true : false );
#else
@ -290,7 +290,7 @@ void WinEDA_PcbFrame::SetToolbars()
UpdateToolbarLayerInfo();
PrepareLayerIndicator();
DisplayUnitsMsg();
#if KICAD_AUIMANAGER
#if defined(KICAD_AUIMANAGER)
if(m_auimgr.GetManagedWindow())
m_auimgr.Update();
#endif