Commit a015ff2a authored by diemer's avatar diemer

Cleanup. Relabeled block zoom command.

parent 48858c30
...@@ -237,8 +237,7 @@ void AddMenusForBlock(wxMenu * PopMenu, WinEDA_LibeditFrame * frame) ...@@ -237,8 +237,7 @@ void AddMenusForBlock(wxMenu * PopMenu, WinEDA_LibeditFrame * frame)
ADD_MENUITEM(PopMenu, ID_POPUP_LIBEDIT_CANCEL_EDITING, _("Cancel Block"), cancel_xpm); ADD_MENUITEM(PopMenu, ID_POPUP_LIBEDIT_CANCEL_EDITING, _("Cancel Block"), cancel_xpm);
if ( frame->GetScreen()->BlockLocate.m_Command == BLOCK_MOVE ) if ( frame->GetScreen()->BlockLocate.m_Command == BLOCK_MOVE )
ADD_MENUITEM(PopMenu, ID_POPUP_ZOOM_BLOCK, ADD_MENUITEM(PopMenu, ID_POPUP_ZOOM_BLOCK, _("Zoom Block (drag middle mouse)"), zoom_selected_xpm);
_("Win. Zoom (Midd butt drag mouse)"), zoom_selected_xpm);
PopMenu->AppendSeparator(); PopMenu->AppendSeparator();
......
...@@ -640,7 +640,7 @@ void AddMenusForBlock( wxMenu* PopMenu, WinEDA_SchematicFrame* frame ) ...@@ -640,7 +640,7 @@ void AddMenusForBlock( wxMenu* PopMenu, WinEDA_SchematicFrame* frame )
if( frame->GetScreen()->BlockLocate.m_Command == BLOCK_MOVE ) if( frame->GetScreen()->BlockLocate.m_Command == BLOCK_MOVE )
ADD_MENUITEM( PopMenu, ID_POPUP_ZOOM_BLOCK, ADD_MENUITEM( PopMenu, ID_POPUP_ZOOM_BLOCK,
_( "Win. Zoom (Midd butt drag mouse)" ), zoom_selected_xpm ); _( "Zoom Block (drag middle mouse)" ), zoom_selected_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_PLACE_BLOCK, _( "Place Block" ), apply_xpm ); ADD_MENUITEM( PopMenu, ID_POPUP_PLACE_BLOCK, _( "Place Block" ), apply_xpm );
......
...@@ -16,9 +16,8 @@ ...@@ -16,9 +16,8 @@
bool WinEDA_GerberFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ) bool WinEDA_GerberFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu )
/********************************************************************************/ /********************************************************************************/
/* Prepare le menu PullUp affich par un click sur le bouton droit /* Prepare the right-click pullup menu.
* de la souris. * The menu already has a list of zoom commands.
* Ce menu est ensuite complt par la liste des commandes de ZOOM
*/ */
{ {
EDA_BaseStruct* DrawStruct = GetScreen()->GetCurItem(); EDA_BaseStruct* DrawStruct = GetScreen()->GetCurItem();
...@@ -49,7 +48,7 @@ bool WinEDA_GerberFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ...@@ -49,7 +48,7 @@ bool WinEDA_GerberFrame::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu
if( BlockActive ) if( BlockActive )
{ {
PopMenu->Append( ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel Block" ) ); PopMenu->Append( ID_POPUP_CANCEL_CURRENT_COMMAND, _( "Cancel Block" ) );
PopMenu->Append( ID_POPUP_ZOOM_BLOCK, _( "Zoom Block (Midd butt drag)" ) ); PopMenu->Append( ID_POPUP_ZOOM_BLOCK, _( "Zoom Block (drag middle mouse)" ) );
PopMenu->AppendSeparator(); PopMenu->AppendSeparator();
PopMenu->Append( ID_POPUP_PLACE_BLOCK, _( "Place Block" ) ); PopMenu->Append( ID_POPUP_PLACE_BLOCK, _( "Place Block" ) );
PopMenu->Append( ID_POPUP_COPY_BLOCK, _( "Copy Block (shift mouse)" ) ); PopMenu->Append( ID_POPUP_COPY_BLOCK, _( "Copy Block (shift mouse)" ) );
......
...@@ -215,7 +215,7 @@ bool WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos, ...@@ -215,7 +215,7 @@ bool WinEDA_ModuleEditFrame::OnRightClick( const wxPoint& MousePos,
ADD_MENUITEM( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND, ADD_MENUITEM( PopMenu, ID_POPUP_CANCEL_CURRENT_COMMAND,
_( "Cancel Block" ), cancel_xpm ); _( "Cancel Block" ), cancel_xpm );
ADD_MENUITEM( PopMenu, ID_POPUP_ZOOM_BLOCK, ADD_MENUITEM( PopMenu, ID_POPUP_ZOOM_BLOCK,
_( "Zoom Block (Midd butt drag)" ), zoom_selected_xpm ); _( "Zoom Block (drag middle mouse)" ), zoom_selected_xpm );
PopMenu->AppendSeparator(); PopMenu->AppendSeparator();
ADD_MENUITEM( PopMenu, ID_POPUP_PLACE_BLOCK, ADD_MENUITEM( PopMenu, ID_POPUP_PLACE_BLOCK,
_( "Place Block" ), apply_xpm ); _( "Place Block" ), apply_xpm );
......
...@@ -483,7 +483,7 @@ void WinEDA_PcbFrame::createPopUpBlockMenu( wxMenu* menu ) ...@@ -483,7 +483,7 @@ void WinEDA_PcbFrame::createPopUpBlockMenu( wxMenu* menu )
ADD_MENUITEM( menu, ID_POPUP_CANCEL_CURRENT_COMMAND, ADD_MENUITEM( menu, ID_POPUP_CANCEL_CURRENT_COMMAND,
_( "Cancel Block" ), cancel_xpm ); _( "Cancel Block" ), cancel_xpm );
ADD_MENUITEM( menu, ID_POPUP_ZOOM_BLOCK, ADD_MENUITEM( menu, ID_POPUP_ZOOM_BLOCK,
_( "Zoom Block (Midd butt drag)" ), zoom_selected_xpm ); _( "Zoom Block (drag middle mouse)" ), zoom_selected_xpm );
menu->AppendSeparator(); menu->AppendSeparator();
ADD_MENUITEM( menu, ID_POPUP_PLACE_BLOCK, ADD_MENUITEM( menu, ID_POPUP_PLACE_BLOCK,
_( "Place Block" ), apply_xpm ); _( "Place Block" ), apply_xpm );
......
...@@ -120,7 +120,7 @@ void WinEDA_DrawFrame::Window_Zoom( EDA_Rect& Rect ) ...@@ -120,7 +120,7 @@ void WinEDA_DrawFrame::Window_Zoom( EDA_Rect& Rect )
/** Compute the zoom factor and the new draw offset to draw the /** Compute the zoom factor and the new draw offset to draw the
* selected area (Rect) in full window screen * selected area (Rect) in full window screen
* @param Rect = selected area th show after zooming * @param Rect = selected area to show after zooming
*/ */
{ {
int ii, jj; int ii, jj;
...@@ -130,7 +130,7 @@ void WinEDA_DrawFrame::Window_Zoom( EDA_Rect& Rect ) ...@@ -130,7 +130,7 @@ void WinEDA_DrawFrame::Window_Zoom( EDA_Rect& Rect )
/* Compute the best zoom */ /* Compute the best zoom */
Rect.Normalize(); Rect.Normalize();
size = DrawPanel->GetClientSize(); size = DrawPanel->GetClientSize();
// Overestimate zoom level, i. e. show more than selected rather than less. // Use ceil to at least show the full rect
ii = static_cast<int>( ceil(1.0 * Rect.GetSize().x / size.x) ); ii = static_cast<int>( ceil(1.0 * Rect.GetSize().x / size.x) );
jj = static_cast<int>( ceil(1.0 * Rect.GetSize().y / size.y) ); jj = static_cast<int>( ceil(1.0 * Rect.GetSize().y / size.y) );
bestzoom = MAX( ii, jj ); bestzoom = MAX( ii, jj );
......
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