Commit 9d400e4c authored by charras's avatar charras

fixed some (minors) problems about hotkeys.

Code cleaning.
Patch for 3D problem with macOSX
parent 5a0aca0e
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: 3d_canvas.cpp // Name: 3d_canvas.cpp
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#include "fctsys.h" #include "fctsys.h"
...@@ -12,6 +13,7 @@ ...@@ -12,6 +13,7 @@
#include "wx/dataobj.h" #include "wx/dataobj.h"
#include "wx/clipbrd.h" #include "wx/clipbrd.h"
#include <wx/wupdlock.h>
#include "gestfich.h" #include "gestfich.h"
...@@ -27,17 +29,20 @@ ...@@ -27,17 +29,20 @@
*/ */
BEGIN_EVENT_TABLE( Pcb3D_GLCanvas, wxGLCanvas ) BEGIN_EVENT_TABLE( Pcb3D_GLCanvas, wxGLCanvas )
EVT_PAINT( Pcb3D_GLCanvas::OnPaint ) EVT_PAINT( Pcb3D_GLCanvas::OnPaint )
// key event:
EVT_CHAR( Pcb3D_GLCanvas::OnChar ) // key event:
// mouse events EVT_CHAR( Pcb3D_GLCanvas::OnChar )
EVT_RIGHT_DOWN( Pcb3D_GLCanvas::OnRightClick )
EVT_MOUSEWHEEL( Pcb3D_GLCanvas::OnMouseWheel ) // mouse events
EVT_MOTION( Pcb3D_GLCanvas::OnMouseMove ) EVT_RIGHT_DOWN( Pcb3D_GLCanvas::OnRightClick )
// other events EVT_MOUSEWHEEL( Pcb3D_GLCanvas::OnMouseWheel )
EVT_ERASE_BACKGROUND( Pcb3D_GLCanvas::OnEraseBackground ) EVT_MOTION( Pcb3D_GLCanvas::OnMouseMove )
EVT_MENU_RANGE( ID_POPUP_3D_VIEW_START, ID_POPUP_3D_VIEW_END,
Pcb3D_GLCanvas::OnPopUpMenu ) // other events
EVT_ERASE_BACKGROUND( Pcb3D_GLCanvas::OnEraseBackground )
EVT_MENU_RANGE( ID_POPUP_3D_VIEW_START, ID_POPUP_3D_VIEW_END,
Pcb3D_GLCanvas::OnPopUpMenu )
END_EVENT_TABLE() END_EVENT_TABLE()
Pcb3D_GLCanvas::Pcb3D_GLCanvas( WinEDA3D_DrawFrame* parent ) : Pcb3D_GLCanvas::Pcb3D_GLCanvas( WinEDA3D_DrawFrame* parent ) :
...@@ -203,6 +208,7 @@ void Pcb3D_GLCanvas::SetView3D( int keycode ) ...@@ -203,6 +208,7 @@ void Pcb3D_GLCanvas::SetView3D( int keycode )
Refresh( FALSE ); Refresh( FALSE );
} }
void Pcb3D_GLCanvas::OnMouseWheel( wxMouseEvent& event ) void Pcb3D_GLCanvas::OnMouseWheel( wxMouseEvent& event )
{ {
wxSize size( GetClientSize() ); wxSize size( GetClientSize() );
...@@ -302,67 +308,67 @@ void Pcb3D_GLCanvas::OnRightClick( wxMouseEvent& event ) ...@@ -302,67 +308,67 @@ void Pcb3D_GLCanvas::OnRightClick( wxMouseEvent& event )
pos.x = event.GetX(); pos.y = event.GetY(); pos.x = event.GetX(); pos.y = event.GetY();
wxMenuItem* item = new wxMenuItem( &PopUpMenu, ID_POPUP_ZOOMIN, wxMenuItem* item = new wxMenuItem( &PopUpMenu, ID_POPUP_ZOOMIN,
_( "Zoom +" ) ); _( "Zoom +" ) );
item->SetBitmap( zoom_in_xpm ); item->SetBitmap( zoom_in_xpm );
PopUpMenu.Append( item ); PopUpMenu.Append( item );
item = new wxMenuItem( &PopUpMenu, ID_POPUP_ZOOMOUT, item = new wxMenuItem( &PopUpMenu, ID_POPUP_ZOOMOUT,
_( "Zoom -" ) ); _( "Zoom -" ) );
item->SetBitmap( zoom_out_xpm ); item->SetBitmap( zoom_out_xpm );
PopUpMenu.Append( item ); PopUpMenu.Append( item );
PopUpMenu.AppendSeparator(); PopUpMenu.AppendSeparator();
item = new wxMenuItem( &PopUpMenu, ID_POPUP_VIEW_ZPOS, item = new wxMenuItem( &PopUpMenu, ID_POPUP_VIEW_ZPOS,
_( "Top View" ) ); _( "Top View" ) );
item->SetBitmap( axis3d_top_xpm ); item->SetBitmap( axis3d_top_xpm );
PopUpMenu.Append( item ); PopUpMenu.Append( item );
item = new wxMenuItem( &PopUpMenu, ID_POPUP_VIEW_ZNEG, item = new wxMenuItem( &PopUpMenu, ID_POPUP_VIEW_ZNEG,
_( "Bottom View" ) ); _( "Bottom View" ) );
item->SetBitmap( axis3d_bottom_xpm ); item->SetBitmap( axis3d_bottom_xpm );
PopUpMenu.Append( item ); PopUpMenu.Append( item );
PopUpMenu.AppendSeparator(); PopUpMenu.AppendSeparator();
item = new wxMenuItem( &PopUpMenu, ID_POPUP_VIEW_XPOS, item = new wxMenuItem( &PopUpMenu, ID_POPUP_VIEW_XPOS,
_( "Right View" ) ); _( "Right View" ) );
item->SetBitmap( axis3d_right_xpm ); item->SetBitmap( axis3d_right_xpm );
PopUpMenu.Append( item ); PopUpMenu.Append( item );
item = new wxMenuItem( &PopUpMenu, ID_POPUP_VIEW_XNEG, item = new wxMenuItem( &PopUpMenu, ID_POPUP_VIEW_XNEG,
_( "Left View" ) ); _( "Left View" ) );
item->SetBitmap( axis3d_left_xpm ); item->SetBitmap( axis3d_left_xpm );
PopUpMenu.Append( item ); PopUpMenu.Append( item );
PopUpMenu.AppendSeparator(); PopUpMenu.AppendSeparator();
item = new wxMenuItem( &PopUpMenu, ID_POPUP_VIEW_YPOS, item = new wxMenuItem( &PopUpMenu, ID_POPUP_VIEW_YPOS,
_( "Front View" ) ); _( "Front View" ) );
item->SetBitmap( axis3d_front_xpm ); item->SetBitmap( axis3d_front_xpm );
PopUpMenu.Append( item ); PopUpMenu.Append( item );
item = new wxMenuItem( &PopUpMenu, ID_POPUP_VIEW_YNEG, item = new wxMenuItem( &PopUpMenu, ID_POPUP_VIEW_YNEG,
_( "Back View" ) ); _( "Back View" ) );
item->SetBitmap( axis3d_back_xpm ); item->SetBitmap( axis3d_back_xpm );
PopUpMenu.Append( item ); PopUpMenu.Append( item );
PopUpMenu.AppendSeparator(); PopUpMenu.AppendSeparator();
item = new wxMenuItem( &PopUpMenu, ID_POPUP_MOVE3D_LEFT, item = new wxMenuItem( &PopUpMenu, ID_POPUP_MOVE3D_LEFT,
_( "Move left <-" ) ); _( "Move left <-" ) );
item->SetBitmap( left_xpm ); item->SetBitmap( left_xpm );
PopUpMenu.Append( item ); PopUpMenu.Append( item );
item = new wxMenuItem( &PopUpMenu, ID_POPUP_MOVE3D_RIGHT, item = new wxMenuItem( &PopUpMenu, ID_POPUP_MOVE3D_RIGHT,
_( "Move right ->" ) ); _( "Move right ->" ) );
item->SetBitmap( right_xpm ); item->SetBitmap( right_xpm );
PopUpMenu.Append( item ); PopUpMenu.Append( item );
item = new wxMenuItem( &PopUpMenu, ID_POPUP_MOVE3D_UP, item = new wxMenuItem( &PopUpMenu, ID_POPUP_MOVE3D_UP,
_( "Move Up ^" ) ); _( "Move Up ^" ) );
item->SetBitmap( up_xpm ); item->SetBitmap( up_xpm );
PopUpMenu.Append( item ); PopUpMenu.Append( item );
item = new wxMenuItem( &PopUpMenu, ID_POPUP_MOVE3D_DOWN, item = new wxMenuItem( &PopUpMenu, ID_POPUP_MOVE3D_DOWN,
_( "Move Down" ) ); _( "Move Down" ) );
item->SetBitmap( down_xpm ); item->SetBitmap( down_xpm );
PopUpMenu.Append( item ); PopUpMenu.Append( item );
...@@ -579,12 +585,52 @@ void Pcb3D_GLCanvas::TakeScreenshot( wxCommandEvent& event ) ...@@ -579,12 +585,52 @@ void Pcb3D_GLCanvas::TakeScreenshot( wxCommandEvent& event )
Redraw( true ); Redraw( true );
wxSize image_size = GetClientSize(); wxSize image_size = GetClientSize();
#ifndef __WXMAC__
wxClientDC dc( this ); wxClientDC dc( this );
wxBitmap bitmap( image_size.x, image_size.y ); wxBitmap bitmap( image_size.x, image_size.y );
wxMemoryDC memdc; wxMemoryDC memdc;
memdc.SelectObject( bitmap ); memdc.SelectObject( bitmap );
memdc.Blit( 0, 0, image_size.x, image_size.y, &dc, 0, 0 ); memdc.Blit( 0, 0, image_size.x, image_size.y, &dc, 0, 0 );
memdc.SelectObject( wxNullBitmap ); memdc.SelectObject( wxNullBitmap );
#else
struct vieport_params
{
GLint originx;
GLint originy;
GLint x;
GLint y;
} viewport;
wxWindowUpdateLocker noUpdates( this );
glGetIntegerv( GL_VIEWPORT, (GLint*) &viewport );
unsigned char* pixelbuffer = (unsigned char*) malloc( viewport.x * viewport.y * 3 );
unsigned char* alphabuffer = (unsigned char*) malloc( viewport.x * viewport.y );
wxImage image( viewport.x, viewport.y );
glPixelStorei( GL_PACK_ALIGNMEN T, 1 );
glReadBuffer( GL_BACK_LEFT );
glReadPixels( viewport.originx,
viewport.originy,
viewport.x,
viewport.y,
GL_RGB,
GL_UNSIGNED_ BYTE,
pixelbuffer );
glReadPixels( viewport.originx,
viewport.originy,
viewport.x,
viewport.y,
GL_ALPHA,
GL_UNSIGNED_ BYTE,
alphabuffer );
image.SetData( pixelbuffer );
image.SetAlpha( alphabuffer );
image = image.Mirror( false );
wxBitmap bitmap( image );
#endif
if( event.GetId() == ID_TOOL_SCREENCOPY_TOCLIBBOARD ) if( event.GetId() == ID_TOOL_SCREENCOPY_TOCLIBBOARD )
{ {
......
...@@ -162,7 +162,7 @@ static struct hotkey_name_descr s_Hotkey_Name_List[] = ...@@ -162,7 +162,7 @@ static struct hotkey_name_descr s_Hotkey_Name_List[] =
}; };
/* /** function ReturnKeyNameFromKeyCode
* return the key name from the key code * return the key name from the key code
* Only some wxWidgets key values are handled for function key ( see * Only some wxWidgets key values are handled for function key ( see
* s_Hotkey_Name_List[] ) * s_Hotkey_Name_List[] )
...@@ -201,7 +201,7 @@ wxString ReturnKeyNameFromKeyCode( int keycode ) ...@@ -201,7 +201,7 @@ wxString ReturnKeyNameFromKeyCode( int keycode )
} }
/* /** function AddHotkeyName
* Add the key name from the Command id value ( m_Idcommand member value) * Add the key name from the Command id value ( m_Idcommand member value)
* @param List = pointer to a Ki_HotkeyInfo list of commands * @param List = pointer to a Ki_HotkeyInfo list of commands
* @param CommandId = Command Id value * @param CommandId = Command Id value
...@@ -219,7 +219,7 @@ wxString AddHotkeyName( const wxString& text, Ki_HotkeyInfo** List, ...@@ -219,7 +219,7 @@ wxString AddHotkeyName( const wxString& text, Ki_HotkeyInfo** List,
} }
/* /** function AddHotkeyName
* Add the key name from the Command id value ( m_Idcommand member value) * Add the key name from the Command id value ( m_Idcommand member value)
* @param List = pointer to a Ki_HotkeyInfoSectionDescriptor* DescrList of * @param List = pointer to a Ki_HotkeyInfoSectionDescriptor* DescrList of
* commands * commands
...@@ -249,7 +249,7 @@ wxString AddHotkeyName( const wxString& text, ...@@ -249,7 +249,7 @@ wxString AddHotkeyName( const wxString& text,
} }
/* /** function ReturnKeyNameFromCommandId
* return the key name from the Command id value ( m_Idcommand member value) * return the key name from the Command id value ( m_Idcommand member value)
* @param List = pointer to a Ki_HotkeyInfo list of commands * @param List = pointer to a Ki_HotkeyInfo list of commands
* @param CommandId = Command Id value * @param CommandId = Command Id value
...@@ -273,7 +273,7 @@ wxString ReturnKeyNameFromCommandId( Ki_HotkeyInfo** List, int CommandId ) ...@@ -273,7 +273,7 @@ wxString ReturnKeyNameFromCommandId( Ki_HotkeyInfo** List, int CommandId )
} }
/* /** function ReturnKeyCodeFromKeyName
* return the key code from its key name * return the key code from its key name
* Only some wxWidgets key values are handled for function key * Only some wxWidgets key values are handled for function key
* @param keyname = wxString key name to find in s_Hotkey_Name_List[], * @param keyname = wxString key name to find in s_Hotkey_Name_List[],
...@@ -300,7 +300,7 @@ static int ReturnKeyCodeFromKeyName( const wxString& keyname ) ...@@ -300,7 +300,7 @@ static int ReturnKeyCodeFromKeyName( const wxString& keyname )
} }
/* /** function DisplayHotkeyList
* Displays the current hotkey list * Displays the current hotkey list
* @param frame = current active frame * @param frame = current active frame
* @param List = pointer to a Ki_HotkeyInfoSectionDescriptor list * @param List = pointer to a Ki_HotkeyInfoSectionDescriptor list
...@@ -331,7 +331,7 @@ void DisplayHotkeyList( WinEDA_DrawFrame* frame, ...@@ -331,7 +331,7 @@ void DisplayHotkeyList( WinEDA_DrawFrame* frame,
} }
/* /** function GetDescriptorFromHotkey
* Return a Ki_HotkeyInfo * pointer fron a key code for OnHotKey() function * Return a Ki_HotkeyInfo * pointer fron a key code for OnHotKey() function
* @param key = key code (ascii value, or wxWidgets value for function keys * @param key = key code (ascii value, or wxWidgets value for function keys
* @param List = pointer to a Ki_HotkeyInfo list of commands * @param List = pointer to a Ki_HotkeyInfo list of commands
......
...@@ -14,10 +14,8 @@ ...@@ -14,10 +14,8 @@
enum id_eeschema_frm enum id_eeschema_frm
{ {
/* Schecmatic editor horizontal toolbar IDs */ /* Schematic editor horizontal toolbar IDs */
ID_SCHEMATIC_UNDO = ID_END_LIST, ID_HIERARCHY = ID_END_LIST,
ID_SCHEMATIC_REDO,
ID_HIERARCHY,
ID_TO_LIBVIEW, ID_TO_LIBVIEW,
ID_GET_ANNOTATE, ID_GET_ANNOTATE,
ID_GET_ERC, ID_GET_ERC,
...@@ -138,8 +136,6 @@ enum id_eeschema_frm ...@@ -138,8 +136,6 @@ enum id_eeschema_frm
ID_LIBEDIT_GET_FRAME_EDIT_PART, ID_LIBEDIT_GET_FRAME_EDIT_PART,
ID_LIBEDIT_GET_FRAME_EDIT_FIELDS, ID_LIBEDIT_GET_FRAME_EDIT_FIELDS,
ID_LIBEDIT_DELETE_PART, ID_LIBEDIT_DELETE_PART,
ID_LIBEDIT_UNDO,
ID_LIBEDIT_REDO,
ID_DE_MORGAN_NORMAL_BUTT, ID_DE_MORGAN_NORMAL_BUTT,
ID_DE_MORGAN_CONVERT_BUTT, ID_DE_MORGAN_CONVERT_BUTT,
ID_LIBEDIT_EDIT_PIN_BY_PIN, ID_LIBEDIT_EDIT_PIN_BY_PIN,
......
...@@ -80,12 +80,12 @@ static Ki_HotkeyInfo HkResetLocalCoord( wxT( "Reset local coord." ), ...@@ -80,12 +80,12 @@ static Ki_HotkeyInfo HkResetLocalCoord( wxT( "Reset local coord." ),
/* Undo */ /* 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) wxID_UNDO );
/* Redo */ /* Redo */
#if !defined( __WXMAC__ ) #if !defined( __WXMAC__ )
static Ki_HotkeyInfo HkRedo( wxT( "Redo" ), HK_REDO, GR_KB_CTRL + 'Y', static Ki_HotkeyInfo HkRedo( wxT( "Redo" ), HK_REDO, GR_KB_CTRL + 'Y',
(int) ID_SCHEMATIC_REDO ); (int) wxID_REDO );
#else #else
static Ki_HotkeyInfo HkRedo( wxT( "Redo" ), HK_REDO, static Ki_HotkeyInfo HkRedo( wxT( "Redo" ), HK_REDO,
GR_KB_SHIFT + GR_KB_CTRL + 'Z', GR_KB_SHIFT + GR_KB_CTRL + 'Z',
...@@ -699,7 +699,7 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -699,7 +699,7 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey,
case HK_UNDO: case HK_UNDO:
if( !ItemInEdit ) if( !ItemInEdit )
{ {
toolCmd.SetId( ID_LIBEDIT_UNDO ); toolCmd.SetId( wxID_UNDO );
GetEventHandler()->ProcessEvent( toolCmd ); GetEventHandler()->ProcessEvent( toolCmd );
} }
break; break;
...@@ -707,7 +707,7 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -707,7 +707,7 @@ void WinEDA_LibeditFrame::OnHotKey( wxDC* DC, int hotkey,
case HK_REDO: case HK_REDO:
if( !ItemInEdit ) if( !ItemInEdit )
{ {
toolCmd.SetId( ID_LIBEDIT_REDO ); toolCmd.SetId( wxID_REDO );
GetEventHandler()->ProcessEvent( toolCmd ); GetEventHandler()->ProcessEvent( toolCmd );
} }
break; break;
......
...@@ -79,9 +79,9 @@ BEGIN_EVENT_TABLE( WinEDA_LibeditFrame, WinEDA_DrawFrame ) ...@@ -79,9 +79,9 @@ BEGIN_EVENT_TABLE( WinEDA_LibeditFrame, WinEDA_DrawFrame )
WinEDA_LibeditFrame::LoadOneLibraryPart ) WinEDA_LibeditFrame::LoadOneLibraryPart )
EVT_TOOL( ID_LIBEDIT_SAVE_CURRENT_PART, EVT_TOOL( ID_LIBEDIT_SAVE_CURRENT_PART,
WinEDA_LibeditFrame::Process_Special_Functions ) WinEDA_LibeditFrame::Process_Special_Functions )
EVT_TOOL( ID_LIBEDIT_UNDO, EVT_TOOL( wxID_UNDO,
WinEDA_LibeditFrame::GetComponentFromUndoList ) WinEDA_LibeditFrame::GetComponentFromUndoList )
EVT_TOOL( ID_LIBEDIT_REDO, EVT_TOOL( wxID_REDO,
WinEDA_LibeditFrame::GetComponentFromRedoList ) WinEDA_LibeditFrame::GetComponentFromRedoList )
EVT_TOOL( ID_LIBEDIT_GET_FRAME_EDIT_PART, EVT_TOOL( ID_LIBEDIT_GET_FRAME_EDIT_PART,
WinEDA_LibeditFrame::OnEditComponentProperties ) WinEDA_LibeditFrame::OnEditComponentProperties )
...@@ -134,8 +134,8 @@ BEGIN_EVENT_TABLE( WinEDA_LibeditFrame, WinEDA_DrawFrame ) ...@@ -134,8 +134,8 @@ BEGIN_EVENT_TABLE( WinEDA_LibeditFrame, WinEDA_DrawFrame )
WinEDA_LibeditFrame::OnUpdateEditingPart ) WinEDA_LibeditFrame::OnUpdateEditingPart )
EVT_UPDATE_UI( ID_LIBEDIT_CHECK_PART, EVT_UPDATE_UI( ID_LIBEDIT_CHECK_PART,
WinEDA_LibeditFrame::OnUpdateEditingPart ) WinEDA_LibeditFrame::OnUpdateEditingPart )
EVT_UPDATE_UI( ID_LIBEDIT_UNDO, WinEDA_LibeditFrame::OnUpdateUndo ) EVT_UPDATE_UI( wxID_UNDO, WinEDA_LibeditFrame::OnUpdateUndo )
EVT_UPDATE_UI( ID_LIBEDIT_REDO, WinEDA_LibeditFrame::OnUpdateRedo ) EVT_UPDATE_UI( wxID_REDO, WinEDA_LibeditFrame::OnUpdateRedo )
EVT_UPDATE_UI( ID_LIBEDIT_SAVE_CURRENT_LIB, EVT_UPDATE_UI( ID_LIBEDIT_SAVE_CURRENT_LIB,
WinEDA_LibeditFrame::OnUpdateSaveCurrentLib ) WinEDA_LibeditFrame::OnUpdateSaveCurrentLib )
EVT_UPDATE_UI( ID_LIBEDIT_VIEW_DOC, WinEDA_LibeditFrame::OnUpdateViewDoc ) EVT_UPDATE_UI( ID_LIBEDIT_VIEW_DOC, WinEDA_LibeditFrame::OnUpdateViewDoc )
......
...@@ -63,26 +63,26 @@ void WinEDA_SchematicFrame::ReCreateMenuBar() ...@@ -63,26 +63,26 @@ void WinEDA_SchematicFrame::ReCreateMenuBar()
/* Separator */ /* Separator */
filesMenu->AppendSeparator(); filesMenu->AppendSeparator();
/* Save */ /* Save */
item = new wxMenuItem( filesMenu, ID_SAVE_ONE_SHEET, _( "&Save\tCtrl+S" ), /* Save Project */
item = new wxMenuItem( filesMenu, ID_SAVE_PROJECT, _( "&Save Whole Schematic Project\tCtrl+S" ),
_( "Save all sheets in the schematic project" ) );
item->SetBitmap( save_project_xpm );
filesMenu->Append( item );
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 as... */ /* Save as... */
item = new wxMenuItem( filesMenu, ID_SAVE_ONE_SHEET_AS, item = new wxMenuItem( filesMenu, ID_SAVE_ONE_SHEET_AS,
_( "Save &as...\tShift+Ctrl+S" ), _( "Save Current Sheet &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 */ /* Separator */
filesMenu->AppendSeparator(); filesMenu->AppendSeparator();
...@@ -157,7 +157,7 @@ void WinEDA_SchematicFrame::ReCreateMenuBar() ...@@ -157,7 +157,7 @@ void WinEDA_SchematicFrame::ReCreateMenuBar()
text = _( "Undo\tCtrl+Z" ); text = _( "Undo\tCtrl+Z" );
#endif #endif
item = new wxMenuItem( editMenu, ID_SCHEMATIC_UNDO, text, item = new wxMenuItem( editMenu, wxID_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 );
...@@ -169,7 +169,7 @@ void WinEDA_SchematicFrame::ReCreateMenuBar() ...@@ -169,7 +169,7 @@ void WinEDA_SchematicFrame::ReCreateMenuBar()
text = _( "Redo\tShift+Ctrl+Z" ); text = _( "Redo\tShift+Ctrl+Z" );
#endif #endif
item = new wxMenuItem( editMenu, ID_SCHEMATIC_REDO, text, item = new wxMenuItem( editMenu, wxID_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 );
......
...@@ -82,9 +82,9 @@ BEGIN_EVENT_TABLE( WinEDA_SchematicFrame, WinEDA_DrawFrame ) ...@@ -82,9 +82,9 @@ BEGIN_EVENT_TABLE( WinEDA_SchematicFrame, WinEDA_DrawFrame )
EVT_TOOL( wxID_CUT, WinEDA_SchematicFrame::Process_Special_Functions ) EVT_TOOL( wxID_CUT, WinEDA_SchematicFrame::Process_Special_Functions )
EVT_TOOL( wxID_COPY, WinEDA_SchematicFrame::Process_Special_Functions ) EVT_TOOL( wxID_COPY, WinEDA_SchematicFrame::Process_Special_Functions )
EVT_TOOL( wxID_PASTE, WinEDA_SchematicFrame::Process_Special_Functions ) EVT_TOOL( wxID_PASTE, WinEDA_SchematicFrame::Process_Special_Functions )
EVT_TOOL( ID_SCHEMATIC_UNDO, EVT_TOOL( wxID_UNDO,
WinEDA_SchematicFrame::GetSchematicFromUndoList ) WinEDA_SchematicFrame::GetSchematicFromUndoList )
EVT_TOOL( ID_SCHEMATIC_REDO, EVT_TOOL( wxID_REDO,
WinEDA_SchematicFrame::GetSchematicFromRedoList ) WinEDA_SchematicFrame::GetSchematicFromRedoList )
EVT_TOOL( ID_GET_ANNOTATE, WinEDA_SchematicFrame::OnAnnotate ) EVT_TOOL( ID_GET_ANNOTATE, WinEDA_SchematicFrame::OnAnnotate )
EVT_TOOL( ID_GEN_PRINT, WinEDA_SchematicFrame::ToPrinter ) EVT_TOOL( ID_GEN_PRINT, WinEDA_SchematicFrame::ToPrinter )
...@@ -120,9 +120,9 @@ BEGIN_EVENT_TABLE( WinEDA_SchematicFrame, WinEDA_DrawFrame ) ...@@ -120,9 +120,9 @@ BEGIN_EVENT_TABLE( WinEDA_SchematicFrame, WinEDA_DrawFrame )
EVT_UPDATE_UI( wxID_CUT, WinEDA_SchematicFrame::OnUpdateBlockSelected ) EVT_UPDATE_UI( wxID_CUT, WinEDA_SchematicFrame::OnUpdateBlockSelected )
EVT_UPDATE_UI( wxID_COPY, WinEDA_SchematicFrame::OnUpdateBlockSelected ) EVT_UPDATE_UI( wxID_COPY, WinEDA_SchematicFrame::OnUpdateBlockSelected )
EVT_UPDATE_UI( wxID_PASTE, WinEDA_SchematicFrame::OnUpdatePaste ) EVT_UPDATE_UI( wxID_PASTE, WinEDA_SchematicFrame::OnUpdatePaste )
EVT_UPDATE_UI( ID_SCHEMATIC_UNDO, EVT_UPDATE_UI( wxID_UNDO,
WinEDA_SchematicFrame::OnUpdateSchematicUndo ) WinEDA_SchematicFrame::OnUpdateSchematicUndo )
EVT_UPDATE_UI( ID_SCHEMATIC_REDO, EVT_UPDATE_UI( wxID_REDO,
WinEDA_SchematicFrame::OnUpdateSchematicRedo ) WinEDA_SchematicFrame::OnUpdateSchematicRedo )
EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_GRID, EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_GRID,
WinEDA_SchematicFrame::OnUpdateGrid ) WinEDA_SchematicFrame::OnUpdateGrid )
......
...@@ -136,11 +136,11 @@ void WinEDA_LibeditFrame::ReCreateHToolbar() ...@@ -136,11 +136,11 @@ void WinEDA_LibeditFrame::ReCreateHToolbar()
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
msg = AddHotkeyName( _( "Undo last command" ), s_Schematic_Hokeys_Descr, msg = AddHotkeyName( _( "Undo last command" ), s_Schematic_Hokeys_Descr,
HK_UNDO ); HK_UNDO );
m_HToolBar->AddTool( ID_LIBEDIT_UNDO, wxEmptyString, wxBitmap( undo_xpm ), m_HToolBar->AddTool( wxID_UNDO, wxEmptyString, wxBitmap( undo_xpm ),
msg ); msg );
msg = AddHotkeyName( _( "Redo the last command" ), s_Schematic_Hokeys_Descr, msg = AddHotkeyName( _( "Redo the last command" ), s_Schematic_Hokeys_Descr,
HK_REDO ); HK_REDO );
m_HToolBar->AddTool( ID_LIBEDIT_REDO, wxEmptyString, wxBitmap( redo_xpm ), m_HToolBar->AddTool( wxID_REDO, wxEmptyString, wxBitmap( redo_xpm ),
msg ); msg );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
......
...@@ -71,12 +71,12 @@ void WinEDA_SchematicFrame::ReCreateHToolbar() ...@@ -71,12 +71,12 @@ void WinEDA_SchematicFrame::ReCreateHToolbar()
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
msg = AddHotkeyName( _( "Undo last edition" ), s_Schematic_Hokeys_Descr, msg = AddHotkeyName( _( "Undo last edition" ), s_Schematic_Hokeys_Descr,
HK_UNDO ); HK_UNDO );
m_HToolBar->AddTool( ID_SCHEMATIC_UNDO, wxEmptyString, m_HToolBar->AddTool( wxID_UNDO, wxEmptyString,
wxBitmap( undo_xpm ), msg ); wxBitmap( undo_xpm ), msg );
msg = AddHotkeyName( _( "Redo the last undo command" ), msg = AddHotkeyName( _( "Redo the last undo command" ),
s_Schematic_Hokeys_Descr, HK_REDO ); s_Schematic_Hokeys_Descr, HK_REDO );
m_HToolBar->AddTool( ID_SCHEMATIC_REDO, wxEmptyString, m_HToolBar->AddTool( wxID_REDO, wxEmptyString,
wxBitmap( redo_xpm ), msg ); wxBitmap( redo_xpm ), msg );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
......
...@@ -84,7 +84,7 @@ BEGIN_EVENT_TABLE( WinEDA_GerberFrame, WinEDA_BasePcbFrame ) ...@@ -84,7 +84,7 @@ BEGIN_EVENT_TABLE( WinEDA_GerberFrame, WinEDA_BasePcbFrame )
EVT_TOOL( wxID_CUT, WinEDA_GerberFrame::Process_Special_Functions ) EVT_TOOL( wxID_CUT, WinEDA_GerberFrame::Process_Special_Functions )
EVT_TOOL( wxID_COPY, WinEDA_GerberFrame::Process_Special_Functions ) EVT_TOOL( wxID_COPY, WinEDA_GerberFrame::Process_Special_Functions )
EVT_TOOL( wxID_PASTE, WinEDA_GerberFrame::Process_Special_Functions ) EVT_TOOL( wxID_PASTE, WinEDA_GerberFrame::Process_Special_Functions )
EVT_TOOL( ID_UNDO_BUTT, WinEDA_GerberFrame::Process_Special_Functions ) EVT_TOOL( wxID_UNDO, WinEDA_GerberFrame::Process_Special_Functions )
EVT_TOOL( ID_GEN_PRINT, WinEDA_GerberFrame::ToPrinter ) EVT_TOOL( ID_GEN_PRINT, WinEDA_GerberFrame::ToPrinter )
EVT_TOOL( ID_FIND_ITEMS, WinEDA_GerberFrame::Process_Special_Functions ) EVT_TOOL( ID_FIND_ITEMS, WinEDA_GerberFrame::Process_Special_Functions )
EVT_TOOL( ID_DRC_CONTROL, WinEDA_GerberFrame::Process_Special_Functions ) EVT_TOOL( ID_DRC_CONTROL, WinEDA_GerberFrame::Process_Special_Functions )
......
...@@ -195,7 +195,7 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void ) ...@@ -195,7 +195,7 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void )
_( "Paste" ) ); _( "Paste" ) );
#endif #endif
m_HToolBar->AddTool( ID_UNDO_BUTT, wxEmptyString, m_HToolBar->AddTool( wxID_UNDO, wxEmptyString,
wxBitmap( undelete_xpm ), wxBitmap( undelete_xpm ),
_( "Undelete" ) ); _( "Undelete" ) );
......
...@@ -56,10 +56,6 @@ enum main_id ...@@ -56,10 +56,6 @@ enum main_id
ID_GEN_COPY_SHEET_TO_CLIPBOARD, ID_GEN_COPY_SHEET_TO_CLIPBOARD,
ID_GEN_COPY_BLOCK_TO_CLIPBOARD, ID_GEN_COPY_BLOCK_TO_CLIPBOARD,
ID_GEN_UNUSED0, ID_GEN_UNUSED0,
ID_GEN_UNUSED1,
ID_GEN_UNUSED2,
ID_GEN_UNUSED3,
ID_GEN_UNUSED4,
ID_GEN_EXPORT_FILE, ID_GEN_EXPORT_FILE,
ID_GEN_EXPORT_SPECCTRA, ID_GEN_EXPORT_SPECCTRA,
...@@ -92,8 +88,6 @@ enum main_id ...@@ -92,8 +88,6 @@ enum main_id
ID_COLORS_SETUP, ID_COLORS_SETUP,
ID_REPEAT_BUTT, ID_REPEAT_BUTT,
ID_UNDO_BUTT,
ID_REDO_BUTT,
ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE,
ID_LANGUAGE_DEFAULT, ID_LANGUAGE_DEFAULT,
......
No preview for this file type
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -86,12 +86,43 @@ static Ki_HotkeyInfo HkDelete( wxT( "Delete Track or Footprint" ), HK_DELETE, ...@@ -86,12 +86,43 @@ static Ki_HotkeyInfo HkDelete( wxT( "Delete Track or Footprint" ), HK_DELETE,
WXK_DELETE ); WXK_DELETE );
static Ki_HotkeyInfo HkResetLocalCoord( wxT( "Reset local coord." ), static Ki_HotkeyInfo HkResetLocalCoord( wxT( "Reset local coord." ),
HK_RESET_LOCAL_COORD, ' ' ); HK_RESET_LOCAL_COORD, ' ' );
static Ki_HotkeyInfo HkZoomAuto( wxT( "Zoom Auto" ), HK_ZOOM_AUTO, WXK_HOME ); static Ki_HotkeyInfo HkZoomAuto( wxT( "Zoom Auto" ), HK_ZOOM_AUTO, WXK_HOME );
static Ki_HotkeyInfo HkZoomCenter( wxT( "Zoom Center" ), HK_ZOOM_CENTER, WXK_F4 ); 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 HkZoomRedraw( wxT( "Zoom Redraw" ), HK_ZOOM_REDRAW, WXK_F3 );
static Ki_HotkeyInfo HkZoomOut( wxT( "Zoom Out" ), HK_ZOOM_OUT, WXK_F2 );
/* Zoom In */
#if !defined( __WXMAC__ )
static Ki_HotkeyInfo HkZoomIn( wxT( "Zoom In" ), HK_ZOOM_IN, WXK_F1 ); 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, '?' );
/* Undo */
static Ki_HotkeyInfo HkUndo( wxT( "Undo" ), HK_UNDO, GR_KB_CTRL + 'Z',
(int) wxID_UNDO );
/* Redo */
#if !defined( __WXMAC__ )
static Ki_HotkeyInfo HkRedo( wxT( "Redo" ), HK_REDO, GR_KB_CTRL + 'Y',
(int) wxID_REDO );
#else
static Ki_HotkeyInfo HkRedo( wxT( "Redo" ), HK_REDO,
GR_KB_SHIFT + GR_KB_CTRL + 'Z',
(int) wxID_REDO );
#endif
static Ki_HotkeyInfo HkSwitchUnits( wxT( "Switch Units" ), HK_SWITCH_UNITS, 'U' static Ki_HotkeyInfo HkSwitchUnits( wxT( "Switch Units" ), HK_SWITCH_UNITS, 'U'
+ GR_KB_CTRL ); + GR_KB_CTRL );
static Ki_HotkeyInfo HkTrackDisplayMode( wxT( "Track Display Mode" ), static Ki_HotkeyInfo HkTrackDisplayMode( wxT( "Track Display Mode" ),
...@@ -99,12 +130,13 @@ static Ki_HotkeyInfo HkTrackDisplayMode( wxT( "Track Display Mode" ), ...@@ -99,12 +130,13 @@ static Ki_HotkeyInfo HkTrackDisplayMode( wxT( "Track Display Mode" ),
static Ki_HotkeyInfo HkAddModule( wxT( "Add Module" ), HK_ADD_MODULE, 'O' ); static Ki_HotkeyInfo HkAddModule( wxT( "Add Module" ), HK_ADD_MODULE, 'O' );
// List of common hotkey descriptors // List of common hotkey descriptors
Ki_HotkeyInfo Ki_HotkeyInfo* s_Common_Hotkey_List[] =
* s_Common_Hotkey_List[] =
{ {
&HkHelp, &HkZoomIn, &HkZoomOut, &HkHelp, &HkZoomIn, &HkZoomOut,
&HkZoomRedraw, &HkZoomCenter, &HkZoomAuto, &HkZoomRedraw, &HkZoomCenter, &HkZoomAuto,
&HkSwitchUnits, &HkResetLocalCoord, NULL &HkSwitchUnits, &HkResetLocalCoord,
&HkUndo, &HkRedo,
NULL
}; };
// List of hotkey descriptors for pcbnew // List of hotkey descriptors for pcbnew
...@@ -143,8 +175,7 @@ struct Ki_HotkeyInfoSectionDescriptor s_Pcbnew_Editor_Hokeys_Descr[] = ...@@ -143,8 +175,7 @@ struct Ki_HotkeyInfoSectionDescriptor s_Pcbnew_Editor_Hokeys_Descr[] =
// list of sections and corresponding hotkey list for the board editor (used to list current hotkeys) // list of sections and corresponding hotkey list for the board editor (used to list current hotkeys)
struct Ki_HotkeyInfoSectionDescriptor s_Board_Editor_Hokeys_Descr[] = struct Ki_HotkeyInfoSectionDescriptor s_Board_Editor_Hokeys_Descr[] =
{ { { {
&g_CommonSectionTag, &g_CommonSectionTag, s_Common_Hotkey_List,
s_Common_Hotkey_List,
NULL NULL
},{ },{
&g_BoardEditorSectionTag, s_board_edit_Hotkey_List, NULL &g_BoardEditorSectionTag, s_board_edit_Hotkey_List, NULL
...@@ -153,8 +184,7 @@ struct Ki_HotkeyInfoSectionDescriptor s_Board_Editor_Hokeys_Descr[] = ...@@ -153,8 +184,7 @@ struct Ki_HotkeyInfoSectionDescriptor s_Board_Editor_Hokeys_Descr[] =
} }; } };
// list of sections and corresponding hotkey list for the footprint editor (used to list current hotkeys) // list of sections and corresponding hotkey list for the footprint editor (used to list current hotkeys)
struct Ki_HotkeyInfoSectionDescriptor struct Ki_HotkeyInfoSectionDescriptor s_Module_Editor_Hokeys_Descr[] =
s_Module_Editor_Hokeys_Descr[] =
{ { { {
&g_CommonSectionTag, s_Common_Hotkey_List, NULL &g_CommonSectionTag, s_Common_Hotkey_List, NULL
},{ },{
...@@ -192,12 +222,13 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct ...@@ -192,12 +222,13 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct
if( (hotkey & GR_KB_CTRL) != 0 ) if( (hotkey & GR_KB_CTRL) != 0 )
hotkey += 'A' - 1; hotkey += 'A' - 1;
/* Convert lower to upper case (the usual toupper function has problem with non ascii codes like function keys */ /* Convert lower to upper case
* (the usual toupper function has problem with non ascii codes like function keys
*/
if( (hotkey >= 'a') && (hotkey <= 'z') ) if( (hotkey >= 'a') && (hotkey <= 'z') )
hotkey += 'A' - 'a'; hotkey += 'A' - 'a';
Ki_HotkeyInfo* HK_Descr = GetDescriptorFromHotkey( hotkey, Ki_HotkeyInfo* HK_Descr = GetDescriptorFromHotkey( hotkey, s_Common_Hotkey_List );
s_Common_Hotkey_List );
if( HK_Descr == NULL ) if( HK_Descr == NULL )
HK_Descr = GetDescriptorFromHotkey( hotkey, s_board_edit_Hotkey_List ); HK_Descr = GetDescriptorFromHotkey( hotkey, s_board_edit_Hotkey_List );
...@@ -308,6 +339,16 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct ...@@ -308,6 +339,16 @@ void WinEDA_PcbFrame::OnHotKey( wxDC* DC, int hotkey, EDA_BaseStruct* DrawStruct
GetEventHandler()->ProcessEvent( cmd ); GetEventHandler()->ProcessEvent( cmd );
break; break;
case HK_UNDO:
case HK_REDO:
if( ItemFree )
{
wxCommandEvent event( wxEVT_COMMAND_TOOL_CLICKED,
HK_Descr->m_IdMenuEvent );
wxPostEvent( this, event );
}
break;
case HK_RESET_LOCAL_COORD: /*Reset the relative coord */ case HK_RESET_LOCAL_COORD: /*Reset the relative coord */
GetScreen()->m_O_Curseur = GetScreen()->m_Curseur; GetScreen()->m_O_Curseur = GetScreen()->m_Curseur;
break; break;
...@@ -631,17 +672,23 @@ void WinEDA_ModuleEditFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -631,17 +672,23 @@ void WinEDA_ModuleEditFrame::OnHotKey( wxDC* DC, int hotkey,
if( hotkey == 0 ) if( hotkey == 0 )
return; return;
bool ItemFree = (GetCurItem() == 0 || GetCurItem()->m_Flags == 0);
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED ); wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
cmd.SetEventObject( this ); cmd.SetEventObject( this );
// Remap the control key Ctrl A (0x01) to GR_KB_CTRL + 'A' (just easier to handle...)
if( (hotkey & GR_KB_CTRL) != 0 )
hotkey += 'A' - 1;
/* Convert lower to upper case (the usual toupper function has problem with non ascii codes like function keys */ /* Convert lower to upper case (the usual toupper function has problem with non ascii codes like function keys */
if( (hotkey >= 'a') && (hotkey <= 'z') ) if( (hotkey >= 'a') && (hotkey <= 'z') )
hotkey += 'A' - 'a'; hotkey += 'A' - 'a';
Ki_HotkeyInfo* HK_Descr = GetDescriptorFromHotkey( hotkey, Ki_HotkeyInfo* HK_Descr = GetDescriptorFromHotkey( hotkey, s_Common_Hotkey_List );
s_Common_Hotkey_List );
if( HK_Descr == NULL ) if( HK_Descr == NULL )
HK_Descr = GetDescriptorFromHotkey( hotkey, s_module_edit_Hotkey_List ); HK_Descr = GetDescriptorFromHotkey( hotkey, s_module_edit_Hotkey_List );
if( HK_Descr == NULL ) if( HK_Descr == NULL )
return; return;
...@@ -684,6 +731,16 @@ void WinEDA_ModuleEditFrame::OnHotKey( wxDC* DC, int hotkey, ...@@ -684,6 +731,16 @@ void WinEDA_ModuleEditFrame::OnHotKey( wxDC* DC, int hotkey,
GetEventHandler()->ProcessEvent( cmd ); GetEventHandler()->ProcessEvent( cmd );
break; break;
case HK_UNDO:
case HK_REDO:
if( ItemFree )
{
wxCommandEvent event( wxEVT_COMMAND_TOOL_CLICKED,
HK_Descr->m_IdMenuEvent );
wxPostEvent( this, event );
}
break;
case HK_ZOOM_AUTO: case HK_ZOOM_AUTO:
cmd.SetId( ID_ZOOM_PAGE ); cmd.SetId( ID_ZOOM_PAGE );
GetEventHandler()->ProcessEvent( cmd ); GetEventHandler()->ProcessEvent( cmd );
......
...@@ -16,6 +16,8 @@ enum hotkey_id_commnand { ...@@ -16,6 +16,8 @@ enum hotkey_id_commnand {
HK_ZOOM_REDRAW, HK_ZOOM_REDRAW,
HK_ZOOM_CENTER, HK_ZOOM_CENTER,
HK_ZOOM_AUTO, HK_ZOOM_AUTO,
HK_UNDO,
HK_REDO,
HK_DELETE, HK_DELETE,
HK_BACK_SPACE, HK_BACK_SPACE,
HK_ROTATE_FOOTPRINT, HK_ROTATE_FOOTPRINT,
......
...@@ -245,8 +245,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar() ...@@ -245,8 +245,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
#else #else
text = _( "Undo\tCtrl+Z" ); text = _( "Undo\tCtrl+Z" );
#endif #endif
item = new wxMenuItem( editMenu, wxID_UNDO, text,
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 );
...@@ -257,8 +256,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar() ...@@ -257,8 +256,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
#else #else
text = _( "Redo\tShift+Ctrl+Z" ); text = _( "Redo\tShift+Ctrl+Z" );
#endif #endif
item = new wxMenuItem( editMenu, wxID_REDO, text,
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 );
...@@ -376,10 +374,11 @@ void WinEDA_PcbFrame::ReCreateMenuBar() ...@@ -376,10 +374,11 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
/* 3D Display */ /* 3D Display */
item = new wxMenuItem( viewMenu, ID_MENU_PCB_SHOW_3D_FRAME, wxMenu* Display3DMenu = new wxMenu;
_( "3D Display" ), _( "Show board in the 3D viewer" ) ); item = new wxMenuItem( Display3DMenu, ID_MENU_PCB_SHOW_3D_FRAME,
_( "3D Display" ), _( "Show board in 3D viewer" ) );
item->SetBitmap( show_3d_xpm ); item->SetBitmap( show_3d_xpm );
viewMenu->Append( item ); Display3DMenu->Append( item );
/** /**
...@@ -525,6 +524,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar() ...@@ -525,6 +524,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
menuBar->Append( viewMenu, _( "&View" ) ); menuBar->Append( viewMenu, _( "&View" ) );
menuBar->Append( configmenu, _( "&Preferences" ) ); menuBar->Append( configmenu, _( "&Preferences" ) );
menuBar->Append( designRulesMenu, _( "&Design Rules" ) ); menuBar->Append( designRulesMenu, _( "&Design Rules" ) );
menuBar->Append( Display3DMenu, _( "&3D Display" ) );
menuBar->Append( helpMenu, _( "&Help" ) ); menuBar->Append( helpMenu, _( "&Help" ) );
/* Associate the menu bar with the frame */ /* Associate the menu bar with the frame */
......
...@@ -74,9 +74,9 @@ BEGIN_EVENT_TABLE( WinEDA_ModuleEditFrame, WinEDA_BasePcbFrame ) ...@@ -74,9 +74,9 @@ BEGIN_EVENT_TABLE( WinEDA_ModuleEditFrame, WinEDA_BasePcbFrame )
WinEDA_ModuleEditFrame::Process_Special_Functions ) WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_EDIT_MODULE_PROPERTIES, EVT_TOOL( ID_MODEDIT_EDIT_MODULE_PROPERTIES,
WinEDA_ModuleEditFrame::Process_Special_Functions ) WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_UNDO, EVT_TOOL( wxID_UNDO,
WinEDA_ModuleEditFrame::GetComponentFromUndoList ) WinEDA_ModuleEditFrame::GetComponentFromUndoList )
EVT_TOOL( ID_MODEDIT_REDO, EVT_TOOL( wxID_REDO,
WinEDA_ModuleEditFrame::GetComponentFromRedoList ) WinEDA_ModuleEditFrame::GetComponentFromRedoList )
// Vertical toolbar (left click): // Vertical toolbar (left click):
...@@ -316,9 +316,9 @@ void WinEDA_ModuleEditFrame::SetToolbars() ...@@ -316,9 +316,9 @@ void WinEDA_ModuleEditFrame::SetToolbars()
if( GetScreen() ) if( GetScreen() )
{ {
m_HToolBar->EnableTool( ID_MODEDIT_UNDO, m_HToolBar->EnableTool( wxID_UNDO,
GetScreen()->GetUndoCommandCount()>0 && active ); GetScreen()->GetUndoCommandCount()>0 && active );
m_HToolBar->EnableTool( ID_MODEDIT_REDO, m_HToolBar->EnableTool( wxID_REDO,
GetScreen()->GetRedoCommandCount()>0 && active ); GetScreen()->GetRedoCommandCount()>0 && active );
} }
......
...@@ -127,8 +127,8 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame ) ...@@ -127,8 +127,8 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame )
EVT_TOOL( wxID_CUT, WinEDA_PcbFrame::Process_Special_Functions ) EVT_TOOL( wxID_CUT, WinEDA_PcbFrame::Process_Special_Functions )
EVT_TOOL( wxID_COPY, WinEDA_PcbFrame::Process_Special_Functions ) EVT_TOOL( wxID_COPY, WinEDA_PcbFrame::Process_Special_Functions )
EVT_TOOL( wxID_PASTE, WinEDA_PcbFrame::Process_Special_Functions ) EVT_TOOL( wxID_PASTE, WinEDA_PcbFrame::Process_Special_Functions )
EVT_TOOL( ID_UNDO_BUTT, WinEDA_PcbFrame::GetBoardFromUndoList ) EVT_TOOL( wxID_UNDO, WinEDA_PcbFrame::GetBoardFromUndoList )
EVT_TOOL( ID_REDO_BUTT, WinEDA_PcbFrame::GetBoardFromRedoList ) EVT_TOOL( wxID_REDO, WinEDA_PcbFrame::GetBoardFromRedoList )
EVT_TOOL( ID_GEN_PRINT, WinEDA_PcbFrame::ToPrinter ) EVT_TOOL( ID_GEN_PRINT, WinEDA_PcbFrame::ToPrinter )
EVT_TOOL( ID_GEN_PLOT_SVG, WinEDA_DrawFrame::SVG_Print ) EVT_TOOL( ID_GEN_PLOT_SVG, WinEDA_DrawFrame::SVG_Print )
EVT_TOOL( ID_GEN_PLOT, WinEDA_PcbFrame::Process_Special_Functions ) EVT_TOOL( ID_GEN_PLOT, WinEDA_PcbFrame::Process_Special_Functions )
......
...@@ -249,8 +249,6 @@ enum pcbnew_ids ...@@ -249,8 +249,6 @@ enum pcbnew_ids
ID_MODEDIT_TRANSFORM_MODULE, ID_MODEDIT_TRANSFORM_MODULE,
ID_MODEDIT_MODULE_ROTATE, ID_MODEDIT_MODULE_ROTATE,
ID_MODEDIT_MODULE_MIRROR, ID_MODEDIT_MODULE_MIRROR,
ID_MODEDIT_UNDO,
ID_MODEDIT_REDO,
ID_MODEDIT_IMPORT_PART, ID_MODEDIT_IMPORT_PART,
ID_MODEDIT_EXPORT_PART, ID_MODEDIT_EXPORT_PART,
ID_MODEDIT_CREATE_NEW_LIB_AND_SAVE_CURRENT_PART, ID_MODEDIT_CREATE_NEW_LIB_AND_SAVE_CURRENT_PART,
......
...@@ -87,9 +87,9 @@ void WinEDA_ModuleEditFrame::ReCreateHToolbar() ...@@ -87,9 +87,9 @@ void WinEDA_ModuleEditFrame::ReCreateHToolbar()
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_MODEDIT_UNDO, wxEmptyString, wxBitmap( undo_xpm ), m_HToolBar->AddTool( wxID_UNDO, wxEmptyString, wxBitmap( undo_xpm ),
_( "Undo last edition" ) ); _( "Undo last edition" ) );
m_HToolBar->AddTool( ID_MODEDIT_REDO, wxEmptyString, wxBitmap( redo_xpm ), m_HToolBar->AddTool( wxID_REDO, wxEmptyString, wxBitmap( redo_xpm ),
_( "Redo the last undo command" ) ); _( "Redo the last undo command" ) );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
......
...@@ -224,9 +224,9 @@ void WinEDA_PcbFrame::ReCreateHToolbar() ...@@ -224,9 +224,9 @@ void WinEDA_PcbFrame::ReCreateHToolbar()
#endif #endif
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_UNDO_BUTT, wxEmptyString, wxBitmap( undo_xpm ), m_HToolBar->AddTool( wxID_UNDO, wxEmptyString, wxBitmap( undo_xpm ),
_( "Undo last edition" ) ); _( "Undo last edition" ) );
m_HToolBar->AddTool( ID_REDO_BUTT, wxEmptyString, wxBitmap( redo_xpm ), m_HToolBar->AddTool( wxID_REDO, wxEmptyString, wxBitmap( redo_xpm ),
_( "Redo the last undo command" ) ); _( "Redo the last undo command" ) );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
......
...@@ -177,10 +177,10 @@ void WinEDA_PcbFrame::SetToolbars() ...@@ -177,10 +177,10 @@ void WinEDA_PcbFrame::SetToolbars()
m_HToolBar->EnableTool( wxID_PASTE, false ); m_HToolBar->EnableTool( wxID_PASTE, false );
state = GetScreen()->GetUndoCommandCount() > 0; state = GetScreen()->GetUndoCommandCount() > 0;
m_HToolBar->EnableTool( ID_UNDO_BUTT, state ); m_HToolBar->EnableTool( wxID_UNDO, state );
state = GetScreen()->GetRedoCommandCount() > 0; state = GetScreen()->GetRedoCommandCount() > 0;
m_HToolBar->EnableTool( ID_REDO_BUTT, state ); m_HToolBar->EnableTool( wxID_REDO, state );
if( m_OptionsToolBar ) if( m_OptionsToolBar )
{ {
......
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