Commit 98bc9bb9 authored by stambaughw's avatar stambaughw
Browse files

Component library pin editing bug fixes from Brian Sidebotham.

* Make cancel button delete new pin instance.
* Make pin redraw correctly to prevent display corruption.
* Prevent edited pin from being move on next left button click.
* Change pin edit property dialog focus to pin name edit text control.
parent 4653ca50
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ DIALOG_LIB_EDIT_PIN::DIALOG_LIB_EDIT_PIN( wxWindow* parent ) :
    DIALOG_LIB_EDIT_PIN_BASE( parent )
{
    /* Required to make escape key work correctly in wxGTK. */
    m_sdbSizer1OK->SetFocus();
    m_textName->SetFocus();

    /* This ugly hack fixes a bug in wxWidgets 2.8.7 and likely earlier
     * versions for the flex grid sizer in wxGTK that prevents the last
+0 −4
Original line number Diff line number Diff line
@@ -34,10 +34,6 @@ void WinEDA_LibeditFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )

            switch( DrawEntry->Type() )
            {
            case COMPONENT_PIN_DRAW_TYPE:
                PlacePin( DC );
                break;

            case COMPONENT_FIELD_DRAW_TYPE:
                PlaceField( DC, (LIB_FIELD*) DrawEntry );
                DrawEntry = NULL;
+15 −3
Original line number Diff line number Diff line
@@ -74,7 +74,10 @@ void WinEDA_LibeditFrame::OnEditPin( wxCommandEvent& event )
    if( dlg.ShowModal() == wxID_CANCEL )
    {
        if( pin->IsNew() )
        {
            pin->m_Flags |= IS_CANCELLED;
            DrawPanel->UnManageCursor();
        }
        return;
    }

@@ -296,7 +299,7 @@ static void DrawMovePin( WinEDA_DrawPanel* panel, wxDC* DC, bool erase )
    /* Redraw pin in new position */
    CurrentPin->m_Pos.x = panel->GetScreen()->m_Curseur.x;
    CurrentPin->m_Pos.y = -panel->GetScreen()->m_Curseur.y;
    CurrentPin->Draw( panel, DC, wxPoint( 0, 0 ), -1, wxCOPY,
    CurrentPin->Draw( panel, DC, wxPoint( 0, 0 ), -1, g_XorMode,
                      &showPinText, DefaultTransformMatrix );

    PinPreviousPos = CurrentPin->m_Pos;
@@ -412,9 +415,18 @@ void WinEDA_LibeditFrame::CreatePin( wxDC* DC )
    GetEventHandler()->ProcessEvent( cmd );
    DrawPanel->MouseToCursorSchema();
    DrawPanel->m_IgnoreMouseEvents = false;

    if (pin->m_Flags & IS_CANCELLED)
    {
        DeletePin(DC, m_component, pin);
        m_drawItem = NULL;
    }
    else
    {
        DrawPanel->ManageCurseur = DrawMovePin;
        DrawPanel->ForceCloseManageCurseur = AbortPinMove;
    }
}


static void CreateImagePins( LIB_PIN* Pin, int unit, int convert,
+1 −0
Original line number Diff line number Diff line
@@ -261,6 +261,7 @@ class DHEAD;
#define SKIP_STRUCT     (1 << 15)           ///< flag indiquant que la structure ne doit pas etre traitee
#define DO_NOT_DRAW     (1 << 16)           ///< Used to disable draw function
#define DRAW_ERASED     (1 << 17)           ///< draw in background color, used by classs TRACK in gerbview
#define IS_CANCELLED     (1 << 18)           ///< flag set when edit dialogs are canceled when editing a new object

class EDA_BaseStruct
{