Update names to match current nomenclature.

(Footprints now have PCB_FIELDs, not FP_TEXTs.)
This commit is contained in:
Jeff Young 2024-05-06 15:59:44 +01:00
parent 3620887a22
commit 73681d08c5
7 changed files with 140 additions and 140 deletions

View File

@ -343,7 +343,7 @@ set( PCBNEW_CLASS_SRCS
specctra_import_export/specctra.cpp
specctra_import_export/specctra_export.cpp
specctra_import_export/specctra_import.cpp
fp_text_grid_table.cpp
pcb_fields_grid_table.cpp
toolbars_footprint_editor.cpp
toolbars_footprint_viewer.cpp
toolbars_pcb_editor.cpp

View File

@ -79,7 +79,7 @@ DIALOG_FOOTPRINT_PROPERTIES::DIALOG_FOOTPRINT_PROPERTIES( PCB_EDIT_FRAME* aParen
m_posX.SetCoordType( ORIGIN_TRANSFORMS::ABS_X_COORD );
m_posY.SetCoordType( ORIGIN_TRANSFORMS::ABS_Y_COORD );
m_fields = new FP_TEXT_GRID_TABLE( m_frame, this );
m_fields = new PCB_FIELDS_GRID_TABLE( m_frame, this );
m_delayedErrorMessage = wxEmptyString;
m_delayedFocusGrid = nullptr;
@ -346,7 +346,7 @@ bool DIALOG_FOOTPRINT_PROPERTIES::TransferDataToWindow()
// Adjust the column size.
int col_size = m_itemsGrid->GetVisibleWidth( col );
if( col == FPT_LAYER ) // This one's a drop-down. Check all possible values.
if( col == PFC_LAYER ) // This one's a drop-down. Check all possible values.
{
BOARD* board = m_footprint->GetBoard();
@ -388,7 +388,7 @@ bool DIALOG_FOOTPRINT_PROPERTIES::Validate()
{
m_delayedFocusGrid = m_itemsGrid;
m_delayedErrorMessage = wxString::Format( _( "Fields must have a name." ) );
m_delayedFocusColumn = FPT_NAME;
m_delayedFocusColumn = PFC_NAME;
m_delayedFocusRow = i;
return false;
@ -396,18 +396,18 @@ bool DIALOG_FOOTPRINT_PROPERTIES::Validate()
int minSize = pcbIUScale.mmToIU( TEXT_MIN_SIZE_MM );
int maxSize = pcbIUScale.mmToIU( TEXT_MAX_SIZE_MM );
int width = m_frame->ValueFromString( m_itemsGrid->GetCellValue( i, FPT_WIDTH ) );
int height = m_frame->ValueFromString( m_itemsGrid->GetCellValue( i, FPT_HEIGHT ) );
int width = m_frame->ValueFromString( m_itemsGrid->GetCellValue( i, PFC_WIDTH ) );
int height = m_frame->ValueFromString( m_itemsGrid->GetCellValue( i, PFC_HEIGHT ) );
if( width < minSize )
{
wxString min = m_frame->StringFromValue( minSize, true );
m_itemsGrid->SetCellValue( i, FPT_WIDTH, min );
m_itemsGrid->SetCellValue( i, PFC_WIDTH, min );
m_delayedFocusGrid = m_itemsGrid;
m_delayedErrorMessage = wxString::Format( _( "Text width must be at least %s." ), min );
m_delayedFocusColumn = FPT_WIDTH;
m_delayedFocusColumn = PFC_WIDTH;
m_delayedFocusRow = i;
return false;
@ -416,11 +416,11 @@ bool DIALOG_FOOTPRINT_PROPERTIES::Validate()
{
wxString max = m_frame->StringFromValue( maxSize, true );
m_itemsGrid->SetCellValue( i, FPT_WIDTH, max );
m_itemsGrid->SetCellValue( i, PFC_WIDTH, max );
m_delayedFocusGrid = m_itemsGrid;
m_delayedErrorMessage = wxString::Format( _( "Text width must be at most %s." ), max );
m_delayedFocusColumn = FPT_WIDTH;
m_delayedFocusColumn = PFC_WIDTH;
m_delayedFocusRow = i;
return false;
@ -430,11 +430,11 @@ bool DIALOG_FOOTPRINT_PROPERTIES::Validate()
{
wxString min = m_frame->StringFromValue( minSize, true );
m_itemsGrid->SetCellValue( i, FPT_HEIGHT, min );
m_itemsGrid->SetCellValue( i, PFC_HEIGHT, min );
m_delayedFocusGrid = m_itemsGrid;
m_delayedErrorMessage = wxString::Format( _( "Text height must be at least %s." ), min );
m_delayedFocusColumn = FPT_HEIGHT;
m_delayedFocusColumn = PFC_HEIGHT;
m_delayedFocusRow = i;
return false;
@ -443,11 +443,11 @@ bool DIALOG_FOOTPRINT_PROPERTIES::Validate()
{
wxString max = m_frame->StringFromValue( maxSize, true );
m_itemsGrid->SetCellValue( i, FPT_HEIGHT, max );
m_itemsGrid->SetCellValue( i, PFC_HEIGHT, max );
m_delayedFocusGrid = m_itemsGrid;
m_delayedErrorMessage = wxString::Format( _( "Text height must be at most %s." ), max );
m_delayedFocusColumn = FPT_HEIGHT;
m_delayedFocusColumn = PFC_HEIGHT;
m_delayedFocusRow = i;
return false;
@ -460,14 +460,14 @@ bool DIALOG_FOOTPRINT_PROPERTIES::Validate()
{
wxString clamped = m_frame->StringFromValue( maxPenWidth, true );
m_itemsGrid->SetCellValue( i, FPT_THICKNESS, clamped );
m_itemsGrid->SetCellValue( i, PFC_THICKNESS, clamped );
m_delayedFocusGrid = m_itemsGrid;
m_delayedErrorMessage = wxString::Format( _( "Text thickness is too large for the "
"text size.\n"
"It will be clamped at %s." ),
clamped );
m_delayedFocusColumn = FPT_THICKNESS;
m_delayedFocusColumn = PFC_THICKNESS;
m_delayedFocusRow = i;
return false;

View File

@ -29,7 +29,7 @@
#include <dialog_footprint_properties_base.h>
#include <wx/valnum.h>
#include <fp_text_grid_table.h>
#include <pcb_fields_grid_table.h>
#include <footprint.h>
#include <widgets/unit_binder.h>
@ -82,7 +82,7 @@ private:
static int m_page; // remember the last open page during session
FP_TEXT_GRID_TABLE* m_fields;
PCB_FIELDS_GRID_TABLE* m_fields;
UNIT_BINDER m_posX;
UNIT_BINDER m_posY;
UNIT_BINDER m_orientation;

View File

@ -142,7 +142,7 @@ DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR(
m_3dPanel = new PANEL_FP_PROPERTIES_3D_MODEL( m_frame, m_footprint, this, m_NoteBook );
m_NoteBook->AddPage( m_3dPanel, _("3D Models"), false );
m_fields = new FP_TEXT_GRID_TABLE( m_frame, this );
m_fields = new PCB_FIELDS_GRID_TABLE( m_frame, this );
m_privateLayers = new PRIVATE_LAYERS_GRID_TABLE( m_frame );
m_delayedErrorMessage = wxEmptyString;
@ -361,7 +361,7 @@ bool DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::TransferDataToWindow()
// Adjust the column size.
int col_size = m_itemsGrid->GetVisibleWidth( col );
if( col == FPT_LAYER ) // This one's a drop-down. Check all possible values.
if( col == PFC_LAYER ) // This one's a drop-down. Check all possible values.
{
BOARD* board = m_footprint->GetBoard();
@ -435,7 +435,7 @@ bool DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::Validate()
{
m_delayedFocusGrid = m_itemsGrid;
m_delayedErrorMessage = wxString::Format( _( "Fields must have a name." ) );
m_delayedFocusColumn = FPT_NAME;
m_delayedFocusColumn = PFC_NAME;
m_delayedFocusRow = i;
return false;
@ -450,7 +450,7 @@ bool DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::Validate()
m_delayedErrorMessage = wxString::Format( _( "The text width must be between %s and %s." ),
m_frame->StringFromValue( minSize, true ),
m_frame->StringFromValue( maxSize, true ) );
m_delayedFocusColumn = FPT_WIDTH;
m_delayedFocusColumn = PFC_WIDTH;
m_delayedFocusRow = i;
return false;
@ -462,7 +462,7 @@ bool DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::Validate()
m_delayedErrorMessage = wxString::Format( _( "The text height must be between %s and %s." ),
m_frame->StringFromValue( minSize, true ),
m_frame->StringFromValue( maxSize, true ) );
m_delayedFocusColumn = FPT_HEIGHT;
m_delayedFocusColumn = PFC_HEIGHT;
m_delayedFocusRow = i;
return false;
@ -473,13 +473,13 @@ bool DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR::Validate()
if( field.GetTextThickness() > maxPenWidth )
{
m_itemsGrid->SetCellValue( i, FPT_THICKNESS,
m_itemsGrid->SetCellValue( i, PFC_THICKNESS,
m_frame->StringFromValue( maxPenWidth, true ) );
m_delayedFocusGrid = m_itemsGrid;
m_delayedErrorMessage = _( "The text thickness is too large for the text size.\n"
"It will be clamped." );
m_delayedFocusColumn = FPT_THICKNESS;
m_delayedFocusColumn = PFC_THICKNESS;
m_delayedFocusRow = i;
return false;

View File

@ -26,7 +26,7 @@
#define DIALOG_FOOTPRINT_PROPERTIES_FP_EDITOR_H
#include <vector>
#include <fp_text_grid_table.h>
#include <pcb_fields_grid_table.h>
#include <widgets/unit_binder.h>
#include <footprint.h>
#include <dialog_footprint_properties_fp_editor_base.h>
@ -102,7 +102,7 @@ private:
static NOTEBOOK_PAGES m_page; // remember the last open page during session
FP_TEXT_GRID_TABLE* m_fields;
PCB_FIELDS_GRID_TABLE* m_fields;
PRIVATE_LAYERS_GRID_TABLE* m_privateLayers;
UNIT_BINDER m_netClearance;

View File

@ -23,7 +23,7 @@
#include <kiway_player.h>
#include <project.h>
#include <fp_text_grid_table.h>
#include <pcb_fields_grid_table.h>
#include <widgets/grid_combobox.h>
#include <trigo.h>
#include <pcb_base_frame.h>
@ -42,7 +42,7 @@ enum
wxArrayString g_menuOrientations;
FP_TEXT_GRID_TABLE::FP_TEXT_GRID_TABLE( PCB_BASE_FRAME* aFrame, DIALOG_SHIM* aDialog ) :
PCB_FIELDS_GRID_TABLE::PCB_FIELDS_GRID_TABLE( PCB_BASE_FRAME* aFrame, DIALOG_SHIM* aDialog ) :
m_frame( aFrame ),
m_dialog( aDialog ),
m_fieldNameValidator( FIELD_NAME ),
@ -102,11 +102,11 @@ FP_TEXT_GRID_TABLE::FP_TEXT_GRID_TABLE( PCB_BASE_FRAME* aFrame, DIALOG_SHIM* aDi
m_eval = std::make_unique<NUMERIC_EVALUATOR>( m_frame->GetUserUnits() );
m_frame->Bind( EDA_EVT_UNITS_CHANGED, &FP_TEXT_GRID_TABLE::onUnitsChanged, this );
m_frame->Bind( EDA_EVT_UNITS_CHANGED, &PCB_FIELDS_GRID_TABLE::onUnitsChanged, this );
}
FP_TEXT_GRID_TABLE::~FP_TEXT_GRID_TABLE()
PCB_FIELDS_GRID_TABLE::~PCB_FIELDS_GRID_TABLE()
{
m_readOnlyAttr->DecRef();
m_boolColAttr->DecRef();
@ -117,11 +117,11 @@ FP_TEXT_GRID_TABLE::~FP_TEXT_GRID_TABLE()
m_footprintAttr->DecRef();
m_urlAttr->DecRef();
m_frame->Unbind( EDA_EVT_UNITS_CHANGED, &FP_TEXT_GRID_TABLE::onUnitsChanged, this );
m_frame->Unbind( EDA_EVT_UNITS_CHANGED, &PCB_FIELDS_GRID_TABLE::onUnitsChanged, this );
}
void FP_TEXT_GRID_TABLE::onUnitsChanged( wxCommandEvent& aEvent )
void PCB_FIELDS_GRID_TABLE::onUnitsChanged( wxCommandEvent& aEvent )
{
if( GetView() )
GetView()->ForceRefresh();
@ -130,51 +130,51 @@ void FP_TEXT_GRID_TABLE::onUnitsChanged( wxCommandEvent& aEvent )
}
wxString FP_TEXT_GRID_TABLE::GetColLabelValue( int aCol )
wxString PCB_FIELDS_GRID_TABLE::GetColLabelValue( int aCol )
{
switch( aCol )
{
case FPT_NAME: return _( "Name" );
case FPT_VALUE: return _( "Value" );
case FPT_SHOWN: return _( "Show" );
case FPT_WIDTH: return _( "Width" );
case FPT_HEIGHT: return _( "Height" );
case FPT_THICKNESS: return _( "Thickness" );
case FPT_ITALIC: return _( "Italic" );
case FPT_LAYER: return _( "Layer" );
case FPT_ORIENTATION: return _( "Orientation" );
case FPT_UPRIGHT: return _( "Keep Upright" );
case FPT_XOFFSET: return _( "X Offset" );
case FPT_YOFFSET: return _( "Y Offset" );
case FPT_KNOCKOUT: return _( "Knockout" );
case FPT_MIRRORED: return _( "Mirrored" );
case PFC_NAME: return _( "Name" );
case PFC_VALUE: return _( "Value" );
case PFC_SHOWN: return _( "Show" );
case PFC_WIDTH: return _( "Width" );
case PFC_HEIGHT: return _( "Height" );
case PFC_THICKNESS: return _( "Thickness" );
case PFC_ITALIC: return _( "Italic" );
case PFC_LAYER: return _( "Layer" );
case PFC_ORIENTATION: return _( "Orientation" );
case PFC_UPRIGHT: return _( "Keep Upright" );
case PFC_XOFFSET: return _( "X Offset" );
case PFC_YOFFSET: return _( "Y Offset" );
case PFC_KNOCKOUT: return _( "Knockout" );
case PFC_MIRRORED: return _( "Mirrored" );
default: wxFAIL; return wxEmptyString;
}
}
bool FP_TEXT_GRID_TABLE::CanGetValueAs( int aRow, int aCol, const wxString& aTypeName )
bool PCB_FIELDS_GRID_TABLE::CanGetValueAs( int aRow, int aCol, const wxString& aTypeName )
{
switch( aCol )
{
case FPT_NAME:
case FPT_VALUE:
case FPT_WIDTH:
case FPT_HEIGHT:
case FPT_THICKNESS:
case FPT_ORIENTATION:
case FPT_XOFFSET:
case FPT_YOFFSET:
case PFC_NAME:
case PFC_VALUE:
case PFC_WIDTH:
case PFC_HEIGHT:
case PFC_THICKNESS:
case PFC_ORIENTATION:
case PFC_XOFFSET:
case PFC_YOFFSET:
return aTypeName == wxGRID_VALUE_STRING;
case FPT_SHOWN:
case FPT_ITALIC:
case FPT_UPRIGHT:
case FPT_KNOCKOUT:
case FPT_MIRRORED:
case PFC_SHOWN:
case PFC_ITALIC:
case PFC_UPRIGHT:
case PFC_KNOCKOUT:
case PFC_MIRRORED:
return aTypeName == wxGRID_VALUE_BOOL;
case FPT_LAYER:
case PFC_LAYER:
return aTypeName == wxGRID_VALUE_NUMBER;
default:
@ -184,17 +184,17 @@ bool FP_TEXT_GRID_TABLE::CanGetValueAs( int aRow, int aCol, const wxString& aTyp
}
bool FP_TEXT_GRID_TABLE::CanSetValueAs( int aRow, int aCol, const wxString& aTypeName )
bool PCB_FIELDS_GRID_TABLE::CanSetValueAs( int aRow, int aCol, const wxString& aTypeName )
{
return CanGetValueAs( aRow, aCol, aTypeName );
}
wxGridCellAttr* FP_TEXT_GRID_TABLE::GetAttr( int aRow, int aCol, wxGridCellAttr::wxAttrKind )
wxGridCellAttr* PCB_FIELDS_GRID_TABLE::GetAttr( int aRow, int aCol, wxGridCellAttr::wxAttrKind )
{
switch( aCol )
{
case FPT_NAME:
case PFC_NAME:
if( aRow < MANDATORY_FIELDS )
{
m_readOnlyAttr->IncRef();
@ -203,7 +203,7 @@ wxGridCellAttr* FP_TEXT_GRID_TABLE::GetAttr( int aRow, int aCol, wxGridCellAttr:
return nullptr;
case FPT_VALUE:
case PFC_VALUE:
if( aRow == REFERENCE_FIELD )
{
m_referenceAttr->IncRef();
@ -227,26 +227,26 @@ wxGridCellAttr* FP_TEXT_GRID_TABLE::GetAttr( int aRow, int aCol, wxGridCellAttr:
return nullptr;
case FPT_WIDTH:
case FPT_HEIGHT:
case FPT_THICKNESS:
case FPT_XOFFSET:
case FPT_YOFFSET:
case PFC_WIDTH:
case PFC_HEIGHT:
case PFC_THICKNESS:
case PFC_XOFFSET:
case PFC_YOFFSET:
return nullptr;
case FPT_SHOWN:
case FPT_ITALIC:
case FPT_UPRIGHT:
case FPT_KNOCKOUT:
case FPT_MIRRORED:
case PFC_SHOWN:
case PFC_ITALIC:
case PFC_UPRIGHT:
case PFC_KNOCKOUT:
case PFC_MIRRORED:
m_boolColAttr->IncRef();
return m_boolColAttr;
case FPT_LAYER:
case PFC_LAYER:
m_layerColAttr->IncRef();
return m_layerColAttr;
case FPT_ORIENTATION:
case PFC_ORIENTATION:
m_orientationColAttr->IncRef();
return m_orientationColAttr;
@ -257,7 +257,7 @@ wxGridCellAttr* FP_TEXT_GRID_TABLE::GetAttr( int aRow, int aCol, wxGridCellAttr:
}
wxString FP_TEXT_GRID_TABLE::GetValue( int aRow, int aCol )
wxString PCB_FIELDS_GRID_TABLE::GetValue( int aRow, int aCol )
{
wxGrid* grid = GetView();
const PCB_FIELD& field = this->at( (size_t) aRow );
@ -273,21 +273,21 @@ wxString FP_TEXT_GRID_TABLE::GetValue( int aRow, int aCol )
switch( aCol )
{
case FPT_NAME: return field.GetName();
case FPT_VALUE: return field.GetText();
case FPT_WIDTH: return m_frame->StringFromValue( field.GetTextWidth(), true );
case FPT_HEIGHT: return m_frame->StringFromValue( field.GetTextHeight(), true );
case FPT_THICKNESS: return m_frame->StringFromValue( field.GetTextThickness(), true );
case FPT_LAYER: return field.GetLayerName();
case PFC_NAME: return field.GetName();
case PFC_VALUE: return field.GetText();
case PFC_WIDTH: return m_frame->StringFromValue( field.GetTextWidth(), true );
case PFC_HEIGHT: return m_frame->StringFromValue( field.GetTextHeight(), true );
case PFC_THICKNESS: return m_frame->StringFromValue( field.GetTextThickness(), true );
case PFC_LAYER: return field.GetLayerName();
case FPT_ORIENTATION:
case PFC_ORIENTATION:
{
EDA_ANGLE angle = field.GetTextAngle() - field.GetParentFootprint()->GetOrientation();
return m_frame->StringFromValue( angle, true );
}
case FPT_XOFFSET: return m_frame->StringFromValue( field.GetFPRelativePosition().x, true );
case FPT_YOFFSET: return m_frame->StringFromValue( field.GetFPRelativePosition().y, true );
case PFC_XOFFSET: return m_frame->StringFromValue( field.GetFPRelativePosition().x, true );
case PFC_YOFFSET: return m_frame->StringFromValue( field.GetFPRelativePosition().y, true );
default:
// we can't assert here because wxWidgets sometimes calls this without checking
@ -297,17 +297,17 @@ wxString FP_TEXT_GRID_TABLE::GetValue( int aRow, int aCol )
}
bool FP_TEXT_GRID_TABLE::GetValueAsBool( int aRow, int aCol )
bool PCB_FIELDS_GRID_TABLE::GetValueAsBool( int aRow, int aCol )
{
PCB_FIELD& field = this->at( (size_t) aRow );
switch( aCol )
{
case FPT_SHOWN: return field.IsVisible();
case FPT_ITALIC: return field.IsItalic();
case FPT_UPRIGHT: return field.IsKeepUpright();
case FPT_KNOCKOUT: return field.IsKnockout();
case FPT_MIRRORED: return field.IsMirrored();
case PFC_SHOWN: return field.IsVisible();
case PFC_ITALIC: return field.IsItalic();
case PFC_UPRIGHT: return field.IsKeepUpright();
case PFC_KNOCKOUT: return field.IsKnockout();
case PFC_MIRRORED: return field.IsMirrored();
default:
wxFAIL_MSG( wxString::Format( wxT( "column %d doesn't hold a bool value" ), aCol ) );
@ -316,13 +316,13 @@ bool FP_TEXT_GRID_TABLE::GetValueAsBool( int aRow, int aCol )
}
long FP_TEXT_GRID_TABLE::GetValueAsLong( int aRow, int aCol )
long PCB_FIELDS_GRID_TABLE::GetValueAsLong( int aRow, int aCol )
{
PCB_FIELD& field = this->at( (size_t) aRow );
switch( aCol )
{
case FPT_LAYER: return field.GetLayer();
case PFC_LAYER: return field.GetLayer();
default:
wxFAIL_MSG( wxString::Format( wxT( "column %d doesn't hold a long value" ), aCol ) );
@ -331,7 +331,7 @@ long FP_TEXT_GRID_TABLE::GetValueAsLong( int aRow, int aCol )
}
void FP_TEXT_GRID_TABLE::SetValue( int aRow, int aCol, const wxString &aValue )
void PCB_FIELDS_GRID_TABLE::SetValue( int aRow, int aCol, const wxString &aValue )
{
PCB_FIELD& field = this->at( (size_t) aRow );
VECTOR2I pos;
@ -339,11 +339,11 @@ void FP_TEXT_GRID_TABLE::SetValue( int aRow, int aCol, const wxString &aValue )
switch( aCol )
{
case FPT_WIDTH:
case FPT_HEIGHT:
case FPT_THICKNESS:
case FPT_XOFFSET:
case FPT_YOFFSET:
case PFC_WIDTH:
case PFC_HEIGHT:
case PFC_THICKNESS:
case PFC_XOFFSET:
case PFC_YOFFSET:
m_eval->SetDefaultUnits( m_frame->GetUserUnits() );
if( m_eval->Process( value ) )
@ -360,22 +360,22 @@ void FP_TEXT_GRID_TABLE::SetValue( int aRow, int aCol, const wxString &aValue )
switch( aCol )
{
case FPT_NAME: field.SetName( value ); break;
case FPT_VALUE: field.SetText( value ); break;
case FPT_WIDTH: field.SetTextWidth( m_frame->ValueFromString( value ) ); break;
case FPT_HEIGHT: field.SetTextHeight( m_frame->ValueFromString( value ) ); break;
case FPT_THICKNESS: field.SetTextThickness( m_frame->ValueFromString( value ) ); break;
case PFC_NAME: field.SetName( value ); break;
case PFC_VALUE: field.SetText( value ); break;
case PFC_WIDTH: field.SetTextWidth( m_frame->ValueFromString( value ) ); break;
case PFC_HEIGHT: field.SetTextHeight( m_frame->ValueFromString( value ) ); break;
case PFC_THICKNESS: field.SetTextThickness( m_frame->ValueFromString( value ) ); break;
case FPT_ORIENTATION:
case PFC_ORIENTATION:
field.SetTextAngle( m_frame->AngleValueFromString( value )
+ field.GetParentFootprint()->GetOrientation() );
break;
case FPT_XOFFSET:
case FPT_YOFFSET:
case PFC_XOFFSET:
case PFC_YOFFSET:
pos = field.GetFPRelativePosition();
if( aCol == FPT_XOFFSET )
if( aCol == PFC_XOFFSET )
pos.x = m_frame->ValueFromString( value );
else
pos.y = m_frame->ValueFromString( value );
@ -392,17 +392,17 @@ void FP_TEXT_GRID_TABLE::SetValue( int aRow, int aCol, const wxString &aValue )
}
void FP_TEXT_GRID_TABLE::SetValueAsBool( int aRow, int aCol, bool aValue )
void PCB_FIELDS_GRID_TABLE::SetValueAsBool( int aRow, int aCol, bool aValue )
{
PCB_FIELD& field = this->at( (size_t) aRow );
switch( aCol )
{
case FPT_SHOWN: field.SetVisible( aValue ); break;
case FPT_ITALIC: field.SetItalic( aValue ); break;
case FPT_UPRIGHT: field.SetKeepUpright( aValue ); break;
case FPT_KNOCKOUT: field.SetIsKnockout( aValue ); break;
case FPT_MIRRORED: field.SetMirrored( aValue ); break;
case PFC_SHOWN: field.SetVisible( aValue ); break;
case PFC_ITALIC: field.SetItalic( aValue ); break;
case PFC_UPRIGHT: field.SetKeepUpright( aValue ); break;
case PFC_KNOCKOUT: field.SetIsKnockout( aValue ); break;
case PFC_MIRRORED: field.SetMirrored( aValue ); break;
default:
wxFAIL_MSG( wxString::Format( wxT( "column %d doesn't hold a bool value" ), aCol ) );
@ -411,13 +411,13 @@ void FP_TEXT_GRID_TABLE::SetValueAsBool( int aRow, int aCol, bool aValue )
}
void FP_TEXT_GRID_TABLE::SetValueAsLong( int aRow, int aCol, long aValue )
void PCB_FIELDS_GRID_TABLE::SetValueAsLong( int aRow, int aCol, long aValue )
{
PCB_FIELD& field = this->at( (size_t) aRow );
switch( aCol )
{
case FPT_LAYER:
case PFC_LAYER:
field.SetLayer( ToLAYER_ID( (int) aValue ) );
field.SetMirrored( IsBackLayer( field.GetLayer() ) );
break;

View File

@ -33,35 +33,35 @@
class PCB_BASE_FRAME;
enum FP_TEXT_COL_ORDER
enum PCB_FIELDS_COL_ORDER
{
FPT_NAME,
FPT_VALUE,
FPT_SHOWN,
FPT_WIDTH,
FPT_HEIGHT,
FPT_THICKNESS,
FPT_ITALIC,
FPT_LAYER,
FPT_ORIENTATION,
FPT_UPRIGHT, // keep text upright when viewed from bottom or right of board
FPT_XOFFSET,
FPT_YOFFSET,
FPT_KNOCKOUT,
FPT_MIRRORED,
PFC_NAME,
PFC_VALUE,
PFC_SHOWN,
PFC_WIDTH,
PFC_HEIGHT,
PFC_THICKNESS,
PFC_ITALIC,
PFC_LAYER,
PFC_ORIENTATION,
PFC_UPRIGHT, // keep text upright when viewed from bottom or right of board
PFC_XOFFSET,
PFC_YOFFSET,
PFC_KNOCKOUT,
PFC_MIRRORED,
FPT_COUNT // keep as last
PFC_COUNT // keep as last
};
class FP_TEXT_GRID_TABLE : public wxGridTableBase, public std::vector<PCB_FIELD>
class PCB_FIELDS_GRID_TABLE : public wxGridTableBase, public std::vector<PCB_FIELD>
{
public:
FP_TEXT_GRID_TABLE( PCB_BASE_FRAME* aFrame, DIALOG_SHIM* aDialog );
~FP_TEXT_GRID_TABLE();
PCB_FIELDS_GRID_TABLE( PCB_BASE_FRAME* aFrame, DIALOG_SHIM* aDialog );
~PCB_FIELDS_GRID_TABLE();
int GetNumberRows() override { return (int) size(); }
int GetNumberCols() override { return FPT_COUNT; }
int GetNumberCols() override { return PFC_COUNT; }
wxString GetColLabelValue( int aCol ) override;