Commit 096f4a10 authored by Marco Mattila's avatar Marco Mattila

Add rotation field to pcbnew text item property dialog.

parent 1da099dd
...@@ -135,27 +135,9 @@ void DIALOG_PCB_TEXT_PROPERTIES::MyInit() ...@@ -135,27 +135,9 @@ void DIALOG_PCB_TEXT_PROPERTIES::MyInit()
} }
} }
switch( (int) m_SelectedPCBText->GetOrientation() ) wxString orientationStr;
{ orientationStr << m_SelectedPCBText->GetOrientation();
default: m_OrientationCtrl->SetValue( orientationStr );
m_OrientationCtrl->SetSelection( 0 );
break;
case 900:
case -2700:
m_OrientationCtrl->SetSelection( 1 );
break;
case 1800:
case -1800:
m_OrientationCtrl->SetSelection( 2 );
break;
case 2700:
case -900:
m_OrientationCtrl->SetSelection( 3 );
break;
}
if( m_SelectedPCBText->m_Mirror ) if( m_SelectedPCBText->m_Mirror )
m_DisplayCtrl->SetSelection( 1 ); m_DisplayCtrl->SetSelection( 1 );
...@@ -263,7 +245,10 @@ void DIALOG_PCB_TEXT_PROPERTIES::OnOkClick( wxCommandEvent& event ) ...@@ -263,7 +245,10 @@ void DIALOG_PCB_TEXT_PROPERTIES::OnOkClick( wxCommandEvent& event )
m_SelectedPCBText->m_Mirror = (m_DisplayCtrl->GetSelection() == 1) ? true : false; m_SelectedPCBText->m_Mirror = (m_DisplayCtrl->GetSelection() == 1) ? true : false;
// Set the text orientation // Set the text orientation
m_SelectedPCBText->m_Orient = m_OrientationCtrl->GetSelection() * 900; long orientation;
m_OrientationCtrl->GetValue().ToLong( &orientation );
orientation = orientation % 3600;
m_SelectedPCBText->SetOrientation( orientation );
// Set whether the PCB text is slanted (it is not italics, as italics has additional curves in style) // 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; m_SelectedPCBText->m_Italic = m_StyleCtrl->GetSelection() ? 1 : 0;
......
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Mar 19 2012) // C++ code generated with wxFormBuilder (version Apr 11 2012)
// http://www.wxformbuilder.org/ // http://www.wxformbuilder.org/
// //
// PLEASE DO "NOT" EDIT THIS FILE! // PLEASE DO "NOT" EDIT THIS FILE!
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
#include <wx/colour.h> #include <wx/colour.h>
#include <wx/settings.h> #include <wx/settings.h>
#include <wx/textctrl.h> #include <wx/textctrl.h>
#include <wx/sizer.h>
#include <wx/choice.h> #include <wx/choice.h>
#include <wx/sizer.h>
#include <wx/button.h> #include <wx/button.h>
#include <wx/dialog.h> #include <wx/dialog.h>
...@@ -38,25 +38,25 @@ class DIALOG_PCB_TEXT_PROPERTIES_BASE : public DIALOG_SHIM ...@@ -38,25 +38,25 @@ class DIALOG_PCB_TEXT_PROPERTIES_BASE : public DIALOG_SHIM
wxStaticText* m_TextLabel; wxStaticText* m_TextLabel;
wxTextCtrl* m_TextContentCtrl; wxTextCtrl* m_TextContentCtrl;
wxStaticText* m_SizeXLabel; wxStaticText* m_SizeXLabel;
wxTextCtrl* m_SizeXCtrl;
wxStaticText* m_SizeYLabel;
wxTextCtrl* m_SizeYCtrl;
wxStaticText* m_ThicknessLabel;
wxTextCtrl* m_ThicknessCtrl;
wxStaticText* m_PositionXLabel; wxStaticText* m_PositionXLabel;
wxTextCtrl* m_PositionXCtrl;
wxStaticText* m_PositionYLabel;
wxTextCtrl* m_PositionYCtrl;
wxStaticText* m_LayerLabel; wxStaticText* m_LayerLabel;
wxChoice* m_LayerSelectionCtrl;
wxStaticText* m_staticText8;
wxChoice* m_OrientationCtrl;
wxStaticText* m_staticText9;
wxChoice* m_StyleCtrl;
wxStaticText* m_staticText10; wxStaticText* m_staticText10;
wxTextCtrl* m_SizeXCtrl;
wxTextCtrl* m_PositionXCtrl;
wxChoice* m_LayerSelectionCtrl;
wxChoice* m_DisplayCtrl; wxChoice* m_DisplayCtrl;
wxStaticText* m_SizeYLabel;
wxStaticText* m_PositionYLabel;
wxStaticText* m_staticText9;
wxStaticText* m_staticText11; wxStaticText* m_staticText11;
wxTextCtrl* m_SizeYCtrl;
wxTextCtrl* m_PositionYCtrl;
wxChoice* m_StyleCtrl;
wxChoice* m_justifyChoice; wxChoice* m_justifyChoice;
wxStaticText* m_ThicknessLabel;
wxStaticText* m_orientationLabel;
wxTextCtrl* m_ThicknessCtrl;
wxTextCtrl* m_OrientationCtrl;
wxStdDialogButtonSizer* m_StandardSizer; wxStdDialogButtonSizer* m_StandardSizer;
wxButton* m_StandardSizerOK; wxButton* m_StandardSizerOK;
wxButton* m_StandardSizerCancel; wxButton* m_StandardSizerCancel;
...@@ -69,7 +69,7 @@ class DIALOG_PCB_TEXT_PROPERTIES_BASE : public DIALOG_SHIM ...@@ -69,7 +69,7 @@ class DIALOG_PCB_TEXT_PROPERTIES_BASE : public DIALOG_SHIM
public: 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,465 ), 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( 433,450 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER|wxSYSTEM_MENU );
~DIALOG_PCB_TEXT_PROPERTIES_BASE(); ~DIALOG_PCB_TEXT_PROPERTIES_BASE();
}; };
......
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