Loading eeschema/class_text-label.cpp +19 −6 Original line number Original line Diff line number Diff line Loading @@ -84,6 +84,7 @@ SCH_TEXT::SCH_TEXT( const wxPoint& pos, const wxString& text, KICAD_T aType ) : m_Pos = pos; m_Pos = pos; m_Shape = 0; m_Shape = 0; m_IsDangling = FALSE; m_IsDangling = FALSE; m_MultilineAllowed=true; } } Loading Loading @@ -243,7 +244,6 @@ void SCH_TEXT::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& aOffset, DrawDanglingSymbol( panel, DC, m_Pos + aOffset, color ); DrawDanglingSymbol( panel, DC, m_Pos + aOffset, color ); } } /** /** * Function Save * Function Save * writes the data structures for this object out to a FILE in "*.brd" format. * writes the data structures for this object out to a FILE in "*.brd" format. Loading @@ -257,11 +257,24 @@ bool SCH_TEXT::Save( FILE* aFile ) const if( m_Italic ) if( m_Italic ) shape = "Italic"; shape = "Italic"; wxString text=m_Text; for (;;) { int i=text.find('\n'); if (i==wxNOT_FOUND) break; text.erase(i,1); text.insert(i,_("\\n")); } if( fprintf( aFile, "Text Notes %-4d %-4d %-4d %-4d %s %d\n%s\n", if( fprintf( aFile, "Text Notes %-4d %-4d %-4d %-4d %s %d\n%s\n", m_Pos.x, m_Pos.y, m_Pos.x, m_Pos.y, m_Orient, m_Size.x, m_Orient, m_Size.x, shape, m_Width, shape, m_Width, CONV_TO_UTF8( m_Text ) ) == EOF ) CONV_TO_UTF8( text ) ) == EOF ) { { success = false; success = false; } } Loading eeschema/class_text-label.h +5 −2 Original line number Original line Diff line number Diff line Loading @@ -22,15 +22,16 @@ typedef enum { extern const char* SheetLabelType[]; extern const char* SheetLabelType[]; extern int* TemplateShape[5][4]; extern int* TemplateShape[5][4]; class SCH_TEXT : public SCH_ITEM class SCH_TEXT : public SCH_ITEM , public EDA_TextStruct , public EDA_TextStruct { { public: public: int m_Layer; int m_Layer; int m_Shape; int m_Shape; bool m_IsDangling; // TRUE if not connected bool m_IsDangling; // TRUE if not connected public: public: SCH_TEXT( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString, SCH_TEXT( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString, KICAD_T aType = TYPE_SCH_TEXT ); KICAD_T aType = TYPE_SCH_TEXT ); Loading Loading @@ -71,6 +72,8 @@ public: #endif #endif }; }; Loading eeschema/dialog_edit_label.cpp +18 −3 Original line number Original line Diff line number Diff line Loading @@ -21,7 +21,22 @@ int DialogLabelEditor::ShowModally( WinEDA_SchematicFrame* parent, SCH_TEXT * CurrentText ) int DialogLabelEditor::ShowModally( WinEDA_SchematicFrame* parent, SCH_TEXT * CurrentText ) { { int ret; int ret; DialogLabelEditor* dialog = new DialogLabelEditor( parent, CurrentText ); bool multiline; switch( CurrentText->Type() ) { case TYPE_SCH_GLOBALLABEL: case TYPE_SCH_HIERLABEL: case TYPE_SCH_LABEL: multiline = false; break; default: multiline = true; break; } DialogLabelEditor* dialog = new DialogLabelEditor( parent, CurrentText, multiline ); // doing any post construction resizing is better done here than in // doing any post construction resizing is better done here than in // OnInitDialog() since it tends to flash/redraw the dialog less. // OnInitDialog() since it tends to flash/redraw the dialog less. Loading @@ -34,8 +49,8 @@ int DialogLabelEditor::ShowModally( WinEDA_SchematicFrame* parent, SCH_TEXT * C DialogLabelEditor::DialogLabelEditor( WinEDA_SchematicFrame* parent, SCH_TEXT* CurrentText ) : DialogLabelEditor::DialogLabelEditor( WinEDA_SchematicFrame* parent, SCH_TEXT* CurrentText,bool multiline ) : DialogLabelEditor_Base( parent ) DialogLabelEditor_Base( parent,wxID_ANY,multiline ) { { m_Parent = parent; m_Parent = parent; m_CurrentText = CurrentText; m_CurrentText = CurrentText; Loading eeschema/dialog_edit_label.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -18,7 +18,7 @@ private: protected: protected: // these are protected so that the static ShowModally() gets used. // these are protected so that the static ShowModally() gets used. DialogLabelEditor( WinEDA_SchematicFrame* parent, SCH_TEXT * CurrentText); DialogLabelEditor( WinEDA_SchematicFrame* parent, SCH_TEXT * CurrentText, bool multiline); ~DialogLabelEditor(){}; ~DialogLabelEditor(){}; Loading eeschema/dialog_edit_label_base.cpp +5 −2 Original line number Original line Diff line number Diff line Loading @@ -9,7 +9,7 @@ /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// DialogLabelEditor_Base::DialogLabelEditor_Base( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) DialogLabelEditor_Base::DialogLabelEditor_Base( wxWindow* parent, wxWindowID id, bool multiline,const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) { { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); this->SetSizeHints( wxDefaultSize, wxDefaultSize ); Loading @@ -22,6 +22,9 @@ DialogLabelEditor_Base::DialogLabelEditor_Base( wxWindow* parent, wxWindowID id, m_staticText1->Wrap( -1 ); m_staticText1->Wrap( -1 ); bSizerTextCtrl->Add( m_staticText1, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); bSizerTextCtrl->Add( m_staticText1, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); if (multiline) m_TextLabel = new wxTextCtrl( this, wxID_VALUE, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER | wxTE_MULTILINE ); else m_TextLabel = new wxTextCtrl( this, wxID_VALUE, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER ); m_TextLabel = new wxTextCtrl( this, wxID_VALUE, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER ); m_TextLabel->SetToolTip( _("Enter the text to be used within the schematic") ); m_TextLabel->SetToolTip( _("Enter the text to be used within the schematic") ); Loading Loading
eeschema/class_text-label.cpp +19 −6 Original line number Original line Diff line number Diff line Loading @@ -84,6 +84,7 @@ SCH_TEXT::SCH_TEXT( const wxPoint& pos, const wxString& text, KICAD_T aType ) : m_Pos = pos; m_Pos = pos; m_Shape = 0; m_Shape = 0; m_IsDangling = FALSE; m_IsDangling = FALSE; m_MultilineAllowed=true; } } Loading Loading @@ -243,7 +244,6 @@ void SCH_TEXT::Draw( WinEDA_DrawPanel* panel, wxDC* DC, const wxPoint& aOffset, DrawDanglingSymbol( panel, DC, m_Pos + aOffset, color ); DrawDanglingSymbol( panel, DC, m_Pos + aOffset, color ); } } /** /** * Function Save * Function Save * writes the data structures for this object out to a FILE in "*.brd" format. * writes the data structures for this object out to a FILE in "*.brd" format. Loading @@ -257,11 +257,24 @@ bool SCH_TEXT::Save( FILE* aFile ) const if( m_Italic ) if( m_Italic ) shape = "Italic"; shape = "Italic"; wxString text=m_Text; for (;;) { int i=text.find('\n'); if (i==wxNOT_FOUND) break; text.erase(i,1); text.insert(i,_("\\n")); } if( fprintf( aFile, "Text Notes %-4d %-4d %-4d %-4d %s %d\n%s\n", if( fprintf( aFile, "Text Notes %-4d %-4d %-4d %-4d %s %d\n%s\n", m_Pos.x, m_Pos.y, m_Pos.x, m_Pos.y, m_Orient, m_Size.x, m_Orient, m_Size.x, shape, m_Width, shape, m_Width, CONV_TO_UTF8( m_Text ) ) == EOF ) CONV_TO_UTF8( text ) ) == EOF ) { { success = false; success = false; } } Loading
eeschema/class_text-label.h +5 −2 Original line number Original line Diff line number Diff line Loading @@ -22,15 +22,16 @@ typedef enum { extern const char* SheetLabelType[]; extern const char* SheetLabelType[]; extern int* TemplateShape[5][4]; extern int* TemplateShape[5][4]; class SCH_TEXT : public SCH_ITEM class SCH_TEXT : public SCH_ITEM , public EDA_TextStruct , public EDA_TextStruct { { public: public: int m_Layer; int m_Layer; int m_Shape; int m_Shape; bool m_IsDangling; // TRUE if not connected bool m_IsDangling; // TRUE if not connected public: public: SCH_TEXT( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString, SCH_TEXT( const wxPoint& pos = wxPoint( 0, 0 ), const wxString& text = wxEmptyString, KICAD_T aType = TYPE_SCH_TEXT ); KICAD_T aType = TYPE_SCH_TEXT ); Loading Loading @@ -71,6 +72,8 @@ public: #endif #endif }; }; Loading
eeschema/dialog_edit_label.cpp +18 −3 Original line number Original line Diff line number Diff line Loading @@ -21,7 +21,22 @@ int DialogLabelEditor::ShowModally( WinEDA_SchematicFrame* parent, SCH_TEXT * CurrentText ) int DialogLabelEditor::ShowModally( WinEDA_SchematicFrame* parent, SCH_TEXT * CurrentText ) { { int ret; int ret; DialogLabelEditor* dialog = new DialogLabelEditor( parent, CurrentText ); bool multiline; switch( CurrentText->Type() ) { case TYPE_SCH_GLOBALLABEL: case TYPE_SCH_HIERLABEL: case TYPE_SCH_LABEL: multiline = false; break; default: multiline = true; break; } DialogLabelEditor* dialog = new DialogLabelEditor( parent, CurrentText, multiline ); // doing any post construction resizing is better done here than in // doing any post construction resizing is better done here than in // OnInitDialog() since it tends to flash/redraw the dialog less. // OnInitDialog() since it tends to flash/redraw the dialog less. Loading @@ -34,8 +49,8 @@ int DialogLabelEditor::ShowModally( WinEDA_SchematicFrame* parent, SCH_TEXT * C DialogLabelEditor::DialogLabelEditor( WinEDA_SchematicFrame* parent, SCH_TEXT* CurrentText ) : DialogLabelEditor::DialogLabelEditor( WinEDA_SchematicFrame* parent, SCH_TEXT* CurrentText,bool multiline ) : DialogLabelEditor_Base( parent ) DialogLabelEditor_Base( parent,wxID_ANY,multiline ) { { m_Parent = parent; m_Parent = parent; m_CurrentText = CurrentText; m_CurrentText = CurrentText; Loading
eeschema/dialog_edit_label.h +1 −1 Original line number Original line Diff line number Diff line Loading @@ -18,7 +18,7 @@ private: protected: protected: // these are protected so that the static ShowModally() gets used. // these are protected so that the static ShowModally() gets used. DialogLabelEditor( WinEDA_SchematicFrame* parent, SCH_TEXT * CurrentText); DialogLabelEditor( WinEDA_SchematicFrame* parent, SCH_TEXT * CurrentText, bool multiline); ~DialogLabelEditor(){}; ~DialogLabelEditor(){}; Loading
eeschema/dialog_edit_label_base.cpp +5 −2 Original line number Original line Diff line number Diff line Loading @@ -9,7 +9,7 @@ /////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////// DialogLabelEditor_Base::DialogLabelEditor_Base( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) DialogLabelEditor_Base::DialogLabelEditor_Base( wxWindow* parent, wxWindowID id, bool multiline,const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) { { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); this->SetSizeHints( wxDefaultSize, wxDefaultSize ); Loading @@ -22,6 +22,9 @@ DialogLabelEditor_Base::DialogLabelEditor_Base( wxWindow* parent, wxWindowID id, m_staticText1->Wrap( -1 ); m_staticText1->Wrap( -1 ); bSizerTextCtrl->Add( m_staticText1, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); bSizerTextCtrl->Add( m_staticText1, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); if (multiline) m_TextLabel = new wxTextCtrl( this, wxID_VALUE, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER | wxTE_MULTILINE ); else m_TextLabel = new wxTextCtrl( this, wxID_VALUE, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER ); m_TextLabel = new wxTextCtrl( this, wxID_VALUE, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER ); m_TextLabel->SetToolTip( _("Enter the text to be used within the schematic") ); m_TextLabel->SetToolTip( _("Enter the text to be used within the schematic") ); Loading