From 5a904e460a7008716cc453c886c8e190bb48f6af Mon Sep 17 00:00:00 2001 From: charras Date: Fri, 5 Sep 2008 16:08:13 +0000 Subject: [PATCH] Solved kbool lib compil problem under Windows and wxWidgets shared version Pcbnew: Add position edition in footprint dialog edition --- common/about_kicad.cpp | 1 + pcbnew/dialog_edit_module.cpp | 33 ++++++++++++++++++++++++++++++++ pcbnew/dialog_edit_module.h | 6 +++++- polygon/kbool/include/booleng.h | 4 ++++ polygon/kbool/include/scanbeam.h | 6 +++++- 5 files changed, 48 insertions(+), 2 deletions(-) diff --git a/common/about_kicad.cpp b/common/about_kicad.cpp index 4b185c00ff..32efb70066 100644 --- a/common/about_kicad.cpp +++ b/common/about_kicad.cpp @@ -92,6 +92,7 @@ void InitKiCadAbout(wxAboutDialogInfo& info) /* Add developers */ info.AddDeveloper(wxT("Jean-Pierre Charras ")); info.AddDeveloper(SetMsg(wxT("Dick Hollenbeck "))); + info.AddDeveloper(SetMsg(wxT("kbool library: http://boolean.klaasholwerda.nl/bool.html"))); /* Add document writers */ info.AddDocWriter(wxT("Jean-Pierre Charras ")); diff --git a/pcbnew/dialog_edit_module.cpp b/pcbnew/dialog_edit_module.cpp index 2c7db4c17f..d84832ff3e 100644 --- a/pcbnew/dialog_edit_module.cpp +++ b/pcbnew/dialog_edit_module.cpp @@ -168,6 +168,8 @@ void WinEDA_ModulePropertiesFrame::BuildPanelModuleProperties( bool FullOptions wxBoxSizer* PropLeftSizer; wxBoxSizer* PropRightSizer; wxString msg; + wxStaticText* XPositionStatic = new wxStaticText(m_PanelProperties, -1, _("X")); + wxStaticText* YPositionStatic = new wxStaticText(m_PanelProperties, -1, _("Y")); /* Create a sizer for controls in the left column */ PropLeftSizer = new wxBoxSizer( wxVERTICAL ); @@ -186,6 +188,28 @@ void WinEDA_ModulePropertiesFrame::BuildPanelModuleProperties( bool FullOptions _( "Edit Module" ) ); Button->SetForegroundColour( wxColor( 0, 128, 80 ) ); PropRightSizer->Add( Button, 0, wxGROW | wxALL, 5 ); + + wxStaticBox* positionBox = new wxStaticBox(m_PanelProperties, -1, _("Position") ); + wxStaticBoxSizer* positionBoxSizer = new wxStaticBoxSizer( positionBox, wxVERTICAL ); + PropRightSizer->Add(positionBoxSizer, 0, wxGROW | wxALL, 5 ); + + m_ModPositionX = new wxTextCtrl( m_PanelProperties, ID_MODULE_EDIT_X_POSITION, wxT(""), + wxDefaultPosition, wxDefaultSize, 0, + wxTextValidator(wxFILTER_NUMERIC, NULL), wxTextCtrlNameStr); + + PutValueInLocalUnits( *m_ModPositionX, m_CurrentModule->GetPosition().x, PCB_INTERNAL_UNIT ); + AddUnitSymbol( *XPositionStatic, g_UnitMetric ); + positionBoxSizer->Add( XPositionStatic, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 ); + positionBoxSizer->Add( m_ModPositionX, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); + + m_ModPositionY = new wxTextCtrl( m_PanelProperties, ID_MODULE_EDIT_Y_POSITION, + wxT(""), wxDefaultPosition, wxDefaultSize, 0, + wxTextValidator(wxFILTER_NUMERIC, NULL), wxTextCtrlNameStr); + + PutValueInLocalUnits( *m_ModPositionY, m_CurrentModule->GetPosition().y, PCB_INTERNAL_UNIT ); + AddUnitSymbol( *YPositionStatic, g_UnitMetric ); + positionBoxSizer->Add( YPositionStatic, 0, wxGROW | wxLEFT | wxRIGHT | wxTOP, 5 ); + positionBoxSizer->Add( m_ModPositionY, 0, wxGROW | wxLEFT | wxRIGHT | wxBOTTOM, 5 ); } else // Module is edited in libedit { @@ -496,6 +520,15 @@ void WinEDA_ModulePropertiesFrame::OnOkClick( wxCommandEvent& event ) /******************************************************************************/ { bool change_layer = FALSE; + wxPoint modpos; + + // Set Module Position + modpos.x = ReturnValueFromTextCtrl( *m_ModPositionX, PCB_INTERNAL_UNIT ); + modpos.y = ReturnValueFromTextCtrl( *m_ModPositionY, PCB_INTERNAL_UNIT ); + m_CurrentModule->SetPosition(modpos); + + if( m_DC ) + m_Parent->DrawPanel->CursorOff( m_DC ); if( m_DC ) m_Parent->DrawPanel->CursorOff( m_DC ); diff --git a/pcbnew/dialog_edit_module.h b/pcbnew/dialog_edit_module.h index e21d278f0d..9c8ad2bfb3 100644 --- a/pcbnew/dialog_edit_module.h +++ b/pcbnew/dialog_edit_module.h @@ -15,7 +15,9 @@ enum id_Module_properties ID_BROWSE_3D_LIB, ID_ADD_3D_SHAPE, ID_REMOVE_3D_SHAPE, - ID_NOTEBOOK + ID_NOTEBOOK, + ID_MODULE_EDIT_X_POSITION, + ID_MODULE_EDIT_Y_POSITION }; class Panel3D_Ctrl; @@ -45,6 +47,8 @@ private: wxTextCtrl *m_Doc, *m_Keyword; wxBoxSizer * m_GeneralBoxSizer; wxBoxSizer* m_PanelPropertiesBoxSizer; + wxTextCtrl *m_ModPositionX, *m_ModPositionY; + wxString *m_ModPosXStr, *m_ModPosYStr; public: diff --git a/polygon/kbool/include/booleng.h b/polygon/kbool/include/booleng.h index 09dbe69c51..ae4fcac2a7 100644 --- a/polygon/kbool/include/booleng.h +++ b/polygon/kbool/include/booleng.h @@ -24,10 +24,14 @@ #define A2DKBOOLDLLEXP WXEXPORT #define A2DKBOOLDLLEXP_DATA(type) WXEXPORT type #define A2DKBOOLDLLEXP_CTORFN +#if 0 // Kicad does dot use wxWidgets lib when building the kbool library + // but uses wxWidgets. So WXUSINGDLL has no meaning here, but could be defined in makefiles + // but must not be used when building kbool #elif defined(WXUSINGDLL) #define A2DKBOOLDLLEXP WXIMPORT #define A2DKBOOLDLLEXP_DATA(type) WXIMPORT type #define A2DKBOOLDLLEXP_CTORFN +#endif #else // not making nor using DLL #define A2DKBOOLDLLEXP #define A2DKBOOLDLLEXP_DATA(type) type diff --git a/polygon/kbool/include/scanbeam.h b/polygon/kbool/include/scanbeam.h index df15ebcb22..b4f659fc6b 100644 --- a/polygon/kbool/include/scanbeam.h +++ b/polygon/kbool/include/scanbeam.h @@ -23,8 +23,12 @@ enum SCANTYPE{NODELINK,LINKLINK,GENLR,LINKHOLES,INOUT}; +#if 0 // Kicad does dot use wxWidgets lib when building the kbool library + // but uses wxWidgets. So WXUSINGDLL could be defined in makefiles + // but must not be used when building kbool #if defined(WXUSINGDLL) - template class A2DKBOOLDLLEXP DL_Iter; +template class A2DKBOOLDLLEXP DL_Iter; +#endif #endif class A2DKBOOLDLLEXP ScanBeam : public DL_List