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,
......
This diff is collapsed.
...@@ -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