KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_create_array.cpp File Reference
#include "dialogs/dialog_create_array.h"
#include <wx/msgdlg.h>
#include <base_units.h>
#include <footprint.h>
#include <pcb_edit_frame.h>
#include <tools/pcb_actions.h>
#include <tools/pcb_picker_tool.h>
#include <tool/tool_manager.h>
#include <widgets/text_ctrl_eval.h>

Go to the source code of this file.

Classes

struct  CREATE_ARRAY_DIALOG_ENTRIES
 Struct containing the last-entered values for the dialog. More...
 
struct  NUMBERING_LIST_DATA
 Local mapping for list-box <-> numbering type. More...
 

Functions

static bool validateLongEntry (const wxTextEntry &entry, long &dest, const wxString &description, wxArrayString &errors)
 Validate and save a long integer entry.
 
static bool validateAxisOptions (const wxTextCtrl &offsetEntry, const wxChoice &typeEntry, const wxTextCtrl &aStepEntry, ARRAY_AXIS &aAxis, wxArrayString &errors)
 Validates and saves (if valid) the type and offset of an array axis numbering.
 

Variables

static CREATE_ARRAY_DIALOG_ENTRIES s_arrayOptions
 
static const std::vector< NUMBERING_LIST_DATAnumberingTypeData
 List of type <--> name mappings (in order) for the numbering type list boxes.
 

Function Documentation

◆ validateAxisOptions()

static bool validateAxisOptions ( const wxTextCtrl &  offsetEntry,
const wxChoice &  typeEntry,
const wxTextCtrl &  aStepEntry,
ARRAY_AXIS aAxis,
wxArrayString &  errors 
)
static

Validates and saves (if valid) the type and offset of an array axis numbering.

Parameters
offsetEntrythe entry of the offset (text)
typeEntrythe entry of the axis nmbering scheme (choice)
typethe destination of the type if valid
offsetthe destination of the offset if valid
errorserror string accumulator
Returns
if all valid

Definition at line 360 of file dialog_create_array.cpp.

References _, ARRAY_AXIS::GetAlphabet(), NUMBERING_LIST_DATA::m_numbering_type, ARRAY_AXIS::SetAxisType(), ARRAY_AXIS::SetOffset(), ARRAY_AXIS::SetStep(), text, and validateLongEntry().

Referenced by DIALOG_CREATE_ARRAY::TransferDataFromWindow().

◆ validateLongEntry()

static bool validateLongEntry ( const wxTextEntry &  entry,
long &  dest,
const wxString &  description,
wxArrayString &  errors 
)
static

Validate and save a long integer entry.

Parameters
entrythe text entry to read from
destthe value destination
descriptiondescription of the field (used if the value is not OK)
errorsa list of errors to add any error to
Returns
valid

Definition at line 333 of file dialog_create_array.cpp.

References _.

Referenced by DIALOG_CREATE_ARRAY::TransferDataFromWindow(), and validateAxisOptions().

Variable Documentation

◆ numberingTypeData

const std::vector<NUMBERING_LIST_DATA> numberingTypeData
static
Initial value:
{
{
_( "Numerals (0,1,2,...,9,10)" ),
},
{
_( "Hexadecimal (0,1,...,F,10,...)" ),
},
{
_( "Alphabet, minus IOSQXZ" ),
},
{
_( "Alphabet, full 26 characters" ),
},
}
@ NUMBERING_NUMERIC
Arabic numerals: 0,1,2,3,4,5,6,7,8,9,10,11...
Definition: array_axis.h:44
@ NUMBERING_HEX
Definition: array_axis.h:45
@ NUMBERING_ALPHA_NO_IOSQXZ
Definition: array_axis.h:46
@ NUMBERING_ALPHA_FULL
Full 26-character alphabet.
Definition: array_axis.h:52
#define _(s)

List of type <--> name mappings (in order) for the numbering type list boxes.

Definition at line 135 of file dialog_create_array.cpp.

Referenced by DIALOG_CREATE_ARRAY::DIALOG_CREATE_ARRAY().

◆ s_arrayOptions

CREATE_ARRAY_DIALOG_ENTRIES s_arrayOptions
static

Definition at line 120 of file dialog_create_array.cpp.

Referenced by DIALOG_CREATE_ARRAY::DIALOG_CREATE_ARRAY().