47 #include <wx/valnum.h> 114 wxCHECK_RET( aItem != NULL, wxT(
"InstallGraphicItemPropertiesDialog() error: NULL item" ) );
116 m_canvas->SetIgnoreMouseEvents(
true );
119 m_canvas->MoveCursorToCrossHair();
120 m_canvas->SetIgnoreMouseEvents(
false );
127 wxStaticText* texts_unit[] =
137 for(
size_t ii = 0; ii <
DIM( texts_unit ); ii++ )
156 SetTitle( _(
"Circle Properties" ) );
164 SetTitle( _(
"Arc Properties" ) );
174 SetTitle( _(
"Polygon Properties" ) );
179 SetTitle( _(
"Line Segment Properties" ) );
213 wxMessageBox( _(
"This item was on a not allowed or non existing layer.\n" 214 "It has been moved to the first allowed layer.\n\n" 215 "Please fix it." ) );
220 return DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::TransferDataToWindow();
239 if( !DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::TransferDataFromWindow() )
280 commit.
Push( _(
"Modify drawing properties" ) );
296 wxArrayString error_msgs;
298 if( !DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::Validate() )
314 error_msgs.Add( _(
"The arc angle must be greater than zero." ) );
320 if( (startx == endx) && (starty == endy) )
322 error_msgs.Add( _(
"The radius must be greater than zero." ) );
332 if( (startx == endx) && (starty == endy) )
334 error_msgs.Add( _(
"The start and end points cannot be the same." ) );
348 error_msgs.Add( _(
"The polygon outline thickness must be >= 0." ) );
350 else if( thickness <= 0 )
351 error_msgs.Add( _(
"The item thickness must be greater than zero." ) );
357 error_msgs.Add( _(
"The default thickness must be greater than zero." ) );
359 if( error_msgs.GetCount() )
366 return error_msgs.GetCount() == 0;
static LSET AllCuMask(int aCuLayerCount=MAX_CU_LAYERS)
Function AllCuMask returns a mask holding the requested number of Cu PCB_LAYER_IDs.
#define DIM(x)
of elements in an array
virtual void OnModify() override
Function OnModify must be called after a board change to set the modified flag.
COMMIT & Modify(EDA_ITEM *aItem)
Modifies a given item in the model.
wxFlexGridSizer * m_fgUpperLeftGridSizer
wxStaticText * m_ThicknessTextUnit
virtual void SetLayer(PCB_LAYER_ID aLayer)
Function SetLayer sets the layer this item is on.
Implementation of conversion functions that require both schematic and board internal units...
This file is part of the common library.
EDA_DRAW_PANEL * GetCanvas()
void SetNotAllowedLayerSet(LSET aMask)
virtual PCB_LAYER_ID GetLayer() const
Function GetLayer returns the primary layer this item is on.
Class BOARD to handle a board.
wxStaticText * m_EndPointXUnit
wxStaticText * m_StartPointYUnit
polygon (not yet used for tracks, but could be in microwave apps)
DIALOG_GRAPHIC_ITEM_PROPERTIES(PCB_EDIT_FRAME *aParent, DRAWSEGMENT *aItem, wxDC *aDC)
void InstallGraphicItemPropertiesDialog(DRAWSEGMENT *aItem, wxDC *aDC)
void FinishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
wxStaticText * m_StartPointXUnit
bool TransferDataFromWindow() override
~DIALOG_GRAPHIC_ITEM_PROPERTIES()
usual segment : line with rounded ends
TEXT_CTRL_EVAL * m_Center_StartYCtrl
void SetBoardFrame(PCB_BASE_FRAME *aFrame)
wxFloatingPointValidator< double > m_AngleValidator
wxStaticText * m_AngleText
This file contains miscellaneous commonly used macros and functions.
wxStaticText * m_StartPointYLabel
STROKE_T GetShape() const
TEXT_CTRL_EVAL * m_AngleCtrl
const wxPoint & GetEnd() const
Function GetEnd returns the ending point of the graphic.
TEXT_CTRL_EVAL * m_Center_StartXCtrl
void SetMsgPanel(const std::vector< MSG_PANEL_ITEM > &aList)
Function SetMsgPanel clears the message panel and populates it with the contents of aList...
wxStaticText * m_EndPointYLabel
void ListSet(const wxString &aList)
Function ListSet Add a list of items.
wxString GetAbbreviatedUnitsLabel(EDA_UNITS_T aUnit)
Subclass of DIALOG_DISPLAY_HTML_TEXT_BASE, which is generated by wxFormBuilder.
int m_DrawSegmentWidth
current graphic line width (not EDGE layer)
int ValueFromString(EDA_UNITS_T aUnits, const wxString &aTextValue)
Function ValueFromString converts aTextValue in aUnits to internal units used by the application...
PCB_LAYER_BOX_SELECTOR * m_LayerSelectionCtrl
int SetLayerSelection(LAYER_NUM layer)
virtual BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings returns the BOARD_DESIGN_SETTINGS for the BOARD owned by this frame...
PCB_EDIT_FRAME * m_parent
wxStaticText * m_EndPointXLabel
wxStaticText * m_AngleUnit
bool SetLayersHotkeys(bool value)
void OnLayerChoice(wxCommandEvent &event)
wxStaticText * m_StartPointXLabel
EDA_UNITS_T g_UserUnit
Global variables definitions.
void PutValueInLocalUnits(wxTextCtrl &aTextCtr, int aValue)
Function PutValueInLocalUnits converts aValue from internal units to user units and append the units ...
wxStaticText * m_DefaulThicknessTextUnit
wxButton * m_StandardButtonsSizerOK
TEXT_CTRL_EVAL * m_DefaultThicknessCtrl
Class to handle a graphic segment.
virtual void SetDesignSettings(const BOARD_DESIGN_SETTINGS &aSettings)
bool TransferDataToWindow() override
LAYER_NUM GetLayerSelection() const
virtual void Push(const wxString &aMessage=wxT("A commit"), bool aCreateUndoEntry=true, bool aSetDirtyBit=true) override
Executes the changes.
BOARD_DESIGN_SETTINGS m_brdSettings
void SetAngle(double aAngle)
Function SetAngle sets the angle for arcs, and normalizes it within the range 0 - 360 degrees...
TEXT_CTRL_EVAL * m_EndY_Ctrl
Class DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE.
wxStaticText * m_EndPointYUnit
int m_EdgeSegmentWidth
current graphic line width (EDGE layer only)
TEXT_CTRL_EVAL * m_EndX_Radius_Ctrl
void Draw(EDA_DRAW_PANEL *panel, wxDC *DC, GR_DRAWMODE aDrawMode, const wxPoint &aOffset=ZeroOffset) override
Function Draw BOARD_ITEMs have their own color information.
TEXT_CTRL_EVAL * m_ThicknessCtrl
const wxPoint & GetStart() const
Function GetStart returns the starting point of the graphic.
PCB_LAYER_ID ToLAYER_ID(int aLayer)
void OnInitDlg(wxInitDialogEvent &event) override
Class BOARD_DESIGN_SETTINGS contains design settings for a BOARD object.
void SetWidth(int aWidth)