diff --git a/common/base_struct.cpp b/common/base_struct.cpp index 3be126e74a..06639105e8 100644 --- a/common/base_struct.cpp +++ b/common/base_struct.cpp @@ -230,7 +230,7 @@ EDA_TEXT::~EDA_TEXT() int EDA_TEXT::LenSize( const wxString& aLine ) const { - return ReturnGraphicTextWidth( aLine, m_Size.x, m_Italic, m_Bold ) + m_Thickness; + return ReturnGraphicTextWidth( aLine, m_Size.x, m_Italic, m_Bold ); } @@ -286,7 +286,6 @@ EDA_RECT EDA_TEXT::GetTextBox( int aLine, int aThickness, bool aInvertY ) const delete list; rect.SetSize( textsize ); - rect.Inflate( thickness / 2 ); // ensure a small margin /* Now, calculate the rect origin, according to text justification * At this point the rectangle origin is the text origin (m_Pos). @@ -297,6 +296,8 @@ EDA_RECT EDA_TEXT::GetTextBox( int aLine, int aThickness, bool aInvertY ) const switch( m_HJustify ) { case GR_TEXT_HJUSTIFY_LEFT: + if( m_Mirror ) + rect.SetX( rect.GetX() - rect.GetWidth() ); break; case GR_TEXT_HJUSTIFY_CENTER: @@ -304,7 +305,8 @@ EDA_RECT EDA_TEXT::GetTextBox( int aLine, int aThickness, bool aInvertY ) const break; case GR_TEXT_HJUSTIFY_RIGHT: - rect.SetX( rect.GetX() - rect.GetWidth() ); + if( !m_Mirror ) + rect.SetX( rect.GetX() - rect.GetWidth() ); break; } @@ -324,6 +326,7 @@ EDA_RECT EDA_TEXT::GetTextBox( int aLine, int aThickness, bool aInvertY ) const break; } + rect.Inflate( thickness / 2 ); rect.Normalize(); // Make h and v sizes always >= 0 return rect; @@ -378,7 +381,7 @@ void EDA_TEXT::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wxPoint& aOffset, aColor, aDrawMode, aFillMode, - aAnchor_color, + i ? UNSPECIFIED_COLOR : aAnchor_color, txt, pos ); pos += offset; diff --git a/include/base_struct.h b/include/base_struct.h index d2c6ef5162..22f9851ff5 100644 --- a/include/base_struct.h +++ b/include/base_struct.h @@ -845,6 +845,11 @@ public: void SetText( const wxString& aText ) { m_Text = aText; } wxString GetText() const { return m_Text; } + + GRTextHorizJustifyType GetHorizJustify() const { return m_HJustify; }; + GRTextVertJustifyType GetVertJustify() const { return m_VJustify; }; + void SetHorizJustify( GRTextHorizJustifyType aType ) { m_HJustify = aType; }; + void SetVertJustify( GRTextVertJustifyType aType ) { m_VJustify = aType; }; }; #endif /* BASE_STRUCT_H */ diff --git a/pcbnew/class_pcb_text.cpp b/pcbnew/class_pcb_text.cpp index 7c2ca00a5f..535ce820eb 100644 --- a/pcbnew/class_pcb_text.cpp +++ b/pcbnew/class_pcb_text.cpp @@ -16,7 +16,7 @@ #include "trigo.h" #include "protos.h" #include "richio.h" - +#include "class_drawpanel.h" /*******************/ /* class TEXTE_PCB */ @@ -119,8 +119,9 @@ int TEXTE_PCB::ReadTextePcbDescr( LINE_READER* aReader ) { style[0] = 0; int normal_display = 1; - sscanf( line + 2, " %d %d %lX %s\n", &m_Layer, &normal_display, - &m_TimeStamp, style ); + char hJustify = 'l'; + sscanf( line + 2, " %d %d %lX %s %c\n", &m_Layer, &normal_display, + &m_TimeStamp, style, &hJustify ); m_Mirror = normal_display ? false : true; @@ -133,6 +134,25 @@ int TEXTE_PCB::ReadTextePcbDescr( LINE_READER* aReader ) m_Italic = 1; else m_Italic = 0; + + switch( hJustify ) + { + case 'l': + case 'L': + m_HJustify = GR_TEXT_HJUSTIFY_LEFT; + break; + case 'c': + case 'C': + m_HJustify = GR_TEXT_HJUSTIFY_CENTER; + break; + case 'r': + case 'R': + m_HJustify = GR_TEXT_HJUSTIFY_RIGHT; + break; + default: + m_HJustify = GR_TEXT_HJUSTIFY_CENTER; + break; + } continue; } } @@ -173,9 +193,26 @@ bool TEXTE_PCB::Save( FILE* aFile ) const fprintf( aFile, "Po %d %d %d %d %d %d\n", m_Pos.x, m_Pos.y, m_Size.x, m_Size.y, m_Thickness, m_Orient ); - fprintf( aFile, "De %d %d %lX %s\n", m_Layer, + char hJustify = 'L'; + switch( m_HJustify ) + { + case GR_TEXT_HJUSTIFY_LEFT: + hJustify = 'L'; + break; + case GR_TEXT_HJUSTIFY_CENTER: + hJustify = 'C'; + break; + case GR_TEXT_HJUSTIFY_RIGHT: + hJustify = 'R'; + break; + default: + hJustify = 'C'; + break; + } + + fprintf( aFile, "De %d %d %lX %s %c\n", m_Layer, m_Mirror ? 0 : 1, - m_TimeStamp, style ); + m_TimeStamp, style, hJustify ); if( fprintf( aFile, "$EndTEXTPCB\n" ) != sizeof("$EndTEXTPCB\n") - 1 ) return false; @@ -193,23 +230,23 @@ bool TEXTE_PCB::Save( FILE* aFile ) const void TEXTE_PCB::Draw( EDA_DRAW_PANEL* panel, wxDC* DC, int DrawMode, const wxPoint& offset ) { - BOARD * brd = GetBoard( ); + BOARD* brd = GetBoard(); if( brd->IsLayerVisible( m_Layer ) == false ) return; - int color = brd->GetLayerColor(m_Layer); + int color = brd->GetLayerColor( m_Layer ); GRTraceMode fillmode = FILLED; - if ( DisplayOpt.DisplayDrawItems == SKETCH) + if( DisplayOpt.DisplayDrawItems == SKETCH ) fillmode = SKETCH; int anchor_color = UNSPECIFIED_COLOR; if( brd->IsElementVisible( ANCHOR_VISIBLE ) ) - anchor_color = brd->GetVisibleElementColor(ANCHOR_VISIBLE); + anchor_color = brd->GetVisibleElementColor( ANCHOR_VISIBLE ); EDA_TEXT::Draw( panel, DC, offset, (EDA_Colors) color, - DrawMode, fillmode, (EDA_Colors) anchor_color ); + DrawMode, fillmode, (EDA_Colors) anchor_color ); } @@ -245,16 +282,16 @@ void TEXTE_PCB::DisplayInfo( EDA_DRAW_FRAME* frame ) frame->AppendMsgPanel( _( "Mirror" ), _( "Yes" ), DARKGREEN ); msg.Printf( wxT( "%.1f" ), (float) m_Orient / 10 ); - frame->AppendMsgPanel( _( "Orient" ), msg, DARKGREEN ); + frame->AppendMsgPanel( _( "Orientation" ), msg, DARKGREEN ); valeur_param( m_Thickness, msg ); frame->AppendMsgPanel( _( "Thickness" ), msg, MAGENTA ); valeur_param( m_Size.x, msg ); - frame->AppendMsgPanel( _( "H Size" ), msg, RED ); + frame->AppendMsgPanel( _( "Size X" ), msg, RED ); valeur_param( m_Size.y, msg ); - frame->AppendMsgPanel( _( "V Size" ), msg, RED ); + frame->AppendMsgPanel( _( "Size Y" ), msg, RED ); } diff --git a/pcbnew/dialogs/dialog_pcb_text_properties.cpp b/pcbnew/dialogs/dialog_pcb_text_properties.cpp index 79b1843702..9101b55456 100644 --- a/pcbnew/dialogs/dialog_pcb_text_properties.cpp +++ b/pcbnew/dialogs/dialog_pcb_text_properties.cpp @@ -58,6 +58,7 @@ DIALOG_PCB_TEXT_PROPERTIES::DIALOG_PCB_TEXT_PROPERTIES( PCB_EDIT_FRAME* parent, Centre(); } + /** * Routine for main window class to launch text properties dialog. */ @@ -70,6 +71,7 @@ void PCB_EDIT_FRAME::InstallTextPCBOptionsFrame( TEXTE_PCB* TextPCB, wxDC* DC ) DrawPanel->m_IgnoreMouseEvents = FALSE; } + void DIALOG_PCB_TEXT_PROPERTIES::MyInit() { SetFocus(); @@ -95,11 +97,18 @@ void DIALOG_PCB_TEXT_PROPERTIES::MyInit() PutValueInLocalUnits( *m_PositionYCtrl, m_SelectedPCBText->m_Pos.y, m_Parent->m_InternalUnits ); + int enabledLayers = m_Parent->GetBoard()->GetEnabledLayers(); for( int layer = 0; layer < NB_LAYERS; ++layer ) { - m_LayerSelectionCtrl->Append( m_Parent->GetBoard()->GetLayerName( layer ) ); + if( enabledLayers & (1 << layer) ) + { + layerList.push_back( layer ); + int itemIndex = + m_LayerSelectionCtrl->Append( m_Parent->GetBoard()->GetLayerName( layer ) ); + if( m_SelectedPCBText->GetLayer() == layer ) + m_LayerSelectionCtrl->SetSelection( itemIndex ); + } } - m_LayerSelectionCtrl->SetSelection( m_SelectedPCBText->GetLayer() ); switch( m_SelectedPCBText->m_Orient ) { @@ -127,16 +136,28 @@ void DIALOG_PCB_TEXT_PROPERTIES::MyInit() else m_StyleCtrl->SetSelection( 0 ); + // Set justification + GRTextHorizJustifyType hJustify = m_SelectedPCBText->GetHorizJustify(); + m_justifyChoice->SetSelection( (int) hJustify + 1 ); + // Set focus on most important control m_TextContentCtrl->SetFocus(); m_TextContentCtrl->SetSelection( -1, -1 ); } + +void DIALOG_PCB_TEXT_PROPERTIES::OnClose( wxCloseEvent& event ) +{ + EndModal( 0 ); +} + + void DIALOG_PCB_TEXT_PROPERTIES::OnCancelClick( wxCommandEvent& event ) { EndModal( wxID_CANCEL ); } + void DIALOG_PCB_TEXT_PROPERTIES::OnOkClick( wxCommandEvent& event ) { wxPoint newPosition; @@ -174,6 +195,7 @@ void DIALOG_PCB_TEXT_PROPERTIES::OnOkClick( wxCommandEvent& event ) // Check constraints and set PCB Text size newSize.x = ReturnValueFromString( g_UserUnit, m_SizeXCtrl->GetValue(), m_Parent->m_InternalUnits ); newSize.y = ReturnValueFromString( g_UserUnit, m_SizeYCtrl->GetValue(), m_Parent->m_InternalUnits ); + if( newSize.x < TEXTS_MIN_SIZE ) newSize.x = TEXTS_MIN_SIZE; if( newSize.y < TEXTS_MIN_SIZE ) @@ -196,7 +218,7 @@ void DIALOG_PCB_TEXT_PROPERTIES::OnOkClick( wxCommandEvent& event ) } // Set the layer on which the PCB text is laying - m_SelectedPCBText->SetLayer( m_LayerSelectionCtrl->GetSelection() ); + m_SelectedPCBText->SetLayer( layerList[m_LayerSelectionCtrl->GetSelection()] ); // Set whether the PCB text is mirrored (faced down from layer face perspective) m_SelectedPCBText->m_Mirror = (m_DisplayCtrl->GetSelection() == 1) ? true : false; @@ -207,6 +229,22 @@ void DIALOG_PCB_TEXT_PROPERTIES::OnOkClick( wxCommandEvent& event ) // Set whether the PCB text is slanted (it is not italics, as italics has additional curves in style) m_SelectedPCBText->m_Italic = m_StyleCtrl->GetSelection() ? 1 : 0; + // Set justification + switch( m_justifyChoice->GetSelection() ) + { + case 0: + m_SelectedPCBText->SetHorizJustify( GR_TEXT_HJUSTIFY_LEFT ); + break; + case 1: + m_SelectedPCBText->SetHorizJustify( GR_TEXT_HJUSTIFY_CENTER ); + break; + case 2: + m_SelectedPCBText->SetHorizJustify( GR_TEXT_HJUSTIFY_RIGHT ); + break; + default: + break; + } + // Finally, display new text if there is a context to do so if( m_DC ) { diff --git a/pcbnew/dialogs/dialog_pcb_text_properties.h b/pcbnew/dialogs/dialog_pcb_text_properties.h index 2e2cf739e3..16593616e5 100644 --- a/pcbnew/dialogs/dialog_pcb_text_properties.h +++ b/pcbnew/dialogs/dialog_pcb_text_properties.h @@ -1,17 +1,11 @@ -#ifndef __dialog_pcb_text_properties__ -#define __dialog_pcb_text_properties__ - -/** -@file -Subclass of DIALOG_PCB_TEXT_PROPERTIES_BASE, which is generated by wxFormBuilder. -*/ +#ifndef DIALOG_PCB_TEXT_PROPERTIES_H +#define DIALOG_PCB_TEXT_PROPERTIES_H +#include +#include #include "dialog_pcb_text_properties_base.h" -//// end generated include - class PCB_EDIT_FRAME; -class wxDC; class TEXTE_PCB; /** Implementing DIALOG_PCB_TEXT_PROPERTIES_BASE */ @@ -21,18 +15,18 @@ private: PCB_EDIT_FRAME* m_Parent; wxDC* m_DC; TEXTE_PCB* m_SelectedPCBText; + std::vector layerList; void MyInit(); protected: // Handlers for DIALOG_PCB_TEXT_PROPERTIES_BASE events. + void OnClose( wxCloseEvent& event ); void OnCancelClick( wxCommandEvent& event ); void OnOkClick( wxCommandEvent& event ); public: DIALOG_PCB_TEXT_PROPERTIES( PCB_EDIT_FRAME* parent, TEXTE_PCB* passedTextPCB, wxDC* DC ); - //// end generated class members - }; -#endif // __dialog_pcb_text_properties__ +#endif // DIALOG_PCB_TEXT_PROPERTIES_H diff --git a/pcbnew/dialogs/dialog_pcb_text_properties_base.cpp b/pcbnew/dialogs/dialog_pcb_text_properties_base.cpp index a5d1c1af37..3eaaa1c47e 100644 --- a/pcbnew/dialogs/dialog_pcb_text_properties_base.cpp +++ b/pcbnew/dialogs/dialog_pcb_text_properties_base.cpp @@ -1,132 +1,171 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Sep 8 2010) -// http://www.wxformbuilder.org/ -// -// PLEASE DO "NOT" EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#include "dialog_pcb_text_properties_base.h" - -/////////////////////////////////////////////////////////////////////////// - -DIALOG_PCB_TEXT_PROPERTIES_BASE::DIALOG_PCB_TEXT_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize ); - - wxBoxSizer* bMainSizer; - bMainSizer = new wxBoxSizer( wxVERTICAL ); - - m_TextLabel = new wxStaticText( this, wxID_ANY, _("Text content:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_TextLabel->Wrap( -1 ); - bMainSizer->Add( m_TextLabel, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_TextContentCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE ); - m_TextContentCtrl->SetToolTip( _("Enter the text placed on selected layer.") ); - m_TextContentCtrl->SetMinSize( wxSize( 400,60 ) ); - - bMainSizer->Add( m_TextContentCtrl, 1, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - - wxBoxSizer* bSizerLower; - bSizerLower = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizerLeft; - bSizerLeft = new wxBoxSizer( wxVERTICAL ); - - m_SizeXLabel = new wxStaticText( this, wxID_ANY, _("Size X"), wxDefaultPosition, wxDefaultSize, 0 ); - m_SizeXLabel->Wrap( -1 ); - bSizerLeft->Add( m_SizeXLabel, 0, wxRIGHT|wxLEFT, 5 ); - - m_SizeXCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - bSizerLeft->Add( m_SizeXCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); - - m_SizeYLabel = new wxStaticText( this, wxID_ANY, _("Size Y"), wxDefaultPosition, wxDefaultSize, 0 ); - m_SizeYLabel->Wrap( -1 ); - bSizerLeft->Add( m_SizeYLabel, 0, wxRIGHT|wxLEFT, 5 ); - - m_SizeYCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - bSizerLeft->Add( m_SizeYCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); - - m_ThicknessLabel = new wxStaticText( this, wxID_ANY, _("Thickness"), wxDefaultPosition, wxDefaultSize, 0 ); - m_ThicknessLabel->Wrap( -1 ); - bSizerLeft->Add( m_ThicknessLabel, 0, wxRIGHT|wxLEFT, 5 ); - - m_ThicknessCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - bSizerLeft->Add( m_ThicknessCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); - - m_PositionXLabel = new wxStaticText( this, wxID_ANY, _("Position X"), wxDefaultPosition, wxDefaultSize, 0 ); - m_PositionXLabel->Wrap( -1 ); - bSizerLeft->Add( m_PositionXLabel, 0, wxRIGHT|wxLEFT, 5 ); - - m_PositionXCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - bSizerLeft->Add( m_PositionXCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - m_PositionYLabel = new wxStaticText( this, wxID_ANY, _("Position Y"), wxDefaultPosition, wxDefaultSize, 0 ); - m_PositionYLabel->Wrap( -1 ); - bSizerLeft->Add( m_PositionYLabel, 0, wxRIGHT|wxLEFT, 5 ); - - m_PositionYCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - bSizerLeft->Add( m_PositionYCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); - - m_LayerLabel = new wxStaticText( this, wxID_ANY, _("Layer:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_LayerLabel->Wrap( -1 ); - bSizerLeft->Add( m_LayerLabel, 0, 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.") ); - - bSizerLeft->Add( m_LayerSelectionCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - bSizerLower->Add( bSizerLeft, 1, 0, 5 ); - - wxBoxSizer* bSizerRight; - bSizerRight = new wxBoxSizer( wxVERTICAL ); - - wxString m_OrientationCtrlChoices[] = { _("0"), _("90"), _("180"), _("-90") }; - int m_OrientationCtrlNChoices = sizeof( m_OrientationCtrlChoices ) / sizeof( wxString ); - m_OrientationCtrl = new wxRadioBox( this, wxID_ANY, _("Orientation"), wxDefaultPosition, wxDefaultSize, m_OrientationCtrlNChoices, m_OrientationCtrlChoices, 2, wxRA_SPECIFY_COLS ); - m_OrientationCtrl->SetSelection( 0 ); - bSizerRight->Add( m_OrientationCtrl, 0, wxALL|wxEXPAND, 3 ); - - wxString m_StyleCtrlChoices[] = { _("Normal"), _("Italic") }; - int m_StyleCtrlNChoices = sizeof( m_StyleCtrlChoices ) / sizeof( wxString ); - m_StyleCtrl = new wxRadioBox( this, wxID_ANY, _("Style"), wxDefaultPosition, wxDefaultSize, m_StyleCtrlNChoices, m_StyleCtrlChoices, 1, wxRA_SPECIFY_COLS ); - m_StyleCtrl->SetSelection( 0 ); - bSizerRight->Add( m_StyleCtrl, 0, wxALL|wxEXPAND, 3 ); - - wxString m_DisplayCtrlChoices[] = { _("Normal"), _("Mirror") }; - int m_DisplayCtrlNChoices = sizeof( m_DisplayCtrlChoices ) / sizeof( wxString ); - m_DisplayCtrl = new wxRadioBox( this, wxID_ANY, _("Display"), wxDefaultPosition, wxDefaultSize, m_DisplayCtrlNChoices, m_DisplayCtrlChoices, 1, wxRA_SPECIFY_COLS ); - m_DisplayCtrl->SetSelection( 0 ); - bSizerRight->Add( m_DisplayCtrl, 0, wxALL|wxEXPAND, 3 ); - - bSizerLower->Add( bSizerRight, 0, 0, 5 ); - - bMainSizer->Add( bSizerLower, 0, wxEXPAND, 5 ); - - m_StandardSizer = new wxStdDialogButtonSizer(); - m_StandardSizerOK = new wxButton( this, wxID_OK ); - m_StandardSizer->AddButton( m_StandardSizerOK ); - m_StandardSizerCancel = new wxButton( this, wxID_CANCEL ); - m_StandardSizer->AddButton( m_StandardSizerCancel ); - m_StandardSizer->Realize(); - bMainSizer->Add( m_StandardSizer, 0, wxALIGN_BOTTOM|wxALIGN_RIGHT|wxALL, 5 ); - - this->SetSizer( bMainSizer ); - this->Layout(); - - this->Centre( wxBOTH ); - - // Connect Events - m_StandardSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCB_TEXT_PROPERTIES_BASE::OnCancelClick ), NULL, this ); - m_StandardSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCB_TEXT_PROPERTIES_BASE::OnOkClick ), NULL, this ); -} - -DIALOG_PCB_TEXT_PROPERTIES_BASE::~DIALOG_PCB_TEXT_PROPERTIES_BASE() -{ - // Disconnect Events - m_StandardSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCB_TEXT_PROPERTIES_BASE::OnCancelClick ), NULL, this ); - m_StandardSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCB_TEXT_PROPERTIES_BASE::OnOkClick ), NULL, this ); - -} +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Nov 18 2010) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "dialog_pcb_text_properties_base.h" + +/////////////////////////////////////////////////////////////////////////// + +DIALOG_PCB_TEXT_PROPERTIES_BASE::DIALOG_PCB_TEXT_PROPERTIES_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize ); + + wxBoxSizer* bMainSizer; + bMainSizer = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer9; + bSizer9 = new wxBoxSizer( wxVERTICAL ); + + m_TextLabel = new wxStaticText( this, wxID_ANY, _("Text:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_TextLabel->Wrap( -1 ); + bSizer9->Add( m_TextLabel, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_TextContentCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE ); + 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 ); + + wxBoxSizer* bSizerLower; + bSizerLower = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizerLeft; + bSizerLeft = new wxBoxSizer( wxVERTICAL ); + + m_SizeXLabel = new wxStaticText( this, wxID_ANY, _("Size X"), wxDefaultPosition, wxDefaultSize, 0 ); + m_SizeXLabel->Wrap( -1 ); + bSizerLeft->Add( m_SizeXLabel, 0, wxLEFT|wxRIGHT|wxTOP, 5 ); + + m_SizeXCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + bSizerLeft->Add( m_SizeXCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); + + m_SizeYLabel = new wxStaticText( this, wxID_ANY, _("Size Y"), wxDefaultPosition, wxDefaultSize, 0 ); + m_SizeYLabel->Wrap( -1 ); + bSizerLeft->Add( m_SizeYLabel, 0, wxLEFT|wxRIGHT|wxTOP, 5 ); + + m_SizeYCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + bSizerLeft->Add( m_SizeYCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); + + m_ThicknessLabel = new wxStaticText( this, wxID_ANY, _("Thickness"), wxDefaultPosition, wxDefaultSize, 0 ); + m_ThicknessLabel->Wrap( -1 ); + bSizerLeft->Add( m_ThicknessLabel, 0, wxLEFT|wxRIGHT|wxTOP, 5 ); + + m_ThicknessCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + bSizerLeft->Add( m_ThicknessCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); + + bSizerLower->Add( bSizerLeft, 1, 0, 5 ); + + wxBoxSizer* bSizerRight; + bSizerRight = new wxBoxSizer( wxVERTICAL ); + + m_PositionXLabel = new wxStaticText( this, wxID_ANY, _("Position X"), wxDefaultPosition, wxDefaultSize, 0 ); + m_PositionXLabel->Wrap( -1 ); + bSizerRight->Add( m_PositionXLabel, 0, wxLEFT|wxRIGHT|wxTOP, 5 ); + + m_PositionXCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + bSizerRight->Add( m_PositionXCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + m_PositionYLabel = new wxStaticText( this, wxID_ANY, _("Position Y"), wxDefaultPosition, wxDefaultSize, 0 ); + m_PositionYLabel->Wrap( -1 ); + bSizerRight->Add( m_PositionYLabel, 0, wxLEFT|wxRIGHT|wxTOP, 5 ); + + m_PositionYCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + bSizerRight->Add( m_PositionYCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); + + m_LayerLabel = new wxStaticText( this, wxID_ANY, _("Layer:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_LayerLabel->Wrap( -1 ); + bSizerRight->Add( m_LayerLabel, 0, wxLEFT|wxRIGHT, 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.") ); + + bSizerRight->Add( m_LayerSelectionCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + bSizerLower->Add( bSizerRight, 1, 0, 5 ); + + wxBoxSizer* bSizer5; + bSizer5 = new wxBoxSizer( wxVERTICAL ); + + m_staticText8 = new wxStaticText( this, wxID_ANY, _("Orientation:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText8->Wrap( -1 ); + bSizer5->Add( m_staticText8, 0, wxLEFT|wxRIGHT, 5 ); + + wxString m_OrientationCtrlChoices[] = { _("0"), _("90"), _("180"), _("-90") }; + int m_OrientationCtrlNChoices = sizeof( m_OrientationCtrlChoices ) / sizeof( wxString ); + m_OrientationCtrl = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_OrientationCtrlNChoices, m_OrientationCtrlChoices, 0 ); + m_OrientationCtrl->SetSelection( 0 ); + bSizer5->Add( m_OrientationCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); + + m_staticText9 = new wxStaticText( this, wxID_ANY, _("Style:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText9->Wrap( -1 ); + bSizer5->Add( m_staticText9, 0, wxLEFT|wxRIGHT, 5 ); + + wxString m_StyleCtrlChoices[] = { _("Normal"), _("Italic") }; + int m_StyleCtrlNChoices = sizeof( m_StyleCtrlChoices ) / sizeof( wxString ); + m_StyleCtrl = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_StyleCtrlNChoices, m_StyleCtrlChoices, 0 ); + m_StyleCtrl->SetSelection( 0 ); + bSizer5->Add( m_StyleCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); + + bSizerLower->Add( bSizer5, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer6; + bSizer6 = new wxBoxSizer( wxVERTICAL ); + + m_staticText10 = new wxStaticText( this, wxID_ANY, _("Display:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText10->Wrap( -1 ); + bSizer6->Add( m_staticText10, 0, wxLEFT|wxRIGHT, 5 ); + + wxString m_DisplayCtrlChoices[] = { _("Normal"), _("Mirrored") }; + int m_DisplayCtrlNChoices = sizeof( m_DisplayCtrlChoices ) / sizeof( wxString ); + m_DisplayCtrl = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_DisplayCtrlNChoices, m_DisplayCtrlChoices, 0 ); + m_DisplayCtrl->SetSelection( 0 ); + bSizer6->Add( m_DisplayCtrl, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); + + m_staticText11 = new wxStaticText( this, wxID_ANY, _("Justification:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText11->Wrap( -1 ); + bSizer6->Add( m_staticText11, 0, wxLEFT|wxRIGHT, 5 ); + + wxString m_justifyChoiceChoices[] = { _("Left"), _("Center"), _("Right") }; + int m_justifyChoiceNChoices = sizeof( m_justifyChoiceChoices ) / sizeof( wxString ); + m_justifyChoice = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_justifyChoiceNChoices, m_justifyChoiceChoices, 0 ); + m_justifyChoice->SetSelection( 0 ); + bSizer6->Add( m_justifyChoice, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 ); + + bSizerLower->Add( bSizer6, 0, wxEXPAND, 5 ); + + bSizer9->Add( bSizerLower, 0, wxEXPAND, 5 ); + + m_StandardSizer = new wxStdDialogButtonSizer(); + m_StandardSizerOK = new wxButton( this, wxID_OK ); + m_StandardSizer->AddButton( m_StandardSizerOK ); + m_StandardSizerCancel = new wxButton( this, wxID_CANCEL ); + m_StandardSizer->AddButton( m_StandardSizerCancel ); + m_StandardSizer->Realize(); + bSizer9->Add( m_StandardSizer, 0, wxALIGN_BOTTOM|wxALIGN_RIGHT|wxALL, 5 ); + + bMainSizer->Add( bSizer9, 1, wxALL|wxEXPAND, 5 ); + + this->SetSizer( bMainSizer ); + this->Layout(); + + this->Centre( wxBOTH ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PCB_TEXT_PROPERTIES_BASE::OnClose ) ); + m_StandardSizerCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCB_TEXT_PROPERTIES_BASE::OnCancelClick ), NULL, this ); + m_StandardSizerOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCB_TEXT_PROPERTIES_BASE::OnOkClick ), NULL, this ); +} + +DIALOG_PCB_TEXT_PROPERTIES_BASE::~DIALOG_PCB_TEXT_PROPERTIES_BASE() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DIALOG_PCB_TEXT_PROPERTIES_BASE::OnClose ) ); + m_StandardSizerCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCB_TEXT_PROPERTIES_BASE::OnCancelClick ), NULL, this ); + m_StandardSizerOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_PCB_TEXT_PROPERTIES_BASE::OnOkClick ), NULL, this ); + +} diff --git a/pcbnew/dialogs/dialog_pcb_text_properties_base.fbp b/pcbnew/dialogs/dialog_pcb_text_properties_base.fbp index da04760e0f..de59effd18 100644 --- a/pcbnew/dialogs/dialog_pcb_text_properties_base.fbp +++ b/pcbnew/dialogs/dialog_pcb_text_properties_base.fbp @@ -1,1134 +1,2083 @@ - - - - - - C++ - 1 - source_name - 0 - UTF-8 - connect - dialog_pcb_text_properties_base - 1000 - none - 1 - DIALOG_PCB_TEXT_PROPERTIES_BASE - - . - - 1 - 1 - 0 - 0 - - - wxBOTH - - 1 - 1 - impl_virtual - - - - 0 - wxID_ANY - - -1,-1 - DIALOG_PCB_TEXT_PROPERTIES_BASE - - 433,465 - wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSYSTEM_MENU - - Text item properties - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bMainSizer - wxVERTICAL - none - - 5 - wxTOP|wxRIGHT|wxLEFT - 0 - - - - 0 - 1 - - - 0 - wxID_ANY - Text content: - - - m_TextLabel - protected - - - - - - - wxFILTER_NONE - wxDefaultValidator - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND - 1 - - - - 1 - 1 - - - 0 - wxID_ANY - - 0 - 400,60 - m_TextContentCtrl - protected - - - wxTE_MULTILINE - - Enter the text placed on selected layer. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND - 0 - - - bSizerLower - wxHORIZONTAL - none - - 5 - - 1 - - - bSizerLeft - wxVERTICAL - none - - 5 - wxRIGHT|wxLEFT - 0 - - - - 0 - 1 - - - 0 - wxID_ANY - Size X - - - m_SizeXLabel - protected - - - - - - - wxFILTER_NONE - wxDefaultValidator - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT - 0 - - - - 1 - 1 - - - 0 - wxID_ANY - - 0 - - m_SizeXCtrl - protected - - - - - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxRIGHT|wxLEFT - 0 - - - - 0 - 1 - - - 0 - wxID_ANY - Size Y - - - m_SizeYLabel - protected - - - - - - - wxFILTER_NONE - wxDefaultValidator - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT - 0 - - - - 1 - 1 - - - 0 - wxID_ANY - - 0 - - m_SizeYCtrl - protected - - - - - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxRIGHT|wxLEFT - 0 - - - - 0 - 1 - - - 0 - wxID_ANY - Thickness - - - m_ThicknessLabel - protected - - - - - - - wxFILTER_NONE - wxDefaultValidator - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT - 0 - - - - 1 - 1 - - - 0 - wxID_ANY - - 0 - - m_ThicknessCtrl - protected - - - - - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxRIGHT|wxLEFT - 0 - - - - 0 - 1 - - - 0 - wxID_ANY - Position X - - - m_PositionXLabel - protected - - - - - - - wxFILTER_NONE - wxDefaultValidator - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT - 0 - - - - 1 - 1 - - - 0 - wxID_ANY - - 0 - - m_PositionXCtrl - protected - - - - - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxRIGHT|wxLEFT - 0 - - - - 0 - 1 - - - 0 - wxID_ANY - Position Y - - - m_PositionYLabel - protected - - - - - - - wxFILTER_NONE - wxDefaultValidator - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT - 0 - - - - 1 - 1 - - - 0 - wxID_ANY - - 0 - - m_PositionYCtrl - protected - - - - - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxRIGHT|wxLEFT - 0 - - - - 0 - 1 - - - 0 - wxID_ANY - Layer: - - - m_LayerLabel - protected - - - - - - - wxFILTER_NONE - wxDefaultValidator - - - - - -1 - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT - 0 - - - - - 1 - 1 - - - 0 - wxID_ANY - - - m_LayerSelectionCtrl - protected - - 0 - - - Select the layer on which text should lay. - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - 0 - - - bSizerRight - wxVERTICAL - none - - 3 - wxALL|wxEXPAND - 0 - - - "0" "90" "180" "-90" - - 1 - 1 - - - 0 - wxID_ANY - Orientation - 2 - - - m_OrientationCtrl - protected - - 0 - - wxRA_SPECIFY_COLS - - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALL|wxEXPAND - 0 - - - "Normal" "Italic" - - 1 - 1 - - - 0 - wxID_ANY - Style - 1 - - - m_StyleCtrl - protected - - 0 - - wxRA_SPECIFY_COLS - - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 3 - wxALL|wxEXPAND - 0 - - - "Normal" "Mirror" - - 1 - 1 - - - 0 - wxID_ANY - Display - 1 - - - m_DisplayCtrl - protected - - 0 - - wxRA_SPECIFY_COLS - - - - wxFILTER_NONE - wxDefaultValidator - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - wxALIGN_BOTTOM|wxALIGN_RIGHT|wxALL - 0 - - 0 - 1 - 0 - 0 - 0 - 1 - 0 - 0 - - m_StandardSizer - protected - - OnCancelClick - - - - OnOkClick - - - - - - - - + + + + + + C++ + 1 + source_name + 0 + UTF-8 + connect + dialog_pcb_text_properties_base + 1000 + none + 1 + DIALOG_PCB_TEXT_PROPERTIES_BASE + + . + + 1 + 1 + 0 + 0 + + 1 + 1 + 1 + 1 + 0 + + + + 1 + wxBOTH + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + impl_virtual + + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + -1,-1 + 1 + DIALOG_PCB_TEXT_PROPERTIES_BASE + 1 + + + 1 + + + Resizable + + 1 + 433,465 + wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSYSTEM_MENU + + Text Item Properties + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + OnClose + + + + + + + + + + + + + + + + + + + + + + + + + + + + + bMainSizer + wxVERTICAL + none + + 5 + wxALL|wxEXPAND + 1 + + + bSizer9 + wxVERTICAL + none + + 5 + wxTOP|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 + + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Text: + + 0 + + 0 + + 1 + m_TextLabel + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND + 1 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + 0 + 400,60 + 1 + m_TextContentCtrl + 1 + + + protected + 1 + + + Resizable + + 1 + + wxTE_MULTILINE + + 0 + Enter the text placed on selected layer. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 0 + + + bSizerLower + wxHORIZONTAL + none + + 5 + + 1 + + + bSizerLeft + wxVERTICAL + none + + 5 + wxLEFT|wxRIGHT|wxTOP + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 + + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Size X + + 0 + + 0 + + 1 + m_SizeXLabel + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + 0 + + 1 + m_SizeXCtrl + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxLEFT|wxRIGHT|wxTOP + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 + + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Size Y + + 0 + + 0 + + 1 + m_SizeYLabel + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + 0 + + 1 + m_SizeYCtrl + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxLEFT|wxRIGHT|wxTOP + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 + + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Thickness + + 0 + + 0 + + 1 + m_ThicknessLabel + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + 0 + + 1 + m_ThicknessCtrl + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + + 1 + + + bSizerRight + wxVERTICAL + none + + 5 + wxLEFT|wxRIGHT|wxTOP + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 + + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Position X + + 0 + + 0 + + 1 + m_PositionXLabel + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + 0 + + 1 + m_PositionXCtrl + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxLEFT|wxRIGHT|wxTOP + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 + + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Position Y + + 0 + + 0 + + 1 + m_PositionYLabel + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + 0 + + 1 + m_PositionYCtrl + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 + + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Layer: + + 0 + + 0 + + 1 + m_LayerLabel + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 1 + m_LayerSelectionCtrl + 1 + + + protected + 1 + + + Resizable + + 0 + 1 + + + 0 + Select the layer on which text should lay. + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 0 + + + bSizer5 + wxVERTICAL + none + + 5 + wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Orientation: + + 0 + + 0 + + 1 + m_staticText8 + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + "0" "90" "180" "-90" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 1 + m_OrientationCtrl + 1 + + + protected + 1 + + + Resizable + + 0 + 1 + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Style: + + 0 + + 0 + + 1 + m_staticText9 + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + "Normal" "Italic" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 1 + m_StyleCtrl + 1 + + + protected + 1 + + + Resizable + + 0 + 1 + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxEXPAND + 0 + + + bSizer6 + wxVERTICAL + none + + 5 + wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Display: + + 0 + + 0 + + 1 + m_staticText10 + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + "Normal" "Mirrored" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 1 + m_DisplayCtrl + 1 + + + protected + 1 + + + Resizable + + 0 + 1 + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Justification: + + 0 + + 0 + + 1 + m_staticText11 + 1 + + + protected + 1 + + + Resizable + + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT + 0 + + 1 + 1 + 1 + 1 + + + + 1 + 0 + "Left" "Center" "Right" + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + 0 + + 1 + m_justifyChoice + 1 + + + protected + 1 + + + Resizable + + 0 + 1 + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + wxALIGN_BOTTOM|wxALIGN_RIGHT|wxALL + 0 + + 0 + 1 + 0 + 0 + 0 + 1 + 0 + 0 + + m_StandardSizer + protected + + OnCancelClick + + + + OnOkClick + + + + + + + + + + diff --git a/pcbnew/dialogs/dialog_pcb_text_properties_base.h b/pcbnew/dialogs/dialog_pcb_text_properties_base.h index 4a9840a6dc..b4e937aa99 100644 --- a/pcbnew/dialogs/dialog_pcb_text_properties_base.h +++ b/pcbnew/dialogs/dialog_pcb_text_properties_base.h @@ -1,70 +1,75 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Sep 8 2010) -// http://www.wxformbuilder.org/ -// -// PLEASE DO "NOT" EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#ifndef __dialog_pcb_text_properties_base__ -#define __dialog_pcb_text_properties_base__ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////// - - -/////////////////////////////////////////////////////////////////////////////// -/// Class DIALOG_PCB_TEXT_PROPERTIES_BASE -/////////////////////////////////////////////////////////////////////////////// -class DIALOG_PCB_TEXT_PROPERTIES_BASE : public wxDialog -{ - private: - - protected: - wxStaticText* m_TextLabel; - wxTextCtrl* m_TextContentCtrl; - wxStaticText* m_SizeXLabel; - wxTextCtrl* m_SizeXCtrl; - wxStaticText* m_SizeYLabel; - wxTextCtrl* m_SizeYCtrl; - wxStaticText* m_ThicknessLabel; - wxTextCtrl* m_ThicknessCtrl; - wxStaticText* m_PositionXLabel; - wxTextCtrl* m_PositionXCtrl; - wxStaticText* m_PositionYLabel; - wxTextCtrl* m_PositionYCtrl; - wxStaticText* m_LayerLabel; - wxChoice* m_LayerSelectionCtrl; - wxRadioBox* m_OrientationCtrl; - wxRadioBox* m_StyleCtrl; - wxRadioBox* m_DisplayCtrl; - wxStdDialogButtonSizer* m_StandardSizer; - wxButton* m_StandardSizerOK; - wxButton* m_StandardSizerCancel; - - // Virtual event handlers, overide them in your derived class - virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } - virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } - - - public: - - DIALOG_PCB_TEXT_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Text item properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 433,465 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSYSTEM_MENU ); - ~DIALOG_PCB_TEXT_PROPERTIES_BASE(); - -}; - -#endif //__dialog_pcb_text_properties_base__ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Nov 18 2010) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __dialog_pcb_text_properties_base__ +#define __dialog_pcb_text_properties_base__ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////////////////////////////// +/// Class DIALOG_PCB_TEXT_PROPERTIES_BASE +/////////////////////////////////////////////////////////////////////////////// +class DIALOG_PCB_TEXT_PROPERTIES_BASE : public wxDialog +{ + private: + + protected: + wxStaticText* m_TextLabel; + wxTextCtrl* m_TextContentCtrl; + wxStaticText* m_SizeXLabel; + wxTextCtrl* m_SizeXCtrl; + wxStaticText* m_SizeYLabel; + wxTextCtrl* m_SizeYCtrl; + wxStaticText* m_ThicknessLabel; + wxTextCtrl* m_ThicknessCtrl; + wxStaticText* m_PositionXLabel; + wxTextCtrl* m_PositionXCtrl; + wxStaticText* m_PositionYLabel; + wxTextCtrl* m_PositionYCtrl; + wxStaticText* m_LayerLabel; + wxChoice* m_LayerSelectionCtrl; + wxStaticText* m_staticText8; + wxChoice* m_OrientationCtrl; + wxStaticText* m_staticText9; + wxChoice* m_StyleCtrl; + wxStaticText* m_staticText10; + wxChoice* m_DisplayCtrl; + wxStaticText* m_staticText11; + wxChoice* m_justifyChoice; + wxStdDialogButtonSizer* m_StandardSizer; + wxButton* m_StandardSizerOK; + wxButton* m_StandardSizerCancel; + + // Virtual event handlers, overide them in your derived class + virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } + virtual void OnCancelClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnOkClick( wxCommandEvent& event ) { event.Skip(); } + + + public: + + DIALOG_PCB_TEXT_PROPERTIES_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Text Item Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 433,465 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSYSTEM_MENU ); + ~DIALOG_PCB_TEXT_PROPERTIES_BASE(); + +}; + +#endif //__dialog_pcb_text_properties_base__ diff --git a/pcbnew/edit.cpp b/pcbnew/edit.cpp index 3a116b45db..600f898d2c 100644 --- a/pcbnew/edit.cpp +++ b/pcbnew/edit.cpp @@ -1005,8 +1005,6 @@ static void Process_Move_Item( PCB_EDIT_FRAME* frame, EDA_ITEM* DrawStruct, wxDC if( DrawStruct == NULL ) return; - frame->DrawPanel->MoveCursorToCrossHair(); - switch( DrawStruct->Type() ) { case TYPE_TEXTE: diff --git a/pcbnew/edit_pcb_text.cpp b/pcbnew/edit_pcb_text.cpp index 192a82e35c..27928c1793 100644 --- a/pcbnew/edit_pcb_text.cpp +++ b/pcbnew/edit_pcb_text.cpp @@ -106,6 +106,10 @@ void PCB_EDIT_FRAME::StartMoveTextePcb( TEXTE_PCB* TextePcb, wxDC* DC ) TextePcb->Draw( DrawPanel, DC, GR_XOR ); TextePcb->m_Flags |= IS_MOVED; TextePcb->DisplayInfo( this ); + + GetScreen()->SetCrossHairPosition( TextePcb->GetPosition() ); + DrawPanel->MoveCursorToCrossHair(); + DrawPanel->SetMouseCapture( Move_Texte_Pcb, Abort_Edit_Pcb_Text ); SetCurItem( TextePcb ); DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, FALSE ); diff --git a/pcbnew/edtxtmod.cpp b/pcbnew/edtxtmod.cpp index 1a2d1170fa..8093f4a5ca 100644 --- a/pcbnew/edtxtmod.cpp +++ b/pcbnew/edtxtmod.cpp @@ -174,15 +174,12 @@ void PCB_BASE_FRAME::StartMoveTexteModule( TEXTE_MODULE* Text, wxDC* DC ) MoveVector.x = MoveVector.y = 0; - DrawPanel->CrossHairOff( DC ); - TextInitialPosition = Text->m_Pos; TextInitialOrientation = Text->m_Orient; // Center cursor on initial position of text GetScreen()->SetCrossHairPosition( TextInitialPosition ); DrawPanel->MoveCursorToCrossHair(); - DrawPanel->CrossHairOn( DC ); Text->DisplayInfo( this );