Commit 5a0aca0e authored by jerryjacobs's avatar jerryjacobs

More Mac OS X work, see CHANGELOG.txt

parent e3894962
...@@ -5,6 +5,17 @@ Please add newer entries at the top, list the date and your name with ...@@ -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
......
...@@ -3,10 +3,16 @@ KiCad TODO List ...@@ -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 ) ...@@ -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 ) ...@@ -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" ) ); ...@@ -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) { ...@@ -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 ) ...@@ -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() ...@@ -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() ...@@ -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;
} }
} }
......
/***************************************/ /**
/* 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() ...@@ -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() ...@@ -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() ...@@ -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() ...@@ -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} ...@@ -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) ...@@ -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) { ...@@ -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() ...@@ -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() ...@@ -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 @@ ...@@ -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' );
......
This diff is collapsed.
...@@ -56,7 +56,7 @@ BEGIN_EVENT_TABLE( WinEDA_SchematicFrame, WinEDA_DrawFrame ) ...@@ -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: ...@@ -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 ) ...@@ -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() ...@@ -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() ...@@ -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) { ...@@ -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 @@ ...@@ -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, ...@@ -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 ) ...@@ -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() ...@@ -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() ...@@ -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() ...@@ -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() ...@@ -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() ...@@ -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() ...@@ -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() ...@@ -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() ...@@ -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() ...@@ -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 ) ...@@ -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() ...@@ -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 @@ ...@@ -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) { ...@@ -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;
......
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