Minor Eeschema user interface improvements.
* Enable and disable save schematic button and menu entry depending on modification status. * Add toolbar and menu entries for leaving sheet. * Enable and disable leave sheet menu entry and toolbar when in root sheet or descended into the hierarchy.
This commit is contained in:
parent
d13a05093a
commit
3d72306f78
|
@ -240,6 +240,10 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
|
||||||
|
|
||||||
AddMenuItem( viewMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT, KiBitmap( zoom_fit_in_page_xpm ) );
|
AddMenuItem( viewMenu, ID_ZOOM_PAGE, text, HELP_ZOOM_FIT, KiBitmap( zoom_fit_in_page_xpm ) );
|
||||||
|
|
||||||
|
text = AddHotkeyName( _( "&Redraw" ), g_Schematic_Hokeys_Descr, HK_ZOOM_REDRAW );
|
||||||
|
|
||||||
|
AddMenuItem( viewMenu, ID_ZOOM_REDRAW, text, HELP_ZOOM_REDRAW, KiBitmap( zoom_redraw_xpm ) );
|
||||||
|
|
||||||
viewMenu->AppendSeparator();
|
viewMenu->AppendSeparator();
|
||||||
|
|
||||||
AddMenuItem( viewMenu,
|
AddMenuItem( viewMenu,
|
||||||
|
@ -248,8 +252,11 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
|
||||||
_( "Navigate hierarchical sheets" ),
|
_( "Navigate hierarchical sheets" ),
|
||||||
KiBitmap( hierarchy_nav_xpm ) );
|
KiBitmap( hierarchy_nav_xpm ) );
|
||||||
|
|
||||||
text = AddHotkeyName( _( "&Redraw" ), g_Schematic_Hokeys_Descr, HK_ZOOM_REDRAW );
|
AddMenuItem( viewMenu,
|
||||||
AddMenuItem( viewMenu, ID_ZOOM_REDRAW, text, HELP_ZOOM_REDRAW, KiBitmap( zoom_redraw_xpm ) );
|
ID_POPUP_SCH_LEAVE_SHEET,
|
||||||
|
_( "&Leave Sheet" ),
|
||||||
|
_( "Leave Sheet" ),
|
||||||
|
KiBitmap( leave_sheet_xpm ) );
|
||||||
|
|
||||||
// Menu place:
|
// Menu place:
|
||||||
wxMenu* placeMenu = new wxMenu;
|
wxMenu* placeMenu = new wxMenu;
|
||||||
|
|
|
@ -308,6 +308,9 @@ BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, EDA_DRAW_FRAME )
|
||||||
EVT_UPDATE_UI( ID_NO_TOOL_SELECTED, SCH_EDIT_FRAME::OnUpdateSelectTool )
|
EVT_UPDATE_UI( ID_NO_TOOL_SELECTED, SCH_EDIT_FRAME::OnUpdateSelectTool )
|
||||||
EVT_UPDATE_UI_RANGE( ID_SCHEMATIC_VERTICAL_TOOLBAR_START, ID_SCHEMATIC_VERTICAL_TOOLBAR_END,
|
EVT_UPDATE_UI_RANGE( ID_SCHEMATIC_VERTICAL_TOOLBAR_START, ID_SCHEMATIC_VERTICAL_TOOLBAR_END,
|
||||||
SCH_EDIT_FRAME::OnUpdateSelectTool )
|
SCH_EDIT_FRAME::OnUpdateSelectTool )
|
||||||
|
EVT_UPDATE_UI( ID_SAVE_PROJECT, SCH_EDIT_FRAME::OnUpdateSave )
|
||||||
|
EVT_UPDATE_UI( ID_UPDATE_ONE_SHEET, SCH_EDIT_FRAME::OnUpdateSaveSheet )
|
||||||
|
EVT_UPDATE_UI( ID_POPUP_SCH_LEAVE_SHEET, SCH_EDIT_FRAME::OnUpdateHierarchySheet )
|
||||||
|
|
||||||
/* Search dialog events. */
|
/* Search dialog events. */
|
||||||
EVT_FIND_CLOSE( wxID_ANY, SCH_EDIT_FRAME::OnFindDialogClose )
|
EVT_FIND_CLOSE( wxID_ANY, SCH_EDIT_FRAME::OnFindDialogClose )
|
||||||
|
@ -773,6 +776,29 @@ void SCH_EDIT_FRAME::OnUpdateHiddenPins( wxUpdateUIEvent& aEvent )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SCH_EDIT_FRAME::OnUpdateSave( wxUpdateUIEvent& aEvent )
|
||||||
|
{
|
||||||
|
SCH_SHEET_LIST sheetList;
|
||||||
|
|
||||||
|
aEvent.Enable( sheetList.IsModified() );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SCH_EDIT_FRAME::OnUpdateSaveSheet( wxUpdateUIEvent& aEvent )
|
||||||
|
{
|
||||||
|
aEvent.Enable( GetScreen()->IsModify() );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void SCH_EDIT_FRAME::OnUpdateHierarchySheet( wxUpdateUIEvent& aEvent )
|
||||||
|
{
|
||||||
|
aEvent.Enable( m_CurrentSheet->Last() != g_RootSheet );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void SCH_EDIT_FRAME::OnAnnotate( wxCommandEvent& event )
|
void SCH_EDIT_FRAME::OnAnnotate( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
InvokeDialogAnnotate( this );
|
InvokeDialogAnnotate( this );
|
||||||
|
|
|
@ -844,6 +844,9 @@ private:
|
||||||
void OnUpdateHiddenPins( wxUpdateUIEvent& event );
|
void OnUpdateHiddenPins( wxUpdateUIEvent& event );
|
||||||
void OnUpdateBusOrientation( wxUpdateUIEvent& event );
|
void OnUpdateBusOrientation( wxUpdateUIEvent& event );
|
||||||
void OnUpdateSelectTool( wxUpdateUIEvent& aEvent );
|
void OnUpdateSelectTool( wxUpdateUIEvent& aEvent );
|
||||||
|
void OnUpdateSave( wxUpdateUIEvent& aEvent );
|
||||||
|
void OnUpdateSaveSheet( wxUpdateUIEvent& aEvent );
|
||||||
|
void OnUpdateHierarchySheet( wxUpdateUIEvent& aEvent );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function UpdateTitle
|
* Function UpdateTitle
|
||||||
|
|
|
@ -128,6 +128,9 @@ void SCH_EDIT_FRAME::ReCreateHToolbar()
|
||||||
_( "Navigate schematic hierarchy" ) );
|
_( "Navigate schematic hierarchy" ) );
|
||||||
|
|
||||||
|
|
||||||
|
m_mainToolBar->AddTool( ID_POPUP_SCH_LEAVE_SHEET, wxEmptyString, KiBitmap( leave_sheet_xpm ),
|
||||||
|
_( "Leave sheet" ) );
|
||||||
|
|
||||||
m_mainToolBar->AddSeparator();
|
m_mainToolBar->AddSeparator();
|
||||||
|
|
||||||
m_mainToolBar->AddTool( ID_RUN_LIBRARY, wxEmptyString, KiBitmap( libedit_xpm ),
|
m_mainToolBar->AddTool( ID_RUN_LIBRARY, wxEmptyString, KiBitmap( libedit_xpm ),
|
||||||
|
|
Loading…
Reference in New Issue