From 4ee4f83de4b7c5c4a4c990f00b070bfc67ab899e Mon Sep 17 00:00:00 2001 From: dickelbeck Date: Thu, 9 Apr 2009 18:16:16 +0000 Subject: [PATCH] move polar coordinates display to status field 2, so that field 0 persists. --- common/drawframe.cpp | 2 +- pcbnew/basepcbframe.cpp | 33 ++++++++++++++++++++------------- 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/common/drawframe.cpp b/common/drawframe.cpp index 990afc6903..63725e4f7f 100644 --- a/common/drawframe.cpp +++ b/common/drawframe.cpp @@ -186,7 +186,7 @@ void WinEDA_DrawFrame::Affiche_Message( const wxString& message ) * Display the message on the bottom the frame */ { - SetStatusText( message ); + SetStatusText( message, 0 ); } diff --git a/pcbnew/basepcbframe.cpp b/pcbnew/basepcbframe.cpp index 3df10357a6..39b6b1e452 100644 --- a/pcbnew/basepcbframe.cpp +++ b/pcbnew/basepcbframe.cpp @@ -336,22 +336,21 @@ void WinEDA_BasePcbFrame::UpdateStatusBar() * Update the status bar information. */ { - wxString Line; - int dx, dy; - double theta, ro; - BASE_SCREEN* screen = GetBaseScreen(); - - if( !screen ) - return; - WinEDA_DrawFrame::UpdateStatusBar(); - dx = screen->m_Curseur.x - screen->m_O_Curseur.x; - dy = screen->m_Curseur.y - screen->m_O_Curseur.y; - - if( DisplayOpt.DisplayPolarCood ) /* Display coordonnee polaire */ + if( DisplayOpt.DisplayPolarCood ) // display polar coordinates { - if( (dx == 0) && (dy == 0) ) + BASE_SCREEN* screen = GetBaseScreen(); + if( !screen ) + return; + + wxString Line; + double theta, ro; + + int dx = screen->m_Curseur.x - screen->m_O_Curseur.x; + int dy = screen->m_Curseur.y - screen->m_O_Curseur.y; + + if( dx==0 && dy==0 ) theta = 0.0; else theta = atan2( (double) -dy, (double) dx ); @@ -362,9 +361,17 @@ void WinEDA_BasePcbFrame::UpdateStatusBar() Line.Printf( g_UnitMetric ? wxT( "Ro %.3f Th %.1f" ) : wxT( "Ro %.4f Th %.1f" ), To_User_Unit( g_UnitMetric, ro, m_InternalUnits ), theta ); + + // overwrite the absolute cartesian coordinates + SetStatusText( Line, 2 ); } + /* not this, because status field no. 0 is reserved for actual fleeting + status information. If this is enabled, then that text is erased on + every DrawPanel redraw. Field no. 0 is set with Affiche_Message() and it + should persist until called again. SetStatusText( Line, 0 ); + */ }