Commit 96b6e1a5 authored by jean-pierre charras's avatar jean-pierre charras

Make dialog pns properties resizable. DXF import: add very basic polyline import.

parent 95a6e8de
...@@ -128,7 +128,7 @@ EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id, ...@@ -128,7 +128,7 @@ EDA_DRAW_PANEL::EDA_DRAW_PANEL( EDA_DRAW_FRAME* parent, int id,
if( cfg ) if( cfg )
{ {
cfg->Read( ENBL_MIDDLE_BUTT_PAN_KEY, &m_enableMiddleButtonPan, false ); cfg->Read( ENBL_MIDDLE_BUTT_PAN_KEY, &m_enableMiddleButtonPan, true );
cfg->Read( ENBL_ZOOM_NO_CENTER_KEY, &m_enableZoomNoCenter, false ); cfg->Read( ENBL_ZOOM_NO_CENTER_KEY, &m_enableZoomNoCenter, false );
cfg->Read( MIDDLE_BUTT_PAN_LIMITED_KEY, &m_panScrollbarLimits, false ); cfg->Read( MIDDLE_BUTT_PAN_LIMITED_KEY, &m_panScrollbarLimits, false );
cfg->Read( ENBL_AUTO_PAN_KEY, &m_enableAutoPan, true ); cfg->Read( ENBL_AUTO_PAN_KEY, &m_enableAutoPan, true );
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
DIALOG_PNS_SETTINGS_BASE::DIALOG_PNS_SETTINGS_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_PNS_SETTINGS_BASE::DIALOG_PNS_SETTINGS_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( wxDefaultSize, wxDefaultSize ); this->SetSizeHints( wxSize( 280,380 ), wxDefaultSize );
wxBoxSizer* bMainSizer; wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxVERTICAL ); bMainSizer = new wxBoxSizer( wxVERTICAL );
...@@ -91,8 +91,8 @@ DIALOG_PNS_SETTINGS_BASE::DIALOG_PNS_SETTINGS_BASE( wxWindow* parent, wxWindowID ...@@ -91,8 +91,8 @@ DIALOG_PNS_SETTINGS_BASE::DIALOG_PNS_SETTINGS_BASE( wxWindow* parent, wxWindowID
bOptions->Add( bEffort, 0, wxEXPAND, 5 ); bOptions->Add( bEffort, 0, wxEXPAND, 5 );
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bOptions->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 ); bMainSizer->Add( bOptions, 1, wxEXPAND|wxALL, 5 );
m_stdButtons = new wxStdDialogButtonSizer(); m_stdButtons = new wxStdDialogButtonSizer();
m_stdButtonsOK = new wxButton( this, wxID_OK ); m_stdButtonsOK = new wxButton( this, wxID_OK );
...@@ -101,10 +101,7 @@ DIALOG_PNS_SETTINGS_BASE::DIALOG_PNS_SETTINGS_BASE( wxWindow* parent, wxWindowID ...@@ -101,10 +101,7 @@ DIALOG_PNS_SETTINGS_BASE::DIALOG_PNS_SETTINGS_BASE( wxWindow* parent, wxWindowID
m_stdButtons->AddButton( m_stdButtonsCancel ); m_stdButtons->AddButton( m_stdButtonsCancel );
m_stdButtons->Realize(); m_stdButtons->Realize();
bOptions->Add( m_stdButtons, 0, wxEXPAND, 5 ); bMainSizer->Add( m_stdButtons, 0, wxEXPAND|wxALL, 5 );
bMainSizer->Add( bOptions, 1, wxEXPAND|wxALL, 5 );
this->SetSizer( bMainSizer ); this->SetSizer( bMainSizer );
......
This diff is collapsed.
...@@ -24,9 +24,8 @@ class DIALOG_SHIM; ...@@ -24,9 +24,8 @@ class DIALOG_SHIM;
#include <wx/stattext.h> #include <wx/stattext.h>
#include <wx/slider.h> #include <wx/slider.h>
#include <wx/sizer.h> #include <wx/sizer.h>
#include <wx/statline.h>
#include <wx/button.h>
#include <wx/statbox.h> #include <wx/statbox.h>
#include <wx/button.h>
#include <wx/dialog.h> #include <wx/dialog.h>
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
...@@ -52,7 +51,6 @@ class DIALOG_PNS_SETTINGS_BASE : public DIALOG_SHIM ...@@ -52,7 +51,6 @@ class DIALOG_PNS_SETTINGS_BASE : public DIALOG_SHIM
wxSlider* m_effort; wxSlider* m_effort;
wxStaticText* m_lowLabel; wxStaticText* m_lowLabel;
wxStaticText* m_highLabel; wxStaticText* m_highLabel;
wxStaticLine* m_staticline1;
wxStdDialogButtonSizer* m_stdButtons; wxStdDialogButtonSizer* m_stdButtons;
wxButton* m_stdButtonsOK; wxButton* m_stdButtonsOK;
wxButton* m_stdButtonsCancel; wxButton* m_stdButtonsCancel;
...@@ -65,7 +63,7 @@ class DIALOG_PNS_SETTINGS_BASE : public DIALOG_SHIM ...@@ -65,7 +63,7 @@ class DIALOG_PNS_SETTINGS_BASE : public DIALOG_SHIM
public: public:
DIALOG_PNS_SETTINGS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Interactive Router settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 277,404 ), long style = wxDEFAULT_DIALOG_STYLE ); DIALOG_PNS_SETTINGS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Interactive Router settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 298,410 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_PNS_SETTINGS_BASE(); ~DIALOG_PNS_SETTINGS_BASE();
}; };
......
...@@ -134,6 +134,66 @@ void DXF2BRD_CONVERTER::addLine( const DRW_Line& data ) ...@@ -134,6 +134,66 @@ void DXF2BRD_CONVERTER::addLine( const DRW_Line& data )
appendToBoard( segm ); appendToBoard( segm );
} }
void DXF2BRD_CONVERTER::addPolyline(const DRW_Polyline& data )
{
// Currently, Pcbnew does not know polylines, for boards.
// So we have to convert a polyline to a set of segments.
// Obviously, the z coordinate is ignored
wxPoint startpoint;
for( unsigned ii = 0; ii < data.vertlist.size(); ii++ )
{
DRW_Vertex* vertex = data.vertlist[ii];
if( ii == 0 )
{
startpoint.x = mapX( vertex->basePoint.x );
startpoint.y = mapY( vertex->basePoint.y );
continue;
}
DRAWSEGMENT* segm = new DRAWSEGMENT( m_brd );
segm->SetLayer( m_brdLayer );
segm->SetStart( startpoint );
wxPoint endpoint( mapX( vertex->basePoint.x ), mapY( vertex->basePoint.y ) );
segm->SetEnd( endpoint );
segm->SetWidth( mapDim( data.thickness == 0 ? m_defaultThickness
: data.thickness ) );
appendToBoard( segm );
startpoint = endpoint;
}
}
void DXF2BRD_CONVERTER::addLWPolyline(const DRW_LWPolyline& data )
{
// Currently, Pcbnew does not know polylines, for boards.
// So we have to convert a polyline to a set of segments.
// The import is a simplified import: the width of segment is
// (obviously contant and is the width of the DRW_LWPolyline.
// the variable width of each vertex (when exists) is not used.
wxPoint startpoint;
for( unsigned ii = 0; ii < data.vertlist.size(); ii++ )
{
DRW_Vertex2D* vertex = data.vertlist[ii];
if( ii == 0 )
{
startpoint.x = mapX( vertex->x );
startpoint.y = mapY( vertex->y );
continue;
}
DRAWSEGMENT* segm = new DRAWSEGMENT( m_brd );
segm->SetLayer( m_brdLayer );
segm->SetStart( startpoint );
wxPoint endpoint( mapX( vertex->x ), mapY( vertex->y ) );
segm->SetEnd( endpoint );
segm->SetWidth( mapDim( data.thickness == 0 ? m_defaultThickness
: data.thickness ) );
appendToBoard( segm );
startpoint = endpoint;
}
}
/* /*
* Import Circle entities. * Import Circle entities.
......
...@@ -123,9 +123,9 @@ private: ...@@ -123,9 +123,9 @@ private:
virtual void addCircle(const DRW_Circle& data ); virtual void addCircle(const DRW_Circle& data );
virtual void addArc(const DRW_Arc& data ); virtual void addArc(const DRW_Arc& data );
virtual void addEllipse(const DRW_Ellipse& data ){} virtual void addEllipse(const DRW_Ellipse& data ){}
virtual void addLWPolyline(const DRW_LWPolyline& data ){} virtual void addLWPolyline(const DRW_LWPolyline& data );
virtual void addText(const DRW_Text& data ); virtual void addText(const DRW_Text& data );
virtual void addPolyline(const DRW_Polyline& data ){} virtual void addPolyline(const DRW_Polyline& data );
virtual void addSpline(const DRW_Spline* data ){} virtual void addSpline(const DRW_Spline* data ){}
virtual void addKnot(const DRW_Entity&) {} virtual void addKnot(const DRW_Entity&) {}
virtual void addInsert(const DRW_Insert& data ){} virtual void addInsert(const DRW_Insert& data ){}
......
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