Fix the pleditor status bar text

This commit is contained in:
Marek Roszko 2020-12-08 19:47:14 -05:00
parent 4e9b9ee9cd
commit 5a2ef73d66
4 changed files with 20 additions and 10 deletions

View File

@ -667,7 +667,7 @@ void PL_EDITOR_FRAME::DisplayGridMsg()
void PL_EDITOR_FRAME::UpdateStatusBar()
{
// Display Zoom level:
EDA_DRAW_FRAME::UpdateStatusBar();
SetStatusText( GetZoomLevelIndicator(), 1 );
// coordinate origin can be the paper Top Left corner, or each of 4 page corners
wxPoint originCoord = ReturnCoordOriginCorner();
@ -706,7 +706,6 @@ void PL_EDITOR_FRAME::UpdateStatusBar()
double dXpos = To_User_Unit( GetUserUnits(), coord.x * Xsign );
double dYpos = To_User_Unit( GetUserUnits(), coord.y * Ysign );
wxString pagesizeformatter = _( "Page size: width %.4g height %.4g" );
wxString absformatter = wxT( "X %.4g Y %.4g" );
wxString locformatter = wxT( "dx %.4g dy %.4g" );
@ -721,13 +720,6 @@ void PL_EDITOR_FRAME::UpdateStatusBar()
wxString line;
// Display page size
#define MILS_TO_MM (25.4/1000)
DSIZE size = GetPageSettings().GetSizeMils();
size = size * MILS_TO_MM;
line.Printf( pagesizeformatter, size.x, size.y );
SetStatusText( line, 0 );
// Display abs coordinates
line.Printf( absformatter, dXpos, dYpos );
SetStatusText( line, 2 );

View File

@ -29,6 +29,7 @@
#include <algorithm>
#include <climits>
#include <eda_draw_frame.h>
#include <eda_item.h>
#include <eda_rect.h>
#include "pl_editor_layout.h"
@ -44,6 +45,7 @@ PL_EDITOR_LAYOUT::~PL_EDITOR_LAYOUT()
{
}
EDA_RECT PL_EDITOR_LAYOUT::ComputeBoundingBox()
{
EDA_RECT bbox;
@ -51,3 +53,14 @@ EDA_RECT PL_EDITOR_LAYOUT::ComputeBoundingBox()
SetBoundingBox( bbox );
return bbox;
}
void PL_EDITOR_LAYOUT::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList )
{
DSIZE size = GetPageSettings().GetSizeIU();
aList.emplace_back( _( "Page Width" ), MessageTextFromValue( aFrame->GetUserUnits(), size.x ) );
aList.emplace_back(
_( "Page Height" ), MessageTextFromValue( aFrame->GetUserUnits(), size.y ) );
}

View File

@ -84,6 +84,8 @@ public:
void SetBoundingBox( const EDA_RECT& aBox ) { m_boundingBox = aBox; }
virtual void GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_ITEM>& aList );
#if defined(DEBUG)
void Show( int nestLevel, std::ostream& os ) const;
#endif

View File

@ -159,7 +159,10 @@ int PL_EDITOR_CONTROL::UpdateMessagePanel( const TOOL_EVENT& aEvent )
}
else
{
m_frame->ClearMsgPanel();
MSG_PANEL_ITEMS msgItems;
m_frame->GetPageLayout().GetMsgPanelInfo( m_frame, msgItems );
m_frame->SetMsgPanel( msgItems );
m_frame->GetPropertiesFrame()->CopyPrmsFromItemToPanel( nullptr );
}