Commit 70de08f3 authored by jean-pierre charras's avatar jean-pierre charras
Browse files

Bug fixes:

Pcbnew: refresh issue with dialog designe rules under wxWidgets 2.9.2 under WINDOWS (replace wxChoiceBox by wxComboBox, should not change anything for users)
Eeschema: some  issues in libedit (when editing a pin )
parent 0e8dbc80
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -1371,8 +1371,8 @@ LIB_ITEM* LIB_COMPONENT::LocateDrawItem( int aUnit, int aConvert, KICAD_T aType,
{
    /* we use LocateDrawItem( int aUnit, int convert, KICAD_T type, const
     * wxPoint& pt ) to search items.
     * because this function uses DefaultTransformMatrix as orient/mirror matrix
     * we temporary copy aTransMat in DefaultTransformMatrix
     * because this function uses DefaultTransform as orient/mirror matrix
     * we temporary copy aTransform in DefaultTransform
     */
    LIB_ITEM* item;
    TRANSFORM transform = DefaultTransform;
+14 −0
Original line number Diff line number Diff line
@@ -16,6 +16,10 @@ DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN( wxWindow* parent, LIB_PIN* aPin ) :
    DIALOG_LIB_EDIT_PIN_BASE( parent )
{
    m_dummyPin = new LIB_PIN( *aPin );

    // m_dummyPin changes do not proparagte to a parent, so set parent to null
    m_dummyPin->SetParent( NULL );

    m_panelShowPin->SetBackgroundColour( MakeColour( g_DrawBgColor ) );

    /* Required to make escape key work correctly in wxGTK. */
@@ -54,6 +58,12 @@ void DIALOG_LIB_EDIT_PIN::OnPaintShowPanel( wxPaintEvent& event )
    wxSize dc_size = dc.GetSize();
    dc.SetDeviceOrigin( dc_size.x / 2, dc_size.y / 2 );

    // Give a parent to m_dummyPin only from draw purpose.
    // In fact m_dummyPin should not have a parent, but draw functions need a parent
    // to know some options
    LIB_EDIT_FRAME* libframe = (LIB_EDIT_FRAME*) GetParent();
    m_dummyPin->SetParent( libframe->GetComponent() );

    // Calculate a suitable scale to fit the available draw area
    EDA_RECT bBox = m_dummyPin->GetBoundingBox();
    double xscale    = (double) dc_size.x / bBox.GetWidth();
@@ -69,9 +79,12 @@ void DIALOG_LIB_EDIT_PIN::OnPaintShowPanel( wxPaintEvent& event )
    NEGATE( offset.y );

    GRResetPenAndBrush( &dc );
    m_dummyPin->SetVisible( true ); // TODO find a better way to show invisible pin here
    m_dummyPin->Draw( NULL, &dc, offset, -1, wxCOPY,
                      NULL, DefaultTransform );

    m_dummyPin->SetParent(NULL);

    event.Skip();
}

@@ -116,6 +129,7 @@ void DIALOG_LIB_EDIT_PIN::OnPropertiesChange( wxCommandEvent& event )
    m_dummyPin->SetOrientation( pinOrient );
    m_dummyPin->SetLength( pinLength );
    m_dummyPin->SetShape( pinShape );
    m_dummyPin->SetVisible( GetVisible() );

    m_panelShowPin->Refresh();
}
+7 −3
Original line number Diff line number Diff line
@@ -78,10 +78,10 @@ DIALOG_LIB_EDIT_PIN_BASE::DIALOG_LIB_EDIT_PIN_BASE( wxWindow* parent, wxWindowID
	sbSizerPinSharing = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Pin Sharing") ), wxVERTICAL );
	
	m_checkApplyToAllParts = new wxCheckBox( this, wxID_ANY, _("Add to all &parts in package"), wxDefaultPosition, wxDefaultSize, 0 );
	m_checkApplyToAllParts->SetValue(true); 
	sbSizerPinSharing->Add( m_checkApplyToAllParts, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
	
	m_checkApplyToAllConversions = new wxCheckBox( this, wxID_ANY, _("Add to all alternate &body styles (DeMorgan)"), wxDefaultPosition, wxDefaultSize, 0 );
	m_checkApplyToAllConversions->SetValue(true); 
	sbSizerPinSharing->Add( m_checkApplyToAllConversions, 0, wxALIGN_CENTER_VERTICAL|wxALL, 3 );
	
	boarderSizer->Add( sbSizerPinSharing, 0, wxEXPAND|wxALL, 5 );
@@ -175,7 +175,9 @@ DIALOG_LIB_EDIT_PIN_BASE::DIALOG_LIB_EDIT_PIN_BASE( wxWindow* parent, wxWindowID
	m_choiceOrientation->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
	m_choiceElectricalType->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
	m_choiceStyle->Connect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
	m_checkApplyToAllConversions->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnCBpartSelection ), NULL, this );
	m_checkApplyToAllParts->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
	m_checkApplyToAllConversions->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
	m_checkShow->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
	m_textPinNameTextSize->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
	m_textPadNameTextSize->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
	m_textLength->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
@@ -193,7 +195,9 @@ DIALOG_LIB_EDIT_PIN_BASE::~DIALOG_LIB_EDIT_PIN_BASE()
	m_choiceOrientation->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
	m_choiceElectricalType->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
	m_choiceStyle->Disconnect( wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
	m_checkApplyToAllConversions->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnCBpartSelection ), NULL, this );
	m_checkApplyToAllParts->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
	m_checkApplyToAllConversions->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
	m_checkShow->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
	m_textPinNameTextSize->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
	m_textPadNameTextSize->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
	m_textLength->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_LIB_EDIT_PIN_BASE::OnPropertiesChange ), NULL, this );
+5 −5
Original line number Diff line number Diff line
@@ -1041,7 +1041,7 @@
                                                        <property name="caption"></property>
                                                        <property name="caption_visible">1</property>
                                                        <property name="center_pane">0</property>
                                                        <property name="checked">1</property>
                                                        <property name="checked">0</property>
                                                        <property name="close_button">1</property>
                                                        <property name="context_help"></property>
                                                        <property name="context_menu">1</property>
@@ -1087,7 +1087,7 @@
                                                        <property name="window_name"></property>
                                                        <property name="window_style"></property>
                                                        <event name="OnChar"></event>
                                                        <event name="OnCheckBox"></event>
                                                        <event name="OnCheckBox">OnPropertiesChange</event>
                                                        <event name="OnEnterWindow"></event>
                                                        <event name="OnEraseBackground"></event>
                                                        <event name="OnKeyDown"></event>
@@ -1126,7 +1126,7 @@
                                                        <property name="caption"></property>
                                                        <property name="caption_visible">1</property>
                                                        <property name="center_pane">0</property>
                                                        <property name="checked">0</property>
                                                        <property name="checked">1</property>
                                                        <property name="close_button">1</property>
                                                        <property name="context_help"></property>
                                                        <property name="context_menu">1</property>
@@ -1172,7 +1172,7 @@
                                                        <property name="window_name"></property>
                                                        <property name="window_style"></property>
                                                        <event name="OnChar"></event>
                                                        <event name="OnCheckBox">OnCBpartSelection</event>
                                                        <event name="OnCheckBox">OnPropertiesChange</event>
                                                        <event name="OnEnterWindow"></event>
                                                        <event name="OnEraseBackground"></event>
                                                        <event name="OnKeyDown"></event>
@@ -1271,7 +1271,7 @@
                                                        <property name="window_name"></property>
                                                        <property name="window_style"></property>
                                                        <event name="OnChar"></event>
                                                        <event name="OnCheckBox"></event>
                                                        <event name="OnCheckBox">OnPropertiesChange</event>
                                                        <event name="OnEnterWindow"></event>
                                                        <event name="OnEraseBackground"></event>
                                                        <event name="OnKeyDown"></event>
+0 −1
Original line number Diff line number Diff line
@@ -85,7 +85,6 @@ class DIALOG_LIB_EDIT_PIN_BASE : public wxDialog
		// Virtual event handlers, overide them in your derived class
		virtual void OnCloseDialog( wxCloseEvent& event ) { event.Skip(); }
		virtual void OnPropertiesChange( wxCommandEvent& event ) { event.Skip(); }
		virtual void OnCBpartSelection( wxCommandEvent& event ) { event.Skip(); }
		virtual void OnPaintShowPanel( wxPaintEvent& event ) { event.Skip(); }
		virtual void OnCancelButtonClick( wxCommandEvent& event ) { event.Skip(); }
		virtual void OnOKButtonClick( wxCommandEvent& event ) { event.Skip(); }
Loading