Commit c02d90e9 authored by Wayne Stambaugh's avatar Wayne Stambaugh

Use wxUpdateUIEvent in CVPcb and other minor changes.

* CVPcb now uses wxUpdateUIEvent instead of set toolbars.
* Removed duplicate event handlers in CVPcb that were factored into
  EDA_DRAW_FRAME.
* Fix definition of GeneralControle() in CVPcb that prevented it from being
  called.
* Remove rarely used and scary refresh code GeneralControle() method in all
  main frame windows.
* Factor zoom menu and tool bar command IDs down to EDA_DRAW_FRAME.
parent cbee2477
...@@ -62,11 +62,11 @@ void BASE_SCREEN::InitDatas() ...@@ -62,11 +62,11 @@ void BASE_SCREEN::InitDatas()
SetCurItem( NULL ); SetCurItem( NULL );
m_FlagRefreshReq = 0; /* Redraw screen request flag */
m_FlagModified = 0; // Set when any change is made on broad m_FlagModified = 0; // Set when any change is made on broad
m_FlagSave = 1; // Used in auto save: set when an auto save is made m_FlagSave = 1; // Used in auto save: set when an auto save is made
} }
/** /**
* Get screen units scalar. * Get screen units scalar.
* *
......
...@@ -261,7 +261,7 @@ void DIALOG_PAGES_SETTINGS::SavePageSettings(wxCommandEvent& event) ...@@ -261,7 +261,7 @@ void DIALOG_PAGES_SETTINGS::SavePageSettings(wxCommandEvent& event)
#endif #endif
m_Screen->SetModify(); m_Screen->SetModify();
m_Screen->SetRefreshReq(); m_Parent->DrawPanel->Refresh();
} }
......
...@@ -40,6 +40,7 @@ BEGIN_EVENT_TABLE( EDA_DRAW_FRAME, EDA_BASE_FRAME ) ...@@ -40,6 +40,7 @@ BEGIN_EVENT_TABLE( EDA_DRAW_FRAME, EDA_BASE_FRAME )
EVT_MOUSEWHEEL( EDA_DRAW_FRAME::OnMouseEvent ) EVT_MOUSEWHEEL( EDA_DRAW_FRAME::OnMouseEvent )
EVT_MENU_OPEN( EDA_DRAW_FRAME::OnMenuOpen ) EVT_MENU_OPEN( EDA_DRAW_FRAME::OnMenuOpen )
EVT_ACTIVATE( EDA_DRAW_FRAME::OnActivate ) EVT_ACTIVATE( EDA_DRAW_FRAME::OnActivate )
EVT_MENU_RANGE( ID_ZOOM_IN, ID_ZOOM_REDRAW, EDA_DRAW_FRAME::OnZoom )
EVT_MENU_RANGE( ID_POPUP_ZOOM_START_RANGE, ID_POPUP_ZOOM_END_RANGE, EVT_MENU_RANGE( ID_POPUP_ZOOM_START_RANGE, ID_POPUP_ZOOM_END_RANGE,
EDA_DRAW_FRAME::OnZoom ) EDA_DRAW_FRAME::OnZoom )
EVT_MENU_RANGE( ID_POPUP_GRID_LEVEL_1000, ID_POPUP_GRID_USER, EVT_MENU_RANGE( ID_POPUP_GRID_LEVEL_1000, ID_POPUP_GRID_USER,
......
...@@ -27,17 +27,17 @@ ...@@ -27,17 +27,17 @@
BEGIN_EVENT_TABLE( DISPLAY_FOOTPRINTS_FRAME, WinEDA_BasePcbFrame ) BEGIN_EVENT_TABLE( DISPLAY_FOOTPRINTS_FRAME, WinEDA_BasePcbFrame )
EVT_CLOSE( DISPLAY_FOOTPRINTS_FRAME::OnCloseWindow ) EVT_CLOSE( DISPLAY_FOOTPRINTS_FRAME::OnCloseWindow )
EVT_SIZE( DISPLAY_FOOTPRINTS_FRAME::OnSize ) EVT_SIZE( DISPLAY_FOOTPRINTS_FRAME::OnSize )
EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_PAGE, DISPLAY_FOOTPRINTS_FRAME::OnZoom )
EVT_TOOL( ID_OPTIONS_SETUP, DISPLAY_FOOTPRINTS_FRAME::InstallOptionsDisplay ) EVT_TOOL( ID_OPTIONS_SETUP, DISPLAY_FOOTPRINTS_FRAME::InstallOptionsDisplay )
EVT_TOOL( ID_CVPCB_SHOW3D_FRAME, DISPLAY_FOOTPRINTS_FRAME::Show3D_Frame ) EVT_TOOL( ID_CVPCB_SHOW3D_FRAME, DISPLAY_FOOTPRINTS_FRAME::Show3D_Frame )
EVT_TOOL( ID_TB_OPTIONS_SHOW_GRID, DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar) EVT_TOOL( ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH,
EVT_TOOL( ID_TB_OPTIONS_SHOW_POLAR_COORD, DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar) DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar)
EVT_TOOL( ID_TB_OPTIONS_SELECT_UNIT_INCH, DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar) EVT_TOOL( ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH,
EVT_TOOL( ID_TB_OPTIONS_SELECT_UNIT_MM, DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar) DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar)
EVT_TOOL( ID_TB_OPTIONS_SELECT_CURSOR, DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar)
EVT_TOOL( ID_TB_OPTIONS_SHOW_PADS_SKETCH, DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar) EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH,
EVT_TOOL( ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH, DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar) DISPLAY_FOOTPRINTS_FRAME::OnUpdateTextDrawMode )
EVT_TOOL( ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH, DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar) EVT_UPDATE_UI( ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH,
DISPLAY_FOOTPRINTS_FRAME::OnUpdateLineDrawMode )
END_EVENT_TABLE() END_EVENT_TABLE()
...@@ -49,11 +49,10 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( CVPCB_MAINFRAME* father, ...@@ -49,11 +49,10 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( CVPCB_MAINFRAME* father,
const wxString& title, const wxString& title,
const wxPoint& pos, const wxPoint& pos,
const wxSize& size, long style ) : const wxSize& size, long style ) :
WinEDA_BasePcbFrame( father, CVPCB_DISPLAY_FRAME, title, pos, WinEDA_BasePcbFrame( father, CVPCB_DISPLAY_FRAME, title, pos, size, style )
size, style )
{ {
m_FrameName = wxT( "CmpFrame" ); m_FrameName = wxT( "CmpFrame" );
m_Draw_Axis = true; // TRUE to draw axis. m_Draw_Axis = true; // true to draw axis.
// Give an icon // Give an icon
#ifdef __WINDOWS__ #ifdef __WINDOWS__
...@@ -67,6 +66,7 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( CVPCB_MAINFRAME* father, ...@@ -67,6 +66,7 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( CVPCB_MAINFRAME* father,
SetScreen( new PCB_SCREEN() ); SetScreen( new PCB_SCREEN() );
LoadSettings(); LoadSettings();
// Initialize grid id to a default value if not found in config or bad: // Initialize grid id to a default value if not found in config or bad:
if( (m_LastGridSizeId <= 0) || if( (m_LastGridSizeId <= 0) ||
(m_LastGridSizeId > (ID_POPUP_GRID_USER - ID_POPUP_GRID_LEVEL_1000)) ) (m_LastGridSizeId > (ID_POPUP_GRID_USER - ID_POPUP_GRID_LEVEL_1000)) )
...@@ -78,7 +78,6 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( CVPCB_MAINFRAME* father, ...@@ -78,7 +78,6 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( CVPCB_MAINFRAME* father,
DisplayOpt.ShowTrackClearanceMode = 0; /* tracks and vias clearance has DisplayOpt.ShowTrackClearanceMode = 0; /* tracks and vias clearance has
* no meaning here. */ * no meaning here. */
SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y ); SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y );
ReCreateHToolbar(); ReCreateHToolbar();
ReCreateVToolbar(); ReCreateVToolbar();
...@@ -100,8 +99,7 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( CVPCB_MAINFRAME* father, ...@@ -100,8 +99,7 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( CVPCB_MAINFRAME* father,
horiz.LeftDockable( false ).RightDockable( false ); horiz.LeftDockable( false ).RightDockable( false );
m_auimgr.AddPane( m_HToolBar, m_auimgr.AddPane( m_HToolBar,
wxAuiPaneInfo( horiz ).Name( wxT( "m_HToolBar" ) ).Top(). wxAuiPaneInfo( horiz ).Name( wxT( "m_HToolBar" ) ).Top(). Row( 0 ) );
Row( 0 ) );
if( m_VToolBar ) // Currently, no vertical right toolbar. if( m_VToolBar ) // Currently, no vertical right toolbar.
m_auimgr.AddPane( m_VToolBar, m_auimgr.AddPane( m_VToolBar,
...@@ -118,7 +116,7 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( CVPCB_MAINFRAME* father, ...@@ -118,7 +116,7 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( CVPCB_MAINFRAME* father,
m_auimgr.Update(); m_auimgr.Update();
Show( TRUE ); Show( true );
} }
...@@ -160,17 +158,14 @@ void DISPLAY_FOOTPRINTS_FRAME::ReCreateOptToolbar() ...@@ -160,17 +158,14 @@ void DISPLAY_FOOTPRINTS_FRAME::ReCreateOptToolbar()
return; return;
// Create options tool bar. // Create options tool bar.
m_OptionsToolBar = new WinEDA_Toolbar( TOOLBAR_OPTION, this, m_OptionsToolBar = new WinEDA_Toolbar( TOOLBAR_OPTION, this, ID_OPT_TOOLBAR, false );
ID_OPT_TOOLBAR, FALSE );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString, m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_GRID, wxEmptyString, wxBitmap( grid_xpm ),
wxBitmap( grid_xpm ),
_( "Hide grid" ), wxITEM_CHECK ); _( "Hide grid" ), wxITEM_CHECK );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_GRID,IsGridVisible() );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_POLAR_COORD, wxEmptyString, m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_POLAR_COORD, wxEmptyString,
wxBitmap( polar_coord_xpm ), wxBitmap( polar_coord_xpm ),
_( "Display Polar Coord ON" ), wxITEM_CHECK ); _( "Display polar coordinates" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_INCH, wxEmptyString, m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_UNIT_INCH, wxEmptyString,
wxBitmap( unit_inch_xpm ), wxBitmap( unit_inch_xpm ),
...@@ -182,26 +177,22 @@ void DISPLAY_FOOTPRINTS_FRAME::ReCreateOptToolbar() ...@@ -182,26 +177,22 @@ void DISPLAY_FOOTPRINTS_FRAME::ReCreateOptToolbar()
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString, m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SELECT_CURSOR, wxEmptyString,
wxBitmap( cursor_shape_xpm ), wxBitmap( cursor_shape_xpm ),
_( "Change Cursor Shape" ), wxITEM_CHECK ); _( "Change cursor shape" ), wxITEM_CHECK );
m_OptionsToolBar->AddSeparator(); m_OptionsToolBar->AddSeparator();
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_PADS_SKETCH, wxEmptyString, m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_PADS_SKETCH, wxEmptyString,
wxBitmap( pad_sketch_xpm ), wxBitmap( pad_sketch_xpm ),
_( "Show Pads Sketch" ), wxITEM_CHECK ); _( "Show pads in outline mode" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH, m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH, wxEmptyString,
wxEmptyString,
wxBitmap( text_sketch_xpm ), wxBitmap( text_sketch_xpm ),
_( "Show Texts Sketch" ), wxITEM_CHECK ); _( "Show texts in line mode" ), wxITEM_CHECK );
m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH, m_OptionsToolBar->AddTool( ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH, wxEmptyString,
wxEmptyString,
wxBitmap( show_mod_edge_xpm ), wxBitmap( show_mod_edge_xpm ),
_( "Show Edges Sketch" ), wxITEM_CHECK ); _( "Show outlines in line mode" ), wxITEM_CHECK );
m_OptionsToolBar->Realize(); m_OptionsToolBar->Realize();
SetToolbars();
} }
...@@ -210,33 +201,27 @@ void DISPLAY_FOOTPRINTS_FRAME::ReCreateHToolbar() ...@@ -210,33 +201,27 @@ void DISPLAY_FOOTPRINTS_FRAME::ReCreateHToolbar()
if( m_HToolBar != NULL ) if( m_HToolBar != NULL )
return; return;
m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, TRUE ); m_HToolBar = new WinEDA_Toolbar( TOOLBAR_MAIN, this, ID_H_TOOLBAR, true );
m_HToolBar->AddTool( ID_OPTIONS_SETUP, wxEmptyString, m_HToolBar->AddTool( ID_OPTIONS_SETUP, wxEmptyString, wxBitmap( display_options_xpm ),
wxBitmap( display_options_xpm ), _( "Display options" ) );
_( "Display Options" ) );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, m_HToolBar->AddTool( ID_ZOOM_IN, wxEmptyString, wxBitmap( zoom_in_xpm ),
wxBitmap( zoom_in_xpm ),
_( "Zoom in (F1)" ) ); _( "Zoom in (F1)" ) );
m_HToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, m_HToolBar->AddTool( ID_ZOOM_OUT, wxEmptyString, wxBitmap( zoom_out_xpm ),
wxBitmap( zoom_out_xpm ),
_( "Zoom out (F2)" ) ); _( "Zoom out (F2)" ) );
m_HToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString, m_HToolBar->AddTool( ID_ZOOM_REDRAW, wxEmptyString, wxBitmap( zoom_redraw_xpm ),
wxBitmap( zoom_redraw_xpm ),
_( "Redraw view (F3)" ) ); _( "Redraw view (F3)" ) );
m_HToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, m_HToolBar->AddTool( ID_ZOOM_PAGE, wxEmptyString, wxBitmap( zoom_auto_xpm ),
wxBitmap( zoom_auto_xpm ),
_( "Zoom auto (Home)" ) ); _( "Zoom auto (Home)" ) );
m_HToolBar->AddSeparator(); m_HToolBar->AddSeparator();
m_HToolBar->AddTool( ID_CVPCB_SHOW3D_FRAME, wxEmptyString, m_HToolBar->AddTool( ID_CVPCB_SHOW3D_FRAME, wxEmptyString, wxBitmap( show_3d_xpm ),
wxBitmap( show_3d_xpm ),
_( "3D Display" ) ); _( "3D Display" ) );
// after adding the buttons to the toolbar, must call Realize() to reflect // after adding the buttons to the toolbar, must call Realize() to reflect
...@@ -245,70 +230,36 @@ void DISPLAY_FOOTPRINTS_FRAME::ReCreateHToolbar() ...@@ -245,70 +230,36 @@ void DISPLAY_FOOTPRINTS_FRAME::ReCreateHToolbar()
} }
void DISPLAY_FOOTPRINTS_FRAME::SetToolbars() void DISPLAY_FOOTPRINTS_FRAME::OnUpdateTextDrawMode( wxUpdateUIEvent& aEvent )
{ {
if( m_OptionsToolBar ) wxString msgTextsFill[3] = { _( "Show texts in line mode" ),
{
m_OptionsToolBar->ToggleTool(
ID_TB_OPTIONS_SELECT_UNIT_MM,
g_UserUnit == MILLIMETRES );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SELECT_UNIT_INCH,
g_UserUnit == INCHES );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_POLAR_COORD,
DisplayOpt.DisplayPolarCood );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_POLAR_COORD,
DisplayOpt.DisplayPolarCood ?
_( "Display rectangular coordinates" ) :
_( "Display polar coordinates" ) );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_GRID,
IsGridVisible( ) );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_GRID,
IsGridVisible( ) ?
_( "Hide grid" ) :
_( "Show grid" ) );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SELECT_CURSOR,
m_CursorShape );
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_PADS_SKETCH,
!m_DisplayPadFill );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_PADS_SKETCH,
m_DisplayPadFill ?
_( "Show pads in sketch mode" ) :
_( "Show pads in filled mode" ) );
wxString msgTextsFill[3] =
{_( "Show texts in line mode" ),
_( "Show texts in filled mode" ), _( "Show texts in filled mode" ),
_( "Show texts in sketch mode" ) _( "Show texts in sketch mode" ) };
};
unsigned idx = m_DisplayModText+1; unsigned i = m_DisplayModText + 1;
if ( idx > 2 )
idx = 0; if ( i > 2 )
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH, i = 0;
m_DisplayModText == 0 );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH, aEvent.Check( m_DisplayModText == 0 );
msgTextsFill[idx] ); m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH, msgTextsFill[i] );
wxString msgEdgesFill[3] = }
{_( "Show outlines in line mode" ),
void DISPLAY_FOOTPRINTS_FRAME::OnUpdateLineDrawMode( wxUpdateUIEvent& aEvent )
{
wxString msgEdgesFill[3] = { _( "Show outlines in line mode" ),
_( "Show outlines in filled mode" ), _( "Show outlines in filled mode" ),
_( "Show outlines in sketch mode" ) _( "Show outlines in sketch mode" ) };
};
idx = m_DisplayModEdge+1; int i = m_DisplayModEdge + 1;
if ( idx > 2 )
idx = 0; if ( i > 2 )
m_OptionsToolBar->ToggleTool( ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH, i = 0;
m_DisplayModEdge == 0 );
m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH, aEvent.Check( m_DisplayModEdge == 0 );
msgEdgesFill[idx] ); m_OptionsToolBar->SetToolShortHelp( ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH, msgEdgesFill[i] );
m_OptionsToolBar->Refresh();
}
} }
...@@ -322,61 +273,34 @@ void DISPLAY_FOOTPRINTS_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) ...@@ -322,61 +273,34 @@ void DISPLAY_FOOTPRINTS_FRAME::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
} }
bool DISPLAY_FOOTPRINTS_FRAME::OnRightClick( const wxPoint& MousePos, bool DISPLAY_FOOTPRINTS_FRAME::OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu )
wxMenu* PopMenu )
{ {
return true; return true;
} }
void DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar( wxCommandEvent& event ) void DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
{ {
int id = event.GetId(); int id = event.GetId();
switch( id ) switch( id )
{ {
case ID_TB_OPTIONS_SHOW_GRID:
SetGridVisibility( m_OptionsToolBar->GetToolState( id ) );
DrawPanel->Refresh( );
break;
case ID_TB_OPTIONS_SELECT_UNIT_MM:
g_UserUnit = MILLIMETRES;
UpdateStatusBar();
break;
case ID_TB_OPTIONS_SELECT_UNIT_INCH:
g_UserUnit = INCHES;
UpdateStatusBar();
break;
case ID_TB_OPTIONS_SHOW_POLAR_COORD:
SetStatusText( wxEmptyString );
DisplayOpt.DisplayPolarCood = m_OptionsToolBar->GetToolState( id );
UpdateStatusBar();
break;
case ID_TB_OPTIONS_SELECT_CURSOR:
m_CursorShape = m_OptionsToolBar->GetToolState( id );
DrawPanel->Refresh( );
break;
case ID_TB_OPTIONS_SHOW_PADS_SKETCH:
m_DisplayPadFill = !m_OptionsToolBar->GetToolState( id );
DrawPanel->Refresh( );
break;
case ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH: case ID_TB_OPTIONS_SHOW_MODULE_TEXT_SKETCH:
m_DisplayModText++; m_DisplayModText++;
if( m_DisplayModText > 2 ) if( m_DisplayModText > 2 )
m_DisplayModText = 0; m_DisplayModText = 0;
DrawPanel->Refresh( ); DrawPanel->Refresh( );
break; break;
case ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH: case ID_TB_OPTIONS_SHOW_MODULE_EDGE_SKETCH:
m_DisplayModEdge++; m_DisplayModEdge++;
if( m_DisplayModEdge > 2 ) if( m_DisplayModEdge > 2 )
m_DisplayModEdge = 0; m_DisplayModEdge = 0;
DrawPanel->Refresh( );
DrawPanel->Refresh();
break; break;
default: default:
...@@ -384,62 +308,52 @@ void DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar( wxCommandEvent& event ) ...@@ -384,62 +308,52 @@ void DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
wxT( "DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar error" ) ); wxT( "DISPLAY_FOOTPRINTS_FRAME::OnSelectOptionToolbar error" ) );
break; break;
} }
SetToolbars();
} }
void DISPLAY_FOOTPRINTS_FRAME::GeneralControle( wxDC* aDC, wxPoint aPosition )
void DISPLAY_FOOTPRINTS_FRAME::GeneralControle( wxDC* aDC, const wxPoint& aPosition )
{ {
wxRealPoint gridSize; wxRealPoint gridSize;
int flagcurseur = 0;
wxPoint oldpos; wxPoint oldpos;
PCB_SCREEN* screen = GetScreen();
wxPoint pos = aPosition; wxPoint pos = aPosition;
wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED ); wxCommandEvent cmd( wxEVT_COMMAND_MENU_SELECTED );
cmd.SetEventObject( this ); cmd.SetEventObject( this );
GetScreen()->SetCrossHairPosition( pos ); pos = screen->GetNearestGridPosition( pos );
oldpos = GetScreen()->GetCrossHairPosition(); oldpos = screen->GetCrossHairPosition();
gridSize = GetScreen()->GetGridSize(); gridSize = screen->GetGridSize();
switch( g_KeyPressed ) switch( g_KeyPressed )
{ {
case WXK_F1: case WXK_F1:
cmd.SetId( ID_POPUP_ZOOM_IN ); cmd.SetId( ID_POPUP_ZOOM_IN );
GetEventHandler()->ProcessEvent( cmd ); GetEventHandler()->ProcessEvent( cmd );
flagcurseur = 2;
pos = GetScreen()->GetCrossHairPosition();
break; break;
case WXK_F2: case WXK_F2:
cmd.SetId( ID_POPUP_ZOOM_OUT ); cmd.SetId( ID_POPUP_ZOOM_OUT );
GetEventHandler()->ProcessEvent( cmd ); GetEventHandler()->ProcessEvent( cmd );
flagcurseur = 2;
pos = GetScreen()->GetCrossHairPosition();
break; break;
case WXK_F3: case WXK_F3:
cmd.SetId( ID_ZOOM_REDRAW ); cmd.SetId( ID_ZOOM_REDRAW );
GetEventHandler()->ProcessEvent( cmd ); GetEventHandler()->ProcessEvent( cmd );
flagcurseur = 2;
break; break;
case WXK_F4: case WXK_F4:
cmd.SetId( ID_POPUP_ZOOM_CENTER ); cmd.SetId( ID_POPUP_ZOOM_CENTER );
GetEventHandler()->ProcessEvent( cmd ); GetEventHandler()->ProcessEvent( cmd );
flagcurseur = 2;
pos = GetScreen()->GetCrossHairPosition();
break; break;
case WXK_HOME: case WXK_HOME:
cmd.SetId( ID_ZOOM_PAGE ); cmd.SetId( ID_ZOOM_PAGE );
GetEventHandler()->ProcessEvent( cmd ); GetEventHandler()->ProcessEvent( cmd );
flagcurseur = 2;
pos = GetScreen()->GetCrossHairPosition();
break; break;
case ' ': case ' ':
GetScreen()->m_O_Curseur = GetScreen()->GetCrossHairPosition(); screen->m_O_Curseur = screen->GetCrossHairPosition();
break; break;
case WXK_NUMPAD8: /* cursor moved up */ case WXK_NUMPAD8: /* cursor moved up */
...@@ -467,24 +381,15 @@ void DISPLAY_FOOTPRINTS_FRAME::GeneralControle( wxDC* aDC, wxPoint aPosition ) ...@@ -467,24 +381,15 @@ void DISPLAY_FOOTPRINTS_FRAME::GeneralControle( wxDC* aDC, wxPoint aPosition )
break; break;
} }
GetScreen()->SetCrossHairPosition( pos ); screen->SetCrossHairPosition( pos );
if( GetScreen()->IsRefreshReq() )
{
flagcurseur = 2;
Refresh();
}
if( oldpos != GetScreen()->GetCrossHairPosition() ) if( oldpos != screen->GetCrossHairPosition() )
{
if( flagcurseur != 2 )
{ {
pos = GetScreen()->GetCrossHairPosition(); pos = screen->GetCrossHairPosition();
GetScreen()->SetCrossHairPosition( oldpos ); screen->SetCrossHairPosition( oldpos );
DrawPanel->CrossHairOff( aDC ); DrawPanel->CrossHairOff( aDC );
GetScreen()->SetCrossHairPosition( pos ); screen->SetCrossHairPosition( pos );
DrawPanel->CrossHairOn( aDC ); DrawPanel->CrossHairOn( aDC );
}
if( DrawPanel->IsMouseCaptured() ) if( DrawPanel->IsMouseCaptured() )
{ {
...@@ -510,18 +415,20 @@ void DISPLAY_FOOTPRINTS_FRAME::Show3D_Frame( wxCommandEvent& event ) ...@@ -510,18 +415,20 @@ void DISPLAY_FOOTPRINTS_FRAME::Show3D_Frame( wxCommandEvent& event )
m_Draw3DFrame = new WinEDA3D_DrawFrame( this, _( "3D Viewer" ), m_Draw3DFrame = new WinEDA3D_DrawFrame( this, _( "3D Viewer" ),
KICAD_DEFAULT_3D_DRAWFRAME_STYLE | KICAD_DEFAULT_3D_DRAWFRAME_STYLE |
wxFRAME_FLOAT_ON_PARENT ); wxFRAME_FLOAT_ON_PARENT );
m_Draw3DFrame->Show( TRUE ); m_Draw3DFrame->Show( true );
} }
/* Virtual function needed by the PCB_SCREEN class derived from BASE_SCREEN /* Virtual function needed by the PCB_SCREEN class derived from BASE_SCREEN
* this is a virtual pure function in BASE_SCREEN * this is a virtual pure function in BASE_SCREEN
* do nothing in cvpcb * do nothing in cvpcb
* could be removed later * could be removed later
*/ */
void PCB_SCREEN::ClearUndoORRedoList(UNDO_REDO_CONTAINER&, int ) void PCB_SCREEN::ClearUndoORRedoList( UNDO_REDO_CONTAINER&, int )
{ {
} }
/** /**
* Function IsGridVisible() , virtual * Function IsGridVisible() , virtual
* @return true if the grid must be shown * @return true if the grid must be shown
...@@ -531,10 +438,11 @@ bool DISPLAY_FOOTPRINTS_FRAME::IsGridVisible() ...@@ -531,10 +438,11 @@ bool DISPLAY_FOOTPRINTS_FRAME::IsGridVisible()
return m_DrawGrid; return m_DrawGrid;
} }
/** /**
* Function SetGridVisibility() , virtual * Function SetGridVisibility() , virtual
* It may be overloaded by derived classes * It may be overloaded by derived classes
* if you want to store/retrieve the grid visiblity in configuration. * if you want to store/retrieve the grid visibility in configuration.
* @param aVisible = true if the grid must be shown * @param aVisible = true if the grid must be shown
*/ */
void DISPLAY_FOOTPRINTS_FRAME::SetGridVisibility(bool aVisible) void DISPLAY_FOOTPRINTS_FRAME::SetGridVisibility(bool aVisible)
...@@ -542,6 +450,7 @@ void DISPLAY_FOOTPRINTS_FRAME::SetGridVisibility(bool aVisible) ...@@ -542,6 +450,7 @@ void DISPLAY_FOOTPRINTS_FRAME::SetGridVisibility(bool aVisible)
m_DrawGrid = aVisible; m_DrawGrid = aVisible;
} }
/** /**
* Function GetGridColor() , virtual * Function GetGridColor() , virtual
* @return the color of the grid * @return the color of the grid
...@@ -550,4 +459,3 @@ int DISPLAY_FOOTPRINTS_FRAME::GetGridColor() ...@@ -550,4 +459,3 @@ int DISPLAY_FOOTPRINTS_FRAME::GetGridColor()
{ {
return DARKGRAY; return DARKGRAY;
} }
...@@ -8,10 +8,7 @@ ...@@ -8,10 +8,7 @@
class DISPLAY_FOOTPRINTS_FRAME : public WinEDA_BasePcbFrame class DISPLAY_FOOTPRINTS_FRAME : public WinEDA_BasePcbFrame
{ {
public: public:
DISPLAY_FOOTPRINTS_FRAME( CVPCB_MAINFRAME* father, const wxString& title,
public:
DISPLAY_FOOTPRINTS_FRAME( CVPCB_MAINFRAME* father,
const wxString& title,
const wxPoint& pos, const wxSize& size, const wxPoint& pos, const wxSize& size,
long style = KICAD_DEFAULT_DRAWFRAME_STYLE ); long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
...@@ -26,6 +23,9 @@ public: ...@@ -26,6 +23,9 @@ public:
void OnSelectOptionToolbar( wxCommandEvent& event ); void OnSelectOptionToolbar( wxCommandEvent& event );
void OnUpdateTextDrawMode( wxUpdateUIEvent& aEvent );
void OnUpdateLineDrawMode( wxUpdateUIEvent& aEvent );
/** /**
* Function IsGridVisible() , virtual * Function IsGridVisible() , virtual
* @return true if the grid must be shown * @return true if the grid must be shown
...@@ -35,10 +35,10 @@ public: ...@@ -35,10 +35,10 @@ public:
/** /**
* Function SetGridVisibility() , virtual * Function SetGridVisibility() , virtual
* It may be overloaded by derived classes * It may be overloaded by derived classes
* if you want to store/retrieve the grid visiblity in configuration. * if you want to store/retrieve the grid visibility in configuration.
* @param aVisible = true if the grid must be shown * @param aVisible = true if the grid must be shown
*/ */
virtual void SetGridVisibility(bool aVisible); virtual void SetGridVisibility( bool aVisible );
/** /**
* Function GetGridColor() , virtual * Function GetGridColor() , virtual
* @return the color of the grid * @return the color of the grid
...@@ -48,8 +48,7 @@ public: ...@@ -48,8 +48,7 @@ public:
void OnLeftClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftClick( wxDC* DC, const wxPoint& MousePos );
void OnLeftDClick( wxDC* DC, const wxPoint& MousePos ); void OnLeftDClick( wxDC* DC, const wxPoint& MousePos );
bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu ); bool OnRightClick( const wxPoint& MousePos, wxMenu* PopMenu );
void SetToolbars(); void GeneralControle( wxDC* DC, const wxPoint& aPosition );
void GeneralControle( wxDC* DC, wxPoint Mouse );
void InstallOptionsDisplay( wxCommandEvent& event ); void InstallOptionsDisplay( wxCommandEvent& event );
MODULE* Get_Module( const wxString& CmpName ); MODULE* Get_Module( const wxString& CmpName );
...@@ -86,4 +85,3 @@ public: ...@@ -86,4 +85,3 @@ public:
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
...@@ -281,12 +281,6 @@ void SCH_EDIT_FRAME::GeneralControle( wxDC* aDC, const wxPoint& aPosition ) ...@@ -281,12 +281,6 @@ void SCH_EDIT_FRAME::GeneralControle( wxDC* aDC, const wxPoint& aPosition )
// Update cursor position. // Update cursor position.
screen->SetCrossHairPosition( pos ); screen->SetCrossHairPosition( pos );
if( screen->IsRefreshReq() )
{
DrawPanel->Refresh();
wxSafeYield();
}
if( oldpos != screen->GetCrossHairPosition() ) if( oldpos != screen->GetCrossHairPosition() )
{ {
pos = screen->GetCrossHairPosition(); pos = screen->GetCrossHairPosition();
...@@ -362,12 +356,6 @@ void LIB_EDIT_FRAME::GeneralControle( wxDC* aDC, const wxPoint& aPosition ) ...@@ -362,12 +356,6 @@ void LIB_EDIT_FRAME::GeneralControle( wxDC* aDC, const wxPoint& aPosition )
// Update the cursor position. // Update the cursor position.
screen->SetCrossHairPosition( pos ); screen->SetCrossHairPosition( pos );
if( screen->IsRefreshReq() )
{
DrawPanel->Refresh( );
wxSafeYield();
}
if( oldpos != screen->GetCrossHairPosition() ) if( oldpos != screen->GetCrossHairPosition() )
{ {
pos = screen->GetCrossHairPosition(); pos = screen->GetCrossHairPosition();
...@@ -443,12 +431,6 @@ void LIB_VIEW_FRAME::GeneralControle( wxDC* aDC, const wxPoint& aPosition ) ...@@ -443,12 +431,6 @@ void LIB_VIEW_FRAME::GeneralControle( wxDC* aDC, const wxPoint& aPosition )
// Update cursor position. // Update cursor position.
screen->SetCrossHairPosition( pos ); screen->SetCrossHairPosition( pos );
if( screen->IsRefreshReq() )
{
DrawPanel->Refresh( );
wxSafeYield();
}
if( oldpos != screen->GetCrossHairPosition() ) if( oldpos != screen->GetCrossHairPosition() )
{ {
pos = screen->GetCrossHairPosition(); pos = screen->GetCrossHairPosition();
......
...@@ -56,8 +56,6 @@ void SCH_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) ...@@ -56,8 +56,6 @@ void SCH_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
TraceWorkSheet( DC, GetScreen(), g_DrawDefaultLineThickness ); TraceWorkSheet( DC, GetScreen(), g_DrawDefaultLineThickness );
GetScreen()->ClrRefreshReq();
if( DrawPanel->IsMouseCaptured() ) if( DrawPanel->IsMouseCaptured() )
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, FALSE ); DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, FALSE );
......
...@@ -214,8 +214,6 @@ void LIB_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg ) ...@@ -214,8 +214,6 @@ void LIB_EDIT_FRAME::RedrawActiveWindow( wxDC* DC, bool EraseBg )
Field->m_Text = fieldText; Field->m_Text = fieldText;
} }
GetScreen()->ClrRefreshReq();
if( DrawPanel->IsMouseCaptured() ) if( DrawPanel->IsMouseCaptured() )
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false ); DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, false );
......
...@@ -80,7 +80,6 @@ BEGIN_EVENT_TABLE( LIB_EDIT_FRAME, EDA_DRAW_FRAME ) ...@@ -80,7 +80,6 @@ BEGIN_EVENT_TABLE( LIB_EDIT_FRAME, EDA_DRAW_FRAME )
EVT_ACTIVATE( LIB_EDIT_FRAME::OnActivate ) EVT_ACTIVATE( LIB_EDIT_FRAME::OnActivate )
/* Main horizontal toolbar. */ /* Main horizontal toolbar. */
EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_REDRAW, LIB_EDIT_FRAME::OnZoom )
EVT_TOOL( ID_LIBEDIT_SAVE_CURRENT_LIB, LIB_EDIT_FRAME::SaveActiveLibrary ) EVT_TOOL( ID_LIBEDIT_SAVE_CURRENT_LIB, LIB_EDIT_FRAME::SaveActiveLibrary )
EVT_TOOL( ID_LIBEDIT_SELECT_CURRENT_LIB, LIB_EDIT_FRAME::Process_Special_Functions ) EVT_TOOL( ID_LIBEDIT_SELECT_CURRENT_LIB, LIB_EDIT_FRAME::Process_Special_Functions )
EVT_TOOL( ID_LIBEDIT_DELETE_PART, LIB_EDIT_FRAME::DeleteOnePart ) EVT_TOOL( ID_LIBEDIT_DELETE_PART, LIB_EDIT_FRAME::DeleteOnePart )
......
...@@ -251,7 +251,7 @@ void SCH_SCREEN::ReplaceWires( SCH_ITEM* aWireList ) ...@@ -251,7 +251,7 @@ void SCH_SCREEN::ReplaceWires( SCH_ITEM* aWireList )
bool SCH_SCREEN::SchematicCleanUp( EDA_DRAW_PANEL* aCanvas, wxDC* aDC ) bool SCH_SCREEN::SchematicCleanUp( EDA_DRAW_PANEL* aCanvas, wxDC* aDC )
{ {
SCH_ITEM* DrawList, * TstDrawList; SCH_ITEM* DrawList, * TstDrawList;
bool Modify = FALSE; bool Modify = false;
DrawList = GetDrawItems(); DrawList = GetDrawItems();
...@@ -273,9 +273,9 @@ bool SCH_SCREEN::SchematicCleanUp( EDA_DRAW_PANEL* aCanvas, wxDC* aDC ) ...@@ -273,9 +273,9 @@ bool SCH_SCREEN::SchematicCleanUp( EDA_DRAW_PANEL* aCanvas, wxDC* aDC )
* segment can be flagged */ * segment can be flagged */
DrawList->m_Flags |= TstDrawList->m_Flags; DrawList->m_Flags |= TstDrawList->m_Flags;
EraseStruct( TstDrawList, this ); EraseStruct( TstDrawList, this );
SetRefreshReq(); aCanvas->Refresh();
TstDrawList = GetDrawItems(); TstDrawList = GetDrawItems();
Modify = TRUE; Modify = true;
} }
else else
{ {
...@@ -308,18 +308,18 @@ bool SCH_SCREEN::Save( FILE* aFile ) const ...@@ -308,18 +308,18 @@ bool SCH_SCREEN::Save( FILE* aFile ) const
if( fprintf( aFile, "%s %s %d", EESCHEMA_FILE_STAMP, if( fprintf( aFile, "%s %s %d", EESCHEMA_FILE_STAMP,
SCHEMATIC_HEAD_STRING, EESCHEMA_VERSION ) < 0 SCHEMATIC_HEAD_STRING, EESCHEMA_VERSION ) < 0
|| fprintf( aFile, " date %s\n", CONV_TO_UTF8( DateAndTime() ) ) < 0 ) || fprintf( aFile, " date %s\n", CONV_TO_UTF8( DateAndTime() ) ) < 0 )
return FALSE; return false;
BOOST_FOREACH( const CMP_LIBRARY& lib, CMP_LIBRARY::GetLibraryList() ) BOOST_FOREACH( const CMP_LIBRARY& lib, CMP_LIBRARY::GetLibraryList() )
{ {
if( fprintf( aFile, "LIBS:%s\n", CONV_TO_UTF8( lib.GetName() ) ) < 0 ) if( fprintf( aFile, "LIBS:%s\n", CONV_TO_UTF8( lib.GetName() ) ) < 0 )
return FALSE; return false;
} }
if( fprintf( aFile, "EELAYER %2d %2d\n", g_LayerDescr.NumberOfLayers, if( fprintf( aFile, "EELAYER %2d %2d\n", g_LayerDescr.NumberOfLayers,
g_LayerDescr.CurrentLayer ) < 0 g_LayerDescr.CurrentLayer ) < 0
|| fprintf( aFile, "EELAYER END\n" ) < 0 ) || fprintf( aFile, "EELAYER END\n" ) < 0 )
return FALSE; return false;
/* Write page info, ScreenNumber and NumberOfScreen; not very meaningful for /* Write page info, ScreenNumber and NumberOfScreen; not very meaningful for
* SheetNumber and Sheet Count in a complex hierarchy, but useful in * SheetNumber and Sheet Count in a complex hierarchy, but useful in
...@@ -339,18 +339,18 @@ bool SCH_SCREEN::Save( FILE* aFile ) const ...@@ -339,18 +339,18 @@ bool SCH_SCREEN::Save( FILE* aFile ) const
|| fprintf( aFile, "Comment3 \"%s\"\n", CONV_TO_UTF8( m_Commentaire3 ) ) < 0 || fprintf( aFile, "Comment3 \"%s\"\n", CONV_TO_UTF8( m_Commentaire3 ) ) < 0
|| fprintf( aFile, "Comment4 \"%s\"\n", CONV_TO_UTF8( m_Commentaire4 ) ) < 0 || fprintf( aFile, "Comment4 \"%s\"\n", CONV_TO_UTF8( m_Commentaire4 ) ) < 0
|| fprintf( aFile, "$EndDescr\n" ) < 0 ) || fprintf( aFile, "$EndDescr\n" ) < 0 )
return FALSE; return false;
for( SCH_ITEM* item = GetDrawItems(); item; item = item->Next() ) for( SCH_ITEM* item = GetDrawItems(); item; item = item->Next() )
{ {
if( !item->Save( aFile ) ) if( !item->Save( aFile ) )
return FALSE; return false;
} }
if( fprintf( aFile, "$EndSCHEMATC\n" ) < 0 ) if( fprintf( aFile, "$EndSCHEMATC\n" ) < 0 )
return FALSE; return false;
return TRUE; return true;
} }
......
...@@ -78,8 +78,6 @@ BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, EDA_DRAW_FRAME ) ...@@ -78,8 +78,6 @@ BEGIN_EVENT_TABLE( SCH_EDIT_FRAME, EDA_DRAW_FRAME )
EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, SCH_EDIT_FRAME::SetLanguage ) EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END, SCH_EDIT_FRAME::SetLanguage )
EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_REDRAW, SCH_EDIT_FRAME::OnZoom )
EVT_TOOL( ID_TO_LIBRARY, SCH_EDIT_FRAME::OnOpenLibraryEditor ) EVT_TOOL( ID_TO_LIBRARY, SCH_EDIT_FRAME::OnOpenLibraryEditor )
EVT_TOOL( ID_TO_LIBVIEW, SCH_EDIT_FRAME::OnOpenLibraryViewer ) EVT_TOOL( ID_TO_LIBVIEW, SCH_EDIT_FRAME::OnOpenLibraryViewer )
......
...@@ -49,7 +49,6 @@ BEGIN_EVENT_TABLE( LIB_VIEW_FRAME, EDA_DRAW_FRAME ) ...@@ -49,7 +49,6 @@ BEGIN_EVENT_TABLE( LIB_VIEW_FRAME, EDA_DRAW_FRAME )
EVT_TOOL_RANGE( ID_LIBVIEW_NEXT, ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT, EVT_TOOL_RANGE( ID_LIBVIEW_NEXT, ID_LIBVIEW_DE_MORGAN_CONVERT_BUTT,
LIB_VIEW_FRAME::Process_Special_Functions ) LIB_VIEW_FRAME::Process_Special_Functions )
EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_REDRAW, LIB_VIEW_FRAME::OnZoom )
EVT_TOOL( ID_LIBVIEW_CMP_EXPORT_TO_SCHEMATIC, EVT_TOOL( ID_LIBVIEW_CMP_EXPORT_TO_SCHEMATIC,
LIB_VIEW_FRAME::ExportToSchematicLibraryPart ) LIB_VIEW_FRAME::ExportToSchematicLibraryPart )
EVT_KICAD_CHOICEBOX( ID_LIBVIEW_SELECT_PART_NUMBER, EVT_KICAD_CHOICEBOX( ID_LIBVIEW_SELECT_PART_NUMBER,
......
...@@ -17,21 +17,6 @@ void WinEDA_GerberFrame::GeneralControle( wxDC* aDC, const wxPoint& aPosition ) ...@@ -17,21 +17,6 @@ void WinEDA_GerberFrame::GeneralControle( wxDC* aDC, const wxPoint& aPosition )
pos = GetScreen()->GetNearestGridPosition( pos ); pos = GetScreen()->GetNearestGridPosition( pos );
if( GetScreen()->IsRefreshReq() )
{
DrawPanel->Refresh( );
wxSafeYield();
// We must return here, instead of proceeding.
// If we let the cursor move during a refresh request,
// the cursor be displayed in the wrong place
// during delayed repaint events that occur when
// you move the mouse when a message dialog is on
// the screen, and then you dismiss the dialog by
// typing the Enter key.
return;
}
oldpos = GetScreen()->GetCrossHairPosition(); oldpos = GetScreen()->GetCrossHairPosition();
gridSize = GetScreen()->GetGridSize(); gridSize = GetScreen()->GetGridSize();
...@@ -87,11 +72,5 @@ void WinEDA_GerberFrame::GeneralControle( wxDC* aDC, const wxPoint& aPosition ) ...@@ -87,11 +72,5 @@ void WinEDA_GerberFrame::GeneralControle( wxDC* aDC, const wxPoint& aPosition )
OnHotKey( aDC, hotkey, NULL ); OnHotKey( aDC, hotkey, NULL );
} }
if( GetScreen()->IsRefreshReq() )
{
DrawPanel->Refresh( );
wxSafeYield();
}
UpdateStatusBar(); UpdateStatusBar();
} }
...@@ -261,8 +261,6 @@ void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, const wxPoin ...@@ -261,8 +261,6 @@ void BOARD::Draw( EDA_DRAW_PANEL* aPanel, wxDC* aDC, int aDrawMode, const wxPoin
delete layerBitmap; delete layerBitmap;
delete screenBitmap; delete screenBitmap;
} }
m_PcbFrame->GetScreen()->ClrRefreshReq();
} }
/* Function DrawItemsDCodeID /* Function DrawItemsDCodeID
......
...@@ -176,7 +176,6 @@ bool WinEDA_GerberFrame::LoadGerberFiles( const wxString& aFullFileName ) ...@@ -176,7 +176,6 @@ bool WinEDA_GerberFrame::LoadGerberFiles( const wxString& aFullFileName )
} }
Zoom_Automatique( true ); Zoom_Automatique( true );
GetScreen()->SetRefreshReq();
g_SaveTime = time( NULL ); g_SaveTime = time( NULL );
// Synchronize layers tools with actual active layer: // Synchronize layers tools with actual active layer:
...@@ -220,5 +219,5 @@ static void LoadDCodeFile( WinEDA_GerberFrame* frame, const wxString& FullFileNa ...@@ -220,5 +219,5 @@ static void LoadDCodeFile( WinEDA_GerberFrame* frame, const wxString& FullFileNa
frame->Read_D_Code_File( fn.GetFullPath() ); frame->Read_D_Code_File( fn.GetFullPath() );
frame->CopyDCodesSizeToItems(); frame->CopyDCodesSizeToItems();
frame->GetScreen()->SetRefreshReq(); frame->Refresh();
} }
...@@ -29,8 +29,6 @@ BEGIN_EVENT_TABLE( WinEDA_GerberFrame, WinEDA_BasePcbFrame ) ...@@ -29,8 +29,6 @@ BEGIN_EVENT_TABLE( WinEDA_GerberFrame, WinEDA_BasePcbFrame )
EVT_CLOSE( WinEDA_GerberFrame::OnCloseWindow ) EVT_CLOSE( WinEDA_GerberFrame::OnCloseWindow )
EVT_SIZE( WinEDA_GerberFrame::OnSize ) EVT_SIZE( WinEDA_GerberFrame::OnSize )
EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_REDRAW, WinEDA_GerberFrame::OnZoom )
EVT_TOOL( wxID_FILE, WinEDA_GerberFrame::Files_io ) EVT_TOOL( wxID_FILE, WinEDA_GerberFrame::Files_io )
EVT_TOOL( ID_INC_LAYER_AND_APPEND_FILE, WinEDA_GerberFrame::Files_io ) EVT_TOOL( ID_INC_LAYER_AND_APPEND_FILE, WinEDA_GerberFrame::Files_io )
EVT_TOOL( ID_GERBVIEW_LOAD_DRILL_FILE, WinEDA_GerberFrame::Files_io ) EVT_TOOL( ID_GERBVIEW_LOAD_DRILL_FILE, WinEDA_GerberFrame::Files_io )
......
...@@ -81,6 +81,6 @@ void WinEDA_GerberFrame::Erase_Current_Layer( bool query ) ...@@ -81,6 +81,6 @@ void WinEDA_GerberFrame::Erase_Current_Layer( bool query )
} }
ScreenPcb->SetModify(); ScreenPcb->SetModify();
ScreenPcb->SetRefreshReq(); DrawPanel->Refresh();
syncLayerBox(); syncLayerBox();
} }
...@@ -248,14 +248,11 @@ public: ...@@ -248,14 +248,11 @@ public:
} }
void SetRefreshReq() { m_FlagRefreshReq = 1; }
void ClrRefreshReq() { m_FlagRefreshReq = 0; }
void SetModify() { m_FlagModified = 1; m_FlagSave = 0; } void SetModify() { m_FlagModified = 1; m_FlagSave = 0; }
void ClrModify() { m_FlagModified = 0; m_FlagSave = 1; } void ClrModify() { m_FlagModified = 0; m_FlagSave = 1; }
void SetSave() { m_FlagSave = 1; } void SetSave() { m_FlagSave = 1; }
void ClrSave() { m_FlagSave = 0; } void ClrSave() { m_FlagSave = 0; }
int IsModify() { return m_FlagModified & 1; } int IsModify() { return m_FlagModified & 1; }
int IsRefreshReq() { return m_FlagRefreshReq & 1; }
int IsSave() { return m_FlagSave & 1; } int IsSave() { return m_FlagSave & 1; }
......
...@@ -216,7 +216,7 @@ void WinEDA_BasePcbFrame::SwitchLayer( wxDC* DC, int layer ) ...@@ -216,7 +216,7 @@ void WinEDA_BasePcbFrame::SwitchLayer( wxDC* DC, int layer )
GetScreen()->m_Active_Layer = layer; GetScreen()->m_Active_Layer = layer;
if( DisplayOpt.ContrastModeDisplay ) if( DisplayOpt.ContrastModeDisplay )
GetScreen()->SetRefreshReq(); DrawPanel->Refresh();
} }
......
...@@ -370,11 +370,5 @@ void WinEDA_PcbFrame::GeneralControle( wxDC* aDC, const wxPoint& aPosition ) ...@@ -370,11 +370,5 @@ void WinEDA_PcbFrame::GeneralControle( wxDC* aDC, const wxPoint& aPosition )
OnHotKey( aDC, hotkey, aPosition ); OnHotKey( aDC, hotkey, aPosition );
} }
if( GetScreen()->IsRefreshReq() )
{
DrawPanel->Refresh( );
wxSafeYield();
}
UpdateStatusBar(); /* Display new cursor coordinates */ UpdateStatusBar(); /* Display new cursor coordinates */
} }
...@@ -317,8 +317,9 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event ) ...@@ -317,8 +317,9 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
GetBoard()->GetBoardDesignSettings()->m_CurrentViaType = VIA_MICROVIA; // place micro via and switch layer GetBoard()->GetBoardDesignSettings()->m_CurrentViaType = VIA_MICROVIA; // place micro via and switch layer
Other_Layer_Route( (TRACK*) GetCurItem(), &dc ); Other_Layer_Route( (TRACK*) GetCurItem(), &dc );
GetBoard()->GetBoardDesignSettings()->m_CurrentViaType = v_type; GetBoard()->GetBoardDesignSettings()->m_CurrentViaType = v_type;
if( DisplayOpt.ContrastModeDisplay ) if( DisplayOpt.ContrastModeDisplay )
( (PCB_SCREEN*) GetScreen() )->SetRefreshReq(); DrawPanel->Refresh();
} }
break; break;
...@@ -1168,7 +1169,7 @@ void WinEDA_PcbFrame::SwitchLayer( wxDC* DC, int layer ) ...@@ -1168,7 +1169,7 @@ void WinEDA_PcbFrame::SwitchLayer( wxDC* DC, int layer )
if( Other_Layer_Route( (TRACK*) GetScreen()->GetCurItem(), DC ) ) if( Other_Layer_Route( (TRACK*) GetScreen()->GetCurItem(), DC ) )
{ {
if( DisplayOpt.ContrastModeDisplay ) if( DisplayOpt.ContrastModeDisplay )
GetScreen()->SetRefreshReq(); DrawPanel->Refresh();
} }
// if the via was allowed by DRC, then the layer swap has already // if the via was allowed by DRC, then the layer swap has already
// been done by Other_Layer_Route(). if via not allowed, then // been done by Other_Layer_Route(). if via not allowed, then
...@@ -1186,7 +1187,7 @@ void WinEDA_PcbFrame::SwitchLayer( wxDC* DC, int layer ) ...@@ -1186,7 +1187,7 @@ void WinEDA_PcbFrame::SwitchLayer( wxDC* DC, int layer )
setActiveLayer( layer ); setActiveLayer( layer );
if( DisplayOpt.ContrastModeDisplay ) if( DisplayOpt.ContrastModeDisplay )
GetScreen()->SetRefreshReq(); DrawPanel->Refresh();
} }
......
...@@ -39,8 +39,6 @@ BEGIN_EVENT_TABLE( WinEDA_ModuleEditFrame, WinEDA_BasePcbFrame ) ...@@ -39,8 +39,6 @@ BEGIN_EVENT_TABLE( WinEDA_ModuleEditFrame, WinEDA_BasePcbFrame )
EVT_KICAD_CHOICEBOX( ID_ON_ZOOM_SELECT, WinEDA_ModuleEditFrame::OnSelectZoom ) EVT_KICAD_CHOICEBOX( ID_ON_ZOOM_SELECT, WinEDA_ModuleEditFrame::OnSelectZoom )
EVT_KICAD_CHOICEBOX( ID_ON_GRID_SELECT, WinEDA_ModuleEditFrame::OnSelectGrid ) EVT_KICAD_CHOICEBOX( ID_ON_GRID_SELECT, WinEDA_ModuleEditFrame::OnSelectGrid )
EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_REDRAW, WinEDA_ModuleEditFrame::OnZoom )
EVT_TOOL( ID_MODEDIT_SELECT_CURRENT_LIB, WinEDA_ModuleEditFrame::Process_Special_Functions ) EVT_TOOL( ID_MODEDIT_SELECT_CURRENT_LIB, WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_SAVE_LIBMODULE, WinEDA_ModuleEditFrame::Process_Special_Functions ) EVT_TOOL( ID_MODEDIT_SAVE_LIBMODULE, WinEDA_ModuleEditFrame::Process_Special_Functions )
EVT_TOOL( ID_MODEDIT_DELETE_PART, WinEDA_ModuleEditFrame::Process_Special_Functions ) EVT_TOOL( ID_MODEDIT_DELETE_PART, WinEDA_ModuleEditFrame::Process_Special_Functions )
...@@ -339,20 +337,6 @@ void WinEDA_ModuleEditFrame::GeneralControle( wxDC* aDC, const wxPoint& aPositio ...@@ -339,20 +337,6 @@ void WinEDA_ModuleEditFrame::GeneralControle( wxDC* aDC, const wxPoint& aPositio
int hotkey = 0; int hotkey = 0;
wxPoint pos = aPosition; wxPoint pos = aPosition;
if( GetScreen()->IsRefreshReq() )
{
DrawPanel->Refresh();
// We must return here, instead of proceeding.
// If we let the cursor move during a refresh request,
// the cursor be displayed in the wrong place
// during delayed repaint events that occur when
// you move the mouse when a message dialog is on
// the screen, and then you dismiss the dialog by
// typing the Enter key.
return;
}
pos = GetScreen()->GetNearestGridPosition( aPosition ); pos = GetScreen()->GetNearestGridPosition( aPosition );
oldpos = GetScreen()->GetCrossHairPosition(); oldpos = GetScreen()->GetCrossHairPosition();
gridSize = GetScreen()->GetGridSize(); gridSize = GetScreen()->GetGridSize();
...@@ -409,12 +393,6 @@ void WinEDA_ModuleEditFrame::GeneralControle( wxDC* aDC, const wxPoint& aPositio ...@@ -409,12 +393,6 @@ void WinEDA_ModuleEditFrame::GeneralControle( wxDC* aDC, const wxPoint& aPositio
OnHotKey( aDC, hotkey, aPosition ); OnHotKey( aDC, hotkey, aPosition );
} }
if( GetScreen()->IsRefreshReq() )
{
DrawPanel->Refresh();
wxSafeYield();
}
UpdateStatusBar(); UpdateStatusBar();
} }
......
...@@ -194,7 +194,7 @@ void Abort_MoveOrCopyModule( EDA_DRAW_PANEL* Panel, wxDC* DC ) ...@@ -194,7 +194,7 @@ void Abort_MoveOrCopyModule( EDA_DRAW_PANEL* Panel, wxDC* DC )
pcbframe->DrawGeneralRatsnest( DC ); pcbframe->DrawGeneralRatsnest( DC );
#ifdef __WXMAC__ #ifdef __WXMAC__
pcbframe->GetScreen()->SetRefreshReq(); Panel->Refresh();
#endif #endif
} }
......
...@@ -74,8 +74,6 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame ) ...@@ -74,8 +74,6 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame )
EVT_CLOSE( WinEDA_PcbFrame::OnCloseWindow ) EVT_CLOSE( WinEDA_PcbFrame::OnCloseWindow )
EVT_SIZE( WinEDA_PcbFrame::OnSize ) EVT_SIZE( WinEDA_PcbFrame::OnSize )
EVT_TOOL_RANGE( ID_ZOOM_IN, ID_ZOOM_REDRAW, WinEDA_PcbFrame::OnZoom )
EVT_TOOL( ID_LOAD_FILE, WinEDA_PcbFrame::Files_io ) EVT_TOOL( ID_LOAD_FILE, WinEDA_PcbFrame::Files_io )
EVT_TOOL( ID_MENU_READ_LAST_SAVED_VERSION_BOARD, WinEDA_PcbFrame::Files_io ) EVT_TOOL( ID_MENU_READ_LAST_SAVED_VERSION_BOARD, WinEDA_PcbFrame::Files_io )
EVT_TOOL( ID_MENU_RECOVER_BOARD, WinEDA_PcbFrame::Files_io ) EVT_TOOL( ID_MENU_RECOVER_BOARD, WinEDA_PcbFrame::Files_io )
......
...@@ -62,8 +62,6 @@ void WinEDA_ModuleEditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg ) ...@@ -62,8 +62,6 @@ void WinEDA_ModuleEditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
} }
#endif #endif
screen->ClrRefreshReq();
if( DrawPanel->IsMouseCaptured() ) if( DrawPanel->IsMouseCaptured() )
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, FALSE ); DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, FALSE );
...@@ -100,8 +98,6 @@ void WinEDA_PcbFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg ) ...@@ -100,8 +98,6 @@ void WinEDA_PcbFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
} }
#endif #endif
GetScreen()->ClrRefreshReq();
if( DrawPanel->IsMouseCaptured() ) if( DrawPanel->IsMouseCaptured() )
DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, FALSE ); DrawPanel->m_mouseCaptureCallback( DrawPanel, DC, wxDefaultPosition, FALSE );
......
...@@ -79,7 +79,7 @@ void WinEDA_PcbFrame::Delete_Zone_Fill( SEGZONE* aZone, long aTimestamp ) ...@@ -79,7 +79,7 @@ void WinEDA_PcbFrame::Delete_Zone_Fill( SEGZONE* aZone, long aTimestamp )
if( modify ) if( modify )
{ {
OnModify(); OnModify();
GetScreen()->SetRefreshReq(); DrawPanel->Refresh();
} }
} }
......
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