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
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>
================================================================================
++any
......
......@@ -3,10 +3,16 @@ KiCad TODO List
CMAKE
-----
* Add install targets for binaries and resources on Mac.
* 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
------
......
......@@ -799,7 +799,7 @@ void WinEDA_DrawPanel::DrawGrid( wxDC* DC )
// Under linux, to be tested (could be depend on linux versions
// 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
// 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 )
EVT_MENU( ID_SAVE_PROJECT,
WinEDA_CvpcbFrame::SaveQuitCvpcb )
EVT_MENU( ID_CVPCB_QUIT,
EVT_MENU( wxID_EXIT,
WinEDA_CvpcbFrame::OnQuit )
EVT_MENU( ID_GENERAL_HELP,
WinEDA_CvpcbFrame::GetKicadHelp )
......
......@@ -36,7 +36,7 @@ const wxString titleLibLoadError( _( "Library Load Error" ) );
* http://wiki.wxwidgets.org/WxMac-specific_topics
*/
void WinEDA_App::MacOpenFile(const wxString &fileName) {
wxFileName fn = fileName;
wxFileName filename = fileName;
wxString oldPath;
WinEDA_CvpcbFrame * frame = ((WinEDA_CvpcbFrame*)GetTopWindow());
......@@ -46,16 +46,16 @@ void WinEDA_App::MacOpenFile(const wxString &fileName) {
/* Update the library search path list. */
if( wxGetApp().GetLibraryPathList().Index( oldPath ) != wxNOT_FOUND )
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() )
{
frame->SetLastProject( fn.GetFullPath() );
frame->SetLastProject( filename.GetFullPath() );
frame->SetTitle( wxGetApp().GetTitle() + wxT( " " ) + GetBuildVersion() +
wxT( " " ) + fn.GetFullPath() );
wxT( " " ) + filename.GetFullPath() );
}
else
{
......@@ -75,8 +75,16 @@ IMPLEMENT_APP( WinEDA_App )
bool WinEDA_App::OnInit()
{
wxFileName fn;
wxString msg;
/* WXMAC application specific */
#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;
InitEDA_Appl( wxT( "CvPCB" ), APP_TYPE_CVPCB );
......@@ -89,8 +97,8 @@ bool WinEDA_App::OnInit()
if( argc > 1 )
{
fn = argv[1];
wxSetWorkingDirectory( fn.GetPath() );
filename = argv[1];
wxSetWorkingDirectory( filename.GetPath() );
}
// 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
SetTopWindow( frame );
frame->LoadProjectFile( fn.GetFullPath() );
frame->LoadProjectFile( filename.GetFullPath() );
frame->Show( TRUE );
frame->BuildFOOTPRINTS_LISTBOX();
if( fn.IsOk() && fn.FileExists() )
if( filename.IsOk() && filename.FileExists() )
{
frame->m_NetlistFileName = fn;
frame->m_NetlistFileName = filename;
if( frame->ReadNetList() )
{
frame->m_NetlistFileExtension = fn.GetExt();
frame->m_NetlistFileExtension = filename.GetExt();
return true;
}
}
......
/***************************************/
/* menucfg : build the cvpcb main menu */
/***************************************/
/**
* @file menubar.cpp
* (Re)Create the CvPCB main MenuBar
*/
#include "fctsys.h"
#include "appl_wxstruct.h"
#include "common.h"
......@@ -28,6 +28,16 @@ void WinEDA_CvpcbFrame::ReCreateMenuBar()
item->SetBitmap( open_xpm );
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();
item = new wxMenuItem( filesMenu, ID_SAVE_PROJECT,
_( "&Save As..." ),
......@@ -35,13 +45,15 @@ void WinEDA_CvpcbFrame::ReCreateMenuBar()
item->SetBitmap( save_xpm );
filesMenu->Append( item );
/* Quit on all platforms except WXMAC */
#if !defined(__WXMAC__)
filesMenu->AppendSeparator();
item = new wxMenuItem( filesMenu, ID_CVPCB_QUIT, _( "E&xit" ),
_( "Quit Cvpcb" ) );
item->SetBitmap( exit_xpm );
item = new wxMenuItem( filesMenu, wxID_EXIT, _( "&Quit" ),
_( "Quit CvPCB" ) );
filesMenu->Append( item );
wxGetApp().m_fileHistory.AddFilesToMenu( filesMenu );
#endif /* !defined( __WXMAC__) */
// Menu Configuration:
wxMenu* configmenu = new wxMenu;
......@@ -70,12 +82,21 @@ void WinEDA_CvpcbFrame::ReCreateMenuBar()
_( "Open the cvpcb manual" ) );
item->SetBitmap( help_xpm );
helpMenu->Append( item );
/* About on all platforms except WXMAC */
#if !defined(__WXMAC__)
item = new wxMenuItem( helpMenu, ID_KICAD_ABOUT,
_( "&About cvpcb" ),
_( "&About" ),
_( "About cvpcb schematic to pcb converter" ) );
item->SetBitmap( info_xpm );
helpMenu->Append( item );
#endif /* !defined(__WXMAC__) */
/**
* Create the menubar and append all submenus
*/
menuBar->Append( filesMenu, _( "&File" ) );
menuBar->Append( configmenu, _( "&Preferences" ) );
menuBar->Append( helpMenu, _( "&Help" ) );
......@@ -84,3 +105,4 @@ void WinEDA_CvpcbFrame::ReCreateMenuBar()
* rebuilt. This allows language changes of the menu text on the fly. */
SetMenuBar( menuBar );
}
......@@ -4,15 +4,6 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/common
${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
annotate.cpp
......@@ -157,15 +148,15 @@ if(APPLE)
set(MACOSX_BUNDLE_GUI_IDENTIFIER org.kicad-eda.eeschema)
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)
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)
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}
COMPONENT binary)
......
......@@ -111,15 +111,15 @@ void WinEDA_App::MacOpenFile(const wxString &fileName) {
bool WinEDA_App::OnInit()
{
/* WXMAC application specific */
#ifdef __WXMAC__
wxApp::SetExitOnFrameDelete(false);
wxApp::s_macAboutMenuItemId = ID_KICAD_ABOUT;
wxApp::s_macPreferencesMenuItemId = ID_CONFIG_REQ;
// wxApp::SetExitOnFrameDelete(false);
// wxApp::s_macAboutMenuItemId = ID_KICAD_ABOUT;
wxApp::s_macPreferencesMenuItemId = ID_OPTIONS_SETUP;
#endif /* __WXMAC__ */
wxFileName fn;
wxFileName filename;
WinEDA_SchematicFrame* frame = NULL;
g_DebugLevel = 0; // Debug level */
......@@ -133,7 +133,7 @@ bool WinEDA_App::OnInit()
}
if( argc > 1 )
fn = argv[1];
filename = argv[1];
/* init EESCHEMA */
SeedLayers();
......@@ -166,13 +166,13 @@ bool WinEDA_App::OnInit()
frame->Zoom_Automatique( TRUE );
/* Load file specified in the command line. */
if( fn.IsOk() )
if( filename.IsOk() )
{
if( fn.GetExt() != SchematicFileExtension )
fn.SetExt( SchematicFileExtension );
wxSetWorkingDirectory( fn.GetPath() );
if( filename.GetExt() != SchematicFileExtension )
filename.SetExt( SchematicFileExtension );
wxSetWorkingDirectory( filename.GetPath() );
if( frame->DrawPanel
&& frame->LoadOneEEProject( fn.GetFullPath(), false ) <= 0 )
&& frame->LoadOneEEProject( filename.GetFullPath(), false ) <= 0 )
frame->DrawPanel->Refresh( true );
}
else
......
......@@ -47,22 +47,50 @@
/* local variables */
/* 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 );
static Ki_HotkeyInfo HkZoomCenter( wxT( "Zoom Center" ), HK_ZOOM_CENTER,
WXK_F4 );
static Ki_HotkeyInfo HkZoomRedraw( wxT( "Zoom Redraw" ), HK_ZOOM_REDRAW,
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 HkResetLocalCoord( wxT( "Reset local coord." ),
HK_RESET_LOCAL_COORD, ' ' );
/* Undo */
static Ki_HotkeyInfo HkUndo( wxT( "Undo" ), HK_UNDO, GR_KB_CTRL + 'Z',
(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 );
#else
static Ki_HotkeyInfo HkRedo( wxT( "Redo" ), HK_REDO,
GR_KB_SHIFT + GR_KB_CTRL + 'Z',
(int) ID_SCHEMATIC_REDO );
#endif
// Schematic editor
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 )
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_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 )
......
......@@ -87,6 +87,8 @@ public:
~WinEDA_PcbFrame();
void OnQuit( wxCommandEvent & WXUNUSED(event) );
/** Function ToPlotter
* Open a dialog frame to create plot and drill files
* relative to the current board
......
......@@ -29,7 +29,7 @@ BEGIN_EVENT_TABLE( WinEDA_MainFrame, WinEDA_BasicFrame )
/* Menu events */
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_BROWSE_AN_SELECT_FILE,
WinEDA_MainFrame::OnOpenFileInTextEditor )
......@@ -127,12 +127,17 @@ void WinEDA_MainFrame::ReCreateMenuBar()
// Separator
filesMenu->AppendSeparator();
// Exit
item = new wxMenuItem( filesMenu, ID_EXIT, _( "E&xit" ),
_( "Quit kicad" ) );
/* Quit on all platforms except WXMAC */
#if !defined( __WXMAC__ )
filesMenu->AppendSeparator();
item = new wxMenuItem( filesMenu, wxID_EXIT, _( "&Quit" ),
_( "Quit KiCad" ) );
item->SetBitmap( exit_xpm );
filesMenu->Append( item );
#endif /* !defined( __WXMAC__ ) */
/* Add the file history */
wxGetApp().m_fileHistory.AddFilesToMenu( filesMenu );
......@@ -222,12 +227,17 @@ void WinEDA_MainFrame::ReCreateMenuBar()
item->SetBitmap( help_xpm );
helpMenu->Append( item );
// About Kicad
// About on all platforms except WXMAC */
#if !defined( __WXMAC__ )
helpMenu->AppendSeparator();
item = new wxMenuItem( helpMenu, ID_KICAD_ABOUT, _( "&About" ),
_( "About kicad project manager" ) );
item->SetBitmap( info_xpm );
helpMenu->Append( item );
#endif /* !defined( __WXMAC__ ) */
// Append menus to menuBar
menuBar->Append( filesMenu, _( "&File" ) );
menuBar->Append( browseMenu, _( "&Browse" ) );
......
......@@ -85,6 +85,15 @@ void WinEDA_App::MacOpenFile(const wxString &fileName) {
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;
InitEDA_Appl( wxT( "KiCad" ), APP_TYPE_KICAD );
......
......@@ -7,13 +7,13 @@
# Original credits by Adium developers !
# http://www.adium.im
###########
VERSION=20100116
VERSION=20100118
###########
# Variables
###########
BUILD_DIR=build
APP_DIR=bin
APP_DIR=release
KICAD_DIR=$(BUILD_DIR)
RELEASE_NAME=kicad-$(VERSION)
......
......@@ -27,6 +27,7 @@ static void Process_Move_Item( WinEDA_PcbFrame* frame,
EDA_BaseStruct* DrawStruct, wxDC* DC );
/* Handles the selection of command events. */
void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
{
......@@ -151,10 +152,6 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
case 0:
break;
case ID_EXIT:
Close( true );
break;
case ID_OPEN_MODULE_EDITOR:
if( m_ModuleEditFrame == NULL )
{
......
......@@ -36,13 +36,13 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
wxMenu* filesMenu = new wxMenu;
/* 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" ) );
item->SetBitmap( new_xpm );
filesMenu->Append( item );
/* 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" ) );
item->SetBitmap( open_xpm );
filesMenu->Append( item );
......@@ -66,14 +66,14 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
/* Save */
item = new wxMenuItem( filesMenu, ID_SAVE_BOARD,
_( "&Save" ),
_( "&Save\tCtrl+S" ),
_( "Save current board" ) );
item->SetBitmap( save_xpm );
filesMenu->Append( item );
/* Save As */
item = new wxMenuItem( filesMenu, ID_SAVE_BOARD_AS,
_( "Save as..." ),
_( "Save as...\tShift+Ctrl+S" ),
_( "Save the current board as.." ) );
item->SetBitmap( save_as_xpm );
filesMenu->Append( item );
......@@ -185,7 +185,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
filesMenu->AppendSeparator();
/* Print */
item = new wxMenuItem( filesMenu, ID_GEN_PRINT, _( "P&rint" ),
item = new wxMenuItem( filesMenu, ID_GEN_PRINT, _( "&Print\tCtrl+P" ),
_( "Print pcb board" ) );
item->SetBitmap( print_button );
filesMenu->Append( item );
......@@ -222,13 +222,17 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
_( "Archive or add footprints in a library file" ),
library_xpm );
/* Exit */
/* Quit on all platforms except WXMAC */
#if !defined( __WXMAC__ )
filesMenu->AppendSeparator();
item = new wxMenuItem( filesMenu, ID_EXIT, _( "&Quit" ),
item = new wxMenuItem( filesMenu, wxID_EXIT, _( "&Quit" ),
_( "Quit PCBNew" ) );
item->SetBitmap( exit_xpm );
filesMenu->Append( item );
#endif /* !defined( __WXMAC__ ) */
/**
* Edit menu
......@@ -236,15 +240,25 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
wxMenu* editMenu = new wxMenu;
/* Undo */
/* TODO add Undo hotkey */
item = new wxMenuItem( editMenu, ID_UNDO_BUTT, _( "Undo" ),
#if !defined( __WXMAC__)
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 );
item->SetBitmap( undo_xpm );
editMenu->Append( item );
/* Redo */
/* TODO add Redo hotkey */
item = new wxMenuItem( editMenu, ID_REDO_BUTT, _( "Redo" ),
#if !defined( __WXMAC__)
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 );
item->SetBitmap( redo_xpm );
editMenu->Append( item );
......@@ -253,7 +267,12 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
editMenu->AppendSeparator();
/* Find */
#if !defined( __WXMAC__)
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,
_( "Find components and text in current loaded board" ) );
item->SetBitmap( find_xpm );
......@@ -291,24 +310,41 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
wxMenu* viewMenu = new wxMenu;
/* Zoom in */
text = AddHotkeyName( _( "Zoom in" ), s_Pcbnew_Editor_Hokeys_Descr, HK_ZOOM_IN );
item = new wxMenuItem( viewMenu, ID_ZOOM_IN, text, _( "Zoom in" ),
#if !defined( __WXMAC__)
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 );
item->SetBitmap( zoom_in_xpm );
viewMenu->Append( item );
/* Zoom out */
#if !defined( __WXMAC__)
text = AddHotkeyName( _( "Zoom out" ), s_Pcbnew_Editor_Hokeys_Descr,
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 );
item->SetBitmap( zoom_out_xpm );
viewMenu->Append( item );
/* Zoom auto */
text = AddHotkeyName( _( "Zoom auto" ), s_Pcbnew_Editor_Hokeys_Descr,
/* Fit on Screen */
#if !defined( __WXMAC__)
text = AddHotkeyName( _( "Fit on Screen" ), s_Pcbnew_Editor_Hokeys_Descr,
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 );
item->SetBitmap( zoom_auto_xpm );
viewMenu->Append( item );
......@@ -316,9 +352,15 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
viewMenu->AppendSeparator();
/* 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 );
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 );
item->SetBitmap( zoom_redraw_xpm );
viewMenu->Append( item );
......@@ -464,11 +506,16 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
item->SetBitmap( help_xpm );
helpMenu->Append( item );
/* About on all platforms except WXMAC */
#if !defined(__WXMAC__)
item = new wxMenuItem( helpMenu, ID_KICAD_ABOUT, _( "&About" ),
_( "About PCBnew printed circuit board designer" ) );
item->SetBitmap( info_xpm );
helpMenu->Append( item );
#endif /* !defined(__WXMAC__) */
/**
* Append all menus to the menuBar
......
......@@ -72,7 +72,7 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame )
EVT_MENU( ID_MENU_ARCHIVE_ALL_MODULES,
WinEDA_PcbFrame::Process_Special_Functions )
EVT_MENU( ID_EXIT, WinEDA_PcbFrame::Process_Special_Functions )
EVT_MENU( wxID_EXIT, WinEDA_PcbFrame::OnQuit )
// menu Config
EVT_MENU_RANGE( ID_CONFIG_AND_PREFERENCES_START,
......@@ -319,6 +319,10 @@ WinEDA_PcbFrame::~WinEDA_PcbFrame()
delete m_drc;
}
void WinEDA_PcbFrame::OnQuit( wxCommandEvent & WXUNUSED(event) )
{
Close(true);
}
void WinEDA_PcbFrame::OnCloseWindow( wxCloseEvent& Event )
{
......
......@@ -21,6 +21,7 @@
#include "zones.h"
#include "drag.h"
#include "eda_dde.h"
#include "id.h"
#include "build_version.h"
......@@ -79,6 +80,14 @@ void WinEDA_App::MacOpenFile(const wxString &fileName) {
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;
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