Minor fixes and code cleaning.

* Remove redundant background redrawing RedrawActiveWindow.
* Remove redundant managed cursor callback in RedrawActiveWindow.
* Use refresh to redraw instead of directly calling RedrawActiveWindow.
* Remove unused SetDrawBgColor for drawframe.cpp.
* Fix compiler warning in cvpcb/cvframe.cpp.
* Fix menu spelling and syntax errors in pcbnew.
* Rename Trace_Curseur to DrawCursor in common/drawpanel.cpp.
This commit is contained in:
stambaughw 2010-01-22 18:13:43 +00:00
parent f41cc301f8
commit 7ab4a9bf2c
17 changed files with 111 additions and 178 deletions

View File

@ -596,34 +596,6 @@ void WinEDA_DrawFrame::AdjustScrollBars()
}
/* Updates the background color for drawing panel. The only valid colors
* are BLACK and WHITE.
* XorMode the parameter is updated according to the background color
*/
void WinEDA_DrawFrame::SetDrawBgColor( int color_num )
{
if( ( color_num != WHITE ) && ( color_num != BLACK ) )
color_num = BLACK;
g_DrawBgColor = color_num;
if( color_num == WHITE )
{
g_XorMode = GR_NXOR;
g_GhostColor = BLACK;
}
else
{
g_XorMode = GR_XOR;
g_GhostColor = WHITE;
}
if( DrawPanel )
DrawPanel->SetBackgroundColour(
wxColour( ColorRefs[g_DrawBgColor].m_Red,
ColorRefs[g_DrawBgColor].m_Green,
ColorRefs[g_DrawBgColor].m_Blue ) );
}
void WinEDA_DrawFrame::SetLanguage( wxCommandEvent& event )
{
int id = event.GetId();

View File

@ -121,32 +121,32 @@ BASE_SCREEN* WinEDA_DrawPanel::GetScreen()
/*
* Draw the schematic cursor which is usually on grid
*/
void WinEDA_DrawPanel::Trace_Curseur( wxDC* DC, int color )
void WinEDA_DrawPanel::DrawCursor( wxDC* aDC, int aColor )
{
if( m_CursorLevel != 0 || DC == NULL )
if( m_CursorLevel != 0 || aDC == NULL )
return;
wxPoint Cursor = GetScreen()->m_Curseur;
GRSetDrawMode( DC, GR_XOR );
GRSetDrawMode( aDC, GR_XOR );
if( m_Parent->m_CursorShape == 1 ) /* Draws a crosshair. */
{
int dx = GetScreen()->Unscale( m_ClipBox.GetWidth() );
int dy = GetScreen()->Unscale( m_ClipBox.GetHeight() );
GRLine( &m_ClipBox, DC, Cursor.x - dx, Cursor.y,
Cursor.x + dx, Cursor.y, 0, color ); // Y axis
GRLine( &m_ClipBox, DC, Cursor.x, Cursor.y - dx,
Cursor.x, Cursor.y + dy, 0, color ); // X axis
GRLine( &m_ClipBox, aDC, Cursor.x - dx, Cursor.y,
Cursor.x + dx, Cursor.y, 0, aColor ); // Y axis
GRLine( &m_ClipBox, aDC, Cursor.x, Cursor.y - dx,
Cursor.x, Cursor.y + dy, 0, aColor ); // X axis
}
else
{
int len = GetScreen()->Unscale( CURSOR_SIZE );
GRLine( &m_ClipBox, DC, Cursor.x - len, Cursor.y,
Cursor.x + len, Cursor.y, 0, color );
GRLine( &m_ClipBox, DC, Cursor.x, Cursor.y - len,
Cursor.x, Cursor.y + len, 0, color );
GRLine( &m_ClipBox, aDC, Cursor.x - len, Cursor.y,
Cursor.x + len, Cursor.y, 0, aColor );
GRLine( &m_ClipBox, aDC, Cursor.x, Cursor.y - len,
Cursor.x, Cursor.y + len, 0, aColor );
}
}
@ -157,7 +157,7 @@ void WinEDA_DrawPanel::Trace_Curseur( wxDC* DC, int color )
*/
void WinEDA_DrawPanel::CursorOff( wxDC* DC )
{
Trace_Curseur( DC );
DrawCursor( DC );
--m_CursorLevel;
}
@ -168,7 +168,7 @@ void WinEDA_DrawPanel::CursorOff( wxDC* DC )
void WinEDA_DrawPanel::CursorOn( wxDC* DC )
{
++m_CursorLevel;
Trace_Curseur( DC );
DrawCursor( DC );
if( m_CursorLevel > 0 ) // Shouldn't happen, but just in case ..
m_CursorLevel = 0;

View File

@ -200,7 +200,7 @@ WinEDA_CvpcbFrame::WinEDA_CvpcbFrame( const wxString& title,
if( m_FootprintList )
m_auimgr.AddPane( m_FootprintList,
wxAuiPaneInfo( horiz ).Name( wxT( "m_FootprintList" ) ).
Right().BestSize( m_FrameSize.x * 0.36, m_FrameSize.y ) );
Right().BestSize( (int) ( m_FrameSize.x * 0.36 ), m_FrameSize.y ) );
m_auimgr.Update();
#endif

View File

@ -297,7 +297,7 @@ void WinEDA_DisplayFrame::GeneralControle( wxDC* DC, wxPoint Mouse )
if( GetScreen()->IsRefreshReq() )
{
flagcurseur = 2;
RedrawActiveWindow( DC, TRUE );
Refresh();
}
if( oldpos != GetScreen()->m_Curseur )

View File

@ -92,16 +92,14 @@ void WinEDA_DisplayFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
ActiveScreen = (PCB_SCREEN*) GetScreen();
if( EraseBg )
DrawPanel->EraseScreen( DC );
DrawPanel->DrawBackGround( DC );
GetBoard()->Draw( DrawPanel, DC, GR_COPY );
MODULE* Module = GetBoard()->m_Modules;
if ( Module )
Module->DisplayInfo( this );
DrawPanel->Trace_Curseur( DC );
DrawPanel->DrawCursor( DC );
}

View File

@ -378,7 +378,8 @@ void WinEDA_SetColorsFrame::UpdateLayerSettings()
g_DrawBgColor = WHITE;
else
g_DrawBgColor = BLACK;
m_Parent->SetDrawBgColor( g_DrawBgColor );
m_Parent->Refresh();
}

View File

@ -52,21 +52,6 @@ void WinEDA_SchematicFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
ActiveScreen = GetScreen();
/* Reinit draw and pen parameters */
GRResetPenAndBrush( DC );
DC->SetBackground( *wxBLACK_BRUSH );
DC->SetBackgroundMode( wxTRANSPARENT );
DrawPanel->CursorOff( DC );
if( DrawPanel->ManageCurseur )
{
DrawPanel->ManageCurseur( DrawPanel, DC, FALSE );
}
if( EraseBg )
DrawPanel->EraseScreen( DC );
DrawPanel->DrawBackGround( DC );
RedrawStructList( DrawPanel, DC, GetScreen()->EEDrawList,
@ -74,14 +59,13 @@ void WinEDA_SchematicFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
TraceWorkSheet( DC, GetScreen(), g_DrawDefaultLineThickness );
DrawPanel->CursorOn( DC );
if( DrawPanel->ManageCurseur )
{
DrawPanel->ManageCurseur( DrawPanel, DC, FALSE );
}
GetScreen()->ClrRefreshReq();
if( DrawPanel->ManageCurseur )
DrawPanel->ManageCurseur( DrawPanel, DC, FALSE );
DrawPanel->DrawCursor( DC );
// Display the sheet filename, and the sheet path, for non root sheets
if( GetScreen()->m_FileName == m_DefaultSchematicFileName )
{

View File

@ -305,7 +305,6 @@ bool WinEDA_SchematicFrame::LoadProjectFile( const wxString& CfgFileName,
if( m_ComponentLibFiles.GetCount() == 0 )
m_ComponentLibFiles.Add( wxT( "power" ) );
SetDrawBgColor( g_DrawBgColor );
LoadLibraries();
GetBaseScreen()->SetGrid( ID_POPUP_GRID_LEVEL_1000 + m_LastGridSizeId );

View File

@ -201,33 +201,19 @@ void WinEDA_LibeditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
ActiveScreen = GetScreen();
DC->SetBackground( *wxBLACK_BRUSH );
DC->SetBackgroundMode( wxTRANSPARENT );
GRResetPenAndBrush( DC );
DrawPanel->CursorOff( DC );
if( DrawPanel->ManageCurseur )
{
DrawPanel->ManageCurseur( DrawPanel, DC, false );
}
if( EraseBg )
DrawPanel->EraseScreen( DC );
DrawPanel->DrawBackGround( DC );
if( m_component )
m_component->Draw( DrawPanel, DC, wxPoint( 0, 0 ), m_unit,
m_convert, GR_DEFAULT_DRAWMODE );
DrawPanel->CursorOn( DC ); // redraw cursor
GetScreen()->ClrRefreshReq();
if( DrawPanel->ManageCurseur )
{
DrawPanel->ManageCurseur( DrawPanel, DC, false );
}
GetScreen()->ClrRefreshReq();
DrawPanel->DrawCursor( DC );
DisplayLibInfos();
UpdateStatusBar();
}

View File

@ -266,14 +266,6 @@ void WinEDA_ViewlibFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
if( entry == NULL )
return;
/* Forcage de la reinit de la brosse et plume courante */
GRResetPenAndBrush( DC );
DC->SetBackground( *wxBLACK_BRUSH );
DC->SetBackgroundMode( wxTRANSPARENT );
if( EraseBg )
DrawPanel->EraseScreen( DC );
DrawPanel->DrawBackGround( DC );
if( entry->isAlias() )
@ -312,6 +304,9 @@ void WinEDA_ViewlibFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
component->Draw( DrawPanel, DC, wxPoint( 0, 0 ), m_unit, m_convert,
GR_DEFAULT_DRAWMODE );
/* Redraw the cursor */
DrawPanel->DrawCursor( DC );
if( !tmp.IsEmpty() )
component->SetName( tmp );
@ -320,6 +315,4 @@ void WinEDA_ViewlibFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
AppendMsgPanel( _( "Alias" ), msg, RED, 6 );
AppendMsgPanel( _( "Description" ), entry->GetDescription(), CYAN, 6 );
AppendMsgPanel( _( "Key words" ), entry->GetKeyWords(), DARKDARKGRAY );
DrawPanel->Trace_Curseur( DC );
}

View File

@ -297,7 +297,7 @@ void WinEDA_GerberFrame::Block_Delete( wxDC* DC )
}
}
RedrawActiveWindow( DC, TRUE );
Refresh();
}

View File

@ -77,9 +77,6 @@ void WinEDA_GerberFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
ActiveScreen = screen;
GRSetDrawMode( DC, GR_COPY );
if( EraseBg )
DrawPanel->EraseScreen( DC );
DrawPanel->DrawBackGround( DC );
Trace_Gerber( DC, GR_COPY, -1 );
@ -88,7 +85,7 @@ void WinEDA_GerberFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
if( DrawPanel->ManageCurseur )
DrawPanel->ManageCurseur( DrawPanel, DC, FALSE );
DrawPanel->Trace_Curseur( DC );
DrawPanel->DrawCursor( DC );
}
/********************************************************************/

View File

@ -196,8 +196,20 @@ public:
void MouseTo( const wxPoint& Mouse );
/* Cursor functions */
// Draw the user cursor (grid cursor)
void Trace_Curseur( wxDC* DC, int color = WHITE );
/**
* Draw the user cursor.
*
* The user cursor is not the mouse cursor although they may be at the
* same screen position. The mouse cursor is still render by the OS.
* This is a drawn cursor that is used to snap to grid when grid snapping
* is enabled. This is required because OSX does not allow moving the
* cursor programmatically.
*
* @param aDC - the device context to draw the cursor
* @param aColor - the color to draw the cursor
*/
void DrawCursor( wxDC* aDC, int aColor = WHITE );
// remove the grid cursor from the display
void CursorOff( wxDC* DC );
// display the grid cursor

View File

@ -224,7 +224,6 @@ public:
void Affiche_Message( const wxString& message );
void EraseMsgBox();
void Process_PageSettings( wxCommandEvent& event );
void SetDrawBgColor( int color_num );
virtual void SetToolbars();
void SetLanguage( wxCommandEvent& event );
virtual void ReCreateHToolbar() = 0;

View File

@ -417,7 +417,7 @@ int BOARD::GetVisibleElementColor( int aPCB_VISIBLE )
case RATSNEST_VISIBLE: color = m_BoardSettings->m_RatsnestColor; break;
case GRID_VISIBLE: color = g_GridColor; break;
default:
wxLogDebug("BOARD::GetVisibleElementColor(): bad arg %d", aPCB_VISIBLE );
wxLogDebug( wxT( "BOARD::GetVisibleElementColor(): bad arg %d" ), aPCB_VISIBLE );
}
return color;
@ -442,7 +442,7 @@ void BOARD::SetVisibleElementColor( int aPCB_VISIBLE, int aColor )
case RATSNEST_VISIBLE: m_BoardSettings->m_RatsnestColor = aColor; break;
case GRID_VISIBLE: g_GridColor = aColor; break;
default:
wxLogDebug("BOARD::SetVisibleElementColor(): bad arg %d", aPCB_VISIBLE );
wxLogDebug( wxT( "BOARD::SetVisibleElementColor(): bad arg %d" ), aPCB_VISIBLE );
}
}

View File

@ -57,7 +57,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
/* PCBNew Board */
item = new wxMenuItem( filesMenu, ID_APPEND_FILE, _( "&Append Board" ),
_( "Append a other PCBNew board to the current loaded board" ) );
_( "Append another PCBNew board to the current loaded board" ) );
item->SetBitmap( import_xpm );
filesMenu->Append( item );
@ -66,8 +66,8 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
/* Save */
item = new wxMenuItem( filesMenu, ID_SAVE_BOARD,
_( "&Save\tCtrl+S" ),
_( "Save current board" ) );
_( "&Save\tCtrl+S" ),
_( "Save current board" ) );
item->SetBitmap( save_xpm );
filesMenu->Append( item );
@ -83,14 +83,14 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
/* Revert */
item = new wxMenuItem( filesMenu, ID_MENU_READ_LAST_SAVED_VERSION_BOARD,
_( "&Revert" ),
_( "Clear board and get previous saved version of board" ) );
_( "&Revert" ),
_( "Clear board and get previous saved version of board" ) );
item->SetBitmap( jigsaw_xpm );
filesMenu->Append( item );
/* Rescue */
item = new wxMenuItem( filesMenu, ID_MENU_RECOVER_BOARD, _( "&Rescue" ),
_( "Clear old board and get last rescue file" ) );
_( "Clear old board and get last rescue file" ) );
item->SetBitmap( hammer_xpm );
filesMenu->Append( item );
@ -101,28 +101,28 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
/* Fabrication Outputs submenu */
wxMenu* fabricationOutputsMenu = new wxMenu;
item = new wxMenuItem( fabricationOutputsMenu, ID_PCB_GEN_POS_MODULES_FILE,
_( "&Modules Position" ),
_( "Generate modules position file for pick and place" ) );
_( "&Modules Position" ),
_( "Generate modules position file for pick and place" ) );
item->SetBitmap( post_compo_xpm );
fabricationOutputsMenu->Append( item );
item = new wxMenuItem( fabricationOutputsMenu, ID_PCB_GEN_DRILL_FILE,
_( "&Drill File" ),
_( "Generate excellon2 drill file" ) );
_( "&Drill File" ),
_( "Generate excellon2 drill file" ) );
item->SetBitmap( post_drill_xpm );
fabricationOutputsMenu->Append( item );
/* Component File */
item = new wxMenuItem( fabricationOutputsMenu, ID_PCB_GEN_CMP_FILE,
_( "&Component File" ),
_( "(Re)create components file for CvPcb" ) );
_( "&Component File" ),
_( "(Re)create components file for CvPcb" ) );
item->SetBitmap( save_cmpstuff_xpm );
fabricationOutputsMenu->Append( item );
/* BOM File */
item = new wxMenuItem( fabricationOutputsMenu, ID_PCB_GEN_BOM_FILE_FROM_BOARD,
_( "&BOM File" ),
_( "Create a bill of materials from schematic" ) );
_( "&BOM File" ),
_( "Create a bill of materials from schematic" ) );
item->SetBitmap( tools_xpm );
fabricationOutputsMenu->Append( item );
@ -137,8 +137,8 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
/* Specctra Session */
item = new wxMenuItem( submenuImport, ID_GEN_IMPORT_SPECCTRA_SESSION,
_( "&Specctra Session" ),
_( "Import a routed \"Specctra Session\" (*.ses) file" ) );
_( "&Specctra Session" ),
_( "Import a routed \"Specctra Session\" (*.ses) file" ) );
item->SetBitmap( import_xpm ); // @todo need better bitmap
submenuImport->Append( item );
@ -161,21 +161,21 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
/* Specctra DSN */
item = new wxMenuItem( submenuexport, ID_GEN_EXPORT_SPECCTRA,
_( "&Specctra DSN" ),
_( "Export the current board to a \"Specctra DSN\" file" ) );
_( "&Specctra DSN" ),
_( "Export the current board to a \"Specctra DSN\" file" ) );
item->SetBitmap( export_xpm );
submenuexport->Append( item );
/* Export GenCAD Format */
item = new wxMenuItem( submenuexport, ID_GEN_EXPORT_FILE_GENCADFORMAT,
_( "&GenCAD" ), _( "Export GenCAD Format" ) );
_( "&GenCAD" ), _( "Export GenCAD format" ) );
item->SetBitmap( export_xpm );
submenuexport->Append( item );
/* Module Report */
item = new wxMenuItem( submenuexport, ID_GEN_EXPORT_FILE_MODULE_REPORT,
_( "&Module Report" ),
_( "Create a report of all modules on the current board" ) );
_( "&Module Report" ),
_( "Create a report of all modules on the current board" ) );
item->SetBitmap( tools_xpm );
submenuexport->Append( item );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, submenuexport,
@ -187,19 +187,19 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
/* Print */
item = new wxMenuItem( filesMenu, ID_GEN_PRINT, _( "&Print\tCtrl+P" ),
_( "Print pcb board" ) );
_( "Print pcb board" ) );
item->SetBitmap( print_button );
filesMenu->Append( item );
/* Print SVG */
item = new wxMenuItem( filesMenu, ID_GEN_PLOT_SVG, _( "Print S&VG" ),
_( "Plot board in Scalable Vector Graphics format" ) );
_( "Plot board in Scalable Vector Graphics format" ) );
item->SetBitmap( print_button );
filesMenu->Append( item );
/* Plot */
item = new wxMenuItem( filesMenu, ID_GEN_PLOT, _( "&Plot" ),
_( "Plot board in HPGL, PostScript or Gerber RS-274X format)" ) );
_( "Plot board in HPGL, PostScript or Gerber RS-274X format)" ) );
item->SetBitmap( plot_xpm );
filesMenu->Append( item );
@ -207,14 +207,13 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
filesMenu->AppendSeparator();
wxMenu* submenuarchive = new wxMenu();
item = new wxMenuItem( submenuarchive, ID_MENU_ARCHIVE_NEW_MODULES,
_( "Add New Footprints" ),
_(
"Archive new footprints only in a library (keep other footprints in this lib)" ) );
_( "Add New Footprints" ),
_( "Archive new footprints only in a library (keep other footprints in this lib)" ) );
item->SetBitmap( library_update_xpm );
submenuarchive->Append( item );
item = new wxMenuItem( submenuarchive, ID_MENU_ARCHIVE_ALL_MODULES,
_( "Create Footprint Archive" ),
_( "Archive all footprints in a library(old lib will be deleted)" ) );
_( "Create Footprint Archive" ),
_( "Archive all footprints in a library (old library will be deleted)" ) );
item->SetBitmap( library_xpm );
submenuarchive->Append( item );
ADD_MENUITEM_WITH_HELP_AND_SUBMENU( filesMenu, submenuarchive,
@ -228,7 +227,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
filesMenu->AppendSeparator();
item = new wxMenuItem( filesMenu, wxID_EXIT, _( "&Quit" ),
_( "Quit PCBNew" ) );
_( "Quit PCBNew" ) );
filesMenu->Append( item );
#endif /* !defined( __WXMAC__ ) */
@ -242,7 +241,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
/* Undo */
#if !defined( __WXMAC__)
text = AddHotkeyName( _( "Undo" ), s_Pcbnew_Editor_Hokeys_Descr, HK_UNDO);
text = AddHotkeyName( _( "Undo" ), s_Pcbnew_Editor_Hokeys_Descr, HK_UNDO );
#else
text = _( "Undo\tCtrl+Z" );
#endif
@ -253,7 +252,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
/* Redo */
#if !defined( __WXMAC__)
text = AddHotkeyName( _( "Redo" ), s_Pcbnew_Editor_Hokeys_Descr, HK_REDO);
text = AddHotkeyName( _( "Redo" ), s_Pcbnew_Editor_Hokeys_Descr, HK_REDO );
#else
text = _( "Redo\tShift+Ctrl+Z" );
#endif
@ -273,7 +272,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
#endif
item = new wxMenuItem( editMenu, ID_FIND_ITEMS, text,
_( "Find components and text in current loaded board" ) );
_( "Find components and text in current loaded board" ) );
item->SetBitmap( find_xpm );
editMenu->Append( item );
@ -282,23 +281,22 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
/* Global Deletions */
item = new wxMenuItem( editMenu, ID_PCB_GLOBAL_DELETE,
_( "Global &Deletions" ),
_( "Delete tracks, modules, texts... on board" ) );
_( "Global &Deletions" ),
_( "Delete tracks, modules, texts... on board" ) );
item->SetBitmap( general_deletions_xpm );
editMenu->Append( item );
/* Tracks */
item = new wxMenuItem( editMenu, ID_MENU_PCB_CLEAN,
_( "&Tracks and Vias Cleanup" ),
_(
"Clean stubs, vias, delete break points, or connect dangling tracks to pads and vias" ) );
_( "&Cleanup Tracks and Vias" ),
_( "Clean stubs, vias, delete break points, or connect dangling tracks to pads and vias" ) );
item->SetBitmap( delete_body_xpm );
editMenu->Append( item );
/* Swap Layers */
item = new wxMenuItem( editMenu, ID_MENU_PCB_SWAP_LAYERS,
_( "&Swap Layers" ),
_( "Swap tracks on copper layers or drawings on others layers" ) );
_( "&Swap Layers" ),
_( "Swap tracks on copper layers or drawings on others layers" ) );
item->SetBitmap( swap_layer_xpm );
editMenu->Append( item );
@ -369,7 +367,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
/* List of Nets */
item = new wxMenuItem( viewMenu, ID_MENU_LIST_NETS, _( "&List Nets" ),
_( "View a list of nets with names and id's" ) );
_( "View a list of nets with names and id's" ) );
item->SetBitmap( tools_xpm );
viewMenu->Append( item );
@ -389,27 +387,27 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
/* Library */
item = new wxMenuItem( configmenu, ID_CONFIG_REQ, _( "&Library" ),
_( "Setting libraries, directories and others..." ) );
_( "Setting libraries, directories and others..." ) );
item->SetBitmap( library_xpm );
configmenu->Append( item );
/* Colors and Visibility */
item = new wxMenuItem( configmenu, ID_COLORS_SETUP,
_( "&Colors and Visibility" ),
_( "Select colors and visibility of layers and some items" ) );
_( "&Colors and Visibility" ),
_( "Select colors and visibility of layers and some items" ) );
item->SetBitmap( palette_xpm );
configmenu->Append( item );
/* General */
item = new wxMenuItem( configmenu, ID_OPTIONS_SETUP, _( "&General" ),
_( "Select general options for PCBnew" ) );
_( "Select general options for PCBnew" ) );
item->SetBitmap( preference_xpm );
configmenu->Append( item );
/* Display */
item = new wxMenuItem( configmenu, ID_PCB_DISPLAY_OPTIONS_SETUP,
_( "&Display" ),
_( "Select how items (pads, tracks texts ... ) are displayed" ) );
_( "&Display" ),
_( "Select how items (pads, tracks texts ... ) are displayed" ) );
item->SetBitmap( display_options_xpm );
configmenu->Append( item );
@ -418,27 +416,27 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
/* Grid */
item = new wxMenuItem( dimensionsMenu, ID_PCB_USER_GRID_SETUP, _( "Grid" ),
_( "Adjust user grid dimensions" ) );
_( "Adjust user grid dimensions" ) );
item->SetBitmap( grid_xpm );
dimensionsMenu->Append( item );
/* Text and Drawings */
item = new wxMenuItem( dimensionsMenu, ID_PCB_DRAWINGS_WIDTHS_SETUP,
_( "Texts and Drawings" ),
_( "Adjust dimensions for texts and drawings" ) );
_( "Texts and Drawings" ),
_( "Adjust dimensions for texts and drawings" ) );
item->SetBitmap( options_text_xpm );
dimensionsMenu->Append( item );
/* Pads */
item = new wxMenuItem( dimensionsMenu, ID_PCB_PAD_SETUP, _( "Pads" ),
_( "Adjust default pads caracteristics" ) );
_( "Adjust default pad characteristics" ) );
item->SetBitmap( pad_xpm );
dimensionsMenu->Append( item );
/* Pads Mask Clearance */
item = new wxMenuItem( dimensionsMenu, ID_PCB_MASK_CLEARANCE,
_( "Pads Mask Clearance" ),
_( "Adjust the global clearance between pads and the solder resist mask" ) );
_( "Pads Mask Clearance" ),
_( "Adjust the global clearance between pads and the solder resist mask" ) );
item->SetBitmap( pads_mask_layers_xpm );
dimensionsMenu->Append( item );
@ -446,7 +444,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
/* Save dimension preferences */
dimensionsMenu->AppendSeparator();
item = new wxMenuItem( dimensionsMenu, ID_CONFIG_SAVE, _( "&Save" ),
_( "Save dimension preferences" ) );
_( "Save dimension preferences" ) );
item->SetBitmap( save_xpm );
dimensionsMenu->Append( item );
@ -467,13 +465,13 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
/* Save Preferences */
item = new wxMenuItem( configmenu, ID_CONFIG_SAVE, _( "&Save Preferences" ),
_( "Save application preferences" ) );
_( "Save application preferences" ) );
item->SetBitmap( save_setup_xpm );
configmenu->Append( item );
/* Read Preferences */
item = new wxMenuItem( configmenu, ID_CONFIG_READ, _( "&Read Preferences" ),
_( "Read application preferences" ) );
_( "Read application preferences" ) );
item->SetBitmap( read_setup_xpm );
configmenu->Append( item );
@ -485,14 +483,14 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
/* Design Rules */
item = new wxMenuItem( designRulesMenu, ID_MENU_PCB_SHOW_DESIGN_RULES_DIALOG,
_( "Design Rules" ),
_( "Open the design rules dialog editor" ) );
_( "Design Rules" ),
_( "Open the design rules editor" ) );
item->SetBitmap( hammer_xpm );
designRulesMenu->Append( item );
/* Layers Setup */
item = new wxMenuItem( configmenu, ID_PCB_LAYERS_SETUP, _( "&Layers Setup" ),
_( "Enable and set properties of layers" ) );
_( "Enable and set layer properties" ) );
item->SetBitmap( copper_layers_setup_xpm );
designRulesMenu->Append( item );
@ -502,7 +500,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
*/
wxMenu* helpMenu = new wxMenu;
item = new wxMenuItem( helpMenu, ID_GENERAL_HELP, _( "&Contents" ),
_( "Open the PCBnew manual" ) );
_( "Open the PCBnew manual" ) );
item->SetBitmap( help_xpm );
helpMenu->Append( item );
@ -511,7 +509,7 @@ void WinEDA_PcbFrame::ReCreateMenuBar()
#if !defined(__WXMAC__)
item = new wxMenuItem( helpMenu, ID_KICAD_ABOUT, _( "&About" ),
_( "About PCBnew printed circuit board designer" ) );
_( "About PCBnew printed circuit board designer" ) );
item->SetBitmap( info_xpm );
helpMenu->Append( item );

View File

@ -31,9 +31,6 @@ void WinEDA_ModuleEditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
ActiveScreen = screen;
GRSetDrawMode( DC, GR_COPY );
if( EraseBg )
DrawPanel->EraseScreen( DC );
DrawPanel->DrawBackGround( DC );
TraceWorkSheet( DC, screen, 0 );
@ -43,13 +40,13 @@ void WinEDA_ModuleEditFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
module->Draw( DrawPanel, DC, GR_OR );
}
screen->ClrRefreshReq();
if( DrawPanel->ManageCurseur )
DrawPanel->ManageCurseur( DrawPanel, DC, FALSE );
/* Redraw the cursor */
DrawPanel->Trace_Curseur( DC );
screen->ClrRefreshReq();
DrawPanel->DrawCursor( DC );
}
@ -65,9 +62,6 @@ void WinEDA_PcbFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
ActiveScreen = screen;
GRSetDrawMode( DC, GR_COPY );
if( EraseBg )
DrawPanel->EraseScreen( DC );
DrawPanel->DrawBackGround( DC );
TraceWorkSheet( DC, GetScreen(), 0 );
@ -82,7 +76,7 @@ void WinEDA_PcbFrame::RedrawActiveWindow( wxDC* DC, bool EraseBg )
DrawPanel->ManageCurseur( DrawPanel, DC, FALSE );
// Redraw the cursor
DrawPanel->Trace_Curseur( DC );
DrawPanel->DrawCursor( DC );
}