diff --git a/common/class_layer_box_selector.cpp b/common/class_layer_box_selector.cpp index a4676e91cf..401f8d3bb9 100644 --- a/common/class_layer_box_selector.cpp +++ b/common/class_layer_box_selector.cpp @@ -84,6 +84,9 @@ int LAYER_BOX_SELECTOR::GetChoice() // Get Current Layer LAYER_NUM LAYER_BOX_SELECTOR::GetLayerSelection() const { + if( GetSelection() < 0 ) + return UNDEFINED_LAYER; + return (LAYER_NUM)(intptr_t) GetClientData( GetSelection() ); } diff --git a/pcbnew/dialogs/dialog_dimension_editor_base.fbp b/pcbnew/dialogs/dialog_dimension_editor_base.fbp index c841d8509c..4373b4f5cf 100644 --- a/pcbnew/dialogs/dialog_dimension_editor_base.fbp +++ b/pcbnew/dialogs/dialog_dimension_editor_base.fbp @@ -42,7 +42,7 @@ DIALOG_DIMENSION_EDITOR_BASE - 378,328 + 417,328 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h Dimension Properties @@ -1341,7 +1341,7 @@ 5 wxBOTTOM|wxRIGHT|wxLEFT 0 - + 1 1 1 diff --git a/pcbnew/dialogs/dialog_dimension_editor_base.h b/pcbnew/dialogs/dialog_dimension_editor_base.h index b0c5e063f4..62291b9a22 100644 --- a/pcbnew/dialogs/dialog_dimension_editor_base.h +++ b/pcbnew/dialogs/dialog_dimension_editor_base.h @@ -24,7 +24,7 @@ class PCB_LAYER_BOX_SELECTOR; #include #include #include -#include +#include #include #include #include @@ -67,7 +67,7 @@ class DIALOG_DIMENSION_EDITOR_BASE : public DIALOG_SHIM public: - DIALOG_DIMENSION_EDITOR_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Dimension Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 378,328 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + DIALOG_DIMENSION_EDITOR_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Dimension Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 417,328 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~DIALOG_DIMENSION_EDITOR_BASE(); }; diff --git a/pcbnew/dialogs/dialog_graphic_item_properties.cpp b/pcbnew/dialogs/dialog_graphic_item_properties.cpp index 352736df26..c4271c7b1c 100644 --- a/pcbnew/dialogs/dialog_graphic_item_properties.cpp +++ b/pcbnew/dialogs/dialog_graphic_item_properties.cpp @@ -24,6 +24,7 @@ #include #include +#include class DIALOG_GRAPHIC_ITEM_PROPERTIES: public DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE { @@ -127,7 +128,7 @@ void DIALOG_GRAPHIC_ITEM_PROPERTIES::initDlg( ) m_EndPointXLabel->SetLabel(_("Start Point X")); m_EndPointYLabel->SetLabel(_("Start Point Y")); - // Here the angle is a double, but the UI is still working + // Here the angle is a double, but the UI is still working // with integers msg << int( m_Item->GetAngle() ); m_Angle_Ctrl->SetValue(msg); @@ -159,20 +160,17 @@ void DIALOG_GRAPHIC_ITEM_PROPERTIES::initDlg( ) PutValueInLocalUnits( *m_DefaultThicknessCtrl, thickness ); - for( LAYER_NUM layer = FIRST_NON_COPPER_LAYER; - layer <= LAST_NON_COPPER_LAYER; ++layer ) + // Configure the layers list selector + m_LayerSelectionCtrl->SetLayersHotkeys( false ); + m_LayerSelectionCtrl->SetLayerMask( ALL_CU_LAYERS ); + m_LayerSelectionCtrl->SetBoardFrame( m_parent ); + m_LayerSelectionCtrl->Resync(); + if( m_LayerSelectionCtrl->SetLayerSelection( m_Item->GetLayer() ) < 0 ) { - m_LayerSelectionCtrl->Append( m_parent->GetBoard()->GetLayerName( layer ) ); + wxMessageBox( _("This item has an illegal layer id.\n" + "Now, forced on the drawings layer. Please, fix it") ); + m_LayerSelectionCtrl->SetLayerSelection( DRAW_N ); } - - LAYER_NUM layer = m_Item->GetLayer(); - - // It has to be an aux layer - if ( layer < FIRST_NON_COPPER_LAYER ) - layer = FIRST_NON_COPPER_LAYER; - if ( layer > LAST_NON_COPPER_LAYER ) - layer = LAST_NON_COPPER_LAYER; - m_LayerSelectionCtrl->SetSelection( layer - FIRST_NON_COPPER_LAYER ); } @@ -182,7 +180,7 @@ void DIALOG_GRAPHIC_ITEM_PROPERTIES::OnLayerChoice( wxCommandEvent& event ) { int thickness; - if( (m_LayerSelectionCtrl->GetCurrentSelection() + FIRST_NON_COPPER_LAYER) == EDGE_N ) + if( m_LayerSelectionCtrl->GetLayerSelection() == EDGE_N ) thickness = m_brdSettings.m_EdgeSegmentWidth; else thickness = m_brdSettings.m_DrawSegmentWidth; @@ -221,7 +219,7 @@ void DIALOG_GRAPHIC_ITEM_PROPERTIES::OnOkClick( wxCommandEvent& event ) msg = m_DefaultThicknessCtrl->GetValue(); int thickness = ReturnValueFromString( g_UserUnit, msg ); - m_Item->SetLayer( FIRST_NON_COPPER_LAYER + m_LayerSelectionCtrl->GetCurrentSelection() ); + m_Item->SetLayer( m_LayerSelectionCtrl->GetLayerSelection() ); if( m_Item->GetLayer() == EDGE_N ) m_brdSettings.m_EdgeSegmentWidth = thickness; diff --git a/pcbnew/dialogs/dialog_graphic_item_properties_base.cpp b/pcbnew/dialogs/dialog_graphic_item_properties_base.cpp index 492623896a..3aa70b5b7b 100644 --- a/pcbnew/dialogs/dialog_graphic_item_properties_base.cpp +++ b/pcbnew/dialogs/dialog_graphic_item_properties_base.cpp @@ -1,10 +1,12 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 10 2012) +// C++ code generated with wxFormBuilder (version Oct 8 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// +#include "class_pcb_layer_box_selector.h" + #include "dialog_graphic_item_properties_base.h" /////////////////////////////////////////////////////////////////////////// @@ -30,6 +32,7 @@ DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE( wxWind fgUpperLeftGridSizer->Add( m_StartPointXLabel, 0, wxALIGN_RIGHT|wxTOP|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); m_Center_StartXCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_Center_StartXCtrl->SetMaxLength( 0 ); fgUpperLeftGridSizer->Add( m_Center_StartXCtrl, 0, wxEXPAND|wxALL, 5 ); m_StartPointXUnit = new wxStaticText( this, wxID_ANY, _("Unit"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -41,6 +44,7 @@ DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE( wxWind fgUpperLeftGridSizer->Add( m_StartPointYLabel, 0, wxALIGN_RIGHT|wxTOP|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); m_Center_StartYCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_Center_StartYCtrl->SetMaxLength( 0 ); fgUpperLeftGridSizer->Add( m_Center_StartYCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); m_StartPointYUnit = new wxStaticText( this, wxID_ANY, _("Unit"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -52,6 +56,7 @@ DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE( wxWind fgUpperLeftGridSizer->Add( m_EndPointXLabel, 0, wxALIGN_RIGHT|wxTOP|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); m_EndX_Radius_Ctrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_EndX_Radius_Ctrl->SetMaxLength( 0 ); fgUpperLeftGridSizer->Add( m_EndX_Radius_Ctrl, 0, wxEXPAND|wxALL, 5 ); m_EndPointXUnit = new wxStaticText( this, wxID_ANY, _("Unit"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -63,6 +68,7 @@ DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE( wxWind fgUpperLeftGridSizer->Add( m_EndPointYLabel, 0, wxALIGN_RIGHT|wxTOP|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); m_EndY_Ctrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_EndY_Ctrl->SetMaxLength( 0 ); fgUpperLeftGridSizer->Add( m_EndY_Ctrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); m_EndPointYUnit = new wxStaticText( this, wxID_ANY, _("Unit"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -89,6 +95,7 @@ DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE( wxWind fgUpperRightGridSizer->Add( m_Angle_Text, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); m_Angle_Ctrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_Angle_Ctrl->SetMaxLength( 0 ); fgUpperRightGridSizer->Add( m_Angle_Ctrl, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); m_AngleUnit = new wxStaticText( this, wxID_ANY, _("0.1 degree"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -100,6 +107,7 @@ DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE( wxWind fgUpperRightGridSizer->Add( m_ThicknessLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxTOP|wxBOTTOM|wxLEFT, 5 ); m_ThicknessCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_ThicknessCtrl->SetMaxLength( 0 ); fgUpperRightGridSizer->Add( m_ThicknessCtrl, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); m_ThicknessTextUnit = new wxStaticText( this, wxID_ANY, _("Unit"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -111,6 +119,7 @@ DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE( wxWind fgUpperRightGridSizer->Add( m_DefaultThicknessLabel, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); m_DefaultThicknessCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_DefaultThicknessCtrl->SetMaxLength( 0 ); fgUpperRightGridSizer->Add( m_DefaultThicknessCtrl, 0, wxALL|wxEXPAND, 5 ); m_DefaulThicknessTextUnit = new wxStaticText( this, wxID_ANY, _("Unit"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -130,12 +139,8 @@ DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE::DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE( wxWind m_LayerLabel->Wrap( -1 ); fgLowerRightSizer->Add( m_LayerLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxTOP|wxBOTTOM|wxLEFT, 5 ); - wxArrayString m_LayerSelectionCtrlChoices; - m_LayerSelectionCtrl = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_LayerSelectionCtrlChoices, 0 ); - m_LayerSelectionCtrl->SetSelection( 0 ); - m_LayerSelectionCtrl->SetToolTip( _("Select the layer on which text should lay.") ); - - fgLowerRightSizer->Add( m_LayerSelectionCtrl, 0, wxEXPAND|wxALL, 5 ); + m_LayerSelectionCtrl = new PCB_LAYER_BOX_SELECTOR( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); + fgLowerRightSizer->Add( m_LayerSelectionCtrl, 0, wxALL, 5 ); bUpperRightSizer->Add( fgLowerRightSizer, 1, wxEXPAND, 5 ); diff --git a/pcbnew/dialogs/dialog_graphic_item_properties_base.fbp b/pcbnew/dialogs/dialog_graphic_item_properties_base.fbp index dd711328ef..b538865a4a 100644 --- a/pcbnew/dialogs/dialog_graphic_item_properties_base.fbp +++ b/pcbnew/dialogs/dialog_graphic_item_properties_base.fbp @@ -2124,11 +2124,11 @@ - + 5 - wxEXPAND|wxALL + wxALL 0 - + 1 1 1 @@ -2172,22 +2172,23 @@ 1 Resizable - 0 + -1 1 - + PCB_LAYER_BOX_SELECTOR; class_pcb_layer_box_selector.h 0 - Select the layer on which text should lay. + wxFILTER_NONE wxDefaultValidator + - + @@ -2209,6 +2210,8 @@ + + diff --git a/pcbnew/dialogs/dialog_graphic_item_properties_base.h b/pcbnew/dialogs/dialog_graphic_item_properties_base.h index 07961a4611..bb78ca4782 100644 --- a/pcbnew/dialogs/dialog_graphic_item_properties_base.h +++ b/pcbnew/dialogs/dialog_graphic_item_properties_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 10 2012) +// C++ code generated with wxFormBuilder (version Oct 8 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -11,6 +11,9 @@ #include #include #include +class DIALOG_SHIM; +class PCB_LAYER_BOX_SELECTOR; + #include "dialog_shim.h" #include #include @@ -21,7 +24,7 @@ #include #include #include -#include +#include #include #include @@ -59,7 +62,7 @@ class DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE : public DIALOG_SHIM wxTextCtrl* m_DefaultThicknessCtrl; wxStaticText* m_DefaulThicknessTextUnit; wxStaticText* m_LayerLabel; - wxChoice* m_LayerSelectionCtrl; + PCB_LAYER_BOX_SELECTOR* m_LayerSelectionCtrl; wxStaticLine* m_staticline1; wxStdDialogButtonSizer* m_StandardButtonsSizer; wxButton* m_StandardButtonsSizerOK; diff --git a/pcbnew/dialogs/dialog_graphic_item_properties_for_Modedit.cpp b/pcbnew/dialogs/dialog_graphic_item_properties_for_Modedit.cpp index 3618570380..9c4fdd2dfe 100644 --- a/pcbnew/dialogs/dialog_graphic_item_properties_for_Modedit.cpp +++ b/pcbnew/dialogs/dialog_graphic_item_properties_for_Modedit.cpp @@ -24,6 +24,7 @@ #include #include +#include class DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES: public DIALOG_GRAPHIC_ITEM_PROPERTIES_BASE { @@ -32,7 +33,6 @@ private: EDGE_MODULE* m_item; BOARD_DESIGN_SETTINGS m_brdSettings; MODULE * m_module; - std::vector m_layerId; // the layer Id with the same order as m_LayerSelectionCtrl widget public: DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES( FOOTPRINT_EDIT_FRAME* aParent, @@ -129,7 +129,7 @@ void DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES::initDlg() m_EndPointXLabel->SetLabel(_("Start Point X")); m_EndPointYLabel->SetLabel(_("Start Point Y")); - // Here the angle is a double, but the UI is still working + // Here the angle is a double, but the UI is still working // with integers msg << int( m_item->GetAngle() ); m_Angle_Ctrl->SetValue(msg); @@ -154,27 +154,16 @@ void DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES::initDlg() PutValueInLocalUnits( *m_DefaultThicknessCtrl, m_brdSettings.m_ModuleSegmentWidth ); - m_LayerSelectionCtrl->Append( m_parent->GetBoard()->GetLayerName( LAYER_N_BACK ) ); - m_layerId.push_back( LAYER_N_BACK ); - m_LayerSelectionCtrl->Append( m_parent->GetBoard()->GetLayerName( LAYER_N_FRONT ) ); - m_layerId.push_back( LAYER_N_FRONT ); - for( LAYER_NUM layer = FIRST_NON_COPPER_LAYER; layer <= LAST_NON_COPPER_LAYER; ++layer ) + // Configure the layers list selector + m_LayerSelectionCtrl->SetLayersHotkeys( false ); + m_LayerSelectionCtrl->SetLayerMask( INTERNAL_CU_LAYERS|EDGE_LAYER ); + m_LayerSelectionCtrl->SetBoardFrame( m_parent ); + m_LayerSelectionCtrl->Resync(); + if( m_LayerSelectionCtrl->SetLayerSelection( m_item->GetLayer() ) < 0 ) { - if( layer == EDGE_N ) - // Do not use pcb edge layer for footprints, this is a special layer - // So skip it in list - continue; - m_LayerSelectionCtrl->Append( m_parent->GetBoard()->GetLayerName( layer ) ); - m_layerId.push_back( layer ); - } - - for( unsigned ii = 0; ii < m_layerId.size(); ii++ ) - { - if( m_layerId[ii] == m_item->GetLayer() ) - { - m_LayerSelectionCtrl->SetSelection( ii ); - break; - } + wxMessageBox( _("This item has an illegal layer id.\n" + "Now, forced on the front silk screen layer. Please, fix it") ); + m_LayerSelectionCtrl->SetLayerSelection( SILKSCREEN_N_FRONT ); } } @@ -191,14 +180,8 @@ void DIALOG_MODEDIT_FP_BODY_ITEM_PROPERTIES::OnOkClick( wxCommandEvent& event ) /* Copy values in text control to the item parameters */ { - int idx = m_LayerSelectionCtrl->GetCurrentSelection(); - if( idx < 0 ) - { - wxMessageBox( _("No valid layer selected for this item. Please, select a layer") ); - return; - } + LAYER_NUM layer = m_LayerSelectionCtrl->GetLayerSelection(); - LAYER_NUM layer = m_layerId[idx]; if( IsCopperLayer( layer ) ) { /* an edge is put on a copper layer: this it is very dangerous. a diff --git a/pcbnew/dialogs/dialog_pcb_text_properties.cpp b/pcbnew/dialogs/dialog_pcb_text_properties.cpp index 7a78102c41..ceaf62f5cc 100644 --- a/pcbnew/dialogs/dialog_pcb_text_properties.cpp +++ b/pcbnew/dialogs/dialog_pcb_text_properties.cpp @@ -41,6 +41,7 @@ #include #include #include +#include class PCB_EDIT_FRAME; @@ -56,7 +57,6 @@ private: PCB_EDIT_FRAME* m_Parent; wxDC* m_DC; TEXTE_PCB* m_SelectedPCBText; - std::vector layerList; void MyInit(); @@ -126,20 +126,13 @@ void DIALOG_PCB_TEXT_PROPERTIES::MyInit() PutValueInLocalUnits( *m_PositionXCtrl, m_SelectedPCBText->GetTextPosition().x ); PutValueInLocalUnits( *m_PositionYCtrl, m_SelectedPCBText->GetTextPosition().y ); - LAYER_MSK enabledLayers = m_Parent->GetBoard()->GetEnabledLayers(); - - for( LAYER_NUM layer = FIRST_LAYER; layer < NB_PCB_LAYERS; ++layer ) - { - if( enabledLayers & GetLayerMask( layer ) ) - { - layerList.push_back( layer ); - int itemIndex = - m_LayerSelectionCtrl->Append( m_Parent->GetBoard()->GetLayerName( layer ) ); - - if( m_SelectedPCBText->GetLayer() == layer ) - m_LayerSelectionCtrl->SetSelection( itemIndex ); - } - } + // Configure the layers list selector + m_LayerSelectionCtrl->SetLayersHotkeys( false ); + // A text has no sense on edge cut layer + m_LayerSelectionCtrl->SetLayerMask( EDGE_LAYER ); + m_LayerSelectionCtrl->SetBoardFrame( m_Parent ); + m_LayerSelectionCtrl->Resync(); + m_LayerSelectionCtrl->SetLayerSelection( m_SelectedPCBText->GetLayer() ); wxString orientationStr; orientationStr << m_SelectedPCBText->GetOrientation(); @@ -245,7 +238,7 @@ void DIALOG_PCB_TEXT_PROPERTIES::OnOkClick( wxCommandEvent& event ) } // Set the layer on which the PCB text is laying - m_SelectedPCBText->SetLayer( layerList[m_LayerSelectionCtrl->GetSelection()] ); + m_SelectedPCBText->SetLayer( m_LayerSelectionCtrl->GetLayerSelection() ); // Set whether the PCB text is mirrored (faced down from layer face perspective) m_SelectedPCBText->SetMirrored( m_DisplayCtrl->GetSelection() == 1 ); diff --git a/pcbnew/dialogs/dialog_pcb_text_properties_base.cpp b/pcbnew/dialogs/dialog_pcb_text_properties_base.cpp index c68284866e..d04c149bcf 100644 --- a/pcbnew/dialogs/dialog_pcb_text_properties_base.cpp +++ b/pcbnew/dialogs/dialog_pcb_text_properties_base.cpp @@ -1,10 +1,12 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 11 2012) +// C++ code generated with wxFormBuilder (version Oct 8 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// +#include "class_pcb_layer_box_selector.h" + #include "dialog_pcb_text_properties_base.h" /////////////////////////////////////////////////////////////////////////// @@ -24,13 +26,14 @@ DIALOG_PCB_TEXT_PROPERTIES_BASE::DIALOG_PCB_TEXT_PROPERTIES_BASE( wxWindow* pare bSizer9->Add( m_TextLabel, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); m_TextContentCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE ); + m_TextContentCtrl->SetMaxLength( 0 ); m_TextContentCtrl->SetToolTip( _("Enter the text placed on selected layer.") ); m_TextContentCtrl->SetMinSize( wxSize( 400,60 ) ); bSizer9->Add( m_TextContentCtrl, 1, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); wxFlexGridSizer* fgSizer1; - fgSizer1 = new wxFlexGridSizer( 6, 4, 0, 0 ); + fgSizer1 = new wxFlexGridSizer( 0, 4, 0, 0 ); fgSizer1->AddGrowableCol( 0 ); fgSizer1->AddGrowableCol( 1 ); fgSizer1->AddGrowableCol( 2 ); @@ -55,17 +58,15 @@ DIALOG_PCB_TEXT_PROPERTIES_BASE::DIALOG_PCB_TEXT_PROPERTIES_BASE( wxWindow* pare fgSizer1->Add( m_staticText10, 0, wxLEFT|wxRIGHT|wxTOP, 5 ); m_SizeXCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_SizeXCtrl->SetMaxLength( 0 ); fgSizer1->Add( m_SizeXCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); m_PositionXCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_PositionXCtrl->SetMaxLength( 0 ); fgSizer1->Add( m_PositionXCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - wxArrayString m_LayerSelectionCtrlChoices; - m_LayerSelectionCtrl = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_LayerSelectionCtrlChoices, 0 ); - m_LayerSelectionCtrl->SetSelection( 0 ); - m_LayerSelectionCtrl->SetToolTip( _("Select the layer on which text should lay.") ); - - fgSizer1->Add( m_LayerSelectionCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + m_LayerSelectionCtrl = new PCB_LAYER_BOX_SELECTOR( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); + fgSizer1->Add( m_LayerSelectionCtrl, 0, wxALL, 5 ); wxString m_DisplayCtrlChoices[] = { _("Normal"), _("Mirrored") }; int m_DisplayCtrlNChoices = sizeof( m_DisplayCtrlChoices ) / sizeof( wxString ); @@ -90,9 +91,11 @@ DIALOG_PCB_TEXT_PROPERTIES_BASE::DIALOG_PCB_TEXT_PROPERTIES_BASE( wxWindow* pare fgSizer1->Add( m_staticText11, 0, wxLEFT|wxRIGHT|wxTOP, 5 ); m_SizeYCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_SizeYCtrl->SetMaxLength( 0 ); fgSizer1->Add( m_SizeYCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); m_PositionYCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_PositionYCtrl->SetMaxLength( 0 ); fgSizer1->Add( m_PositionYCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); wxString m_StyleCtrlChoices[] = { _("Normal"), _("Italic") }; @@ -122,9 +125,11 @@ DIALOG_PCB_TEXT_PROPERTIES_BASE::DIALOG_PCB_TEXT_PROPERTIES_BASE( wxWindow* pare fgSizer1->Add( 0, 0, 1, wxEXPAND, 5 ); m_ThicknessCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_ThicknessCtrl->SetMaxLength( 0 ); fgSizer1->Add( m_ThicknessCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); m_OrientationCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_OrientationCtrl->SetMaxLength( 0 ); fgSizer1->Add( m_OrientationCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); diff --git a/pcbnew/dialogs/dialog_pcb_text_properties_base.fbp b/pcbnew/dialogs/dialog_pcb_text_properties_base.fbp index ba2d76916c..18ad8d4662 100644 --- a/pcbnew/dialogs/dialog_pcb_text_properties_base.fbp +++ b/pcbnew/dialogs/dialog_pcb_text_properties_base.fbp @@ -42,7 +42,7 @@ -1,-1 DIALOG_PCB_TEXT_PROPERTIES_BASE - 433,450 + 483,450 wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSYSTEM_MENU DIALOG_SHIM; dialog_shim.h Text Properties @@ -288,7 +288,7 @@ fgSizer1 wxFLEX_GROWMODE_SPECIFIED none - 6 + 0 0 5 @@ -804,11 +804,11 @@ - + 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + wxALL 0 - + 1 1 1 @@ -852,22 +852,23 @@ 1 Resizable - 0 + -1 1 - + PCB_LAYER_BOX_SELECTOR; class_pcb_layer_box_selector.h 0 - Select the layer on which text should lay. + wxFILTER_NONE wxDefaultValidator + - + @@ -889,6 +890,8 @@ + + diff --git a/pcbnew/dialogs/dialog_pcb_text_properties_base.h b/pcbnew/dialogs/dialog_pcb_text_properties_base.h index e5062b8b94..c049515d48 100644 --- a/pcbnew/dialogs/dialog_pcb_text_properties_base.h +++ b/pcbnew/dialogs/dialog_pcb_text_properties_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 11 2012) +// C++ code generated with wxFormBuilder (version Oct 8 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -11,6 +11,9 @@ #include #include #include +class DIALOG_SHIM; +class PCB_LAYER_BOX_SELECTOR; + #include "dialog_shim.h" #include #include @@ -19,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -43,7 +47,7 @@ class DIALOG_PCB_TEXT_PROPERTIES_BASE : public DIALOG_SHIM wxStaticText* m_staticText10; wxTextCtrl* m_SizeXCtrl; wxTextCtrl* m_PositionXCtrl; - wxChoice* m_LayerSelectionCtrl; + PCB_LAYER_BOX_SELECTOR* m_LayerSelectionCtrl; wxChoice* m_DisplayCtrl; wxStaticText* m_SizeYLabel; wxStaticText* m_PositionYLabel; @@ -69,7 +73,7 @@ class DIALOG_PCB_TEXT_PROPERTIES_BASE : public DIALOG_SHIM public: - DIALOG_PCB_TEXT_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Text Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 433,450 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSYSTEM_MENU ); + DIALOG_PCB_TEXT_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Text Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 483,450 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSYSTEM_MENU ); ~DIALOG_PCB_TEXT_PROPERTIES_BASE(); };