Commit 2043001b authored by jean-pierre charras's avatar jean-pierre charras

eeschema: fix Bug #1184318 (Eeschema-Libedit: Reference moving+zooming issue)

and fix a minor issue in netlist dialog.
parents b7504145 ea04a4af
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -22,43 +22,43 @@ class DIALOG_SHIM;
#include <wx/settings.h>
#include <wx/choice.h>
#include <wx/textctrl.h>
#include <wx/valtext.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/valtext.h>
#include <wx/bitmap.h>
#include <wx/image.h>
#include <wx/icon.h>
#include <wx/statbmp.h>
#include <wx/checkbox.h>
#include <wx/statline.h>
#include <wx/button.h>
#include <wx/datectrl.h>
#include <wx/dateevt.h>
#include <wx/checkbox.h>
#include <wx/statbox.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
#define ID_CHICE_PAGE_SIZE 1000
#define ID_CHOICE_PAGE_ORIENTATION 1001
#define ID_TEXTCTRL_USER_PAGE_SIZE_X 1002
#define ID_TEXTCTRL_USER_PAGE_SIZE_Y 1003
#define ID_PAGE_LAYOUT_EXAMPLE_SIZER 1004
#define ID_TEXTCTRL_REVISION 1005
#define ID_CHECKBOX_REVISION 1006
#define ID_TEXTCTRL_DATE 1007
#define ID_BTN_APPLY_DATE 1008
#define ID_PICKER_DATE 1009
#define ID_CHECKBOX_DATE 1010
#define ID_TEXTCTRL_TITLE 1011
#define ID_TEXTCTRL_COMPANY 1012
#define ID_CHECKBOX_COMPANY 1013
#define ID_TEXTCTRL_COMMENT1 1014
#define ID_CHECKBOX_COMMENT1 1015
#define ID_TEXTCTRL_COMMENT2 1016
#define ID_CHECKBOX_COMMENT2 1017
#define ID_TEXTCTRL_COMMENT3 1018
#define ID_CHECKBOX_COMMENT3 1019
#define ID_TEXTCTRL_COMMENT4 1020
#define ID_CHECKBOX_COMMENT4 1021
#define ID_TEXTCTRL_USER_PAGE_SIZE_Y 1002
#define ID_TEXTCTRL_USER_PAGE_SIZE_X 1003
#define ID_TEXTCTRL_DATE 1004
#define ID_BTN_APPLY_DATE 1005
#define ID_PICKER_DATE 1006
#define ID_CHECKBOX_DATE 1007
#define ID_TEXTCTRL_REVISION 1008
#define ID_CHECKBOX_REVISION 1009
#define ID_TEXTCTRL_TITLE 1010
#define ID_TEXTCTRL_COMPANY 1011
#define ID_CHECKBOX_COMPANY 1012
#define ID_TEXTCTRL_COMMENT1 1013
#define ID_CHECKBOX_COMMENT1 1014
#define ID_TEXTCTRL_COMMENT2 1015
#define ID_CHECKBOX_COMMENT2 1016
#define ID_TEXTCTRL_COMMENT3 1017
#define ID_CHECKBOX_COMMENT3 1018
#define ID_TEXTCTRL_COMMENT4 1019
#define ID_CHECKBOX_COMMENT4 1020
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_PAGES_SETTINGS_BASE
......@@ -68,21 +68,29 @@ class DIALOG_PAGES_SETTINGS_BASE : public DIALOG_SHIM
private:
protected:
wxStaticText* m_staticText5;
wxStaticText* m_staticTextPaper;
wxStaticText* m_staticTextSize;
wxChoice* m_paperSizeComboBox;
wxStaticText* m_staticText6;
wxStaticText* m_staticTextOrient;
wxChoice* m_orientationComboBox;
wxTextCtrl* m_TextUserSizeX;
wxStaticText* m_staticTextCustSize;
wxStaticText* m_staticTextHeight;
wxTextCtrl* m_TextUserSizeY;
wxStaticText* m_staticTextWidth;
wxTextCtrl* m_TextUserSizeX;
wxStaticText* m_staticTextPreview;
wxStaticBitmap* m_PageLayoutExampleBitmap;
wxStaticLine* m_staticline1;
wxStaticText* m_staticTexttbprm;
wxStaticText* m_TextSheetCount;
wxStaticText* m_TextSheetNumber;
wxTextCtrl* m_TextRevision;
wxCheckBox* m_RevisionExport;
wxTextCtrl* m_TextDate;
wxButton* m_ApplyDate;
wxDatePickerCtrl* m_PickDate;
wxCheckBox* m_DateExport;
wxStaticText* m_staticTextRev;
wxTextCtrl* m_TextRevision;
wxCheckBox* m_RevisionExport;
wxTextCtrl* m_TextTitle;
wxCheckBox* m_TitleExport;
wxTextCtrl* m_TextCompany;
......@@ -103,11 +111,11 @@ class DIALOG_PAGES_SETTINGS_BASE : public DIALOG_SHIM
virtual void OnCloseWindow( wxCloseEvent& event ) { event.Skip(); }
virtual void OnPaperSizeChoice( wxCommandEvent& event ) { event.Skip(); }
virtual void OnPageOrientationChoice( wxCommandEvent& event ) { event.Skip(); }
virtual void OnUserPageSizeXTextUpdated( wxCommandEvent& event ) { event.Skip(); }
virtual void OnUserPageSizeYTextUpdated( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRevisionTextUpdated( wxCommandEvent& event ) { event.Skip(); }
virtual void OnUserPageSizeXTextUpdated( wxCommandEvent& event ) { event.Skip(); }
virtual void OnDateTextUpdated( wxCommandEvent& event ) { event.Skip(); }
virtual void OnDateApplyClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRevisionTextUpdated( wxCommandEvent& event ) { event.Skip(); }
virtual void OnTitleTextUpdated( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCheckboxTitleClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCompanyTextUpdated( wxCommandEvent& event ) { event.Skip(); }
......
......@@ -475,18 +475,22 @@ void NETLIST_DIALOG::GenNetlist( wxCommandEvent& event )
}
fn.SetExt( fileExt );
wxString fullfilname = fn.GetFullName();
if( fn.GetPath().IsEmpty() )
fn.SetPath( wxGetCwd() );
wxString fullfilename = fn.GetFullPath();
if( !GetUseDefaultNetlistName() || currPage->m_IdNetType >= NET_TYPE_CUSTOM1 )
{
wxFileDialog dlg( this, title, fn.GetPath(),
fullfilname, fileWildcard,
fullfilename, fileWildcard,
wxFD_SAVE );
if( dlg.ShowModal() == wxID_CANCEL )
return;
fullfilname = dlg.GetPath();
fullfilename = dlg.GetPath();
}
m_Parent->ClearMsgPanel();
......@@ -496,7 +500,7 @@ void NETLIST_DIALOG::GenNetlist( wxCommandEvent& event )
else
m_Parent->SetNetListerCommand( wxEmptyString );
m_Parent->CreateNetlist( currPage->m_IdNetType, fullfilname, netlist_opt );
m_Parent->CreateNetlist( currPage->m_IdNetType, fullfilename, netlist_opt );
WriteCurrentNetlistSetup();
......
......@@ -257,13 +257,13 @@ void LIB_EDIT_FRAME::RedrawComponent( wxDC* aDC, wxPoint aOffset )
// display reference like in schematic (a reference U is shown U? or U?A)
// although it is stored without ? and part id.
// So temporary change the reference by a schematic like reference
LIB_FIELD* Field = m_component->GetField( REFERENCE );
wxString fieldText = Field->GetText();
wxString fieldfullText = Field->GetFullText( m_unit );
Field->SetText( fieldfullText );
LIB_FIELD* field = m_component->GetField( REFERENCE );
wxString fieldText = field->GetText();
wxString fieldfullText = field->GetFullText( m_unit );
field->EDA_TEXT::SetText( fieldfullText ); // change the field text string only
m_component->Draw( m_canvas, aDC, aOffset, m_unit,
m_convert, GR_DEFAULT_DRAWMODE );
Field->SetText( fieldText );
field->EDA_TEXT::SetText( fieldText ); // restore the field text string
}
}
......
......@@ -273,11 +273,13 @@ static void RedrawWhileMovingCursor( EDA_DRAW_PANEL* aPanel, wxDC* aDC, const wx
{
int unit = ((LIB_EDIT_FRAME*)aPanel->GetParent())->GetUnit();
wxString text = ((LIB_FIELD*)item)->GetFullText( unit );
item->Draw( aPanel, aDC, Screen->GetCrossHairPosition( true ), UNSPECIFIED_COLOR, g_XorMode, &text,
item->Draw( aPanel, aDC, Screen->GetCrossHairPosition( true ),
UNSPECIFIED_COLOR, g_XorMode, &text,
DefaultTransform );
}
else
item->Draw( aPanel, aDC, Screen->GetCrossHairPosition( true ), UNSPECIFIED_COLOR, g_XorMode, NULL,
item->Draw( aPanel, aDC, Screen->GetCrossHairPosition( true ),
UNSPECIFIED_COLOR, g_XorMode, NULL,
DefaultTransform );
}
......
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