More Mac OS X work, see CHANGELOG.txt
This commit is contained in:
parent
e38949625b
commit
5a0aca0e4d
|
@ -5,6 +5,17 @@ Please add newer entries at the top, list the date and your name with
|
||||||
email address.
|
email address.
|
||||||
|
|
||||||
|
|
||||||
|
2010-Jan-17 UPDATE Jerry Jacobs <xor.gate.engineering[at]gmail[dot]com>
|
||||||
|
================================================================================
|
||||||
|
More work to make kicad more Mac OS X compliant.
|
||||||
|
* Workaround for wxAboutDialog bug.
|
||||||
|
* WXMAC needs wxID_EXIT to make closing the application function properly.
|
||||||
|
* Workaround for hotkeys, on Mac OS X we can't use Fx keys.
|
||||||
|
This needs to be further implemented and is a work in progress.
|
||||||
|
We need to modify the hotkey code to display Mac OS X the
|
||||||
|
special modifier keys in the hotkey list.
|
||||||
|
|
||||||
|
|
||||||
2010-Jan-18 UPDATE Dick Hollenbeck <dick@softplc.com>
|
2010-Jan-18 UPDATE Dick Hollenbeck <dick@softplc.com>
|
||||||
================================================================================
|
================================================================================
|
||||||
++any
|
++any
|
||||||
|
|
8
TODO.txt
8
TODO.txt
|
@ -3,10 +3,16 @@ KiCad TODO List
|
||||||
|
|
||||||
CMAKE
|
CMAKE
|
||||||
-----
|
-----
|
||||||
|
|
||||||
* Add install targets for binaries and resources on Mac.
|
* Add install targets for binaries and resources on Mac.
|
||||||
* Add Python.
|
* Add Python.
|
||||||
|
|
||||||
|
WXMAC Platform
|
||||||
|
--------------
|
||||||
|
* Fix hotkey list to match CMD key
|
||||||
|
* Fix AddHotkeyName to let wxWidgets handle Ctrl to CMD key
|
||||||
|
* Fix About dialog crash, or trash wxAboutDialog and create our own
|
||||||
|
About dialog to match all platforms. (wxAboutDialog different on platforms)
|
||||||
|
* Fix toolbar button tooltips.
|
||||||
|
|
||||||
Common
|
Common
|
||||||
------
|
------
|
||||||
|
|
|
@ -799,7 +799,7 @@ void WinEDA_DrawPanel::DrawGrid( wxDC* DC )
|
||||||
// Under linux, to be tested (could be depend on linux versions
|
// Under linux, to be tested (could be depend on linux versions
|
||||||
// so perhaps could be necessary to set this option at run time.
|
// so perhaps could be necessary to set this option at run time.
|
||||||
|
|
||||||
#if 0
|
#if defined( __WXMAC__ )
|
||||||
|
|
||||||
// Use a pixel based draw to display grid
|
// Use a pixel based draw to display grid
|
||||||
// There is a lot of calls, so the cost is hight
|
// There is a lot of calls, so the cost is hight
|
||||||
|
|
|
@ -35,7 +35,7 @@ BEGIN_EVENT_TABLE( WinEDA_CvpcbFrame, WinEDA_BasicFrame )
|
||||||
WinEDA_CvpcbFrame::LoadNetList )
|
WinEDA_CvpcbFrame::LoadNetList )
|
||||||
EVT_MENU( ID_SAVE_PROJECT,
|
EVT_MENU( ID_SAVE_PROJECT,
|
||||||
WinEDA_CvpcbFrame::SaveQuitCvpcb )
|
WinEDA_CvpcbFrame::SaveQuitCvpcb )
|
||||||
EVT_MENU( ID_CVPCB_QUIT,
|
EVT_MENU( wxID_EXIT,
|
||||||
WinEDA_CvpcbFrame::OnQuit )
|
WinEDA_CvpcbFrame::OnQuit )
|
||||||
EVT_MENU( ID_GENERAL_HELP,
|
EVT_MENU( ID_GENERAL_HELP,
|
||||||
WinEDA_CvpcbFrame::GetKicadHelp )
|
WinEDA_CvpcbFrame::GetKicadHelp )
|
||||||
|
|
|
@ -36,7 +36,7 @@ const wxString titleLibLoadError( _( "Library Load Error" ) );
|
||||||
* http://wiki.wxwidgets.org/WxMac-specific_topics
|
* http://wiki.wxwidgets.org/WxMac-specific_topics
|
||||||
*/
|
*/
|
||||||
void WinEDA_App::MacOpenFile(const wxString &fileName) {
|
void WinEDA_App::MacOpenFile(const wxString &fileName) {
|
||||||
wxFileName fn = fileName;
|
wxFileName filename = fileName;
|
||||||
wxString oldPath;
|
wxString oldPath;
|
||||||
WinEDA_CvpcbFrame * frame = ((WinEDA_CvpcbFrame*)GetTopWindow());
|
WinEDA_CvpcbFrame * frame = ((WinEDA_CvpcbFrame*)GetTopWindow());
|
||||||
|
|
||||||
|
@ -46,16 +46,16 @@ void WinEDA_App::MacOpenFile(const wxString &fileName) {
|
||||||
/* Update the library search path list. */
|
/* Update the library search path list. */
|
||||||
if( wxGetApp().GetLibraryPathList().Index( oldPath ) != wxNOT_FOUND )
|
if( wxGetApp().GetLibraryPathList().Index( oldPath ) != wxNOT_FOUND )
|
||||||
wxGetApp().GetLibraryPathList().Remove( oldPath );
|
wxGetApp().GetLibraryPathList().Remove( oldPath );
|
||||||
wxGetApp().GetLibraryPathList().Insert( fn.GetPath(), 0 );
|
wxGetApp().GetLibraryPathList().Insert( filename.GetPath(), 0 );
|
||||||
|
|
||||||
frame->m_NetlistFileName = fn;
|
frame->m_NetlistFileName = filename;
|
||||||
|
|
||||||
if( frame->ReadNetList() )
|
if( frame->ReadNetList() )
|
||||||
{
|
{
|
||||||
frame->SetLastProject( fn.GetFullPath() );
|
frame->SetLastProject( filename.GetFullPath() );
|
||||||
|
|
||||||
frame->SetTitle( wxGetApp().GetTitle() + wxT( " " ) + GetBuildVersion() +
|
frame->SetTitle( wxGetApp().GetTitle() + wxT( " " ) + GetBuildVersion() +
|
||||||
wxT( " " ) + fn.GetFullPath() );
|
wxT( " " ) + filename.GetFullPath() );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -75,8 +75,16 @@ IMPLEMENT_APP( WinEDA_App )
|
||||||
|
|
||||||
bool WinEDA_App::OnInit()
|
bool WinEDA_App::OnInit()
|
||||||
{
|
{
|
||||||
wxFileName fn;
|
/* WXMAC application specific */
|
||||||
wxString msg;
|
#ifdef __WXMAC__
|
||||||
|
// wxApp::SetExitOnFrameDelete(false);
|
||||||
|
// wxApp::s_macAboutMenuItemId = ID_KICAD_ABOUT;
|
||||||
|
wxApp::s_macPreferencesMenuItemId = ID_OPTIONS_SETUP;
|
||||||
|
#endif /* __WXMAC__ */
|
||||||
|
|
||||||
|
|
||||||
|
wxFileName filename;
|
||||||
|
wxString message;
|
||||||
WinEDA_CvpcbFrame* frame = NULL;
|
WinEDA_CvpcbFrame* frame = NULL;
|
||||||
|
|
||||||
InitEDA_Appl( wxT( "CvPCB" ), APP_TYPE_CVPCB );
|
InitEDA_Appl( wxT( "CvPCB" ), APP_TYPE_CVPCB );
|
||||||
|
@ -89,8 +97,8 @@ bool WinEDA_App::OnInit()
|
||||||
|
|
||||||
if( argc > 1 )
|
if( argc > 1 )
|
||||||
{
|
{
|
||||||
fn = argv[1];
|
filename = argv[1];
|
||||||
wxSetWorkingDirectory( fn.GetPath() );
|
wxSetWorkingDirectory( filename.GetPath() );
|
||||||
}
|
}
|
||||||
|
|
||||||
// read current setup and reopen last directory if no filename to open in command line
|
// read current setup and reopen last directory if no filename to open in command line
|
||||||
|
@ -105,17 +113,17 @@ bool WinEDA_App::OnInit()
|
||||||
// Show the frame
|
// Show the frame
|
||||||
SetTopWindow( frame );
|
SetTopWindow( frame );
|
||||||
|
|
||||||
frame->LoadProjectFile( fn.GetFullPath() );
|
frame->LoadProjectFile( filename.GetFullPath() );
|
||||||
frame->Show( TRUE );
|
frame->Show( TRUE );
|
||||||
frame->BuildFOOTPRINTS_LISTBOX();
|
frame->BuildFOOTPRINTS_LISTBOX();
|
||||||
|
|
||||||
if( fn.IsOk() && fn.FileExists() )
|
if( filename.IsOk() && filename.FileExists() )
|
||||||
{
|
{
|
||||||
frame->m_NetlistFileName = fn;
|
frame->m_NetlistFileName = filename;
|
||||||
|
|
||||||
if( frame->ReadNetList() )
|
if( frame->ReadNetList() )
|
||||||
{
|
{
|
||||||
frame->m_NetlistFileExtension = fn.GetExt();
|
frame->m_NetlistFileExtension = filename.GetExt();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/***************************************/
|
/**
|
||||||
/* menucfg : build the cvpcb main menu */
|
* @file menubar.cpp
|
||||||
/***************************************/
|
* (Re)Create the CvPCB main MenuBar
|
||||||
|
*/
|
||||||
#include "fctsys.h"
|
#include "fctsys.h"
|
||||||
#include "appl_wxstruct.h"
|
#include "appl_wxstruct.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
@ -28,6 +28,16 @@ void WinEDA_CvpcbFrame::ReCreateMenuBar()
|
||||||
item->SetBitmap( open_xpm );
|
item->SetBitmap( open_xpm );
|
||||||
filesMenu->Append( item );
|
filesMenu->Append( item );
|
||||||
|
|
||||||
|
/* Open Recent submenu */
|
||||||
|
wxMenu* openRecentMenu = new wxMenu();
|
||||||
|
wxGetApp().m_fileHistory.AddFilesToMenu( openRecentMenu );
|
||||||
|
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, openRecentMenu,
|
||||||
|
-1, _( "Open &Recent" ),
|
||||||
|
_("Open a recent opened netlist document" ),
|
||||||
|
open_project_xpm );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
filesMenu->AppendSeparator();
|
filesMenu->AppendSeparator();
|
||||||
item = new wxMenuItem( filesMenu, ID_SAVE_PROJECT,
|
item = new wxMenuItem( filesMenu, ID_SAVE_PROJECT,
|
||||||
_( "&Save As..." ),
|
_( "&Save As..." ),
|
||||||
|
@ -35,13 +45,15 @@ void WinEDA_CvpcbFrame::ReCreateMenuBar()
|
||||||
item->SetBitmap( save_xpm );
|
item->SetBitmap( save_xpm );
|
||||||
filesMenu->Append( item );
|
filesMenu->Append( item );
|
||||||
|
|
||||||
|
/* Quit on all platforms except WXMAC */
|
||||||
|
#if !defined(__WXMAC__)
|
||||||
|
|
||||||
filesMenu->AppendSeparator();
|
filesMenu->AppendSeparator();
|
||||||
item = new wxMenuItem( filesMenu, ID_CVPCB_QUIT, _( "E&xit" ),
|
item = new wxMenuItem( filesMenu, wxID_EXIT, _( "&Quit" ),
|
||||||
_( "Quit Cvpcb" ) );
|
_( "Quit CvPCB" ) );
|
||||||
item->SetBitmap( exit_xpm );
|
|
||||||
filesMenu->Append( item );
|
filesMenu->Append( item );
|
||||||
|
|
||||||
wxGetApp().m_fileHistory.AddFilesToMenu( filesMenu );
|
#endif /* !defined( __WXMAC__) */
|
||||||
|
|
||||||
// Menu Configuration:
|
// Menu Configuration:
|
||||||
wxMenu* configmenu = new wxMenu;
|
wxMenu* configmenu = new wxMenu;
|
||||||
|
@ -70,12 +82,21 @@ void WinEDA_CvpcbFrame::ReCreateMenuBar()
|
||||||
_( "Open the cvpcb manual" ) );
|
_( "Open the cvpcb manual" ) );
|
||||||
item->SetBitmap( help_xpm );
|
item->SetBitmap( help_xpm );
|
||||||
helpMenu->Append( item );
|
helpMenu->Append( item );
|
||||||
|
|
||||||
|
/* About on all platforms except WXMAC */
|
||||||
|
#if !defined(__WXMAC__)
|
||||||
|
|
||||||
item = new wxMenuItem( helpMenu, ID_KICAD_ABOUT,
|
item = new wxMenuItem( helpMenu, ID_KICAD_ABOUT,
|
||||||
_( "&About cvpcb" ),
|
_( "&About" ),
|
||||||
_( "About cvpcb schematic to pcb converter" ) );
|
_( "About cvpcb schematic to pcb converter" ) );
|
||||||
item->SetBitmap( info_xpm );
|
item->SetBitmap( info_xpm );
|
||||||
helpMenu->Append( item );
|
helpMenu->Append( item );
|
||||||
|
|
||||||
|
#endif /* !defined(__WXMAC__) */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create the menubar and append all submenus
|
||||||
|
*/
|
||||||
menuBar->Append( filesMenu, _( "&File" ) );
|
menuBar->Append( filesMenu, _( "&File" ) );
|
||||||
menuBar->Append( configmenu, _( "&Preferences" ) );
|
menuBar->Append( configmenu, _( "&Preferences" ) );
|
||||||
menuBar->Append( helpMenu, _( "&Help" ) );
|
menuBar->Append( helpMenu, _( "&Help" ) );
|
||||||
|
@ -84,3 +105,4 @@ void WinEDA_CvpcbFrame::ReCreateMenuBar()
|
||||||
* rebuilt. This allows language changes of the menu text on the fly. */
|
* rebuilt. This allows language changes of the menu text on the fly. */
|
||||||
SetMenuBar( menuBar );
|
SetMenuBar( menuBar );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,15 +4,6 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
${CMAKE_SOURCE_DIR}/common
|
${CMAKE_SOURCE_DIR}/common
|
||||||
${Boost_INCLUDE_DIR}
|
${Boost_INCLUDE_DIR}
|
||||||
)
|
)
|
||||||
##
|
|
||||||
# Name of target on OSX is also the title of the application
|
|
||||||
# on other targets this should be as normal
|
|
||||||
##
|
|
||||||
if(APPLE)
|
|
||||||
set(EESCHEMA_NAME EESchema)
|
|
||||||
else(APPLE)
|
|
||||||
set(EESCHEMA_NAME eeschema)
|
|
||||||
endif(APPLE)
|
|
||||||
|
|
||||||
set(EESCHEMA_SRCS
|
set(EESCHEMA_SRCS
|
||||||
annotate.cpp
|
annotate.cpp
|
||||||
|
@ -157,15 +148,15 @@ if(APPLE)
|
||||||
set(MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad-eda.eeschema)
|
set(MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad-eda.eeschema)
|
||||||
endif(APPLE)
|
endif(APPLE)
|
||||||
|
|
||||||
add_executable(${EESCHEMA_NAME} WIN32 MACOSX_BUNDLE ${EESCHEMA_SRCS} ${EESCHEMA_EXTRA_SRCS} ${EESCHEMA_RESOURCES})
|
add_executable(eeschema WIN32 MACOSX_BUNDLE ${EESCHEMA_SRCS} ${EESCHEMA_EXTRA_SRCS} ${EESCHEMA_RESOURCES})
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
set_target_properties(${EESCHEMA_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
|
set_target_properties(eeschema PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
|
||||||
endif(APPLE)
|
endif(APPLE)
|
||||||
|
|
||||||
target_link_libraries(${EESCHEMA_NAME} common bitmaps ${wxWidgets_LIBRARIES})
|
target_link_libraries(eeschema common bitmaps ${wxWidgets_LIBRARIES})
|
||||||
|
|
||||||
install(TARGETS ${EESCHEMA_NAME}
|
install(TARGETS eeschema
|
||||||
DESTINATION ${KICAD_BIN}
|
DESTINATION ${KICAD_BIN}
|
||||||
COMPONENT binary)
|
COMPONENT binary)
|
||||||
|
|
||||||
|
|
|
@ -111,15 +111,15 @@ void WinEDA_App::MacOpenFile(const wxString &fileName) {
|
||||||
|
|
||||||
bool WinEDA_App::OnInit()
|
bool WinEDA_App::OnInit()
|
||||||
{
|
{
|
||||||
|
/* WXMAC application specific */
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
wxApp::SetExitOnFrameDelete(false);
|
// wxApp::SetExitOnFrameDelete(false);
|
||||||
wxApp::s_macAboutMenuItemId = ID_KICAD_ABOUT;
|
// wxApp::s_macAboutMenuItemId = ID_KICAD_ABOUT;
|
||||||
wxApp::s_macPreferencesMenuItemId = ID_CONFIG_REQ;
|
wxApp::s_macPreferencesMenuItemId = ID_OPTIONS_SETUP;
|
||||||
#endif /* __WXMAC__ */
|
#endif /* __WXMAC__ */
|
||||||
|
|
||||||
|
|
||||||
|
wxFileName filename;
|
||||||
wxFileName fn;
|
|
||||||
WinEDA_SchematicFrame* frame = NULL;
|
WinEDA_SchematicFrame* frame = NULL;
|
||||||
|
|
||||||
g_DebugLevel = 0; // Debug level */
|
g_DebugLevel = 0; // Debug level */
|
||||||
|
@ -133,7 +133,7 @@ bool WinEDA_App::OnInit()
|
||||||
}
|
}
|
||||||
|
|
||||||
if( argc > 1 )
|
if( argc > 1 )
|
||||||
fn = argv[1];
|
filename = argv[1];
|
||||||
|
|
||||||
/* init EESCHEMA */
|
/* init EESCHEMA */
|
||||||
SeedLayers();
|
SeedLayers();
|
||||||
|
@ -166,13 +166,13 @@ bool WinEDA_App::OnInit()
|
||||||
frame->Zoom_Automatique( TRUE );
|
frame->Zoom_Automatique( TRUE );
|
||||||
|
|
||||||
/* Load file specified in the command line. */
|
/* Load file specified in the command line. */
|
||||||
if( fn.IsOk() )
|
if( filename.IsOk() )
|
||||||
{
|
{
|
||||||
if( fn.GetExt() != SchematicFileExtension )
|
if( filename.GetExt() != SchematicFileExtension )
|
||||||
fn.SetExt( SchematicFileExtension );
|
filename.SetExt( SchematicFileExtension );
|
||||||
wxSetWorkingDirectory( fn.GetPath() );
|
wxSetWorkingDirectory( filename.GetPath() );
|
||||||
if( frame->DrawPanel
|
if( frame->DrawPanel
|
||||||
&& frame->LoadOneEEProject( fn.GetFullPath(), false ) <= 0 )
|
&& frame->LoadOneEEProject( filename.GetFullPath(), false ) <= 0 )
|
||||||
frame->DrawPanel->Refresh( true );
|
frame->DrawPanel->Refresh( true );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -47,22 +47,50 @@
|
||||||
/* local variables */
|
/* local variables */
|
||||||
/* Hotkey list: */
|
/* Hotkey list: */
|
||||||
|
|
||||||
// Common commands
|
/**
|
||||||
static Ki_HotkeyInfo HkZoomAuto( wxT( "Zoom Auto" ), HK_ZOOM_AUTO,
|
* Common commands
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Fit on Screen */
|
||||||
|
static Ki_HotkeyInfo HkZoomAuto( wxT( "Fit on Screen" ), HK_ZOOM_AUTO,
|
||||||
WXK_HOME );
|
WXK_HOME );
|
||||||
|
|
||||||
static Ki_HotkeyInfo HkZoomCenter( wxT( "Zoom Center" ), HK_ZOOM_CENTER,
|
static Ki_HotkeyInfo HkZoomCenter( wxT( "Zoom Center" ), HK_ZOOM_CENTER,
|
||||||
WXK_F4 );
|
WXK_F4 );
|
||||||
static Ki_HotkeyInfo HkZoomRedraw( wxT( "Zoom Redraw" ), HK_ZOOM_REDRAW,
|
static Ki_HotkeyInfo HkZoomRedraw( wxT( "Zoom Redraw" ), HK_ZOOM_REDRAW,
|
||||||
WXK_F3 );
|
WXK_F3 );
|
||||||
static Ki_HotkeyInfo HkZoomOut( wxT( "Zoom Out" ), HK_ZOOM_OUT, WXK_F2 );
|
|
||||||
static Ki_HotkeyInfo HkZoomIn( wxT( "Zoom In" ), HK_ZOOM_IN, WXK_F1 );
|
/* Zoom In */
|
||||||
|
#if !defined( __WXMAC__ )
|
||||||
|
static Ki_HotkeyInfo HkZoomIn( wxT( "Zoom In" ), HK_ZOOM_IN, WXK_F1 );
|
||||||
|
#else
|
||||||
|
static Ki_HotkeyInfo HkZoomIn( wxT( "Zoom In" ), HK_ZOOM_IN, GR_KB_CTRL + '+' );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Zoom Out */
|
||||||
|
#if !defined( __WXMAC__ )
|
||||||
|
static Ki_HotkeyInfo HkZoomOut( wxT( "Zoom Out" ), HK_ZOOM_OUT, WXK_F2 );
|
||||||
|
#else
|
||||||
|
static Ki_HotkeyInfo HkZoomOut( wxT( "Zoom Out" ), HK_ZOOM_OUT, GR_KB_CTRL + '-' );
|
||||||
|
#endif
|
||||||
|
|
||||||
static Ki_HotkeyInfo HkHelp( wxT( "Help: this message" ), HK_HELP, '?' );
|
static Ki_HotkeyInfo HkHelp( wxT( "Help: this message" ), HK_HELP, '?' );
|
||||||
static Ki_HotkeyInfo HkResetLocalCoord( wxT( "Reset local coord." ),
|
static Ki_HotkeyInfo HkResetLocalCoord( wxT( "Reset local coord." ),
|
||||||
HK_RESET_LOCAL_COORD, ' ' );
|
HK_RESET_LOCAL_COORD, ' ' );
|
||||||
|
|
||||||
|
/* Undo */
|
||||||
static Ki_HotkeyInfo HkUndo( wxT( "Undo" ), HK_UNDO, GR_KB_CTRL + 'Z',
|
static Ki_HotkeyInfo HkUndo( wxT( "Undo" ), HK_UNDO, GR_KB_CTRL + 'Z',
|
||||||
(int) ID_SCHEMATIC_UNDO );
|
(int) ID_SCHEMATIC_UNDO );
|
||||||
static Ki_HotkeyInfo HkRedo( wxT( "Redo" ), HK_REDO, GR_KB_CTRL + 'Y',
|
|
||||||
|
/* Redo */
|
||||||
|
#if !defined( __WXMAC__ )
|
||||||
|
static Ki_HotkeyInfo HkRedo( wxT( "Redo" ), HK_REDO, GR_KB_CTRL + 'Y',
|
||||||
(int) ID_SCHEMATIC_REDO );
|
(int) ID_SCHEMATIC_REDO );
|
||||||
|
#else
|
||||||
|
static Ki_HotkeyInfo HkRedo( wxT( "Redo" ), HK_REDO,
|
||||||
|
GR_KB_SHIFT + GR_KB_CTRL + 'Z',
|
||||||
|
(int) ID_SCHEMATIC_REDO );
|
||||||
|
#endif
|
||||||
|
|
||||||
// Schematic editor
|
// Schematic editor
|
||||||
static Ki_HotkeyInfo HkBeginWire( wxT( "begin Wire" ), HK_BEGIN_WIRE, 'W' );
|
static Ki_HotkeyInfo HkBeginWire( wxT( "begin Wire" ), HK_BEGIN_WIRE, 'W' );
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*************************************************************/
|
/**
|
||||||
/* menubar.cpp - create the menubar for the schematic frame */
|
* @file menubar.cpp
|
||||||
/*************************************************************/
|
* @brief Create the main menubar for the schematic frame
|
||||||
|
*/
|
||||||
#ifdef __GNUG__
|
#ifdef __GNUG__
|
||||||
#pragma implementation
|
#pragma implementation
|
||||||
#endif
|
#endif
|
||||||
|
@ -17,34 +17,38 @@
|
||||||
#include "eeschema_id.h"
|
#include "eeschema_id.h"
|
||||||
#include "hotkeys.h"
|
#include "hotkeys.h"
|
||||||
|
|
||||||
|
/**
|
||||||
/************************************************/
|
* @brief Create or update the menubar for the schematic frame
|
||||||
void WinEDA_SchematicFrame::ReCreateMenuBar()
|
|
||||||
/************************************************/
|
|
||||||
|
|
||||||
/* create or update the menubar for the schematic frame
|
|
||||||
*/
|
*/
|
||||||
|
void WinEDA_SchematicFrame::ReCreateMenuBar()
|
||||||
{
|
{
|
||||||
wxString msg;
|
wxString text;
|
||||||
wxMenuItem *item;
|
wxMenuItem *item;
|
||||||
wxMenuBar *menuBar = GetMenuBar();
|
wxMenuBar *menuBar = GetMenuBar();
|
||||||
|
|
||||||
/* Destroy the existing menu bar so it can be rebuilt. This allows
|
/**
|
||||||
* language changes of the menu text on the fly. */
|
* Destroy the existing menu bar so it can be rebuilt. This allows
|
||||||
|
* language changes of the menu text on the fly.
|
||||||
|
*/
|
||||||
if( menuBar )
|
if( menuBar )
|
||||||
SetMenuBar( NULL );
|
SetMenuBar( NULL );
|
||||||
|
|
||||||
menuBar = new wxMenuBar();
|
menuBar = new wxMenuBar();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* File menu
|
||||||
|
*/
|
||||||
wxMenu* filesMenu = new wxMenu;
|
wxMenu* filesMenu = new wxMenu;
|
||||||
|
|
||||||
// Menu File:
|
/* New */
|
||||||
item = new wxMenuItem( filesMenu, ID_NEW_PROJECT, _( "&New" ),
|
item = new wxMenuItem( filesMenu, ID_NEW_PROJECT, _( "&New\tCtrl+N" ),
|
||||||
_( "New schematic project" ) );
|
_( "New schematic project" ) );
|
||||||
|
|
||||||
item->SetBitmap( new_xpm );
|
item->SetBitmap( new_xpm );
|
||||||
filesMenu->Append( item );
|
filesMenu->Append( item );
|
||||||
|
|
||||||
item = new wxMenuItem( filesMenu, ID_LOAD_PROJECT, _( "&Open" ),
|
/* Open */
|
||||||
|
item = new wxMenuItem( filesMenu, ID_LOAD_PROJECT, _( "&Open\tCtrl+O" ),
|
||||||
_( "Open an existing schematic project" ) );
|
_( "Open an existing schematic project" ) );
|
||||||
item->SetBitmap( open_xpm );
|
item->SetBitmap( open_xpm );
|
||||||
filesMenu->Append( item );
|
filesMenu->Append( item );
|
||||||
|
@ -53,39 +57,42 @@ void WinEDA_SchematicFrame::ReCreateMenuBar()
|
||||||
wxMenu* openRecentMenu = new wxMenu();
|
wxMenu* openRecentMenu = new wxMenu();
|
||||||
wxGetApp().m_fileHistory.AddFilesToMenu( openRecentMenu );
|
wxGetApp().m_fileHistory.AddFilesToMenu( openRecentMenu );
|
||||||
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, openRecentMenu,
|
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, openRecentMenu,
|
||||||
-1, _( "Open &Recent" ),
|
-1, _( "Open &Recent" ),
|
||||||
_("Open a recent opened schematic project" ), open_project_xpm );
|
_("Open a recent opened schematic project" ),
|
||||||
|
open_project_xpm );
|
||||||
|
|
||||||
// Save menus:
|
/* Separator */
|
||||||
filesMenu->AppendSeparator();
|
filesMenu->AppendSeparator();
|
||||||
|
|
||||||
// Normal save command:
|
/* Save */
|
||||||
item = new wxMenuItem( filesMenu, ID_SAVE_PROJECT, _( "&Save Whole Schematic Project" ),
|
item = new wxMenuItem( filesMenu, ID_SAVE_ONE_SHEET, _( "&Save\tCtrl+S" ),
|
||||||
_( "Save all sheets in the schematic project" ) );
|
|
||||||
item->SetBitmap( save_project_xpm );
|
|
||||||
filesMenu->Append( item );
|
|
||||||
|
|
||||||
// Save current sheet only
|
|
||||||
item = new wxMenuItem( filesMenu, ID_SAVE_ONE_SHEET, _( "&Save Current Sheet Only" ),
|
|
||||||
_( "Save only current schematic sheet" ) );
|
_( "Save only current schematic sheet" ) );
|
||||||
item->SetBitmap( save_xpm );
|
item->SetBitmap( save_xpm );
|
||||||
filesMenu->Append( item );
|
filesMenu->Append( item );
|
||||||
|
|
||||||
// Save current sheet only and ask for a new name
|
/* Save as... */
|
||||||
item = new wxMenuItem( filesMenu, ID_SAVE_ONE_SHEET_AS, _( "Save Current Sheet &as..." ),
|
item = new wxMenuItem( filesMenu, ID_SAVE_ONE_SHEET_AS,
|
||||||
|
_( "Save &as...\tShift+Ctrl+S" ),
|
||||||
_( "Save current schematic sheet as..." ) );
|
_( "Save current schematic sheet as..." ) );
|
||||||
item->SetBitmap( save_as_xpm );
|
item->SetBitmap( save_as_xpm );
|
||||||
filesMenu->Append( item );
|
filesMenu->Append( item );
|
||||||
|
|
||||||
|
/* Save Project */
|
||||||
|
item = new wxMenuItem( filesMenu, ID_SAVE_PROJECT, _( "&Save Project" ),
|
||||||
|
_( "Save all sheets in the schematic project" ) );
|
||||||
|
item->SetBitmap( save_project_xpm );
|
||||||
|
filesMenu->Append( item );
|
||||||
|
|
||||||
|
/* Separator */
|
||||||
filesMenu->AppendSeparator();
|
filesMenu->AppendSeparator();
|
||||||
|
|
||||||
// Print and Plot section:
|
/* Print */
|
||||||
item = new wxMenuItem( filesMenu, ID_GEN_PRINT, _( "P&rint" ),
|
item = new wxMenuItem( filesMenu, ID_GEN_PRINT, _( "P&rint\tCtrl+P" ),
|
||||||
_( "Print schematic sheet" ) );
|
_( "Print schematic sheet" ) );
|
||||||
item->SetBitmap( print_button );
|
item->SetBitmap( print_button );
|
||||||
filesMenu->Append( item );
|
filesMenu->Append( item );
|
||||||
|
|
||||||
/* Plot Submenu */
|
/* Plot submenu */
|
||||||
wxMenu* choice_plot_fmt = new wxMenu;
|
wxMenu* choice_plot_fmt = new wxMenu;
|
||||||
item = new wxMenuItem( choice_plot_fmt, ID_GEN_PLOT_PS,
|
item = new wxMenuItem( choice_plot_fmt, ID_GEN_PLOT_PS,
|
||||||
_( "Plot PostScript" ),
|
_( "Plot PostScript" ),
|
||||||
|
@ -93,169 +100,245 @@ void WinEDA_SchematicFrame::ReCreateMenuBar()
|
||||||
item->SetBitmap( plot_PS_xpm );
|
item->SetBitmap( plot_PS_xpm );
|
||||||
choice_plot_fmt->Append( item );
|
choice_plot_fmt->Append( item );
|
||||||
|
|
||||||
|
/* Plot HPGL */
|
||||||
item = new wxMenuItem( choice_plot_fmt, ID_GEN_PLOT_HPGL, _( "Plot HPGL" ),
|
item = new wxMenuItem( choice_plot_fmt, ID_GEN_PLOT_HPGL, _( "Plot HPGL" ),
|
||||||
_( "Plot schematic sheet in HPGL format" ) );
|
_( "Plot schematic sheet in HPGL format" ) );
|
||||||
item->SetBitmap( plot_HPG_xpm );
|
item->SetBitmap( plot_HPG_xpm );
|
||||||
choice_plot_fmt->Append( item );
|
choice_plot_fmt->Append( item );
|
||||||
|
|
||||||
|
/* Plot SVG */
|
||||||
item = new wxMenuItem( choice_plot_fmt, ID_GEN_PLOT_SVG, _( "Plot SVG" ),
|
item = new wxMenuItem( choice_plot_fmt, ID_GEN_PLOT_SVG, _( "Plot SVG" ),
|
||||||
_( "Plot schematic sheet in SVG format" ) );
|
_( "Plot schematic sheet in SVG format" ) );
|
||||||
item->SetBitmap( plot_xpm );
|
item->SetBitmap( plot_xpm );
|
||||||
choice_plot_fmt->Append( item );
|
choice_plot_fmt->Append( item );
|
||||||
|
|
||||||
|
/* Plot DXF */
|
||||||
item = new wxMenuItem( choice_plot_fmt, ID_GEN_PLOT_DXF, _( "Plot DXF" ),
|
item = new wxMenuItem( choice_plot_fmt, ID_GEN_PLOT_DXF, _( "Plot DXF" ),
|
||||||
_( "Plot schematic sheet in DXF format" ) );
|
_( "Plot schematic sheet in DXF format" ) );
|
||||||
item->SetBitmap( plot_xpm );
|
item->SetBitmap( plot_xpm );
|
||||||
choice_plot_fmt->Append( item );
|
choice_plot_fmt->Append( item );
|
||||||
|
|
||||||
|
|
||||||
#ifdef __WINDOWS__
|
|
||||||
/* Under windows, one can draw to the clipboard */
|
/* Under windows, one can draw to the clipboard */
|
||||||
|
#ifdef __WINDOWS__
|
||||||
|
|
||||||
item = new wxMenuItem( choice_plot_fmt, ID_GEN_COPY_SHEET_TO_CLIPBOARD,
|
item = new wxMenuItem( choice_plot_fmt, ID_GEN_COPY_SHEET_TO_CLIPBOARD,
|
||||||
_( "Plot to Clipboard" ),
|
_( "Plot to Clipboard" ),
|
||||||
_( "Export drawings to clipboard" ) );
|
_( "Export drawings to clipboard" ) );
|
||||||
item->SetBitmap( copy_button );
|
item->SetBitmap( copy_button );
|
||||||
choice_plot_fmt->Append( item );
|
choice_plot_fmt->Append( item );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, choice_plot_fmt,
|
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, choice_plot_fmt,
|
||||||
ID_GEN_PLOT, _( "&Plot" ),
|
ID_GEN_PLOT, _( "&Plot" ),
|
||||||
_( "Plot schematic sheet in HPGL, PostScript or SVG format" ), plot_xpm );
|
_( "Plot schematic sheet in HPGL, PostScript or SVG format" ), plot_xpm );
|
||||||
|
|
||||||
|
/* Quit on all platforms except WXMAC */
|
||||||
|
#if !defined(__WXMAC__)
|
||||||
|
|
||||||
filesMenu->AppendSeparator();
|
filesMenu->AppendSeparator();
|
||||||
item = new wxMenuItem( filesMenu, ID_EXIT, _( "E&xit" ),
|
item = new wxMenuItem( filesMenu, wxID_EXIT, _( "&Quit" ),
|
||||||
_( "Quit Eeschema" ) );
|
_( "Quit EESchema" ) );
|
||||||
item->SetBitmap( exit_xpm );
|
|
||||||
filesMenu->Append( item );
|
filesMenu->Append( item );
|
||||||
|
|
||||||
|
#endif /* !defined( __WXMAC__) */
|
||||||
|
|
||||||
|
|
||||||
// Menu Edit:
|
|
||||||
|
/**
|
||||||
|
* Edit menu
|
||||||
|
*/
|
||||||
wxMenu* editMenu = new wxMenu;
|
wxMenu* editMenu = new wxMenu;
|
||||||
msg = AddHotkeyName( _( "&Undo\t" ), s_Schematic_Hokeys_Descr, HK_UNDO );
|
|
||||||
item = new wxMenuItem( editMenu, ID_SCHEMATIC_UNDO, msg,
|
/* Undo */
|
||||||
|
#if !defined( __WXMAC__)
|
||||||
|
text = AddHotkeyName( _( "Undo" ), s_Schematic_Hokeys_Descr, HK_UNDO);
|
||||||
|
#else
|
||||||
|
text = _( "Undo\tCtrl+Z" );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
item = new wxMenuItem( editMenu, ID_SCHEMATIC_UNDO, text,
|
||||||
_( "Undo last edition" ), wxITEM_NORMAL );
|
_( "Undo last edition" ), wxITEM_NORMAL );
|
||||||
item->SetBitmap( undo_xpm );
|
item->SetBitmap( undo_xpm );
|
||||||
editMenu->Append( item );
|
editMenu->Append( item );
|
||||||
|
|
||||||
msg = AddHotkeyName( _( "&Redo\t" ), s_Schematic_Hokeys_Descr, HK_REDO );
|
/* Redo */
|
||||||
item = new wxMenuItem( editMenu, ID_SCHEMATIC_REDO, msg,
|
#if !defined( __WXMAC__)
|
||||||
|
text = AddHotkeyName( _( "Redo" ), s_Schematic_Hokeys_Descr, HK_REDO);
|
||||||
|
#else
|
||||||
|
text = _( "Redo\tShift+Ctrl+Z" );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
item = new wxMenuItem( editMenu, ID_SCHEMATIC_REDO, text,
|
||||||
_( "Redo the last undo command" ), wxITEM_NORMAL );
|
_( "Redo the last undo command" ), wxITEM_NORMAL );
|
||||||
item->SetBitmap( redo_xpm );
|
item->SetBitmap( redo_xpm );
|
||||||
editMenu->Append( item );
|
editMenu->Append( item );
|
||||||
|
|
||||||
|
/* Separator */
|
||||||
editMenu->AppendSeparator();
|
editMenu->AppendSeparator();
|
||||||
|
|
||||||
|
/* Delete */
|
||||||
item = new wxMenuItem( editMenu, ID_SCHEMATIC_DELETE_ITEM_BUTT,
|
item = new wxMenuItem( editMenu, ID_SCHEMATIC_DELETE_ITEM_BUTT,
|
||||||
_( "Delete" ), _( "Delete items" ), wxITEM_NORMAL );
|
_( "Delete" ), _( "Delete items" ), wxITEM_NORMAL );
|
||||||
item->SetBitmap( delete_body_xpm );
|
item->SetBitmap( delete_body_xpm );
|
||||||
editMenu->Append( item );
|
editMenu->Append( item );
|
||||||
|
|
||||||
|
/* Separator */
|
||||||
editMenu->AppendSeparator();
|
editMenu->AppendSeparator();
|
||||||
|
|
||||||
item = new wxMenuItem( editMenu, ID_FIND_ITEMS, _( "Find" ),
|
/* Find */
|
||||||
|
item = new wxMenuItem( editMenu, ID_FIND_ITEMS, _( "&Find\tCtrl+F" ),
|
||||||
_( "Find components and texts" ), wxITEM_NORMAL );
|
_( "Find components and texts" ), wxITEM_NORMAL );
|
||||||
item->SetBitmap( find_xpm );
|
item->SetBitmap( find_xpm );
|
||||||
editMenu->Append( item );
|
editMenu->Append( item );
|
||||||
|
|
||||||
|
/* Separator */
|
||||||
editMenu->AppendSeparator();
|
editMenu->AppendSeparator();
|
||||||
|
|
||||||
|
/* Backannotate */
|
||||||
item = new wxMenuItem( editMenu, ID_BACKANNO_ITEMS, _( "Backannotate" ),
|
item = new wxMenuItem( editMenu, ID_BACKANNO_ITEMS, _( "Backannotate" ),
|
||||||
_( "Back annotated footprint fields" ),
|
_( "Back annotated footprint fields" ),
|
||||||
wxITEM_NORMAL );
|
wxITEM_NORMAL );
|
||||||
item->SetBitmap( backanno_xpm );
|
item->SetBitmap( backanno_xpm );
|
||||||
editMenu->Append( item );
|
editMenu->Append( item );
|
||||||
|
|
||||||
// Menu View:
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* View menu
|
||||||
|
*/
|
||||||
wxMenu* viewMenu = new wxMenu;
|
wxMenu* viewMenu = new wxMenu;
|
||||||
msg = AddHotkeyName( _( "Zoom in" ), s_Schematic_Hokeys_Descr, HK_ZOOM_IN);
|
|
||||||
item = new wxMenuItem( viewMenu, ID_ZOOM_IN, msg, _( "Zoom in" ),
|
/* Zoom in */
|
||||||
|
#if !defined( __WXMAC__)
|
||||||
|
text = AddHotkeyName( _( "Zoom In" ), s_Schematic_Hokeys_Descr, HK_ZOOM_IN);
|
||||||
|
#else
|
||||||
|
text = _( "Zoom In\tCtrl++" );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
item = new wxMenuItem( viewMenu, ID_ZOOM_IN, text, _( "Zoom In" ),
|
||||||
wxITEM_NORMAL );
|
wxITEM_NORMAL );
|
||||||
item->SetBitmap( zoom_in_xpm );
|
item->SetBitmap( zoom_in_xpm );
|
||||||
viewMenu->Append( item );
|
viewMenu->Append( item );
|
||||||
|
|
||||||
msg = AddHotkeyName( _( "Zoom out" ), s_Schematic_Hokeys_Descr,
|
/* Zoom out */
|
||||||
|
#if !defined( __WXMAC__)
|
||||||
|
text = AddHotkeyName( _( "Zoom Out\t" ), s_Schematic_Hokeys_Descr,
|
||||||
HK_ZOOM_OUT );
|
HK_ZOOM_OUT );
|
||||||
item = new wxMenuItem( viewMenu, ID_ZOOM_OUT, msg, _( "Zoom out" ),
|
#else
|
||||||
|
text = _( "Zoom out\tCtrl+-" );
|
||||||
|
#endif /* !defined( __WXMAC__) */
|
||||||
|
|
||||||
|
item = new wxMenuItem( viewMenu, ID_ZOOM_OUT, text, _( "Zoom Out" ),
|
||||||
wxITEM_NORMAL );
|
wxITEM_NORMAL );
|
||||||
item->SetBitmap( zoom_out_xpm );
|
item->SetBitmap( zoom_out_xpm );
|
||||||
viewMenu->Append( item );
|
viewMenu->Append( item );
|
||||||
|
|
||||||
msg = AddHotkeyName( _( "Zoom auto" ), s_Schematic_Hokeys_Descr,
|
/* Fit on screen */
|
||||||
|
#if !defined( __WXMAC__)
|
||||||
|
text = AddHotkeyName( _( "Fit on Screen" ), s_Schematic_Hokeys_Descr,
|
||||||
HK_ZOOM_AUTO );
|
HK_ZOOM_AUTO );
|
||||||
item = new wxMenuItem( viewMenu, ID_ZOOM_PAGE, msg, _( "Zoom auto" ),
|
#else
|
||||||
|
text = _( "Fit on Screen\tCtrl+0" );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
item = new wxMenuItem( viewMenu, ID_ZOOM_PAGE, text,
|
||||||
|
_( "Fit the schematic sheet on the screen" ),
|
||||||
wxITEM_NORMAL );
|
wxITEM_NORMAL );
|
||||||
item->SetBitmap( zoom_auto_xpm );
|
item->SetBitmap( zoom_auto_xpm );
|
||||||
viewMenu->Append( item );
|
viewMenu->Append( item );
|
||||||
|
|
||||||
viewMenu->AppendSeparator();
|
viewMenu->AppendSeparator();
|
||||||
|
|
||||||
msg = AddHotkeyName( _( "Redraw view" ), s_Schematic_Hokeys_Descr,
|
/* Redraw view */
|
||||||
|
#if !defined( __WXMAC__)
|
||||||
|
text = AddHotkeyName( _( "Redraw" ), s_Schematic_Hokeys_Descr,
|
||||||
HK_ZOOM_REDRAW );
|
HK_ZOOM_REDRAW );
|
||||||
item = new wxMenuItem( viewMenu, ID_ZOOM_REDRAW, msg, _( "Zoom auto" ),
|
#else
|
||||||
|
text = _( "Redraw\tCtrl+R" );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
item = new wxMenuItem( viewMenu, ID_ZOOM_REDRAW, text,
|
||||||
|
_( "Redraw the schematic view" ),
|
||||||
wxITEM_NORMAL );
|
wxITEM_NORMAL );
|
||||||
item->SetBitmap( zoom_redraw_xpm );
|
item->SetBitmap( zoom_redraw_xpm );
|
||||||
viewMenu->Append( item );
|
viewMenu->Append( item );
|
||||||
|
|
||||||
// Place Menu
|
|
||||||
//TODO: Unify the ID names!
|
|
||||||
|
/**
|
||||||
|
* Place menu
|
||||||
|
* TODO: Unify the ID names!
|
||||||
|
*/
|
||||||
wxMenu* placeMenu = new wxMenu;
|
wxMenu* placeMenu = new wxMenu;
|
||||||
|
|
||||||
|
/* Component */
|
||||||
item = new wxMenuItem( placeMenu, ID_COMPONENT_BUTT, _( "&Component" ),
|
item = new wxMenuItem( placeMenu, ID_COMPONENT_BUTT, _( "&Component" ),
|
||||||
_( "Place the component" ), wxITEM_NORMAL );
|
_( "Place the component" ), wxITEM_NORMAL );
|
||||||
item->SetBitmap( add_component_xpm );
|
item->SetBitmap( add_component_xpm );
|
||||||
placeMenu->Append( item );
|
placeMenu->Append( item );
|
||||||
|
|
||||||
|
/* Power port */
|
||||||
item = new wxMenuItem( placeMenu, ID_PLACE_POWER_BUTT, _( "&Power port" ),
|
item = new wxMenuItem( placeMenu, ID_PLACE_POWER_BUTT, _( "&Power port" ),
|
||||||
_( "Place the power port" ), wxITEM_NORMAL );
|
_( "Place the power port" ), wxITEM_NORMAL );
|
||||||
item->SetBitmap( add_power_xpm );
|
item->SetBitmap( add_power_xpm );
|
||||||
placeMenu->Append( item );
|
placeMenu->Append( item );
|
||||||
|
|
||||||
|
/* Wire */
|
||||||
item = new wxMenuItem( placeMenu, ID_WIRE_BUTT, _( "&Wire" ),
|
item = new wxMenuItem( placeMenu, ID_WIRE_BUTT, _( "&Wire" ),
|
||||||
_( "Place the wire" ), wxITEM_NORMAL );
|
_( "Place the wire" ), wxITEM_NORMAL );
|
||||||
item->SetBitmap( add_line_xpm );
|
item->SetBitmap( add_line_xpm );
|
||||||
placeMenu->Append( item );
|
placeMenu->Append( item );
|
||||||
|
|
||||||
|
/* Bus */
|
||||||
item = new wxMenuItem( placeMenu, ID_BUS_BUTT, _( "&Bus" ),
|
item = new wxMenuItem( placeMenu, ID_BUS_BUTT, _( "&Bus" ),
|
||||||
_( "Place bus" ), wxITEM_NORMAL );
|
_( "Place bus" ), wxITEM_NORMAL );
|
||||||
item->SetBitmap( add_bus_xpm );
|
item->SetBitmap( add_bus_xpm );
|
||||||
placeMenu->Append( item );
|
placeMenu->Append( item );
|
||||||
|
|
||||||
|
/* Wire to Bus */
|
||||||
item = new wxMenuItem( placeMenu, ID_WIRETOBUS_ENTRY_BUTT,
|
item = new wxMenuItem( placeMenu, ID_WIRETOBUS_ENTRY_BUTT,
|
||||||
_( "W&ire to bus entry" ),
|
_( "W&ire to bus entry" ),
|
||||||
_( "Place a wire to bus entry" ), wxITEM_NORMAL );
|
_( "Place a wire to bus entry" ), wxITEM_NORMAL );
|
||||||
item->SetBitmap( add_line2bus_xpm );
|
item->SetBitmap( add_line2bus_xpm );
|
||||||
placeMenu->Append( item );
|
placeMenu->Append( item );
|
||||||
|
|
||||||
|
/* Bus to Bus */
|
||||||
item = new wxMenuItem( placeMenu, ID_BUSTOBUS_ENTRY_BUTT,
|
item = new wxMenuItem( placeMenu, ID_BUSTOBUS_ENTRY_BUTT,
|
||||||
_( "B&us to bus entry" ),
|
_( "B&us to bus entry" ),
|
||||||
_( "Place a bus to bus entry" ), wxITEM_NORMAL );
|
_( "Place a bus to bus entry" ), wxITEM_NORMAL );
|
||||||
item->SetBitmap( add_bus2bus_xpm );
|
item->SetBitmap( add_bus2bus_xpm );
|
||||||
placeMenu->Append( item );
|
placeMenu->Append( item );
|
||||||
|
|
||||||
|
/* No connect flag */
|
||||||
item = new wxMenuItem( placeMenu, ID_NOCONN_BUTT, _( "No connect flag" ),
|
item = new wxMenuItem( placeMenu, ID_NOCONN_BUTT, _( "No connect flag" ),
|
||||||
_( "Place a no connect flag" ), wxITEM_NORMAL );
|
_( "Place a no connect flag" ), wxITEM_NORMAL );
|
||||||
item->SetBitmap( noconn_button );
|
item->SetBitmap( noconn_button );
|
||||||
placeMenu->Append( item );
|
placeMenu->Append( item );
|
||||||
|
|
||||||
|
/* Net name */
|
||||||
item = new wxMenuItem( placeMenu, ID_LABEL_BUTT, _( "Net name" ),
|
item = new wxMenuItem( placeMenu, ID_LABEL_BUTT, _( "Net name" ),
|
||||||
_( "Place net name" ), wxITEM_NORMAL );
|
_( "Place net name" ), wxITEM_NORMAL );
|
||||||
item->SetBitmap( add_line_label_xpm );
|
item->SetBitmap( add_line_label_xpm );
|
||||||
placeMenu->Append( item );
|
placeMenu->Append( item );
|
||||||
|
|
||||||
|
/* Global label */
|
||||||
item = new wxMenuItem( placeMenu, ID_GLABEL_BUTT, _( "Global label" ),
|
item = new wxMenuItem( placeMenu, ID_GLABEL_BUTT, _( "Global label" ),
|
||||||
_( "Place a global label. Warning: all global labels with the same name are connected in whole hierarchy" ),
|
_( "Place a global label. Warning: all global labels with the same name are connected in whole hierarchy" ),
|
||||||
wxITEM_NORMAL );
|
wxITEM_NORMAL );
|
||||||
item->SetBitmap( add_glabel_xpm );
|
item->SetBitmap( add_glabel_xpm );
|
||||||
placeMenu->Append( item );
|
placeMenu->Append( item );
|
||||||
|
|
||||||
|
/* Junction */
|
||||||
item = new wxMenuItem( placeMenu, ID_JUNCTION_BUTT, _( "Junction" ),
|
item = new wxMenuItem( placeMenu, ID_JUNCTION_BUTT, _( "Junction" ),
|
||||||
_( "Place junction" ), wxITEM_NORMAL );
|
_( "Place junction" ), wxITEM_NORMAL );
|
||||||
item->SetBitmap( add_junction_xpm );
|
item->SetBitmap( add_junction_xpm );
|
||||||
placeMenu->Append( item );
|
placeMenu->Append( item );
|
||||||
|
|
||||||
|
/* Separator */
|
||||||
placeMenu->AppendSeparator();
|
placeMenu->AppendSeparator();
|
||||||
|
|
||||||
|
/* Hierarchical label */
|
||||||
item = new wxMenuItem( placeMenu, ID_HIERLABEL_BUTT,
|
item = new wxMenuItem( placeMenu, ID_HIERLABEL_BUTT,
|
||||||
_( "Hierarchical label" ),
|
_( "Hierarchical label" ),
|
||||||
_( "Place a hierarchical label. This label will be seen as a pin sheet in the sheet symbol" ),
|
_( "Place a hierarchical label. This label will be seen as a pin sheet in the sheet symbol" ),
|
||||||
|
@ -263,12 +346,14 @@ void WinEDA_SchematicFrame::ReCreateMenuBar()
|
||||||
item->SetBitmap( add_hierarchical_label_xpm );
|
item->SetBitmap( add_hierarchical_label_xpm );
|
||||||
placeMenu->Append( item );
|
placeMenu->Append( item );
|
||||||
|
|
||||||
|
/* Hierarchical sheet */
|
||||||
item = new wxMenuItem( placeMenu, ID_SHEET_SYMBOL_BUTT,
|
item = new wxMenuItem( placeMenu, ID_SHEET_SYMBOL_BUTT,
|
||||||
_( "Hierarchical sheet" ),
|
_( "Hierarchical sheet" ),
|
||||||
_( "Create a hierarchical sheet" ), wxITEM_NORMAL );
|
_( "Create a hierarchical sheet" ), wxITEM_NORMAL );
|
||||||
item->SetBitmap( add_hierarchical_subsheet_xpm );
|
item->SetBitmap( add_hierarchical_subsheet_xpm );
|
||||||
placeMenu->Append( item );
|
placeMenu->Append( item );
|
||||||
|
|
||||||
|
/* Import hierarchical sheet */
|
||||||
item = new wxMenuItem( placeMenu, ID_IMPORT_HLABEL_BUTT,
|
item = new wxMenuItem( placeMenu, ID_IMPORT_HLABEL_BUTT,
|
||||||
_( "Import Hierarchical Label" ),
|
_( "Import Hierarchical Label" ),
|
||||||
_( "Place a pin sheet created by importing a hierarchical label from sheet" ),
|
_( "Place a pin sheet created by importing a hierarchical label from sheet" ),
|
||||||
|
@ -276,6 +361,7 @@ void WinEDA_SchematicFrame::ReCreateMenuBar()
|
||||||
item->SetBitmap( import_hierarchical_label_xpm );
|
item->SetBitmap( import_hierarchical_label_xpm );
|
||||||
placeMenu->Append( item );
|
placeMenu->Append( item );
|
||||||
|
|
||||||
|
/* Add hierarchical Pin to Sheet */
|
||||||
item = new wxMenuItem( placeMenu, ID_SHEET_LABEL_BUTT,
|
item = new wxMenuItem( placeMenu, ID_SHEET_LABEL_BUTT,
|
||||||
_( "Add Hierarchical Pin to Sheet" ),
|
_( "Add Hierarchical Pin to Sheet" ),
|
||||||
_( "Place a hierarchical pin to sheet" ),
|
_( "Place a hierarchical pin to sheet" ),
|
||||||
|
@ -283,8 +369,10 @@ void WinEDA_SchematicFrame::ReCreateMenuBar()
|
||||||
item->SetBitmap( add_hierar_pin_xpm );
|
item->SetBitmap( add_hierar_pin_xpm );
|
||||||
placeMenu->Append( item );
|
placeMenu->Append( item );
|
||||||
|
|
||||||
|
/* Separator */
|
||||||
placeMenu->AppendSeparator();
|
placeMenu->AppendSeparator();
|
||||||
|
|
||||||
|
/* Graphic line or polygon */
|
||||||
item = new wxMenuItem( placeMenu, ID_LINE_COMMENT_BUTT,
|
item = new wxMenuItem( placeMenu, ID_LINE_COMMENT_BUTT,
|
||||||
_( "Graphic line or polygon" ),
|
_( "Graphic line or polygon" ),
|
||||||
_( "Place graphic lines or polygons" ),
|
_( "Place graphic lines or polygons" ),
|
||||||
|
@ -292,59 +380,85 @@ void WinEDA_SchematicFrame::ReCreateMenuBar()
|
||||||
item->SetBitmap( add_dashed_line_xpm );
|
item->SetBitmap( add_dashed_line_xpm );
|
||||||
placeMenu->Append( item );
|
placeMenu->Append( item );
|
||||||
|
|
||||||
|
/* Graphic text */
|
||||||
item = new wxMenuItem( placeMenu, ID_TEXT_COMMENT_BUTT,
|
item = new wxMenuItem( placeMenu, ID_TEXT_COMMENT_BUTT,
|
||||||
_( "Graphic text (comment)" ),
|
_( "Graphic text" ),
|
||||||
_( "Place graphic text (comment)" ),
|
_( "Place graphic text for comment" ),
|
||||||
wxITEM_NORMAL );
|
wxITEM_NORMAL );
|
||||||
item->SetBitmap( add_text_xpm );
|
item->SetBitmap( add_text_xpm );
|
||||||
placeMenu->Append( item );
|
placeMenu->Append( item );
|
||||||
|
|
||||||
/* Preferences Menu */
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Preferences Menu
|
||||||
|
*/
|
||||||
wxMenu* configmenu = new wxMenu;
|
wxMenu* configmenu = new wxMenu;
|
||||||
|
|
||||||
|
/* Library */
|
||||||
item = new wxMenuItem( configmenu, ID_CONFIG_REQ, _( "&Library" ),
|
item = new wxMenuItem( configmenu, ID_CONFIG_REQ, _( "&Library" ),
|
||||||
_( "Library preferences" ) );
|
_( "Library preferences" ) );
|
||||||
item->SetBitmap( library_xpm );
|
item->SetBitmap( library_xpm );
|
||||||
configmenu->Append( item );
|
configmenu->Append( item );
|
||||||
|
|
||||||
|
/* Colors */
|
||||||
item = new wxMenuItem( configmenu, ID_COLORS_SETUP, _( "&Colors" ),
|
item = new wxMenuItem( configmenu, ID_COLORS_SETUP, _( "&Colors" ),
|
||||||
_( "Color preferences" ) );
|
_( "Color preferences" ) );
|
||||||
item->SetBitmap( palette_xpm );
|
item->SetBitmap( palette_xpm );
|
||||||
configmenu->Append( item );
|
configmenu->Append( item );
|
||||||
|
|
||||||
// Options
|
/* Options */
|
||||||
item = new wxMenuItem( configmenu, ID_OPTIONS_SETUP, _( "&Options" ),
|
item = new wxMenuItem( configmenu, ID_OPTIONS_SETUP, _( "&Options" ),
|
||||||
_( "Eeschema general options and preferences" ) );
|
_( "Eeschema general options and preferences" ) );
|
||||||
item->SetBitmap( preference_xpm );
|
item->SetBitmap( preference_xpm );
|
||||||
configmenu->Append( item );
|
configmenu->Append( item );
|
||||||
|
|
||||||
|
/* Language submenu */
|
||||||
wxGetApp().AddMenuLanguageList( configmenu );
|
wxGetApp().AddMenuLanguageList( configmenu );
|
||||||
|
|
||||||
|
/* Hotkey submenu */
|
||||||
AddHotkeyConfigMenu( configmenu );
|
AddHotkeyConfigMenu( configmenu );
|
||||||
|
|
||||||
|
/* Separator */
|
||||||
configmenu->AppendSeparator();
|
configmenu->AppendSeparator();
|
||||||
|
|
||||||
|
/* Save preferences */
|
||||||
item = new wxMenuItem( configmenu, ID_CONFIG_SAVE, _( "&Save preferences" ),
|
item = new wxMenuItem( configmenu, ID_CONFIG_SAVE, _( "&Save preferences" ),
|
||||||
_( "Save application preferences" ) );
|
_( "Save application preferences" ) );
|
||||||
item->SetBitmap( save_setup_xpm );
|
item->SetBitmap( save_setup_xpm );
|
||||||
configmenu->Append( item );
|
configmenu->Append( item );
|
||||||
|
|
||||||
|
/* Read preferences */
|
||||||
item = new wxMenuItem( configmenu, ID_CONFIG_READ, _( "&Read preferences" ),
|
item = new wxMenuItem( configmenu, ID_CONFIG_READ, _( "&Read preferences" ),
|
||||||
_( "Read application preferences" ) );
|
_( "Read application preferences" ) );
|
||||||
item->SetBitmap( read_setup_xpm );
|
item->SetBitmap( read_setup_xpm );
|
||||||
configmenu->Append( item );
|
configmenu->Append( item );
|
||||||
|
|
||||||
/* Help Menu*/
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Help Menu
|
||||||
|
*/
|
||||||
wxMenu* helpMenu = new wxMenu;
|
wxMenu* helpMenu = new wxMenu;
|
||||||
item = new wxMenuItem( helpMenu, ID_GENERAL_HELP, _( "&Contents" ),
|
item = new wxMenuItem( helpMenu, ID_GENERAL_HELP, _( "&Contents" ),
|
||||||
_( "Open the eeschema manual" ) );
|
_( "Open the eeschema manual" ) );
|
||||||
item->SetBitmap( help_xpm );
|
item->SetBitmap( help_xpm );
|
||||||
helpMenu->Append( item );
|
helpMenu->Append( item );
|
||||||
|
|
||||||
|
/* About on all platforms except WXMAC */
|
||||||
|
#if !defined(__WXMAC__)
|
||||||
|
|
||||||
item = new wxMenuItem( helpMenu, ID_KICAD_ABOUT, _( "&About" ),
|
item = new wxMenuItem( helpMenu, ID_KICAD_ABOUT, _( "&About" ),
|
||||||
_( "About eeschema schematic designer" ) );
|
_( "About eeschema schematic designer" ) );
|
||||||
item->SetBitmap( info_xpm );
|
item->SetBitmap( info_xpm );
|
||||||
helpMenu->Append( item );
|
helpMenu->Append( item );
|
||||||
|
|
||||||
|
#endif /* !defined(__WXMAC__) */
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create the menubar and append all submenus
|
||||||
|
*/
|
||||||
menuBar->Append( filesMenu, _( "&File" ) );
|
menuBar->Append( filesMenu, _( "&File" ) );
|
||||||
menuBar->Append( editMenu, _( "&Edit" ) );
|
menuBar->Append( editMenu, _( "&Edit" ) );
|
||||||
menuBar->Append( viewMenu, _( "&View" ) );
|
menuBar->Append( viewMenu, _( "&View" ) );
|
||||||
|
@ -352,6 +466,7 @@ void WinEDA_SchematicFrame::ReCreateMenuBar()
|
||||||
menuBar->Append( configmenu, _( "&Preferences" ) );
|
menuBar->Append( configmenu, _( "&Preferences" ) );
|
||||||
menuBar->Append( helpMenu, _( "&Help" ) );
|
menuBar->Append( helpMenu, _( "&Help" ) );
|
||||||
|
|
||||||
// Associate the menu bar with the frame
|
/* Associate the menu bar with the frame */
|
||||||
SetMenuBar( menuBar );
|
SetMenuBar( menuBar );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ BEGIN_EVENT_TABLE( WinEDA_SchematicFrame, WinEDA_DrawFrame )
|
||||||
EVT_MENU( ID_GEN_PLOT_DXF, WinEDA_SchematicFrame::ToPlot_DXF )
|
EVT_MENU( ID_GEN_PLOT_DXF, WinEDA_SchematicFrame::ToPlot_DXF )
|
||||||
EVT_MENU( ID_GEN_COPY_SHEET_TO_CLIPBOARD, WinEDA_DrawFrame::CopyToClipboard )
|
EVT_MENU( ID_GEN_COPY_SHEET_TO_CLIPBOARD, WinEDA_DrawFrame::CopyToClipboard )
|
||||||
EVT_MENU( ID_GEN_COPY_BLOCK_TO_CLIPBOARD, WinEDA_DrawFrame::CopyToClipboard )
|
EVT_MENU( ID_GEN_COPY_BLOCK_TO_CLIPBOARD, WinEDA_DrawFrame::CopyToClipboard )
|
||||||
EVT_MENU( ID_EXIT, WinEDA_SchematicFrame::OnExit )
|
EVT_MENU( wxID_EXIT, WinEDA_SchematicFrame::OnExit )
|
||||||
|
|
||||||
EVT_MENU( ID_POPUP_SCH_COPY_ITEM, WinEDA_SchematicFrame::OnCopySchematicItemRequest )
|
EVT_MENU( ID_POPUP_SCH_COPY_ITEM, WinEDA_SchematicFrame::OnCopySchematicItemRequest )
|
||||||
|
|
||||||
|
|
|
@ -87,6 +87,8 @@ public:
|
||||||
|
|
||||||
~WinEDA_PcbFrame();
|
~WinEDA_PcbFrame();
|
||||||
|
|
||||||
|
void OnQuit( wxCommandEvent & WXUNUSED(event) );
|
||||||
|
|
||||||
/** Function ToPlotter
|
/** Function ToPlotter
|
||||||
* Open a dialog frame to create plot and drill files
|
* Open a dialog frame to create plot and drill files
|
||||||
* relative to the current board
|
* relative to the current board
|
||||||
|
|
|
@ -29,7 +29,7 @@ BEGIN_EVENT_TABLE( WinEDA_MainFrame, WinEDA_BasicFrame )
|
||||||
|
|
||||||
/* Menu events */
|
/* Menu events */
|
||||||
EVT_MENU( ID_SAVE_PROJECT, WinEDA_MainFrame::OnSaveProject )
|
EVT_MENU( ID_SAVE_PROJECT, WinEDA_MainFrame::OnSaveProject )
|
||||||
EVT_MENU( ID_EXIT, WinEDA_MainFrame::OnExit )
|
EVT_MENU( wxID_EXIT, WinEDA_MainFrame::OnExit )
|
||||||
EVT_MENU( ID_TO_EDITOR, WinEDA_MainFrame::OnOpenTextEditor )
|
EVT_MENU( ID_TO_EDITOR, WinEDA_MainFrame::OnOpenTextEditor )
|
||||||
EVT_MENU( ID_BROWSE_AN_SELECT_FILE,
|
EVT_MENU( ID_BROWSE_AN_SELECT_FILE,
|
||||||
WinEDA_MainFrame::OnOpenFileInTextEditor )
|
WinEDA_MainFrame::OnOpenFileInTextEditor )
|
||||||
|
@ -127,12 +127,17 @@ void WinEDA_MainFrame::ReCreateMenuBar()
|
||||||
// Separator
|
// Separator
|
||||||
filesMenu->AppendSeparator();
|
filesMenu->AppendSeparator();
|
||||||
|
|
||||||
// Exit
|
/* Quit on all platforms except WXMAC */
|
||||||
item = new wxMenuItem( filesMenu, ID_EXIT, _( "E&xit" ),
|
#if !defined( __WXMAC__ )
|
||||||
_( "Quit kicad" ) );
|
|
||||||
|
filesMenu->AppendSeparator();
|
||||||
|
item = new wxMenuItem( filesMenu, wxID_EXIT, _( "&Quit" ),
|
||||||
|
_( "Quit KiCad" ) );
|
||||||
item->SetBitmap( exit_xpm );
|
item->SetBitmap( exit_xpm );
|
||||||
filesMenu->Append( item );
|
filesMenu->Append( item );
|
||||||
|
|
||||||
|
#endif /* !defined( __WXMAC__ ) */
|
||||||
|
|
||||||
/* Add the file history */
|
/* Add the file history */
|
||||||
wxGetApp().m_fileHistory.AddFilesToMenu( filesMenu );
|
wxGetApp().m_fileHistory.AddFilesToMenu( filesMenu );
|
||||||
|
|
||||||
|
@ -222,12 +227,17 @@ void WinEDA_MainFrame::ReCreateMenuBar()
|
||||||
item->SetBitmap( help_xpm );
|
item->SetBitmap( help_xpm );
|
||||||
helpMenu->Append( item );
|
helpMenu->Append( item );
|
||||||
|
|
||||||
// About Kicad
|
// About on all platforms except WXMAC */
|
||||||
|
#if !defined( __WXMAC__ )
|
||||||
|
|
||||||
|
helpMenu->AppendSeparator();
|
||||||
item = new wxMenuItem( helpMenu, ID_KICAD_ABOUT, _( "&About" ),
|
item = new wxMenuItem( helpMenu, ID_KICAD_ABOUT, _( "&About" ),
|
||||||
_( "About kicad project manager" ) );
|
_( "About kicad project manager" ) );
|
||||||
item->SetBitmap( info_xpm );
|
item->SetBitmap( info_xpm );
|
||||||
helpMenu->Append( item );
|
helpMenu->Append( item );
|
||||||
|
|
||||||
|
#endif /* !defined( __WXMAC__ ) */
|
||||||
|
|
||||||
// Append menus to menuBar
|
// Append menus to menuBar
|
||||||
menuBar->Append( filesMenu, _( "&File" ) );
|
menuBar->Append( filesMenu, _( "&File" ) );
|
||||||
menuBar->Append( browseMenu, _( "&Browse" ) );
|
menuBar->Append( browseMenu, _( "&Browse" ) );
|
||||||
|
|
|
@ -85,6 +85,15 @@ void WinEDA_App::MacOpenFile(const wxString &fileName) {
|
||||||
bool WinEDA_App::OnInit()
|
bool WinEDA_App::OnInit()
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
{
|
{
|
||||||
|
/* WXMAC application specific */
|
||||||
|
/* TODO fix about dialog issue */
|
||||||
|
/* TODO fix SetExitOnFrameDelete */
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
// wxApp::SetExitOnFrameDelete(false);
|
||||||
|
// wxApp::s_macAboutMenuItemId = ID_KICAD_ABOUT;
|
||||||
|
wxApp::s_macPreferencesMenuItemId = ID_OPTIONS_SETUP;
|
||||||
|
#endif /* __WXMAC__ */
|
||||||
|
|
||||||
WinEDA_MainFrame* frame;
|
WinEDA_MainFrame* frame;
|
||||||
|
|
||||||
InitEDA_Appl( wxT( "KiCad" ), APP_TYPE_KICAD );
|
InitEDA_Appl( wxT( "KiCad" ), APP_TYPE_KICAD );
|
||||||
|
|
|
@ -7,13 +7,13 @@
|
||||||
# Original credits by Adium developers !
|
# Original credits by Adium developers !
|
||||||
# http://www.adium.im
|
# http://www.adium.im
|
||||||
###########
|
###########
|
||||||
VERSION=20100116
|
VERSION=20100118
|
||||||
|
|
||||||
###########
|
###########
|
||||||
# Variables
|
# Variables
|
||||||
###########
|
###########
|
||||||
BUILD_DIR=build
|
BUILD_DIR=build
|
||||||
APP_DIR=bin
|
APP_DIR=release
|
||||||
KICAD_DIR=$(BUILD_DIR)
|
KICAD_DIR=$(BUILD_DIR)
|
||||||
RELEASE_NAME=kicad-$(VERSION)
|
RELEASE_NAME=kicad-$(VERSION)
|
||||||
|
|
||||||
|
|
|
@ -27,6 +27,7 @@ static void Process_Move_Item( WinEDA_PcbFrame* frame,
|
||||||
EDA_BaseStruct* DrawStruct, wxDC* DC );
|
EDA_BaseStruct* DrawStruct, wxDC* DC );
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Handles the selection of command events. */
|
/* Handles the selection of command events. */
|
||||||
void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
|
void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
|
@ -151,10 +152,6 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
|
||||||
case 0:
|
case 0:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ID_EXIT:
|
|
||||||
Close( true );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ID_OPEN_MODULE_EDITOR:
|
case ID_OPEN_MODULE_EDITOR:
|
||||||
if( m_ModuleEditFrame == NULL )
|
if( m_ModuleEditFrame == NULL )
|
||||||
{
|
{
|
||||||
|
|
|
@ -36,13 +36,13 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
|
||||||
wxMenu* filesMenu = new wxMenu;
|
wxMenu* filesMenu = new wxMenu;
|
||||||
|
|
||||||
/* New Board */
|
/* New Board */
|
||||||
item = new wxMenuItem( filesMenu, ID_NEW_BOARD, _( "&New" ),
|
item = new wxMenuItem( filesMenu, ID_NEW_BOARD, _( "&New\tCtrl+N" ),
|
||||||
_( "Clear current board and initialize a new one" ) );
|
_( "Clear current board and initialize a new one" ) );
|
||||||
item->SetBitmap( new_xpm );
|
item->SetBitmap( new_xpm );
|
||||||
filesMenu->Append( item );
|
filesMenu->Append( item );
|
||||||
|
|
||||||
/* Load Board */
|
/* Load Board */
|
||||||
item = new wxMenuItem( filesMenu, ID_LOAD_FILE, _( "&Open" ),
|
item = new wxMenuItem( filesMenu, ID_LOAD_FILE, _( "&Open\tCtrl+O" ),
|
||||||
_( "Delete current board and load new board" ) );
|
_( "Delete current board and load new board" ) );
|
||||||
item->SetBitmap( open_xpm );
|
item->SetBitmap( open_xpm );
|
||||||
filesMenu->Append( item );
|
filesMenu->Append( item );
|
||||||
|
@ -66,14 +66,14 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
|
||||||
|
|
||||||
/* Save */
|
/* Save */
|
||||||
item = new wxMenuItem( filesMenu, ID_SAVE_BOARD,
|
item = new wxMenuItem( filesMenu, ID_SAVE_BOARD,
|
||||||
_( "&Save" ),
|
_( "&Save\tCtrl+S" ),
|
||||||
_( "Save current board" ) );
|
_( "Save current board" ) );
|
||||||
item->SetBitmap( save_xpm );
|
item->SetBitmap( save_xpm );
|
||||||
filesMenu->Append( item );
|
filesMenu->Append( item );
|
||||||
|
|
||||||
/* Save As */
|
/* Save As */
|
||||||
item = new wxMenuItem( filesMenu, ID_SAVE_BOARD_AS,
|
item = new wxMenuItem( filesMenu, ID_SAVE_BOARD_AS,
|
||||||
_( "Save as..." ),
|
_( "Save as...\tShift+Ctrl+S" ),
|
||||||
_( "Save the current board as.." ) );
|
_( "Save the current board as.." ) );
|
||||||
item->SetBitmap( save_as_xpm );
|
item->SetBitmap( save_as_xpm );
|
||||||
filesMenu->Append( item );
|
filesMenu->Append( item );
|
||||||
|
@ -185,7 +185,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
|
||||||
filesMenu->AppendSeparator();
|
filesMenu->AppendSeparator();
|
||||||
|
|
||||||
/* Print */
|
/* Print */
|
||||||
item = new wxMenuItem( filesMenu, ID_GEN_PRINT, _( "P&rint" ),
|
item = new wxMenuItem( filesMenu, ID_GEN_PRINT, _( "&Print\tCtrl+P" ),
|
||||||
_( "Print pcb board" ) );
|
_( "Print pcb board" ) );
|
||||||
item->SetBitmap( print_button );
|
item->SetBitmap( print_button );
|
||||||
filesMenu->Append( item );
|
filesMenu->Append( item );
|
||||||
|
@ -222,13 +222,17 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
|
||||||
_( "Archive or add footprints in a library file" ),
|
_( "Archive or add footprints in a library file" ),
|
||||||
library_xpm );
|
library_xpm );
|
||||||
|
|
||||||
/* Exit */
|
/* Quit on all platforms except WXMAC */
|
||||||
|
#if !defined( __WXMAC__ )
|
||||||
|
|
||||||
filesMenu->AppendSeparator();
|
filesMenu->AppendSeparator();
|
||||||
item = new wxMenuItem( filesMenu, ID_EXIT, _( "&Quit" ),
|
item = new wxMenuItem( filesMenu, wxID_EXIT, _( "&Quit" ),
|
||||||
_( "Quit PCBNew" ) );
|
_( "Quit PCBNew" ) );
|
||||||
item->SetBitmap( exit_xpm );
|
|
||||||
filesMenu->Append( item );
|
filesMenu->Append( item );
|
||||||
|
|
||||||
|
#endif /* !defined( __WXMAC__ ) */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Edit menu
|
* Edit menu
|
||||||
|
@ -236,15 +240,25 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
|
||||||
wxMenu* editMenu = new wxMenu;
|
wxMenu* editMenu = new wxMenu;
|
||||||
|
|
||||||
/* Undo */
|
/* Undo */
|
||||||
/* TODO add Undo hotkey */
|
#if !defined( __WXMAC__)
|
||||||
item = new wxMenuItem( editMenu, ID_UNDO_BUTT, _( "Undo" ),
|
text = AddHotkeyName( _( "Undo" ), s_Pcbnew_Editor_Hokeys_Descr, HK_UNDO);
|
||||||
|
#else
|
||||||
|
text = _( "Undo\tCtrl+Z" );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
item = new wxMenuItem( editMenu, ID_UNDO_BUTT, text,
|
||||||
_( "Undo last edition" ), wxITEM_NORMAL );
|
_( "Undo last edition" ), wxITEM_NORMAL );
|
||||||
item->SetBitmap( undo_xpm );
|
item->SetBitmap( undo_xpm );
|
||||||
editMenu->Append( item );
|
editMenu->Append( item );
|
||||||
|
|
||||||
/* Redo */
|
/* Redo */
|
||||||
/* TODO add Redo hotkey */
|
#if !defined( __WXMAC__)
|
||||||
item = new wxMenuItem( editMenu, ID_REDO_BUTT, _( "Redo" ),
|
text = AddHotkeyName( _( "Redo" ), s_Pcbnew_Editor_Hokeys_Descr, HK_REDO);
|
||||||
|
#else
|
||||||
|
text = _( "Redo\tShift+Ctrl+Z" );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
item = new wxMenuItem( editMenu, ID_REDO_BUTT, text,
|
||||||
_( "Redo the last undo command" ), wxITEM_NORMAL );
|
_( "Redo the last undo command" ), wxITEM_NORMAL );
|
||||||
item->SetBitmap( redo_xpm );
|
item->SetBitmap( redo_xpm );
|
||||||
editMenu->Append( item );
|
editMenu->Append( item );
|
||||||
|
@ -253,7 +267,12 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
|
||||||
editMenu->AppendSeparator();
|
editMenu->AppendSeparator();
|
||||||
|
|
||||||
/* Find */
|
/* Find */
|
||||||
|
#if !defined( __WXMAC__)
|
||||||
text = AddHotkeyName( _( "&Find..." ), s_Pcbnew_Editor_Hokeys_Descr, HK_FIND_ITEM );
|
text = AddHotkeyName( _( "&Find..." ), s_Pcbnew_Editor_Hokeys_Descr, HK_FIND_ITEM );
|
||||||
|
#else
|
||||||
|
text = _( "Find\tCtrl+F" );
|
||||||
|
#endif
|
||||||
|
|
||||||
item = new wxMenuItem( editMenu, ID_FIND_ITEMS, text,
|
item = new wxMenuItem( editMenu, ID_FIND_ITEMS, text,
|
||||||
_( "Find components and text in current loaded board" ) );
|
_( "Find components and text in current loaded board" ) );
|
||||||
item->SetBitmap( find_xpm );
|
item->SetBitmap( find_xpm );
|
||||||
|
@ -291,24 +310,41 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
|
||||||
wxMenu* viewMenu = new wxMenu;
|
wxMenu* viewMenu = new wxMenu;
|
||||||
|
|
||||||
/* Zoom in */
|
/* Zoom in */
|
||||||
text = AddHotkeyName( _( "Zoom in" ), s_Pcbnew_Editor_Hokeys_Descr, HK_ZOOM_IN );
|
#if !defined( __WXMAC__)
|
||||||
item = new wxMenuItem( viewMenu, ID_ZOOM_IN, text, _( "Zoom in" ),
|
text = AddHotkeyName( _( "Zoom In" ), s_Pcbnew_Editor_Hokeys_Descr,
|
||||||
|
HK_ZOOM_IN );
|
||||||
|
#else
|
||||||
|
text = _( "Zoom In\tCtrl++" );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
item = new wxMenuItem( viewMenu, ID_ZOOM_IN, text, _( "Zoom In" ),
|
||||||
wxITEM_NORMAL );
|
wxITEM_NORMAL );
|
||||||
item->SetBitmap( zoom_in_xpm );
|
item->SetBitmap( zoom_in_xpm );
|
||||||
viewMenu->Append( item );
|
viewMenu->Append( item );
|
||||||
|
|
||||||
/* Zoom out */
|
/* Zoom out */
|
||||||
|
#if !defined( __WXMAC__)
|
||||||
text = AddHotkeyName( _( "Zoom out" ), s_Pcbnew_Editor_Hokeys_Descr,
|
text = AddHotkeyName( _( "Zoom out" ), s_Pcbnew_Editor_Hokeys_Descr,
|
||||||
HK_ZOOM_OUT );
|
HK_ZOOM_OUT );
|
||||||
item = new wxMenuItem( viewMenu, ID_ZOOM_OUT, text, _( "Zoom out" ),
|
#else
|
||||||
|
text = _( "Zoom Out\tCtrl+-" );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
item = new wxMenuItem( viewMenu, ID_ZOOM_OUT, text, _( "Zoom Out" ),
|
||||||
wxITEM_NORMAL );
|
wxITEM_NORMAL );
|
||||||
item->SetBitmap( zoom_out_xpm );
|
item->SetBitmap( zoom_out_xpm );
|
||||||
viewMenu->Append( item );
|
viewMenu->Append( item );
|
||||||
|
|
||||||
/* Zoom auto */
|
/* Fit on Screen */
|
||||||
text = AddHotkeyName( _( "Zoom auto" ), s_Pcbnew_Editor_Hokeys_Descr,
|
#if !defined( __WXMAC__)
|
||||||
|
text = AddHotkeyName( _( "Fit on Screen" ), s_Pcbnew_Editor_Hokeys_Descr,
|
||||||
HK_ZOOM_AUTO );
|
HK_ZOOM_AUTO );
|
||||||
item = new wxMenuItem( viewMenu, ID_ZOOM_PAGE, text, _( "Zoom auto" ),
|
#else
|
||||||
|
text = _( "Fit on Screen\tCtrl+0" );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
item = new wxMenuItem( viewMenu, ID_ZOOM_PAGE, text,
|
||||||
|
_( "Zoom to fit the board on the screen" ),
|
||||||
wxITEM_NORMAL );
|
wxITEM_NORMAL );
|
||||||
item->SetBitmap( zoom_auto_xpm );
|
item->SetBitmap( zoom_auto_xpm );
|
||||||
viewMenu->Append( item );
|
viewMenu->Append( item );
|
||||||
|
@ -316,9 +352,15 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
|
||||||
viewMenu->AppendSeparator();
|
viewMenu->AppendSeparator();
|
||||||
|
|
||||||
/* Redraw view */
|
/* Redraw view */
|
||||||
text = AddHotkeyName( _( "Redraw view" ), s_Pcbnew_Editor_Hokeys_Descr,
|
#if !defined( __WXMAC__)
|
||||||
|
text = AddHotkeyName( _( "Redraw" ), s_Pcbnew_Editor_Hokeys_Descr,
|
||||||
HK_ZOOM_REDRAW );
|
HK_ZOOM_REDRAW );
|
||||||
item = new wxMenuItem( viewMenu, ID_ZOOM_REDRAW, text, _( "Zoom auto" ),
|
#else
|
||||||
|
text = _( "Redraw\tCtrl+R" );
|
||||||
|
#endif
|
||||||
|
|
||||||
|
item = new wxMenuItem( viewMenu, ID_ZOOM_REDRAW, text,
|
||||||
|
_( "Redraw the screen of the board" ),
|
||||||
wxITEM_NORMAL );
|
wxITEM_NORMAL );
|
||||||
item->SetBitmap( zoom_redraw_xpm );
|
item->SetBitmap( zoom_redraw_xpm );
|
||||||
viewMenu->Append( item );
|
viewMenu->Append( item );
|
||||||
|
@ -464,11 +506,16 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
|
||||||
item->SetBitmap( help_xpm );
|
item->SetBitmap( help_xpm );
|
||||||
helpMenu->Append( item );
|
helpMenu->Append( item );
|
||||||
|
|
||||||
|
|
||||||
|
/* About on all platforms except WXMAC */
|
||||||
|
#if !defined(__WXMAC__)
|
||||||
|
|
||||||
item = new wxMenuItem( helpMenu, ID_KICAD_ABOUT, _( "&About" ),
|
item = new wxMenuItem( helpMenu, ID_KICAD_ABOUT, _( "&About" ),
|
||||||
_( "About PCBnew printed circuit board designer" ) );
|
_( "About PCBnew printed circuit board designer" ) );
|
||||||
item->SetBitmap( info_xpm );
|
item->SetBitmap( info_xpm );
|
||||||
helpMenu->Append( item );
|
helpMenu->Append( item );
|
||||||
|
|
||||||
|
#endif /* !defined(__WXMAC__) */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Append all menus to the menuBar
|
* Append all menus to the menuBar
|
||||||
|
|
|
@ -72,7 +72,7 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame )
|
||||||
EVT_MENU( ID_MENU_ARCHIVE_ALL_MODULES,
|
EVT_MENU( ID_MENU_ARCHIVE_ALL_MODULES,
|
||||||
WinEDA_PcbFrame::Process_Special_Functions )
|
WinEDA_PcbFrame::Process_Special_Functions )
|
||||||
|
|
||||||
EVT_MENU( ID_EXIT, WinEDA_PcbFrame::Process_Special_Functions )
|
EVT_MENU( wxID_EXIT, WinEDA_PcbFrame::OnQuit )
|
||||||
|
|
||||||
// menu Config
|
// menu Config
|
||||||
EVT_MENU_RANGE( ID_CONFIG_AND_PREFERENCES_START,
|
EVT_MENU_RANGE( ID_CONFIG_AND_PREFERENCES_START,
|
||||||
|
@ -319,6 +319,10 @@ WinEDA_PcbFrame::~WinEDA_PcbFrame()
|
||||||
delete m_drc;
|
delete m_drc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WinEDA_PcbFrame::OnQuit( wxCommandEvent & WXUNUSED(event) )
|
||||||
|
{
|
||||||
|
Close(true);
|
||||||
|
}
|
||||||
|
|
||||||
void WinEDA_PcbFrame::OnCloseWindow( wxCloseEvent& Event )
|
void WinEDA_PcbFrame::OnCloseWindow( wxCloseEvent& Event )
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include "zones.h"
|
#include "zones.h"
|
||||||
#include "drag.h"
|
#include "drag.h"
|
||||||
#include "eda_dde.h"
|
#include "eda_dde.h"
|
||||||
|
#include "id.h"
|
||||||
|
|
||||||
#include "build_version.h"
|
#include "build_version.h"
|
||||||
|
|
||||||
|
@ -79,6 +80,14 @@ void WinEDA_App::MacOpenFile(const wxString &fileName) {
|
||||||
bool WinEDA_App::OnInit()
|
bool WinEDA_App::OnInit()
|
||||||
/****************************/
|
/****************************/
|
||||||
{
|
{
|
||||||
|
/* WXMAC application specific */
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
// wxApp::SetExitOnFrameDelete(false);
|
||||||
|
// wxApp::s_macAboutMenuItemId = ID_KICAD_ABOUT;
|
||||||
|
wxApp::s_macPreferencesMenuItemId = ID_OPTIONS_SETUP;
|
||||||
|
#endif /* __WXMAC__ */
|
||||||
|
|
||||||
|
|
||||||
wxFileName fn;
|
wxFileName fn;
|
||||||
WinEDA_PcbFrame* frame = NULL;
|
WinEDA_PcbFrame* frame = NULL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue