Improve shape properties dialog layout.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15683
This commit is contained in:
Jeff Young 2023-09-19 11:23:35 +01:00
parent 0a26ab1cae
commit 58889f8120
8 changed files with 3874 additions and 3967 deletions

View File

@ -149,7 +149,7 @@ double EDA_SHAPE::GetLength() const
} }
} }
long long int EDA_SHAPE::GetRectangleHeight() const int EDA_SHAPE::GetRectangleHeight() const
{ {
switch( m_shape ) switch( m_shape )
{ {
@ -161,7 +161,7 @@ long long int EDA_SHAPE::GetRectangleHeight() const
} }
} }
long long int EDA_SHAPE::GetRectangleWidth() const int EDA_SHAPE::GetRectangleWidth() const
{ {
switch( m_shape ) switch( m_shape )
{ {

View File

@ -309,14 +309,12 @@ public:
void SetSegmentAngle( const EDA_ANGLE& aAngle ); void SetSegmentAngle( const EDA_ANGLE& aAngle );
/** /**
* Return the length of the track using the hypotenuse calculation. * @return the length of the segment using the hypotenuse calculation.
*
* @return the length of the track
*/ */
double GetLength() const; double GetLength() const;
long long int GetRectangleHeight() const; int GetRectangleHeight() const;
long long int GetRectangleWidth() const; int GetRectangleWidth() const;
/** /**
* Convert the shape to a closed polygon. Circles and arcs are approximated by segments. * Convert the shape to a closed polygon. Circles and arcs are approximated by segments.

View File

@ -95,8 +95,8 @@ set( PCBNEW_DIALOGS
dialogs/dialog_group_properties_base.cpp dialogs/dialog_group_properties_base.cpp
dialogs/dialog_push_pad_properties.cpp dialogs/dialog_push_pad_properties.cpp
dialogs/dialog_push_pad_properties_base.cpp dialogs/dialog_push_pad_properties_base.cpp
dialogs/dialog_graphic_item_properties.cpp dialogs/dialog_shape_properties.cpp
dialogs/dialog_graphic_item_properties_base.cpp dialogs/dialog_shape_properties_base.cpp
dialogs/dialog_image_properties.cpp dialogs/dialog_image_properties.cpp
dialogs/dialog_image_properties_base.cpp dialogs/dialog_image_properties_base.cpp
dialogs/dialog_import_settings.cpp dialogs/dialog_import_settings.cpp

File diff suppressed because it is too large Load Diff

View File

@ -38,29 +38,20 @@
#include <macros.h> #include <macros.h>
#include <widgets/unit_binder.h> #include <widgets/unit_binder.h>
#include <dialog_graphic_item_properties_base.h> #include <dialog_shape_properties_base.h>
#include <tools/drawing_tool.h> #include <tools/drawing_tool.h>
class DIALOG_GRAPHIC_ITEM_PROPERTIES : public DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE class DIALOG_SHAPE_PROPERTIES : public DIALOG_SHAPE_PROPERTIES_BASE
{ {
public: public:
DIALOG_GRAPHIC_ITEM_PROPERTIES( PCB_BASE_EDIT_FRAME* aParent, PCB_SHAPE* aShape ); DIALOG_SHAPE_PROPERTIES( PCB_BASE_EDIT_FRAME* aParent, PCB_SHAPE* aShape );
~DIALOG_GRAPHIC_ITEM_PROPERTIES() {}; ~DIALOG_SHAPE_PROPERTIES() {};
private: private:
bool TransferDataToWindow() override; bool TransferDataToWindow() override;
bool TransferDataFromWindow() override; bool TransferDataFromWindow() override;
void OnInitDlg( wxInitDialogEvent& event ) override
{
// Call the default wxDialog handler of a wxInitDialogEvent
TransferDataToWindow();
// Now all widgets have the size fixed, call FinishDialogSettings
finishDialogSettings();
}
void onFilledCheckbox( wxCommandEvent& event ) override; void onFilledCheckbox( wxCommandEvent& event ) override;
void onLayerSelection( wxCommandEvent& event ) override; void onLayerSelection( wxCommandEvent& event ) override;
@ -93,9 +84,8 @@ private:
bool m_flipStartEnd; bool m_flipStartEnd;
}; };
DIALOG_GRAPHIC_ITEM_PROPERTIES::DIALOG_GRAPHIC_ITEM_PROPERTIES( PCB_BASE_EDIT_FRAME* aParent, DIALOG_SHAPE_PROPERTIES::DIALOG_SHAPE_PROPERTIES( PCB_BASE_EDIT_FRAME* aParent, PCB_SHAPE* aShape ):
PCB_SHAPE* aShape ): DIALOG_SHAPE_PROPERTIES_BASE( aParent ),
DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE( aParent ),
m_parent( aParent ), m_parent( aParent ),
m_item( aShape ), m_item( aShape ),
m_startX( aParent, m_startXLabel, m_startXCtrl, m_startXUnits ), m_startX( aParent, m_startXLabel, m_startXCtrl, m_startXUnits ),
@ -114,6 +104,9 @@ DIALOG_GRAPHIC_ITEM_PROPERTIES::DIALOG_GRAPHIC_ITEM_PROPERTIES( PCB_BASE_EDIT_FR
m_bezierCtrl2Y( aParent, m_BezierPointC2YLabel, m_BezierC2Y_Ctrl, m_BezierPointC2YUnit ), m_bezierCtrl2Y( aParent, m_BezierPointC2YLabel, m_BezierC2Y_Ctrl, m_BezierPointC2YUnit ),
m_flipStartEnd( false ) m_flipStartEnd( false )
{ {
SetTitle( wxString::Format( GetTitle(), m_item->GetFriendlyName() ) );
m_hash_key = TO_UTF8( GetTitle() );
// Configure display origin transforms // Configure display origin transforms
m_startX.SetCoordType( ORIGIN_TRANSFORMS::ABS_X_COORD ); m_startX.SetCoordType( ORIGIN_TRANSFORMS::ABS_X_COORD );
m_startY.SetCoordType( ORIGIN_TRANSFORMS::ABS_Y_COORD ); m_startY.SetCoordType( ORIGIN_TRANSFORMS::ABS_Y_COORD );
@ -172,19 +165,61 @@ DIALOG_GRAPHIC_ITEM_PROPERTIES::DIALOG_GRAPHIC_ITEM_PROPERTIES( PCB_BASE_EDIT_FR
m_netSelector->SetIndeterminate(); m_netSelector->SetIndeterminate();
} }
if( m_item->GetShape() == SHAPE_T::POLY )
m_sizerStartEnd->Show( false );
// Only a Bezeier curve has control points. So do not show these parameters for other shapes
if( m_item->GetShape() != SHAPE_T::BEZIER )
m_sizerBezier->Show( false );
// Only a segment has this format
if( m_item->GetShape() != SHAPE_T::SEGMENT )
{
m_segmentLength.Show( false );
m_segmentAngle.Show( false );
}
if( m_item->GetShape() != SHAPE_T::RECTANGLE )
{
m_rectangleHeight.Show( false );
m_rectangleWidth.Show( false );
}
// Only an arc has a angle parameter. So do not show this parameter for other shapes
if( m_item->GetShape() != SHAPE_T::ARC )
m_angle.Show( false );
if( m_item->GetShape() == SHAPE_T::ARC || m_item->GetShape() == SHAPE_T::SEGMENT )
m_filledCtrl->Show( false );
// Change texts for circles:
if( m_item->GetShape() == SHAPE_T::CIRCLE )
{
m_startPointLabel->SetLabel( _( "Center Point" ) );
m_endPointLabel->SetLabel( _( "Radius" ) );
m_endXLabel->Show( false );
m_endX.SetCoordType( ORIGIN_TRANSFORMS::NOT_A_COORD );
m_endY.Show( false );
}
showHideNetInfo(); showHideNetInfo();
SetInitialFocus( m_startXCtrl ); SetInitialFocus( m_startXCtrl );
SetupStandardButtons(); SetupStandardButtons();
// Now all widgets have the size fixed, call FinishDialogSettings
finishDialogSettings();
Layout();
} }
void PCB_BASE_EDIT_FRAME::ShowGraphicItemPropertiesDialog( PCB_SHAPE* aShape ) void PCB_BASE_EDIT_FRAME::ShowGraphicItemPropertiesDialog( PCB_SHAPE* aShape )
{ {
wxCHECK_RET( aShape != NULL, wxT( "ShowGraphicItemPropertiesDialog() error: NULL item" ) ); wxCHECK_RET( aShape, wxT( "ShowGraphicItemPropertiesDialog() error: NULL item" ) );
DIALOG_GRAPHIC_ITEM_PROPERTIES dlg( this, aShape ); DIALOG_SHAPE_PROPERTIES dlg( this, aShape );
if( dlg.ShowQuasiModal() == wxID_OK ) if( dlg.ShowQuasiModal() == wxID_OK )
{ {
@ -197,7 +232,7 @@ void PCB_BASE_EDIT_FRAME::ShowGraphicItemPropertiesDialog( PCB_SHAPE* aShape )
} }
void DIALOG_GRAPHIC_ITEM_PROPERTIES::onLayerSelection( wxCommandEvent& event ) void DIALOG_SHAPE_PROPERTIES::onLayerSelection( wxCommandEvent& event )
{ {
if( m_LayerSelectionCtrl->GetLayerSelection() >= 0 ) if( m_LayerSelectionCtrl->GetLayerSelection() >= 0 )
{ {
@ -207,7 +242,7 @@ void DIALOG_GRAPHIC_ITEM_PROPERTIES::onLayerSelection( wxCommandEvent& event )
} }
void DIALOG_GRAPHIC_ITEM_PROPERTIES::onFilledCheckbox( wxCommandEvent& event ) void DIALOG_SHAPE_PROPERTIES::onFilledCheckbox( wxCommandEvent& event )
{ {
if( m_filledCtrl->GetValue() ) if( m_filledCtrl->GetValue() )
{ {
@ -230,100 +265,29 @@ void DIALOG_GRAPHIC_ITEM_PROPERTIES::onFilledCheckbox( wxCommandEvent& event )
} }
} }
bool DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataToWindow() bool DIALOG_SHAPE_PROPERTIES::TransferDataToWindow()
{ {
if( !m_item ) if( !m_item )
return false; return false;
// Only a segment has this format if( m_item->GetShape() == SHAPE_T::ARC )
if( m_item->GetShape() != SHAPE_T::SEGMENT )
{
m_segmentLength.Show( false );
m_segmentAngle.Show( false );
}
if( m_item->GetShape() != SHAPE_T::RECTANGLE )
{
m_rectangleHeight.Show( false );
m_rectangleWidth.Show( false );
}
// Only an arc has a angle parameter. So do not show this parameter for other shapes
if( m_item->GetShape() != SHAPE_T::ARC )
m_angle.Show( false );
// Only a Bezeier curve has control points. So do not show these parameters for other shapes
if( m_item->GetShape() != SHAPE_T::BEZIER )
{
m_bezierCtrlPt1Label->Show( false );
m_bezierCtrl1X.Show( false );
m_bezierCtrl1Y.Show( false );
m_bezierCtrlPt2Label->Show( false );
m_bezierCtrl2X.Show( false );
m_bezierCtrl2Y.Show( false );
}
m_netSelector->Show( m_item->IsOnCopperLayer() );
m_netLabel->Show( m_item->IsOnCopperLayer() );
// Change texts according to the segment shape:
switch( m_item->GetShape() )
{
case SHAPE_T::CIRCLE:
SetTitle( _( "Circle Properties" ) );
m_startPointLabel->SetLabel( _( "Center Point" ) );
m_endPointLabel->SetLabel( _( "Radius" ) );
m_endXLabel->Show( false );
m_endX.SetCoordType( ORIGIN_TRANSFORMS::NOT_A_COORD );
m_endY.Show( false );
m_filledCtrl->Show( true );
break;
case SHAPE_T::ARC:
SetTitle( _( "Arc Properties" ) );
m_angle.SetAngleValue( m_item->GetArcAngle() ); m_angle.SetAngleValue( m_item->GetArcAngle() );
m_filledCtrl->Show( false );
break;
case SHAPE_T::POLY:
SetTitle( _( "Polygon Properties" ) );
m_sizerLeft->Show( false );
m_filledCtrl->Show( true );
break;
case SHAPE_T::RECTANGLE:
SetTitle( _( "Rectangle Properties" ) );
if( m_item->GetShape() == SHAPE_T::RECTANGLE )
{
m_rectangleHeight.SetValue( m_item->GetRectangleHeight() ); m_rectangleHeight.SetValue( m_item->GetRectangleHeight() );
m_rectangleWidth.SetValue( m_item->GetRectangleWidth() ); m_rectangleWidth.SetValue( m_item->GetRectangleWidth() );
}
m_filledCtrl->Show( true ); if( m_item->GetShape() == SHAPE_T::SEGMENT )
break; {
case SHAPE_T::SEGMENT:
SetTitle( _( "Line Segment Properties" ) );
if( m_item->GetStart().x == m_item->GetEnd().x ) if( m_item->GetStart().x == m_item->GetEnd().x )
m_flipStartEnd = m_item->GetStart().y > m_item->GetEnd().y; m_flipStartEnd = m_item->GetStart().y > m_item->GetEnd().y;
else else
m_flipStartEnd = m_item->GetStart().x > m_item->GetEnd().x; m_flipStartEnd = m_item->GetStart().x > m_item->GetEnd().x;
m_segmentLength.SetValue( m_item->GetLength() ); m_segmentLength.SetValue( KiROUND( m_item->GetLength() ) );
m_segmentAngle.SetAngleValue( m_item->GetSegmentAngle() ); m_segmentAngle.SetAngleValue( m_item->GetSegmentAngle() );
m_filledCtrl->Show( false );
break;
case SHAPE_T::BEZIER:
SetTitle( _( "Curve Properties" ) );
m_filledCtrl->Show( true );
break;
default:
break;
} }
if( m_flipStartEnd && m_item->GetShape() != SHAPE_T::ARC ) if( m_flipStartEnd && m_item->GetShape() != SHAPE_T::ARC )
@ -352,11 +316,13 @@ bool DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataToWindow()
m_endY.SetValue( m_item->GetEnd().y ); m_endY.SetValue( m_item->GetEnd().y );
} }
// For Bezier curve: if( m_item->GetShape() == SHAPE_T::BEZIER )
{
m_bezierCtrl1X.SetValue( m_item->GetBezierC1().x ); m_bezierCtrl1X.SetValue( m_item->GetBezierC1().x );
m_bezierCtrl1Y.SetValue( m_item->GetBezierC1().y ); m_bezierCtrl1Y.SetValue( m_item->GetBezierC1().y );
m_bezierCtrl2X.SetValue( m_item->GetBezierC2().x ); m_bezierCtrl2X.SetValue( m_item->GetBezierC2().x );
m_bezierCtrl2Y.SetValue( m_item->GetBezierC2().y ); m_bezierCtrl2Y.SetValue( m_item->GetBezierC2().y );
}
m_filledCtrl->SetValue( m_item->IsFilled() ); m_filledCtrl->SetValue( m_item->IsFilled() );
m_locked->SetValue( m_item->IsLocked() ); m_locked->SetValue( m_item->IsLocked() );
@ -374,26 +340,25 @@ bool DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataToWindow()
m_LayerSelectionCtrl->SetLayerSelection( m_item->GetLayer() ); m_LayerSelectionCtrl->SetLayerSelection( m_item->GetLayer() );
return DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::TransferDataToWindow(); return DIALOG_SHAPE_PROPERTIES_BASE::TransferDataToWindow();
} }
bool DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataFromWindow() bool DIALOG_SHAPE_PROPERTIES::TransferDataFromWindow()
{ {
if( !DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::TransferDataFromWindow() ) if( !DIALOG_SHAPE_PROPERTIES_BASE::TransferDataFromWindow() )
return false; return false;
if( !m_item ) if( !m_item )
return true; return true;
int layer = m_LayerSelectionCtrl->GetLayerSelection(); int layer = m_LayerSelectionCtrl->GetLayerSelection();
VECTOR2I begin_point = m_item->GetStart(); VECTOR2I begin_point = m_item->GetStart();
VECTOR2I end_point = m_item->GetEnd(); VECTOR2I end_point = m_item->GetEnd();
long long int segment_length = 0; int segment_length = 0;
EDA_ANGLE segment_angle = EDA_ANGLE( 0, RADIANS_T ); EDA_ANGLE segment_angle = EDA_ANGLE( 0, RADIANS_T );
long long int rectangle_height = 0; int rectangle_height = 0;
long long int rectangle_width = 0; int rectangle_width = 0;
BOARD_COMMIT commit( m_parent ); BOARD_COMMIT commit( m_parent );
@ -401,7 +366,7 @@ bool DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataFromWindow()
if( m_item->GetShape() == SHAPE_T::SEGMENT ) if( m_item->GetShape() == SHAPE_T::SEGMENT )
{ {
segment_length = m_item->GetLength(); segment_length = KiROUND( m_item->GetLength() );
segment_angle = m_item->GetSegmentAngle().Round( 3 ); segment_angle = m_item->GetSegmentAngle().Round( 3 );
} }
@ -413,28 +378,28 @@ bool DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataFromWindow()
if( m_flipStartEnd && m_item->GetShape() != SHAPE_T::ARC ) if( m_flipStartEnd && m_item->GetShape() != SHAPE_T::ARC )
{ {
m_item->SetEndX( m_startX.GetValue() ); m_item->SetEndX( m_startX.GetIntValue() );
m_item->SetEndY( m_startY.GetValue() ); m_item->SetEndY( m_startY.GetIntValue() );
} }
else else
{ {
m_item->SetStartX( m_startX.GetValue() ); m_item->SetStartX( m_startX.GetIntValue() );
m_item->SetStartY( m_startY.GetValue() ); m_item->SetStartY( m_startY.GetIntValue() );
} }
if( m_item->GetShape() == SHAPE_T::CIRCLE ) if( m_item->GetShape() == SHAPE_T::CIRCLE )
{ {
m_item->SetEnd( m_item->GetStart() + VECTOR2I( m_endX.GetValue(), 0 ) ); m_item->SetEnd( m_item->GetStart() + VECTOR2I( m_endX.GetIntValue(), 0 ) );
} }
else if( m_flipStartEnd && m_item->GetShape() != SHAPE_T::ARC ) else if( m_flipStartEnd && m_item->GetShape() != SHAPE_T::ARC )
{ {
m_item->SetStartX( m_endX.GetValue() ); m_item->SetStartX( m_endX.GetIntValue() );
m_item->SetStartY( m_endY.GetValue() ); m_item->SetStartY( m_endY.GetIntValue() );
} }
else else
{ {
m_item->SetEndX( m_endX.GetValue() ); m_item->SetEndX( m_endX.GetIntValue() );
m_item->SetEndY( m_endY.GetValue() ); m_item->SetEndY( m_endY.GetIntValue() );
} }
if( m_item->GetShape() == SHAPE_T::SEGMENT ) if( m_item->GetShape() == SHAPE_T::SEGMENT )
@ -443,13 +408,11 @@ bool DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataFromWindow()
bool change_end = ( end_point != m_item->GetEnd() ); bool change_end = ( end_point != m_item->GetEnd() );
bool change_length = ( segment_length != m_segmentLength.GetValue() ); bool change_length = ( segment_length != m_segmentLength.GetValue() );
EDA_ANGLE difference = std::abs( segment_angle - m_segmentAngle.GetAngleValue() ); EDA_ANGLE difference = std::abs( segment_angle - m_segmentAngle.GetAngleValue() );
bool change_angle = ( difference >= EDA_ANGLE( 0.00049, DEGREES_T ) );
bool change_angle =
( difference >= EDA_ANGLE( 0.00049, DEGREES_T ) );
if( !( change_begin && change_end ) ) if( !( change_begin && change_end ) )
{ {
segment_length = m_segmentLength.GetValue(); segment_length = m_segmentLength.GetIntValue();
segment_angle = m_segmentAngle.GetAngleValue().Round( 3 ); segment_angle = m_segmentAngle.GetAngleValue().Round( 3 );
if( change_length || change_angle ) if( change_length || change_angle )
@ -457,22 +420,22 @@ bool DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataFromWindow()
if( change_end ) if( change_end )
{ {
m_item->SetStartX( m_item->GetEndX() m_item->SetStartX( m_item->GetEndX()
- segment_length * segment_angle.Cos() ); - KiROUND( segment_length * segment_angle.Cos() ) );
m_item->SetStartY( m_item->GetEndY() m_item->SetStartY( m_item->GetEndY()
+ segment_length * segment_angle.Sin() ); + KiROUND( segment_length * segment_angle.Sin() ) );
} }
else else
{ {
m_item->SetEndX( m_item->GetStartX() m_item->SetEndX( m_item->GetStartX()
+ segment_length * segment_angle.Cos() ); + KiROUND( segment_length * segment_angle.Cos() ) );
m_item->SetEndY( m_item->GetStartY() m_item->SetEndY( m_item->GetStartY()
- segment_length * segment_angle.Sin() ); - KiROUND( segment_length * segment_angle.Sin() ) );
} }
} }
} }
if( change_length ) if( change_length )
m_item->SetLength( m_segmentLength.GetValue() ); m_item->SetLength( m_segmentLength.GetIntValue() );
else else
m_item->SetLength( m_item->GetLength() ); m_item->SetLength( m_item->GetLength() );
@ -480,7 +443,6 @@ bool DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataFromWindow()
m_item->SetSegmentAngle( m_segmentAngle.GetAngleValue().Round( 3 ) ); m_item->SetSegmentAngle( m_segmentAngle.GetAngleValue().Round( 3 ) );
else else
m_item->SetSegmentAngle( m_item->GetSegmentAngle().Round( 3 ) ); m_item->SetSegmentAngle( m_item->GetSegmentAngle().Round( 3 ) );
} }
if( m_item->GetShape() == SHAPE_T::RECTANGLE ) if( m_item->GetShape() == SHAPE_T::RECTANGLE )
@ -490,11 +452,10 @@ bool DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataFromWindow()
bool change_height = ( rectangle_height != m_rectangleHeight.GetValue() ); bool change_height = ( rectangle_height != m_rectangleHeight.GetValue() );
bool change_width = ( rectangle_width != m_rectangleWidth.GetValue() ); bool change_width = ( rectangle_width != m_rectangleWidth.GetValue() );
if( !( change_begin && change_end ) ) if( !( change_begin && change_end ) )
{ {
rectangle_height = m_rectangleHeight.GetValue(); rectangle_height = m_rectangleHeight.GetIntValue();
rectangle_width = m_rectangleWidth.GetValue(); rectangle_width = m_rectangleWidth.GetIntValue();
if( change_height || change_width ) if( change_height || change_width )
{ {
@ -518,8 +479,8 @@ bool DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataFromWindow()
// For Bezier curve: Set the two control points // For Bezier curve: Set the two control points
if( m_item->GetShape() == SHAPE_T::BEZIER ) if( m_item->GetShape() == SHAPE_T::BEZIER )
{ {
m_item->SetBezierC1( VECTOR2I( m_bezierCtrl1X.GetValue(), m_bezierCtrl1Y.GetValue() ) ); m_item->SetBezierC1( VECTOR2I( m_bezierCtrl1X.GetIntValue(), m_bezierCtrl1Y.GetIntValue() ) );
m_item->SetBezierC2( VECTOR2I( m_bezierCtrl2X.GetValue(), m_bezierCtrl2Y.GetValue() ) ); m_item->SetBezierC2( VECTOR2I( m_bezierCtrl2X.GetIntValue(), m_bezierCtrl2Y.GetIntValue() ) );
} }
if( m_item->GetShape() == SHAPE_T::ARC ) if( m_item->GetShape() == SHAPE_T::ARC )
@ -536,7 +497,7 @@ bool DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataFromWindow()
STROKE_PARAMS stroke = m_item->GetStroke(); STROKE_PARAMS stroke = m_item->GetStroke();
stroke.SetWidth( m_thickness.GetValue() ); stroke.SetWidth( m_thickness.GetIntValue() );
auto it = lineTypeNames.begin(); auto it = lineTypeNames.begin();
std::advance( it, m_lineStyleCombo->GetSelection() ); std::advance( it, m_lineStyleCombo->GetSelection() );
@ -567,11 +528,11 @@ bool DIALOG_GRAPHIC_ITEM_PROPERTIES::TransferDataFromWindow()
} }
bool DIALOG_GRAPHIC_ITEM_PROPERTIES::Validate() bool DIALOG_SHAPE_PROPERTIES::Validate()
{ {
wxArrayString errors; wxArrayString errors;
if( !DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::Validate() ) if( !DIALOG_SHAPE_PROPERTIES_BASE::Validate() )
return false; return false;
// Type specific checks. // Type specific checks.
@ -589,8 +550,8 @@ bool DIALOG_GRAPHIC_ITEM_PROPERTIES::Validate()
} }
else else
{ {
VECTOR2D start( m_startX.GetValue(), m_startY.GetValue() ); VECTOR2D start( m_startX.GetIntValue(), m_startY.GetIntValue() );
VECTOR2D end( m_endX.GetValue(), m_endY.GetValue() ); VECTOR2D end( m_endX.GetIntValue(), m_endY.GetIntValue() );
VECTOR2D center = CalcArcCenter( start, end, m_angle.GetAngleValue() ); VECTOR2D center = CalcArcCenter( start, end, m_angle.GetAngleValue() );
double radius = ( center - start ).EuclideanNorm(); double radius = ( center - start ).EuclideanNorm();

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.1-370-gc831f1f7) // C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO *NOT* EDIT THIS FILE! // PLEASE DO *NOT* EDIT THIS FILE!
@ -7,154 +7,164 @@
#include "pcb_layer_box_selector.h" #include "pcb_layer_box_selector.h"
#include "dialog_graphic_item_properties_base.h" #include "dialog_shape_properties_base.h"
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) DIALOG_SHAPE_PROPERTIES_BASE::DIALOG_SHAPE_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style )
{ {
this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize ); this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bMainSizer; wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxVERTICAL ); bMainSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bUpperSizer; m_upperSizer = new wxBoxSizer( wxVERTICAL );
bUpperSizer = new wxBoxSizer( wxVERTICAL );
m_sizerLeft = new wxGridBagSizer( 5, 3 ); m_sizerStartEnd = new wxGridBagSizer( 3, 3 );
m_sizerLeft->SetFlexibleDirection( wxBOTH ); m_sizerStartEnd->SetFlexibleDirection( wxBOTH );
m_sizerLeft->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); m_sizerStartEnd->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_sizerLeft->SetEmptyCellSize( wxSize( 5,5 ) ); m_sizerStartEnd->SetEmptyCellSize( wxSize( 5,5 ) );
m_startPointLabel = new wxStaticText( this, wxID_ANY, _("Start Point"), wxDefaultPosition, wxDefaultSize, 0 ); m_startPointLabel = new wxStaticText( this, wxID_ANY, _("Start Point"), wxDefaultPosition, wxDefaultSize, 0 );
m_startPointLabel->Wrap( -1 ); m_startPointLabel->Wrap( -1 );
m_sizerLeft->Add( m_startPointLabel, wxGBPosition( 0, 0 ), wxGBSpan( 1, 3 ), wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 ); m_sizerStartEnd->Add( m_startPointLabel, wxGBPosition( 0, 0 ), wxGBSpan( 1, 3 ), wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 );
m_startXLabel = new wxStaticText( this, wxID_ANY, _("X:"), wxDefaultPosition, wxDefaultSize, 0 ); m_startXLabel = new wxStaticText( this, wxID_ANY, _("X:"), wxDefaultPosition, wxDefaultSize, 0 );
m_startXLabel->Wrap( -1 ); m_startXLabel->Wrap( -1 );
m_sizerLeft->Add( m_startXLabel, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); m_sizerStartEnd->Add( m_startXLabel, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_startXCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_startXCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_sizerLeft->Add( m_startXCtrl, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); m_sizerStartEnd->Add( m_startXCtrl, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
m_startXUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 ); m_startXUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_startXUnits->Wrap( -1 ); m_startXUnits->Wrap( -1 );
m_sizerLeft->Add( m_startXUnits, wxGBPosition( 1, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT, 15 ); m_sizerStartEnd->Add( m_startXUnits, wxGBPosition( 1, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT, 20 );
m_startYLabel = new wxStaticText( this, wxID_ANY, _("Y:"), wxDefaultPosition, wxDefaultSize, 0 ); m_startYLabel = new wxStaticText( this, wxID_ANY, _("Y:"), wxDefaultPosition, wxDefaultSize, 0 );
m_startYLabel->Wrap( -1 ); m_startYLabel->Wrap( -1 );
m_sizerLeft->Add( m_startYLabel, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); m_sizerStartEnd->Add( m_startYLabel, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_startYCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_startYCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_sizerLeft->Add( m_startYCtrl, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); m_sizerStartEnd->Add( m_startYCtrl, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
m_startYUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 ); m_startYUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_startYUnits->Wrap( -1 ); m_startYUnits->Wrap( -1 );
m_sizerLeft->Add( m_startYUnits, wxGBPosition( 2, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT, 15 ); m_sizerStartEnd->Add( m_startYUnits, wxGBPosition( 2, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT, 20 );
m_endPointLabel = new wxStaticText( this, wxID_ANY, _("End Point"), wxDefaultPosition, wxDefaultSize, 0 ); m_endPointLabel = new wxStaticText( this, wxID_ANY, _("End Point"), wxDefaultPosition, wxDefaultSize, 0 );
m_endPointLabel->Wrap( -1 ); m_endPointLabel->Wrap( -1 );
m_sizerLeft->Add( m_endPointLabel, wxGBPosition( 0, 3 ), wxGBSpan( 1, 3 ), wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 ); m_sizerStartEnd->Add( m_endPointLabel, wxGBPosition( 0, 3 ), wxGBSpan( 1, 3 ), wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 );
m_endXLabel = new wxStaticText( this, wxID_ANY, _("X:"), wxDefaultPosition, wxDefaultSize, 0 ); m_endXLabel = new wxStaticText( this, wxID_ANY, _("X:"), wxDefaultPosition, wxDefaultSize, 0 );
m_endXLabel->Wrap( -1 ); m_endXLabel->Wrap( -1 );
m_sizerLeft->Add( m_endXLabel, wxGBPosition( 1, 3 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); m_sizerStartEnd->Add( m_endXLabel, wxGBPosition( 1, 3 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
m_endXCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_endXCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_sizerLeft->Add( m_endXCtrl, wxGBPosition( 1, 4 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); m_sizerStartEnd->Add( m_endXCtrl, wxGBPosition( 1, 4 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
m_endXUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 ); m_endXUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_endXUnits->Wrap( -1 ); m_endXUnits->Wrap( -1 );
m_sizerLeft->Add( m_endXUnits, wxGBPosition( 1, 5 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); m_sizerStartEnd->Add( m_endXUnits, wxGBPosition( 1, 5 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
m_endYLabel = new wxStaticText( this, wxID_ANY, _("Y:"), wxDefaultPosition, wxDefaultSize, 0 ); m_endYLabel = new wxStaticText( this, wxID_ANY, _("Y:"), wxDefaultPosition, wxDefaultSize, 0 );
m_endYLabel->Wrap( -1 ); m_endYLabel->Wrap( -1 );
m_sizerLeft->Add( m_endYLabel, wxGBPosition( 2, 3 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); m_sizerStartEnd->Add( m_endYLabel, wxGBPosition( 2, 3 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
m_endYCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_endYCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_sizerLeft->Add( m_endYCtrl, wxGBPosition( 2, 4 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); m_sizerStartEnd->Add( m_endYCtrl, wxGBPosition( 2, 4 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
m_endYUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 ); m_endYUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_endYUnits->Wrap( -1 ); m_endYUnits->Wrap( -1 );
m_sizerLeft->Add( m_endYUnits, wxGBPosition( 2, 5 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); m_sizerStartEnd->Add( m_endYUnits, wxGBPosition( 2, 5 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
m_bezierCtrlPt1Label = new wxStaticText( this, wxID_ANY, _("Bezier Control Pt"), wxDefaultPosition, wxDefaultSize, 0 );
m_upperSizer->Add( m_sizerStartEnd, 0, wxEXPAND|wxBOTTOM|wxRIGHT, 5 );
m_sizerBezier = new wxGridBagSizer( 3, 3 );
m_sizerBezier->SetFlexibleDirection( wxBOTH );
m_sizerBezier->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_sizerBezier->SetEmptyCellSize( wxSize( 5,5 ) );
m_bezierCtrlPt1Label = new wxStaticText( this, wxID_ANY, _("Bezier Control Point"), wxDefaultPosition, wxDefaultSize, 0 );
m_bezierCtrlPt1Label->Wrap( -1 ); m_bezierCtrlPt1Label->Wrap( -1 );
m_sizerLeft->Add( m_bezierCtrlPt1Label, wxGBPosition( 4, 0 ), wxGBSpan( 1, 3 ), wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 ); m_sizerBezier->Add( m_bezierCtrlPt1Label, wxGBPosition( 0, 0 ), wxGBSpan( 1, 3 ), wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 );
m_BezierPointC1XLabel = new wxStaticText( this, wxID_ANY, _("X:"), wxDefaultPosition, wxDefaultSize, 0 ); m_BezierPointC1XLabel = new wxStaticText( this, wxID_ANY, _("X:"), wxDefaultPosition, wxDefaultSize, 0 );
m_BezierPointC1XLabel->Wrap( -1 ); m_BezierPointC1XLabel->Wrap( -1 );
m_sizerLeft->Add( m_BezierPointC1XLabel, wxGBPosition( 5, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); m_sizerBezier->Add( m_BezierPointC1XLabel, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_BezierC1X_Ctrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_BezierC1X_Ctrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_sizerLeft->Add( m_BezierC1X_Ctrl, wxGBPosition( 5, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); m_sizerBezier->Add( m_BezierC1X_Ctrl, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
m_BezierPointC1XUnit = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 ); m_BezierPointC1XUnit = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_BezierPointC1XUnit->Wrap( -1 ); m_BezierPointC1XUnit->Wrap( -1 );
m_sizerLeft->Add( m_BezierPointC1XUnit, wxGBPosition( 5, 2 ), wxGBSpan( 1, 1 ), wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); m_sizerBezier->Add( m_BezierPointC1XUnit, wxGBPosition( 1, 2 ), wxGBSpan( 1, 1 ), wxRIGHT|wxALIGN_CENTER_VERTICAL, 20 );
m_BezierPointC1YLabel = new wxStaticText( this, wxID_ANY, _("Y:"), wxDefaultPosition, wxDefaultSize, 0 ); m_BezierPointC1YLabel = new wxStaticText( this, wxID_ANY, _("Y:"), wxDefaultPosition, wxDefaultSize, 0 );
m_BezierPointC1YLabel->Wrap( -1 ); m_BezierPointC1YLabel->Wrap( -1 );
m_sizerLeft->Add( m_BezierPointC1YLabel, wxGBPosition( 6, 0 ), wxGBSpan( 1, 1 ), wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); m_sizerBezier->Add( m_BezierPointC1YLabel, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
m_BezierC1Y_Ctrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_BezierC1Y_Ctrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_sizerLeft->Add( m_BezierC1Y_Ctrl, wxGBPosition( 6, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); m_sizerBezier->Add( m_BezierC1Y_Ctrl, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
m_BezierPointC1YUnit = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 ); m_BezierPointC1YUnit = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_BezierPointC1YUnit->Wrap( -1 ); m_BezierPointC1YUnit->Wrap( -1 );
m_sizerLeft->Add( m_BezierPointC1YUnit, wxGBPosition( 6, 2 ), wxGBSpan( 1, 1 ), wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); m_sizerBezier->Add( m_BezierPointC1YUnit, wxGBPosition( 2, 2 ), wxGBSpan( 1, 1 ), wxRIGHT|wxALIGN_CENTER_VERTICAL, 20 );
m_bezierCtrlPt2Label = new wxStaticText( this, wxID_ANY, _("Bezier Control Pt"), wxDefaultPosition, wxDefaultSize, 0 ); m_bezierCtrlPt2Label = new wxStaticText( this, wxID_ANY, _("Bezier Control Point"), wxDefaultPosition, wxDefaultSize, 0 );
m_bezierCtrlPt2Label->Wrap( -1 ); m_bezierCtrlPt2Label->Wrap( -1 );
m_sizerLeft->Add( m_bezierCtrlPt2Label, wxGBPosition( 4, 3 ), wxGBSpan( 1, 3 ), wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 ); m_sizerBezier->Add( m_bezierCtrlPt2Label, wxGBPosition( 0, 3 ), wxGBSpan( 1, 3 ), wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 );
m_BezierPointC2XLabel = new wxStaticText( this, wxID_ANY, _("X:"), wxDefaultPosition, wxDefaultSize, 0 ); m_BezierPointC2XLabel = new wxStaticText( this, wxID_ANY, _("X:"), wxDefaultPosition, wxDefaultSize, 0 );
m_BezierPointC2XLabel->Wrap( -1 ); m_BezierPointC2XLabel->Wrap( -1 );
m_sizerLeft->Add( m_BezierPointC2XLabel, wxGBPosition( 5, 3 ), wxGBSpan( 1, 1 ), wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); m_sizerBezier->Add( m_BezierPointC2XLabel, wxGBPosition( 1, 3 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
m_BezierC2X_Ctrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_BezierC2X_Ctrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_sizerLeft->Add( m_BezierC2X_Ctrl, wxGBPosition( 5, 4 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); m_sizerBezier->Add( m_BezierC2X_Ctrl, wxGBPosition( 1, 4 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
m_BezierPointC2XUnit = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 ); m_BezierPointC2XUnit = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_BezierPointC2XUnit->Wrap( -1 ); m_BezierPointC2XUnit->Wrap( -1 );
m_sizerLeft->Add( m_BezierPointC2XUnit, wxGBPosition( 5, 5 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); m_sizerBezier->Add( m_BezierPointC2XUnit, wxGBPosition( 1, 5 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
m_BezierPointC2YLabel = new wxStaticText( this, wxID_ANY, _("Y:"), wxDefaultPosition, wxDefaultSize, 0 ); m_BezierPointC2YLabel = new wxStaticText( this, wxID_ANY, _("Y:"), wxDefaultPosition, wxDefaultSize, 0 );
m_BezierPointC2YLabel->Wrap( -1 ); m_BezierPointC2YLabel->Wrap( -1 );
m_sizerLeft->Add( m_BezierPointC2YLabel, wxGBPosition( 6, 3 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); m_sizerBezier->Add( m_BezierPointC2YLabel, wxGBPosition( 2, 3 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
m_BezierC2Y_Ctrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_BezierC2Y_Ctrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_sizerLeft->Add( m_BezierC2Y_Ctrl, wxGBPosition( 6, 4 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 ); m_sizerBezier->Add( m_BezierC2Y_Ctrl, wxGBPosition( 2, 4 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
m_BezierPointC2YUnit = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 ); m_BezierPointC2YUnit = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_BezierPointC2YUnit->Wrap( -1 ); m_BezierPointC2YUnit->Wrap( -1 );
m_sizerLeft->Add( m_BezierPointC2YUnit, wxGBPosition( 6, 5 ), wxGBSpan( 1, 1 ), wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); m_sizerBezier->Add( m_BezierPointC2YUnit, wxGBPosition( 2, 5 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL, 5 );
bUpperSizer->Add( m_sizerLeft, 0, wxEXPAND, 20 ); m_upperSizer->Add( m_sizerBezier, 0, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 );
wxBoxSizer* bMiddleSizer; wxBoxSizer* bMiddleSizer;
bMiddleSizer = new wxBoxSizer( wxVERTICAL ); bMiddleSizer = new wxBoxSizer( wxVERTICAL );
wxGridBagSizer* gbSizer2; wxFlexGridSizer* fgSizer1;
gbSizer2 = new wxGridBagSizer( 5, 0 ); fgSizer1 = new wxFlexGridSizer( 0, 3, 0, 5 );
gbSizer2->SetFlexibleDirection( wxBOTH ); fgSizer1->AddGrowableCol( 1 );
gbSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); fgSizer1->SetFlexibleDirection( wxBOTH );
fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
m_segmentLengthLabel = new wxStaticText( this, wxID_ANY, _("Length:"), wxDefaultPosition, wxDefaultSize, 0 ); m_segmentLengthLabel = new wxStaticText( this, wxID_ANY, _("Length:"), wxDefaultPosition, wxDefaultSize, 0 );
m_segmentLengthLabel->Wrap( -1 ); m_segmentLengthLabel->Wrap( -1 );
gbSizer2->Add( m_segmentLengthLabel, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, 5 ); fgSizer1->Add( m_segmentLengthLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
m_segmentLengthCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_segmentLengthCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
gbSizer2->Add( m_segmentLengthCtrl, wxGBPosition( 0, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxEXPAND|wxTOP, 5 ); m_segmentLengthCtrl->SetMinSize( wxSize( 140,-1 ) );
fgSizer1->Add( m_segmentLengthCtrl, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
m_segmentLengthUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 ); m_segmentLengthUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_segmentLengthUnits->Wrap( -1 ); m_segmentLengthUnits->Wrap( -1 );
gbSizer2->Add( m_segmentLengthUnits, wxGBPosition( 0, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, 5 ); fgSizer1->Add( m_segmentLengthUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
m_segmentAngleLabel = new wxStaticText( this, wxID_ANY, _("Angle:"), wxDefaultPosition, wxDefaultSize, 0 ); m_segmentAngleLabel = new wxStaticText( this, wxID_ANY, _("Angle:"), wxDefaultPosition, wxDefaultSize, 0 );
m_segmentAngleLabel->Wrap( -1 ); m_segmentAngleLabel->Wrap( -1 );
gbSizer2->Add( m_segmentAngleLabel, wxGBPosition( 1, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, 5 ); fgSizer1->Add( m_segmentAngleLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
m_segmentAngleCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_segmentAngleCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
#ifdef __WXGTK__ #ifdef __WXGTK__
@ -165,95 +175,106 @@ DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE( wxWind
#else #else
m_segmentAngleCtrl->SetMaxLength( 8 ); m_segmentAngleCtrl->SetMaxLength( 8 );
#endif #endif
gbSizer2->Add( m_segmentAngleCtrl, wxGBPosition( 1, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxEXPAND|wxTOP, 5 ); fgSizer1->Add( m_segmentAngleCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
m_segmentAngleUnits = new wxStaticText( this, wxID_ANY, _("deg"), wxDefaultPosition, wxDefaultSize, 0 ); m_segmentAngleUnits = new wxStaticText( this, wxID_ANY, _("deg"), wxDefaultPosition, wxDefaultSize, 0 );
m_segmentAngleUnits->Wrap( -1 ); m_segmentAngleUnits->Wrap( -1 );
gbSizer2->Add( m_segmentAngleUnits, wxGBPosition( 1, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, 5 ); fgSizer1->Add( m_segmentAngleUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
m_rectangleHeightLabel = new wxStaticText( this, wxID_ANY, _("Height:"), wxDefaultPosition, wxDefaultSize, 0 ); m_rectangleHeightLabel = new wxStaticText( this, wxID_ANY, _("Height:"), wxDefaultPosition, wxDefaultSize, 0 );
m_rectangleHeightLabel->Wrap( -1 ); m_rectangleHeightLabel->Wrap( -1 );
gbSizer2->Add( m_rectangleHeightLabel, wxGBPosition( 2, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, 5 ); fgSizer1->Add( m_rectangleHeightLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
m_rectangleHeightCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_rectangleHeightCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
gbSizer2->Add( m_rectangleHeightCtrl, wxGBPosition( 2, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxEXPAND|wxTOP, 5 ); fgSizer1->Add( m_rectangleHeightCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
m_rectangleHeightUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 ); m_rectangleHeightUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_rectangleHeightUnits->Wrap( -1 ); m_rectangleHeightUnits->Wrap( -1 );
gbSizer2->Add( m_rectangleHeightUnits, wxGBPosition( 2, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, 5 ); fgSizer1->Add( m_rectangleHeightUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
m_rectangleWidthLabel = new wxStaticText( this, wxID_ANY, _("Width:"), wxDefaultPosition, wxDefaultSize, 0 ); m_rectangleWidthLabel = new wxStaticText( this, wxID_ANY, _("Width:"), wxDefaultPosition, wxDefaultSize, 0 );
m_rectangleWidthLabel->Wrap( -1 ); m_rectangleWidthLabel->Wrap( -1 );
gbSizer2->Add( m_rectangleWidthLabel, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, 5 ); fgSizer1->Add( m_rectangleWidthLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
m_rectangleWidthCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_rectangleWidthCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
gbSizer2->Add( m_rectangleWidthCtrl, wxGBPosition( 3, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxEXPAND|wxTOP, 5 ); fgSizer1->Add( m_rectangleWidthCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
m_rectangleWidthUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 ); m_rectangleWidthUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_rectangleWidthUnits->Wrap( -1 ); m_rectangleWidthUnits->Wrap( -1 );
gbSizer2->Add( m_rectangleWidthUnits, wxGBPosition( 3, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxALL, 5 ); fgSizer1->Add( m_rectangleWidthUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
m_angleLabel = new wxStaticText( this, wxID_ANY, _("Arc angle:"), wxDefaultPosition, wxDefaultSize, 0 ); m_angleLabel = new wxStaticText( this, wxID_ANY, _("Arc angle:"), wxDefaultPosition, wxDefaultSize, 0 );
m_angleLabel->Wrap( -1 ); m_angleLabel->Wrap( -1 );
gbSizer2->Add( m_angleLabel, wxGBPosition( 5, 0 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 ); fgSizer1->Add( m_angleLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
m_angleCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_angleCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
gbSizer2->Add( m_angleCtrl, wxGBPosition( 5, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM, 5 ); fgSizer1->Add( m_angleCtrl, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
m_angleUnits = new wxStaticText( this, wxID_ANY, _("deg"), wxDefaultPosition, wxDefaultSize, 0 ); m_angleUnits = new wxStaticText( this, wxID_ANY, _("deg"), wxDefaultPosition, wxDefaultSize, 0 );
m_angleUnits->Wrap( -1 ); m_angleUnits->Wrap( -1 );
gbSizer2->Add( m_angleUnits, wxGBPosition( 5, 2 ), wxGBSpan( 1, 1 ), wxALL|wxALIGN_CENTER_VERTICAL, 5 ); fgSizer1->Add( m_angleUnits, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 );
bMiddleSizer->Add( fgSizer1, 0, wxTOP, 5 );
m_upperSizer->Add( bMiddleSizer, 0, wxBOTTOM|wxEXPAND, 5 );
wxGridBagSizer* gbSizer2;
gbSizer2 = new wxGridBagSizer( 1, 5 );
gbSizer2->SetFlexibleDirection( wxBOTH );
gbSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
gbSizer2->SetEmptyCellSize( wxSize( -1,4 ) );
m_locked = new wxCheckBox( this, wxID_ANY, _("Locked"), wxDefaultPosition, wxDefaultSize, 0 ); m_locked = new wxCheckBox( this, wxID_ANY, _("Locked"), wxDefaultPosition, wxDefaultSize, 0 );
gbSizer2->Add( m_locked, wxGBPosition( 6, 0 ), wxGBSpan( 1, 1 ), wxRIGHT|wxLEFT, 5 ); gbSizer2->Add( m_locked, wxGBPosition( 0, 0 ), wxGBSpan( 1, 1 ), wxALL, 5 );
m_filledCtrl = new wxCheckBox( this, wxID_ANY, _("Filled shape"), wxDefaultPosition, wxDefaultSize, 0 ); m_filledCtrl = new wxCheckBox( this, wxID_ANY, _("Filled shape"), wxDefaultPosition, wxDefaultSize, 0 );
gbSizer2->Add( m_filledCtrl, wxGBPosition( 7, 0 ), wxGBSpan( 1, 2 ), wxBOTTOM|wxRIGHT|wxLEFT, 5 ); gbSizer2->Add( m_filledCtrl, wxGBPosition( 1, 0 ), wxGBSpan( 1, 2 ), wxALL, 5 );
m_thicknessLabel = new wxStaticText( this, wxID_ANY, _("Line width:"), wxDefaultPosition, wxDefaultSize, 0 ); m_thicknessLabel = new wxStaticText( this, wxID_ANY, _("Line width:"), wxDefaultPosition, wxDefaultSize, 0 );
m_thicknessLabel->Wrap( -1 ); m_thicknessLabel->Wrap( -1 );
gbSizer2->Add( m_thicknessLabel, wxGBPosition( 8, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); gbSizer2->Add( m_thicknessLabel, wxGBPosition( 3, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_thicknessCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_thicknessCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
gbSizer2->Add( m_thicknessCtrl, wxGBPosition( 8, 1 ), wxGBSpan( 1, 1 ), wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP, 5 ); m_thicknessCtrl->SetMinSize( wxSize( 140,-1 ) );
gbSizer2->Add( m_thicknessCtrl, wxGBPosition( 3, 1 ), wxGBSpan( 1, 1 ), wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
m_thicknessUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 ); m_thicknessUnits = new wxStaticText( this, wxID_ANY, _("unit"), wxDefaultPosition, wxDefaultSize, 0 );
m_thicknessUnits->Wrap( -1 ); m_thicknessUnits->Wrap( -1 );
gbSizer2->Add( m_thicknessUnits, wxGBPosition( 8, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 5 ); gbSizer2->Add( m_thicknessUnits, wxGBPosition( 3, 2 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
m_lineStyleLabel = new wxStaticText( this, wxID_ANY, _("Line style:"), wxDefaultPosition, wxDefaultSize, 0 ); m_lineStyleLabel = new wxStaticText( this, wxID_ANY, _("Line style:"), wxDefaultPosition, wxDefaultSize, 0 );
m_lineStyleLabel->Wrap( -1 ); m_lineStyleLabel->Wrap( -1 );
gbSizer2->Add( m_lineStyleLabel, wxGBPosition( 9, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); gbSizer2->Add( m_lineStyleLabel, wxGBPosition( 4, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_lineStyleCombo = new wxBitmapComboBox( this, wxID_ANY, _("Combo!"), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY ); m_lineStyleCombo = new wxBitmapComboBox( this, wxID_ANY, _("Combo!"), wxDefaultPosition, wxDefaultSize, 0, NULL, wxCB_READONLY );
m_lineStyleCombo->SetMinSize( wxSize( 210,-1 ) ); m_lineStyleCombo->SetMinSize( wxSize( 210,-1 ) );
gbSizer2->Add( m_lineStyleCombo, wxGBPosition( 9, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxEXPAND, 5 ); gbSizer2->Add( m_lineStyleCombo, wxGBPosition( 4, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 );
m_LayerLabel = new wxStaticText( this, wxID_ANY, _("Layer:"), wxDefaultPosition, wxDefaultSize, 0 ); m_LayerLabel = new wxStaticText( this, wxID_ANY, _("Layer:"), wxDefaultPosition, wxDefaultSize, 0 );
m_LayerLabel->Wrap( -1 ); m_LayerLabel->Wrap( -1 );
gbSizer2->Add( m_LayerLabel, wxGBPosition( 10, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); gbSizer2->Add( m_LayerLabel, wxGBPosition( 6, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
m_LayerSelectionCtrl = new PCB_LAYER_BOX_SELECTOR( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); m_LayerSelectionCtrl = new PCB_LAYER_BOX_SELECTOR( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 );
gbSizer2->Add( m_LayerSelectionCtrl, wxGBPosition( 10, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxEXPAND|wxRESERVE_SPACE_EVEN_IF_HIDDEN, 5 ); gbSizer2->Add( m_LayerSelectionCtrl, wxGBPosition( 6, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRESERVE_SPACE_EVEN_IF_HIDDEN, 5 );
m_netLabel = new wxStaticText( this, wxID_ANY, _("Net:"), wxDefaultPosition, wxDefaultSize, 0 ); m_netLabel = new wxStaticText( this, wxID_ANY, _("Net:"), wxDefaultPosition, wxDefaultSize, 0 );
m_netLabel->Wrap( -1 ); m_netLabel->Wrap( -1 );
gbSizer2->Add( m_netLabel, wxGBPosition( 11, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxLEFT|wxRESERVE_SPACE_EVEN_IF_HIDDEN|wxRIGHT, 5 ); gbSizer2->Add( m_netLabel, wxGBPosition( 7, 0 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxRESERVE_SPACE_EVEN_IF_HIDDEN|wxLEFT, 5 );
m_netSelector = new NET_SELECTOR( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); m_netSelector = new NET_SELECTOR( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
gbSizer2->Add( m_netSelector, wxGBPosition( 11, 1 ), wxGBSpan( 1, 1 ), wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxEXPAND|wxRESERVE_SPACE_EVEN_IF_HIDDEN, 5 ); gbSizer2->Add( m_netSelector, wxGBPosition( 7, 1 ), wxGBSpan( 1, 2 ), wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRESERVE_SPACE_EVEN_IF_HIDDEN, 5 );
gbSizer2->AddGrowableCol( 1 ); gbSizer2->AddGrowableCol( 1 );
bMiddleSizer->Add( gbSizer2, 1, wxBOTTOM|wxEXPAND|wxTOP, 5 ); m_upperSizer->Add( gbSizer2, 0, 0, 5 );
bUpperSizer->Add( bMiddleSizer, 0, wxBOTTOM|wxEXPAND, 5 ); bMainSizer->Add( m_upperSizer, 1, wxALL|wxEXPAND, 5 );
bMainSizer->Add( bUpperSizer, 1, wxEXPAND|wxALL, 5 );
m_StandardButtonsSizer = new wxStdDialogButtonSizer(); m_StandardButtonsSizer = new wxStdDialogButtonSizer();
m_StandardButtonsSizerOK = new wxButton( this, wxID_OK ); m_StandardButtonsSizerOK = new wxButton( this, wxID_OK );
@ -269,21 +290,15 @@ DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE( wxWind
this->Layout(); this->Layout();
bMainSizer->Fit( this ); bMainSizer->Fit( this );
this->Centre( wxBOTH );
// Connect Events // Connect Events
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::OnClose ) ); m_filledCtrl->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_SHAPE_PROPERTIES_BASE::onFilledCheckbox ), NULL, this );
this->Connect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::OnInitDlg ) ); m_LayerSelectionCtrl->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_SHAPE_PROPERTIES_BASE::onLayerSelection ), NULL, this );
m_filledCtrl->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::onFilledCheckbox ), NULL, this );
m_LayerSelectionCtrl->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::onLayerSelection ), NULL, this );
} }
DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::~DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE() DIALOG_SHAPE_PROPERTIES_BASE::~DIALOG_SHAPE_PROPERTIES_BASE()
{ {
// Disconnect Events // Disconnect Events
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::OnClose ) ); m_filledCtrl->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_SHAPE_PROPERTIES_BASE::onFilledCheckbox ), NULL, this );
this->Disconnect( wxEVT_INIT_DIALOG, wxInitDialogEventHandler( DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::OnInitDlg ) ); m_LayerSelectionCtrl->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_SHAPE_PROPERTIES_BASE::onLayerSelection ), NULL, this );
m_filledCtrl->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::onFilledCheckbox ), NULL, this );
m_LayerSelectionCtrl->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::onLayerSelection ), NULL, this );
} }

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.1-370-gc831f1f7) // C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO *NOT* EDIT THIS FILE! // PLEASE DO *NOT* EDIT THIS FILE!
@ -21,10 +21,10 @@ class PCB_LAYER_BOX_SELECTOR;
#include <wx/settings.h> #include <wx/settings.h>
#include <wx/textctrl.h> #include <wx/textctrl.h>
#include <wx/gbsizer.h> #include <wx/gbsizer.h>
#include <wx/sizer.h>
#include <wx/checkbox.h> #include <wx/checkbox.h>
#include <wx/bmpcbox.h> #include <wx/bmpcbox.h>
#include <widgets/net_selector.h> #include <widgets/net_selector.h>
#include <wx/sizer.h>
#include <wx/button.h> #include <wx/button.h>
#include <wx/dialog.h> #include <wx/dialog.h>
@ -32,14 +32,15 @@ class PCB_LAYER_BOX_SELECTOR;
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE /// Class DIALOG_SHAPE_PROPERTIES_BASE
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
class DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE : public DIALOG_SHIM class DIALOG_SHAPE_PROPERTIES_BASE : public DIALOG_SHIM
{ {
private: private:
protected: protected:
wxGridBagSizer* m_sizerLeft; wxBoxSizer* m_upperSizer;
wxGridBagSizer* m_sizerStartEnd;
wxStaticText* m_startPointLabel; wxStaticText* m_startPointLabel;
wxStaticText* m_startXLabel; wxStaticText* m_startXLabel;
wxTextCtrl* m_startXCtrl; wxTextCtrl* m_startXCtrl;
@ -54,6 +55,7 @@ class DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE : public DIALOG_SHIM
wxStaticText* m_endYLabel; wxStaticText* m_endYLabel;
wxTextCtrl* m_endYCtrl; wxTextCtrl* m_endYCtrl;
wxStaticText* m_endYUnits; wxStaticText* m_endYUnits;
wxGridBagSizer* m_sizerBezier;
wxStaticText* m_bezierCtrlPt1Label; wxStaticText* m_bezierCtrlPt1Label;
wxStaticText* m_BezierPointC1XLabel; wxStaticText* m_BezierPointC1XLabel;
wxTextCtrl* m_BezierC1X_Ctrl; wxTextCtrl* m_BezierC1X_Ctrl;
@ -99,17 +101,15 @@ class DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE : public DIALOG_SHIM
wxButton* m_StandardButtonsSizerCancel; wxButton* m_StandardButtonsSizerCancel;
// Virtual event handlers, override them in your derived class // Virtual event handlers, override them in your derived class
virtual void OnClose( wxCloseEvent& event ) { event.Skip(); }
virtual void OnInitDlg( wxInitDialogEvent& event ) { event.Skip(); }
virtual void onFilledCheckbox( wxCommandEvent& event ) { event.Skip(); } virtual void onFilledCheckbox( wxCommandEvent& event ) { event.Skip(); }
virtual void onLayerSelection( wxCommandEvent& event ) { event.Skip(); } virtual void onLayerSelection( wxCommandEvent& event ) { event.Skip(); }
public: public:
DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Graphic Item Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSYSTEM_MENU ); DIALOG_SHAPE_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("%s Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE(); ~DIALOG_SHAPE_PROPERTIES_BASE();
}; };