Commit 28bcad84 authored by Lorenzo Marcantonio's avatar Lorenzo Marcantonio Committed by Wayne Stambaugh

Rename BASE_SCREEN member m_NumberOfScreen to m_NumberOfScreens.

parent 5e436255
...@@ -35,17 +35,13 @@ ...@@ -35,17 +35,13 @@
#include <id.h> #include <id.h>
#include <base_units.h> #include <base_units.h>
#define CURSOR_SIZE 12 /// size of the cross cursor.
BASE_SCREEN::BASE_SCREEN( KICAD_T aType ) : BASE_SCREEN::BASE_SCREEN( KICAD_T aType ) :
EDA_ITEM( aType ) EDA_ITEM( aType )
{ {
m_UndoRedoCountMax = 10; // undo/Redo command Max depth, 10 is a reasonable value m_UndoRedoCountMax = 10; // undo/Redo command Max depth, 10 is a reasonable value
m_FirstRedraw = true; m_FirstRedraw = true;
m_ScreenNumber = 1; m_ScreenNumber = 1;
m_NumberOfScreen = 1; // Hierarchy: Root: ScreenNumber = 1 m_NumberOfScreens = 1; // Hierarchy: Root: ScreenNumber = 1
m_Zoom = 32.0; m_Zoom = 32.0;
m_Grid.m_Size = wxRealPoint( 50, 50 ); // Default grid size m_Grid.m_Size = wxRealPoint( 50, 50 ); // Default grid size
m_Grid.m_Id = ID_POPUP_GRID_LEVEL_50; m_Grid.m_Id = ID_POPUP_GRID_LEVEL_50;
...@@ -289,31 +285,8 @@ GRID_TYPE& BASE_SCREEN::GetGrid( size_t aIndex ) ...@@ -289,31 +285,8 @@ GRID_TYPE& BASE_SCREEN::GetGrid( size_t aIndex )
} }
GRID_TYPE BASE_SCREEN::GetGrid() wxPoint BASE_SCREEN::GetNearestGridPosition( const wxPoint& aPosition,
{ wxRealPoint* aGridSize ) const
return m_Grid;
}
const wxPoint& BASE_SCREEN::GetGridOrigin()
{
return m_GridOrigin;
}
wxRealPoint BASE_SCREEN::GetGridSize()
{
return m_Grid.m_Size;
}
int BASE_SCREEN::GetGridId()
{
return m_Grid.m_Id;
}
wxPoint BASE_SCREEN::GetNearestGridPosition( const wxPoint& aPosition, wxRealPoint* aGridSize )
{ {
wxPoint pt; wxPoint pt;
wxRealPoint gridSize; wxRealPoint gridSize;
...@@ -337,7 +310,7 @@ wxPoint BASE_SCREEN::GetNearestGridPosition( const wxPoint& aPosition, wxRealPoi ...@@ -337,7 +310,7 @@ wxPoint BASE_SCREEN::GetNearestGridPosition( const wxPoint& aPosition, wxRealPoi
} }
wxPoint BASE_SCREEN::GetCursorPosition( bool aOnGrid, wxRealPoint* aGridSize ) wxPoint BASE_SCREEN::GetCursorPosition( bool aOnGrid, wxRealPoint* aGridSize ) const
{ {
if( aOnGrid ) if( aOnGrid )
return GetNearestGridPosition( m_crossHairPosition, aGridSize ); return GetNearestGridPosition( m_crossHairPosition, aGridSize );
......
...@@ -299,7 +299,7 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen ) ...@@ -299,7 +299,7 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
case WS_IDENTSHEET: case WS_IDENTSHEET:
if( WsItem->m_Legende ) if( WsItem->m_Legende )
msg = WsItem->m_Legende; msg = WsItem->m_Legende;
if( screen->m_NumberOfScreen > 1 ) if( screen->m_NumberOfScreens > 1 )
msg << screen->m_ScreenNumber; msg << screen->m_ScreenNumber;
plotter->Text( pos, color, plotter->Text( pos, color,
msg, TEXT_ORIENT_HORIZ, text_size, msg, TEXT_ORIENT_HORIZ, text_size,
...@@ -310,7 +310,7 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen ) ...@@ -310,7 +310,7 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
case WS_SHEETS: case WS_SHEETS:
if( WsItem->m_Legende ) if( WsItem->m_Legende )
msg = WsItem->m_Legende; msg = WsItem->m_Legende;
msg << screen->m_NumberOfScreen; msg << screen->m_NumberOfScreens;
plotter->Text( pos, color, plotter->Text( pos, color,
msg, TEXT_ORIENT_HORIZ, text_size, msg, TEXT_ORIENT_HORIZ, text_size,
GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
...@@ -497,7 +497,7 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen ) ...@@ -497,7 +497,7 @@ void EDA_DRAW_FRAME::PlotWorkSheet( PLOTTER* plotter, BASE_SCREEN* screen )
case WS_IDENTSHEET: case WS_IDENTSHEET:
msg << screen->m_ScreenNumber << wxT( "/" ) << msg << screen->m_ScreenNumber << wxT( "/" ) <<
screen->m_NumberOfScreen; screen->m_NumberOfScreens;
break; break;
case WS_FILENAME: case WS_FILENAME:
......
...@@ -132,7 +132,7 @@ void DIALOG_PAGES_SETTINGS::initDialog() ...@@ -132,7 +132,7 @@ void DIALOG_PAGES_SETTINGS::initDialog()
#ifdef EESCHEMA #ifdef EESCHEMA
// Init display value for sheet User size // Init display value for sheet User size
wxString format = m_TextSheetCount->GetLabel(); wxString format = m_TextSheetCount->GetLabel();
msg.Printf( format, m_Screen->m_NumberOfScreen ); msg.Printf( format, m_Screen->m_NumberOfScreens );
m_TextSheetCount->SetLabel( msg ); m_TextSheetCount->SetLabel( msg );
format = m_TextSheetNumber->GetLabel(); format = m_TextSheetNumber->GetLabel();
...@@ -644,7 +644,7 @@ void DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample() ...@@ -644,7 +644,7 @@ void DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample()
GRResetPenAndBrush( ( wxDC* ) &memDC ); GRResetPenAndBrush( ( wxDC* ) &memDC );
m_Parent->TraceWorkSheet( (wxDC*) &memDC, dummySize, pointLeftTop, pointRightBottom, m_Parent->TraceWorkSheet( (wxDC*) &memDC, dummySize, pointLeftTop, pointRightBottom,
emptyString, emptyString, m_tb, m_Screen->m_NumberOfScreen, emptyString, emptyString, m_tb, m_Screen->m_NumberOfScreens,
m_Screen->m_ScreenNumber, 1, appScale, LIGHTGRAY, RED ); m_Screen->m_ScreenNumber, 1, appScale, LIGHTGRAY, RED );
memDC.SelectObject( wxNullBitmap ); memDC.SelectObject( wxNullBitmap );
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
#include <kicad_device_context.h> #include <kicad_device_context.h>
#define CURSOR_SIZE 12 // Cursor size in pixels static const int CURSOR_SIZE = 12; ///< Cursor size in pixels
#define CLIP_BOX_PADDING 2 #define CLIP_BOX_PADDING 2
......
...@@ -1026,7 +1026,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* aDC, BASE_SCREEN* aScreen, int aLineW ...@@ -1026,7 +1026,7 @@ void EDA_DRAW_FRAME::TraceWorkSheet( wxDC* aDC, BASE_SCREEN* aScreen, int aLineW
wxString paper = pageInfo.GetType(); wxString paper = pageInfo.GetType();
wxString file = aScreen->GetFileName(); wxString file = aScreen->GetFileName();
TITLE_BLOCK t_block = GetTitleBlock(); TITLE_BLOCK t_block = GetTitleBlock();
int number_of_screens = aScreen->m_NumberOfScreen; int number_of_screens = aScreen->m_NumberOfScreens;
int screen_to_draw = aScreen->m_ScreenNumber; int screen_to_draw = aScreen->m_ScreenNumber;
TraceWorkSheet( aDC, pageSize, margin_left_top, margin_right_bottom, TraceWorkSheet( aDC, pageSize, margin_left_top, margin_right_bottom,
...@@ -1657,7 +1657,7 @@ wxString EDA_DRAW_FRAME::GetScreenDesc() ...@@ -1657,7 +1657,7 @@ wxString EDA_DRAW_FRAME::GetScreenDesc()
wxString msg; wxString msg;
msg << GetScreen()->m_ScreenNumber << wxT( "/" ) msg << GetScreen()->m_ScreenNumber << wxT( "/" )
<< GetScreen()->m_NumberOfScreen; << GetScreen()->m_NumberOfScreens;
return msg; return msg;
} }
......
...@@ -347,7 +347,7 @@ line %d,\nAbort reading file.\n" ), ...@@ -347,7 +347,7 @@ line %d,\nAbort reading file.\n" ),
if( strnicmp( line, "Sheet", 2 ) == 0 ) if( strnicmp( line, "Sheet", 2 ) == 0 )
sscanf( line + 5, " %d %d", sscanf( line + 5, " %d %d",
&aScreen->m_ScreenNumber, &aScreen->m_NumberOfScreen ); &aScreen->m_ScreenNumber, &aScreen->m_NumberOfScreens );
if( strnicmp( line, "Title", 2 ) == 0 ) if( strnicmp( line, "Title", 2 ) == 0 )
{ {
......
...@@ -146,8 +146,8 @@ void SCH_SCREEN::Clear() ...@@ -146,8 +146,8 @@ void SCH_SCREEN::Clear()
{ {
FreeDrawList(); FreeDrawList();
/* Clear the project settings. */ // Clear the project settings
m_ScreenNumber = m_NumberOfScreen = 1; m_ScreenNumber = m_NumberOfScreens = 1;
m_titles.Clear(); m_titles.Clear();
m_titles.SetDate(); m_titles.SetDate();
...@@ -507,7 +507,7 @@ bool SCH_SCREEN::Save( FILE* aFile ) const ...@@ -507,7 +507,7 @@ bool SCH_SCREEN::Save( FILE* aFile ) const
" portrait" : "" " portrait" : ""
) < 0 ) < 0
|| fprintf( aFile, "encoding utf-8\n") < 0 || fprintf( aFile, "encoding utf-8\n") < 0
|| fprintf( aFile, "Sheet %d %d\n", m_ScreenNumber, m_NumberOfScreen ) < 0 || fprintf( aFile, "Sheet %d %d\n", m_ScreenNumber, m_NumberOfScreens ) < 0
|| fprintf( aFile, "Title %s\n", EscapedUTF8( tb.GetTitle() ).c_str() ) < 0 || fprintf( aFile, "Title %s\n", EscapedUTF8( tb.GetTitle() ).c_str() ) < 0
|| fprintf( aFile, "Date %s\n", EscapedUTF8( tb.GetDate() ).c_str() ) < 0 || fprintf( aFile, "Date %s\n", EscapedUTF8( tb.GetDate() ).c_str() ) < 0
|| fprintf( aFile, "Rev %s\n", EscapedUTF8( tb.GetRevision() ).c_str() ) < 0 || fprintf( aFile, "Rev %s\n", EscapedUTF8( tb.GetRevision() ).c_str() ) < 0
......
...@@ -313,7 +313,7 @@ void SCH_EDIT_FRAME::SetSheetNumberAndCount() ...@@ -313,7 +313,7 @@ void SCH_EDIT_FRAME::SetSheetNumberAndCount()
for( screen = s_list.GetFirst(); screen != NULL; screen = s_list.GetNext() ) for( screen = s_list.GetFirst(); screen != NULL; screen = s_list.GetNext() )
{ {
screen->m_NumberOfScreen = sheet_count; screen->m_NumberOfScreens = sheet_count;
} }
GetScreen()->m_ScreenNumber = SheetNumber; GetScreen()->m_ScreenNumber = SheetNumber;
......
...@@ -74,9 +74,9 @@ typedef std::vector< GRID_TYPE > GRIDS; ...@@ -74,9 +74,9 @@ typedef std::vector< GRID_TYPE > GRIDS;
*/ */
class BASE_SCREEN : public EDA_ITEM class BASE_SCREEN : public EDA_ITEM
{ {
private:
GRIDS m_grids; ///< List of valid grid sizes. GRIDS m_grids; ///< List of valid grid sizes.
wxString m_fileName; ///< File used to load the screen. wxString m_fileName; ///< File used to load the screen.
char m_FlagRefreshReq; ///< Indicates that the screen should be redrawn.
bool m_FlagModified; ///< Indicates current drawing has been modified. bool m_FlagModified; ///< Indicates current drawing has been modified.
bool m_FlagSave; ///< Indicates automatic file save. bool m_FlagSave; ///< Indicates automatic file save.
EDA_ITEM* m_CurrentItem; ///< Currently selected object EDA_ITEM* m_CurrentItem; ///< Currently selected object
...@@ -131,9 +131,9 @@ public: ...@@ -131,9 +131,9 @@ public:
BLOCK_SELECTOR m_BlockLocate; ///< Block description for block commands BLOCK_SELECTOR m_BlockLocate; ///< Block description for block commands
int m_ScreenNumber; int m_ScreenNumber;
int m_NumberOfScreen; int m_NumberOfScreens;
wxPoint m_GridOrigin; wxPoint m_GridOrigin;
std::vector<double> m_ZoomList; ///< standard zoom (i.e. scale) coefficients. std::vector<double> m_ZoomList; ///< standard zoom (i.e. scale) coefficients.
bool m_IsPrinting; bool m_IsPrinting;
...@@ -245,13 +245,13 @@ public: ...@@ -245,13 +245,13 @@ public:
*/ */
virtual PICKED_ITEMS_LIST* PopCommandFromRedoList(); virtual PICKED_ITEMS_LIST* PopCommandFromRedoList();
int GetUndoCommandCount() int GetUndoCommandCount() const
{ {
return m_UndoList.m_CommandsList.size(); return m_UndoList.m_CommandsList.size();
} }
int GetRedoCommandCount() int GetRedoCommandCount() const
{ {
return m_RedoList.m_CommandsList.size(); return m_RedoList.m_CommandsList.size();
} }
...@@ -261,8 +261,8 @@ public: ...@@ -261,8 +261,8 @@ public:
void ClrModify() { m_FlagModified = false;; } void ClrModify() { m_FlagModified = false;; }
void SetSave() { m_FlagSave = true; } void SetSave() { m_FlagSave = true; }
void ClrSave() { m_FlagSave = false; } void ClrSave() { m_FlagSave = false; }
int IsModify() { return m_FlagModified; } bool IsModify() const { return m_FlagModified; }
int IsSave() { return m_FlagSave; } bool IsSave() const { return m_FlagSave; }
//----<zoom stuff>--------------------------------------------------------- //----<zoom stuff>---------------------------------------------------------
...@@ -336,23 +336,24 @@ public: ...@@ -336,23 +336,24 @@ public:
* *
* @return int - Currently selected grid command ID. * @return int - Currently selected grid command ID.
*/ */
int GetGridId(); int GetGridId() const { return m_Grid.m_Id; }
/** /**
* Return the grid size of the currently selected grid. * Return the grid size of the currently selected grid.
* *
* @return wxRealPoint - The currently selected grid size. * @return wxRealPoint - The currently selected grid size.
*/ */
wxRealPoint GetGridSize(); const wxRealPoint& GetGridSize() const { return m_Grid.m_Size; }
/** /**
* Return the grid object of the currently selected grid. * Return the grid object of the currently selected grid.
* *
* @return GRID_TYPE - The currently selected grid. * @return GRID_TYPE - The currently selected grid.
*/ */
GRID_TYPE GetGrid(); const GRID_TYPE& GetGrid() const { return m_Grid; }
const wxPoint& GetGridOrigin() const { return m_GridOrigin; }
const wxPoint& GetGridOrigin();
void SetGrid( const wxRealPoint& size ); void SetGrid( const wxRealPoint& size );
/** /**
...@@ -402,7 +403,7 @@ public: ...@@ -402,7 +403,7 @@ public:
* @return wxPoint - The reference point, either the mouse position or * @return wxPoint - The reference point, either the mouse position or
* the cursor position. * the cursor position.
*/ */
wxPoint RefPos( bool useMouse ) wxPoint RefPos( bool useMouse ) const
{ {
return useMouse ? m_MousePosition : m_crossHairPosition; return useMouse ? m_MousePosition : m_crossHairPosition;
} }
...@@ -415,7 +416,7 @@ public: ...@@ -415,7 +416,7 @@ public:
* if \a aOnGrid is true. * if \a aOnGrid is true.
* @return The current cursor position. * @return The current cursor position.
*/ */
wxPoint GetCursorPosition( bool aOnGrid, wxRealPoint* aGridSize = NULL ); wxPoint GetCursorPosition( bool aOnGrid, wxRealPoint* aGridSize = NULL ) const;
/** /**
* Function GetCursorScreenPosition * Function GetCursorScreenPosition
...@@ -432,7 +433,8 @@ public: ...@@ -432,7 +433,8 @@ public:
* grid size is used. * grid size is used.
* @return The nearst grid position. * @return The nearst grid position.
*/ */
wxPoint GetNearestGridPosition( const wxPoint& aPosition, wxRealPoint* aGridSize = NULL ); wxPoint GetNearestGridPosition( const wxPoint& aPosition,
wxRealPoint* aGridSize = NULL ) const;
/** /**
* Function GetClass * Function GetClass
......
...@@ -560,7 +560,7 @@ public: ...@@ -560,7 +560,7 @@ public:
/** /**
* Function SetSheetNumberAndCount * Function SetSheetNumberAndCount
* Set the m_ScreenNumber and m_NumberOfScreen members for screens * Set the m_ScreenNumber and m_NumberOfScreens members for screens
* must be called after a delete or add sheet command, and when entering * must be called after a delete or add sheet command, and when entering
* a sheet * a sheet
*/ */
......
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