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

Minor fixes and changes:

Remove a minor warning message in Debug mode for 2 dialogs.
Pcbnew: update Gerber X2 file format (File Attribute) to very last X2 specification
Eeschema: Fix a minor bug in block selection (sometimes the last selected component was select instead of items in selected area)
and better drag behavior when draging an item by the drag hotkey.
parent 57e53769
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -71,6 +71,10 @@ void BLOCK_SELECTOR::SetMessageBlock( EDA_DRAW_FRAME* frame )
        msg = _( "Block Drag" );
        break;

    case BLOCK_DRAG_ITEM:     // Drag
        msg = _( "Drag item" );
        break;

    case BLOCK_COPY:     // Copy
        msg = _( "Block Copy" );
        break;
+13 −15
Original line number Diff line number Diff line
@@ -717,17 +717,18 @@ bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* aDC, int aKey, const wxPoint& aPosi
    case BLOCK_IDLE:
        break;

    case BLOCK_MOVE:                /* Move */
    case BLOCK_DRAG:                /* Drag */
    case BLOCK_COPY:                /* Copy */
    case BLOCK_DELETE:              /* Delete */
    case BLOCK_SAVE:                /* Save */
    case BLOCK_ROTATE:              /* Rotate 90 deg */
    case BLOCK_FLIP:                /* Flip */
    case BLOCK_ZOOM:                /* Window Zoom */
    case BLOCK_MOVE:                // Move
    case BLOCK_DRAG:                // Drag (block defined)
    case BLOCK_DRAG_ITEM:           // Drag from a drag item command
    case BLOCK_COPY:                // Copy
    case BLOCK_DELETE:              // Delete
    case BLOCK_SAVE:                // Save
    case BLOCK_ROTATE:              // Rotate 90 deg
    case BLOCK_FLIP:                // Flip
    case BLOCK_ZOOM:                // Window Zoom
    case BLOCK_MIRROR_X:
    case BLOCK_MIRROR_Y:            /* mirror */
    case BLOCK_PRESELECT_MOVE:      /* Move with preselection list*/
    case BLOCK_MIRROR_Y:            // mirror
    case BLOCK_PRESELECT_MOVE:      // Move with preselection list
        Block->InitData( m_canvas, aPosition );
        break;

@@ -736,7 +737,7 @@ bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* aDC, int aKey, const wxPoint& aPosi
        Block->SetLastCursorPosition( wxPoint( 0, 0 ) );
        InitBlockPasteInfos();

        if( Block->GetCount() == 0 )      /* No data to paste */
        if( Block->GetCount() == 0 )      // No data to paste
        {
            DisplayError( this, wxT( "No Block to paste" ), 20 );
            GetScreen()->m_BlockLocate.SetCommand( BLOCK_IDLE );
@@ -771,10 +772,7 @@ bool EDA_DRAW_FRAME::HandleBlockBegin( wxDC* aDC, int aKey, const wxPoint& aPosi
}


// See comment in classpcb.cpp near line 66
//static const double MAX_AXIS = 1518500251;

// However I am not seeing a problem with this size yet:
// I am not seeing a problem with this size yet:
static const double MAX_AXIS = INT_MAX - 100;

#define VIRT_MIN    (-MAX_AXIS/2.0)     ///< min X or Y coordinate in virtual space
+9 −3
Original line number Diff line number Diff line
@@ -133,8 +133,9 @@ void SCH_EDIT_FRAME::HandleBlockPlace( wxDC* DC )

    switch( block->GetCommand() )
    {
    case BLOCK_DRAG:        /* Drag */
    case BLOCK_MOVE:        /* Move */
    case BLOCK_DRAG:        // Drag from mouse
    case BLOCK_DRAG_ITEM:   // Drag from a component selection and drag command
    case BLOCK_MOVE:
        if( m_canvas->IsMouseCaptured() )
            m_canvas->CallMouseCapture( DC, wxDefaultPosition, false );

@@ -238,19 +239,24 @@ bool SCH_EDIT_FRAME::HandleBlockEnd( wxDC* aDC )
            break;

        case BLOCK_DRAG:
        case BLOCK_DRAG_ITEM:   // Drag from a drag command
            GetScreen()->BreakSegmentsOnJunctions();
            // fall through

        case BLOCK_MOVE:
        case BLOCK_COPY:
            if( GetScreen()->GetCurItem() != NULL )
            if( block->GetCommand() == BLOCK_DRAG_ITEM &&
                GetScreen()->GetCurItem() != NULL )
            {
                // This is a drag command, not a mouse block command
                // Only this item is put in list
                ITEM_PICKER picker;
                picker.SetItem( GetScreen()->GetCurItem() );
                block->PushItem( picker );
            }
            else
            {
                // Collect all items in the locate block
                GetScreen()->UpdatePickList();
            }
            // fall through
+8 −6
Original line number Diff line number Diff line
@@ -109,9 +109,10 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
        DisplayError( this, wxT( "Error in HandleBlockPLace" ) );
        break;

    case BLOCK_DRAG:        /* Drag */
    case BLOCK_MOVE:        /* Move */
    case BLOCK_COPY:        /* Copy */
    case BLOCK_DRAG:
    case BLOCK_DRAG_ITEM:
    case BLOCK_MOVE:
    case BLOCK_COPY:
        if ( m_component )
            ItemCount = m_component->SelectItems( GetScreen()->m_BlockLocate,
                                                  m_unit, m_convert,
@@ -132,7 +133,7 @@ bool LIB_EDIT_FRAME::HandleBlockEnd( wxDC* DC )
        }
        break;

    case BLOCK_PRESELECT_MOVE:     /* Move with preselection list*/
    case BLOCK_PRESELECT_MOVE:     // Move with preselection list
        nextCmd = true;
        m_canvas->SetMouseCaptureCallback( DrawMovingBlockOutlines );
        GetScreen()->m_BlockLocate.SetState( STATE_BLOCK_MOVE );
@@ -232,8 +233,9 @@ void LIB_EDIT_FRAME::HandleBlockPlace( wxDC* DC )
    case  BLOCK_IDLE:
        break;

    case BLOCK_DRAG:                /* Drag */
    case BLOCK_MOVE:                /* Move */
    case BLOCK_DRAG:
    case BLOCK_DRAG_ITEM:
    case BLOCK_MOVE:
    case BLOCK_PRESELECT_MOVE:      /* Move with preselection list*/
        GetScreen()->m_BlockLocate.ClearItemsList();

+1 −3
Original line number Diff line number Diff line
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 30 2013)
// C++ code generated with wxFormBuilder (version Nov  6 2013)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@@ -32,7 +32,6 @@ DIALOG_LABEL_EDITOR_BASE::DIALOG_LABEL_EDITOR_BASE( wxWindow* parent, wxWindowID
	bSizeText = new wxBoxSizer( wxVERTICAL );
	
	m_textLabelSingleLine = new wxTextCtrl( this, wxID_VALUESINGLE, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER );
	m_textLabelSingleLine->SetMaxLength( 0 ); 
	m_textLabelSingleLine->SetValidator( wxTextValidator( wxFILTER_EXCLUDE_CHAR_LIST, &m_labelText ) );
	
	bSizeText->Add( m_textLabelSingleLine, 0, wxEXPAND|wxLEFT, 3 );
@@ -54,7 +53,6 @@ DIALOG_LABEL_EDITOR_BASE::DIALOG_LABEL_EDITOR_BASE( wxWindow* parent, wxWindowID
	bSizeCtrlSizer = new wxBoxSizer( wxHORIZONTAL );
	
	m_TextSize = new wxTextCtrl( this, wxID_SIZE, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
	m_TextSize->SetMaxLength( 0 ); 
	bSizeCtrlSizer->Add( m_TextSize, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT|wxRIGHT, 3 );
	
	m_staticSizeUnits = new wxStaticText( this, wxID_ANY, _("units"), wxDefaultPosition, wxDefaultSize, 0 );
Loading