55
55
BEGIN_EVENT_TABLE( FOOTPRINT_WIZARD_FRAME, EDA_DRAW_FRAME )
57
57
EVT_CLOSE( FOOTPRINT_WIZARD_FRAME::OnCloseWindow )
58
58
EVT_SIZE( FOOTPRINT_WIZARD_FRAME::OnSize )
59
59
EVT_ACTIVATE( FOOTPRINT_WIZARD_FRAME::OnActivate )
61
/* Sash drag events */
62
62
EVT_SASH_DRAGGED( ID_FOOTPRINT_WIZARD_PAGES, FOOTPRINT_WIZARD_FRAME::OnSashDrag )
63
63
EVT_SASH_DRAGGED( ID_FOOTPRINT_WIZARD_PARAMETERS, FOOTPRINT_WIZARD_FRAME::OnSashDrag )
66
66
EVT_TOOL( ID_FOOTPRINT_WIZARD_SELECT_WIZARD,
67
67
FOOTPRINT_WIZARD_FRAME::SelectCurrentWizard )
78
78
EVT_TOOL( ID_FOOTPRINT_WIZARD_SHOW_3D_VIEW,
79
79
FOOTPRINT_WIZARD_FRAME::Show3D_Frame )
82
82
EVT_LISTBOX( ID_FOOTPRINT_WIZARD_PAGE_LIST, FOOTPRINT_WIZARD_FRAME::ClickOnPageList )
83
83
EVT_GRID_CMD_CELL_CHANGE( ID_FOOTPRINT_WIZARD_PARAMETER_LIST,
84
84
FOOTPRINT_WIZARD_FRAME::ParametersUpdated )
127
127
m_showAxis = true; // true to draw axis.
131
131
// Disabled for now, it raises an assert error in wxwidgets
133
// icon.CopyFromBitmap( KiBitmap( module_wizard_xpm) );
133
icon.CopyFromBitmap( KiBitmap( module_wizard_xpm) );
136
137
m_HotkeysZoomAndGridList = g_Module_Viewer_Hokeys_Descr;
137
138
m_PageList = NULL;
201
203
m_ParameterGrid->AutoSizeColumns();
202
m_ParameterGrid->SetColLabelSize( 20 );
203
204
m_ParameterGrid->SetColLabelValue( 0, _( "Parameter" ) );
204
205
m_ParameterGrid->SetColLabelValue( 1, _( "Value" ) );
205
206
m_ParameterGrid->SetColLabelValue( 2, _( "Units" ) );
206
207
m_ParameterGrid->SetColLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTRE );
208
m_ParameterGrid->AutoSizeColumns();
209
211
ReCreatePageList();
295
297
void FOOTPRINT_WIZARD_FRAME::OnCloseWindow( wxCloseEvent& Event )
297
wxCommandEvent fakeEvent;
299
ExportSelectedFootprint( fakeEvent );
303
void FOOTPRINT_WIZARD_FRAME::ExportSelectedFootprint( wxCommandEvent& aEvent )
307
301
if( m_Semaphore )
450
451
m_ParameterGrid->DeleteRows( 0, m_ParameterGrid->GetNumberRows() );
451
452
m_ParameterGrid->AppendRows( fpList.size() );
454
wxString name, value, units;
453
455
for( unsigned int i = 0; i<fpList.size(); i++ )
455
wxString name, value, units;
457
457
name = fpList[i];
458
458
value = fvList[i];
482
482
units = wxT( "mm" );
485
value.Printf( wxT( "%lf" ), dValue );
485
std::string s = Double2Str( dValue );
486
value = FROM_UTF8( s.c_str() );
487
488
else if( ptList[i]==wxT( "UNITS" ) ) // 1,2,3,4,5 ... N
588
589
cmd.SetEventObject( this );
590
pos = screen->GetNearestGridPosition( pos );
591
oldpos = screen->GetCrossHairPosition();
591
pos = GetNearestGridPosition( pos );
592
oldpos = GetCrossHairPosition();
592
593
gridSize = screen->GetGridSize();
594
595
switch( aHotKey )
622
screen->m_O_Curseur = screen->GetCrossHairPosition();
623
screen->m_O_Curseur = GetCrossHairPosition();
625
case WXK_NUMPAD8: /* cursor moved up */
626
case WXK_NUMPAD8: // cursor moved up
627
628
pos.y -= KiROUND( gridSize.y );
628
629
m_canvas->MoveCursor( pos );
631
case WXK_NUMPAD2: /* cursor moved down */
632
case WXK_NUMPAD2: // cursor moved down
633
634
pos.y += KiROUND( gridSize.y );
634
635
m_canvas->MoveCursor( pos );
637
case WXK_NUMPAD4: /* cursor moved left */
638
case WXK_NUMPAD4: // cursor moved left
639
640
pos.x -= KiROUND( gridSize.x );
640
641
m_canvas->MoveCursor( pos );
643
case WXK_NUMPAD6: /* cursor moved right */
644
case WXK_NUMPAD6: // cursor moved right
645
646
pos.x += KiROUND( gridSize.x );
646
647
m_canvas->MoveCursor( pos );
650
screen->SetCrossHairPosition( pos );
651
SetCrossHairPosition( pos );
652
if( oldpos != screen->GetCrossHairPosition() )
653
if( oldpos != GetCrossHairPosition() )
654
pos = screen->GetCrossHairPosition();
655
screen->SetCrossHairPosition( oldpos );
655
pos = GetCrossHairPosition();
656
SetCrossHairPosition( oldpos );
656
657
m_canvas->CrossHairOff( aDC );
657
screen->SetCrossHairPosition( pos );
658
SetCrossHairPosition( pos );
658
659
m_canvas->CrossHairOn( aDC );
660
661
if( m_canvas->IsMouseCaptured() )
733
734
m_mainToolBar->AddSeparator();
734
735
m_mainToolBar->AddTool( ID_FOOTPRINT_WIZARD_PREVIOUS, wxEmptyString,
735
736
KiBitmap( lib_previous_xpm ),
736
_( "Display previous page" ) );
737
_( "Select previous editable item" ) );
738
739
m_mainToolBar->AddTool( ID_FOOTPRINT_WIZARD_NEXT, wxEmptyString,
739
740
KiBitmap( lib_next_xpm ),
740
_( "Display next page" ) );
741
_( "Select next editable item" ) );
742
743
m_mainToolBar->AddSeparator();
743
744
m_mainToolBar->AddTool( ID_FOOTPRINT_WIZARD_SHOW_3D_VIEW, wxEmptyString,