Commit 60c1cbe8 authored by jean-pierre charras's avatar jean-pierre charras

fixed issues with wxWidgets 2.9.1

parent 141d5b5f
...@@ -364,29 +364,33 @@ void WinEDA_DrawFrame::OnSize( wxSizeEvent& SizeEv ) ...@@ -364,29 +364,33 @@ void WinEDA_DrawFrame::OnSize( wxSizeEvent& SizeEv )
} }
/* /** Function SetToolID
* Enables the icon of the selected tool in the vertical toolbar. * Enables the icon of the selected tool in the vertical toolbar.
* (Or tool ID_NO_SELECT_BUTT default if no new selection) * (Or tool ID_NO_SELECT_BUTT default if no new selection)
* if (id >= 0) * @param aId = new m_ID_current_state value (if aId >= 0)
* @param aCursor = the new cursor shape (0 = default cursor)
* @param aTitle = tool message in status bar
* if (aId >= 0)
* Updates all variables related: * Updates all variables related:
* Message m_ID_current_state, cursor * m_ID_current_state, cursor shape and message in status bar
* If (id < 0) * If (aId < 0)
* Only updates the variables message and cursor * Only updates the cursor shape and message in status bar
* (does not the current m_ID_current_state value
*/ */
void WinEDA_DrawFrame::SetToolID( int id, int new_cursor_id, void WinEDA_DrawFrame::SetToolID( int aId, int aCursor,
const wxString& title ) const wxString& aToolMsg )
{ {
// Keep default cursor in toolbars // Keep default cursor in toolbars
SetCursor( wxNullCursor ); SetCursor( wxNullCursor );
// Change Cursor in DrawPanel only // Change Cursor in DrawPanel only
if( DrawPanel ) if( DrawPanel )
{ {
DrawPanel->m_PanelDefaultCursor = new_cursor_id; DrawPanel->m_PanelDefaultCursor = aCursor;
DrawPanel->SetCursor( new_cursor_id ); DrawPanel->SetCursor( aCursor );
} }
DisplayToolMsg( title ); DisplayToolMsg( aToolMsg );
if( id < 0 ) if( aId < 0 )
return; return;
// Old Tool ID_NO_SELECT_BUTT active or inactive if no new tool. // Old Tool ID_NO_SELECT_BUTT active or inactive if no new tool.
...@@ -400,7 +404,7 @@ void WinEDA_DrawFrame::SetToolID( int id, int new_cursor_id, ...@@ -400,7 +404,7 @@ void WinEDA_DrawFrame::SetToolID( int id, int new_cursor_id,
} }
else else
{ {
if( id ) if( aId )
{ {
if( m_VToolBar ) if( m_VToolBar )
m_VToolBar->ToggleTool( ID_NO_SELECT_BUTT, FALSE ); m_VToolBar->ToggleTool( ID_NO_SELECT_BUTT, FALSE );
...@@ -412,18 +416,18 @@ void WinEDA_DrawFrame::SetToolID( int id, int new_cursor_id, ...@@ -412,18 +416,18 @@ void WinEDA_DrawFrame::SetToolID( int id, int new_cursor_id,
m_VToolBar->ToggleTool( ID_NO_SELECT_BUTT, TRUE ); m_VToolBar->ToggleTool( ID_NO_SELECT_BUTT, TRUE );
} }
if( id ) if( aId )
{ {
if( m_VToolBar ) if( m_VToolBar )
m_VToolBar->ToggleTool( id, TRUE ); m_VToolBar->ToggleTool( aId, TRUE );
if( m_AuxVToolBar ) if( m_AuxVToolBar )
m_AuxVToolBar->ToggleTool( id, TRUE ); m_AuxVToolBar->ToggleTool( aId, TRUE );
} }
else if( m_VToolBar ) else if( m_VToolBar )
m_VToolBar->ToggleTool( ID_NO_SELECT_BUTT, TRUE ); m_VToolBar->ToggleTool( ID_NO_SELECT_BUTT, TRUE );
m_ID_current_state = id; m_ID_current_state = aId;
if( m_VToolBar ) if( m_VToolBar )
m_VToolBar->Refresh( ); m_VToolBar->Refresh( );
} }
......
/***************************************/ /***************************************/
/* edit.cpp: Gerbview events functions */ /* edit.cpp: Gerbview events functions */
/***************************************/ /***************************************/
#include "fctsys.h" #include "fctsys.h"
#include "class_drawpanel.h" #include "class_drawpanel.h"
#include "confirm.h" #include "confirm.h"
#include "common.h" #include "common.h"
#include "gestfich.h" #include "gestfich.h"
#include "appl_wxstruct.h" #include "appl_wxstruct.h"
#include "gerbview.h" #include "gerbview.h"
#include "pcbplot.h" #include "pcbplot.h"
#include "protos.h" #include "protos.h"
#include "kicad_device_context.h" #include "kicad_device_context.h"
#include "gerbview_id.h" #include "gerbview_id.h"
/* Process the command triggered by the left button of the mouse when a tool /* Process the command triggered by the left button of the mouse when a tool
* is already selected. * is already selected.
*/ */
void WinEDA_GerberFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos ) void WinEDA_GerberFrame::OnLeftClick( wxDC* DC, const wxPoint& MousePos )
{ {
BOARD_ITEM* DrawStruct = GetScreen()->GetCurItem(); BOARD_ITEM* DrawStruct = GetScreen()->GetCurItem();
wxString msg; wxString msg;
if( m_ID_current_state == 0 ) if( m_ID_current_state == 0 )
{ {
if( DrawStruct && DrawStruct->m_Flags ) if( DrawStruct && DrawStruct->m_Flags )
{ {
msg.Printf( wxT( "WinEDA_GerberFrame::ProcessCommand err: Struct %d, m_Flags = %X" ), msg.Printf( wxT( "WinEDA_GerberFrame::ProcessCommand err: Struct %d, m_Flags = %X" ),
(unsigned) DrawStruct->Type(), (unsigned) DrawStruct->Type(),
(unsigned) DrawStruct->m_Flags ); (unsigned) DrawStruct->m_Flags );
DisplayError( this, msg ); DisplayError( this, msg );
} }
else else
{ {
DrawStruct = GerberGeneralLocateAndDisplay(); DrawStruct = GerberGeneralLocateAndDisplay();
GetScreen()->SetCurItem( DrawStruct ); GetScreen()->SetCurItem( DrawStruct );
} }
} }
switch( m_ID_current_state ) switch( m_ID_current_state )
{ {
case 0: case 0:
break; break;
case ID_NO_SELECT_BUTT: case ID_NO_SELECT_BUTT:
break; break;
case ID_GERBVIEW_DELETE_ITEM_BUTT: case ID_GERBVIEW_DELETE_ITEM_BUTT:
DrawStruct = GerberGeneralLocateAndDisplay(); DrawStruct = GerberGeneralLocateAndDisplay();
if( DrawStruct == NULL ) if( DrawStruct == NULL )
break; break;
if( DrawStruct->Type() == TYPE_TRACK ) if( DrawStruct->Type() == TYPE_TRACK )
{ {
Delete_Segment( DC, (TRACK*) DrawStruct ); Delete_Segment( DC, (TRACK*) DrawStruct );
GetScreen()->SetCurItem( NULL ); GetScreen()->SetCurItem( NULL );
GetScreen()->SetModify(); GetScreen()->SetModify();
} }
break; break;
default: default:
DisplayError( this, wxT( "WinEDA_GerberFrame::ProcessCommand error" ) ); DisplayError( this, wxT( "WinEDA_GerberFrame::ProcessCommand error" ) );
break; break;
} }
} }
/* Handles the selection of tools, menu, and popup menu commands. /* Handles the selection of tools, menu, and popup menu commands.
*/ */
void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event ) void WinEDA_GerberFrame::Process_Special_Functions( wxCommandEvent& event )
{ {
int id = event.GetId(); int id = event.GetId();
int layer = GetScreen()->m_Active_Layer; int layer = GetScreen()->m_Active_Layer;
GERBER* gerber_layer = g_GERBER_List[layer]; GERBER* gerber_layer = g_GERBER_List[layer];
wxPoint pos; wxPoint pos;
wxGetMousePosition( &pos.x, &pos.y ); wxGetMousePosition( &pos.x, &pos.y );
pos.y += 20; pos.y += 20;
switch( id ) switch( id )
{ {
case wxID_CUT: case wxID_CUT:
case wxID_COPY: case wxID_COPY:
case ID_POPUP_MIRROR_X_BLOCK: case ID_POPUP_MIRROR_X_BLOCK:
case ID_POPUP_DELETE_BLOCK: case ID_POPUP_DELETE_BLOCK:
case ID_POPUP_PLACE_BLOCK: case ID_POPUP_PLACE_BLOCK:
case ID_POPUP_ZOOM_BLOCK: case ID_POPUP_ZOOM_BLOCK:
case ID_POPUP_FLIP_BLOCK: case ID_POPUP_FLIP_BLOCK:
case ID_POPUP_ROTATE_BLOCK: case ID_POPUP_ROTATE_BLOCK:
case ID_POPUP_COPY_BLOCK: case ID_POPUP_COPY_BLOCK:
break; break;
case ID_POPUP_CANCEL_CURRENT_COMMAND: case ID_POPUP_CANCEL_CURRENT_COMMAND:
DrawPanel->UnManageCursor( ); DrawPanel->UnManageCursor( );
/* Should not be executed, except bug */ /* Should not be executed, except bug */
if( GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE ) if( GetScreen()->m_BlockLocate.m_Command != BLOCK_IDLE )
{ {
GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE; GetScreen()->m_BlockLocate.m_Command = BLOCK_IDLE;
GetScreen()->m_BlockLocate.m_State = STATE_NO_BLOCK; GetScreen()->m_BlockLocate.m_State = STATE_NO_BLOCK;
GetScreen()->m_BlockLocate.ClearItemsList(); GetScreen()->m_BlockLocate.ClearItemsList();
} }
if( m_ID_current_state == 0 ) if( m_ID_current_state == 0 )
SetToolID( 0, wxCURSOR_ARROW, wxEmptyString ); SetToolID( 0, 0, wxEmptyString );
else else
SetCursor( DrawPanel->m_PanelCursor = DrawPanel->m_PanelDefaultCursor ); DrawPanel->SetCursor( DrawPanel->m_PanelCursor = DrawPanel->m_PanelDefaultCursor );
break; break;
default: default:
DrawPanel->UnManageCursor( 0, wxCURSOR_ARROW, wxEmptyString ); DrawPanel->UnManageCursor( 0, 0, wxEmptyString );
break; break;
} }
INSTALL_DC( dc, DrawPanel ); INSTALL_DC( dc, DrawPanel );
switch( id ) switch( id )
{ {
case ID_EXIT: case ID_EXIT:
Close( TRUE ); Close( TRUE );
break; break;
case ID_NEW_PROJECT: case ID_NEW_PROJECT:
case ID_LOAD_PROJECT: case ID_LOAD_PROJECT:
Files_io( event ); Files_io( event );
break; break;
case ID_GERBVIEW_GLOBAL_DELETE: case ID_GERBVIEW_GLOBAL_DELETE:
Erase_Current_Layer( TRUE ); Erase_Current_Layer( TRUE );
break; break;
case ID_GET_TOOLS: case ID_GET_TOOLS:
// InstallToolsFrame(this, wxPoint(-1,-1) ); // InstallToolsFrame(this, wxPoint(-1,-1) );
break; break;
case ID_FIND_ITEMS: case ID_FIND_ITEMS:
// InstallFindFrame(this, pos); // InstallFindFrame(this, pos);
break; break;
case ID_NO_SELECT_BUTT: case ID_NO_SELECT_BUTT:
SetToolID( 0, 0, wxEmptyString ); SetToolID( 0, 0, wxEmptyString );
break; break;
case ID_POPUP_CLOSE_CURRENT_TOOL: case ID_POPUP_CLOSE_CURRENT_TOOL:
SetToolID( 0, wxCURSOR_ARROW, wxEmptyString ); SetToolID( 0, 0, wxEmptyString );
break; break;
case ID_POPUP_CANCEL_CURRENT_COMMAND: case ID_POPUP_CANCEL_CURRENT_COMMAND:
break; break;
case ID_GERBVIEW_DELETE_ITEM_BUTT: case ID_GERBVIEW_DELETE_ITEM_BUTT:
SetToolID( id, wxCURSOR_BULLSEYE, wxT( "Delete item" ) ); SetToolID( id, wxCURSOR_BULLSEYE, wxT( "Delete item" ) );
break; break;
case ID_TOOLBARH_GERBVIEW_SELECT_LAYER: case ID_TOOLBARH_GERBVIEW_SELECT_LAYER:
setActiveLayer(m_SelLayerBox->GetChoice()); setActiveLayer(m_SelLayerBox->GetChoice());
DrawPanel->Refresh( TRUE ); DrawPanel->Refresh( TRUE );
break; break;
case ID_TOOLBARH_GERBER_SELECT_TOOL: case ID_TOOLBARH_GERBER_SELECT_TOOL:
if( gerber_layer ) if( gerber_layer )
{ {
int tool = m_SelLayerTool->GetChoice(); int tool = m_SelLayerTool->GetChoice();
if( tool > 0 ) if( tool > 0 )
tool = tool - 1 + FIRST_DCODE; tool = tool - 1 + FIRST_DCODE;
else else
tool = 0; tool = 0;
gerber_layer->m_Selected_Tool = tool; gerber_layer->m_Selected_Tool = tool;
DrawPanel->Refresh( TRUE ); DrawPanel->Refresh( TRUE );
} }
else break;
DisplayError( this, _( "No layer selected" ) );
break; case ID_GERBVIEW_SHOW_LIST_DCODES:
Liste_D_Codes( );
case ID_GERBVIEW_SHOW_LIST_DCODES: break;
Liste_D_Codes( );
break; case ID_GERBVIEW_SHOW_SOURCE:
if( gerber_layer )
case ID_GERBVIEW_SHOW_SOURCE: {
if( gerber_layer ) wxString editorname = wxGetApp().GetEditorName();
{ if( !editorname.IsEmpty() )
wxString editorname = wxGetApp().GetEditorName(); {
if( !editorname.IsEmpty() ) wxFileName fn( gerber_layer->m_FileName );
{ ExecuteFile( this, editorname, QuoteFullPath( fn ) );
wxFileName fn( gerber_layer->m_FileName ); }
ExecuteFile( this, editorname, QuoteFullPath( fn ) ); }
} break;
}
break; case ID_POPUP_PLACE_BLOCK:
GetScreen()->m_BlockLocate.m_Command = BLOCK_MOVE;
case ID_POPUP_PLACE_BLOCK: DrawPanel->m_AutoPAN_Request = FALSE;
GetScreen()->m_BlockLocate.m_Command = BLOCK_MOVE; HandleBlockPlace( &dc );
DrawPanel->m_AutoPAN_Request = FALSE; break;
HandleBlockPlace( &dc );
break; case ID_POPUP_COPY_BLOCK:
GetScreen()->m_BlockLocate.m_Command = BLOCK_COPY;
case ID_POPUP_COPY_BLOCK: GetScreen()->m_BlockLocate.SetMessageBlock( this );
GetScreen()->m_BlockLocate.m_Command = BLOCK_COPY; DrawPanel->m_AutoPAN_Request = FALSE;
GetScreen()->m_BlockLocate.SetMessageBlock( this ); HandleBlockEnd( &dc );
DrawPanel->m_AutoPAN_Request = FALSE; break;
HandleBlockEnd( &dc );
break; case ID_POPUP_ZOOM_BLOCK:
GetScreen()->m_BlockLocate.m_Command = BLOCK_ZOOM;
case ID_POPUP_ZOOM_BLOCK: GetScreen()->m_BlockLocate.SetMessageBlock( this );
GetScreen()->m_BlockLocate.m_Command = BLOCK_ZOOM; GetScreen()->m_BlockLocate.SetMessageBlock( this );
GetScreen()->m_BlockLocate.SetMessageBlock( this ); HandleBlockEnd( &dc );
GetScreen()->m_BlockLocate.SetMessageBlock( this ); break;
HandleBlockEnd( &dc );
break; case ID_POPUP_DELETE_BLOCK:
GetScreen()->m_BlockLocate.m_Command = BLOCK_DELETE;
case ID_POPUP_DELETE_BLOCK: GetScreen()->m_BlockLocate.SetMessageBlock( this );
GetScreen()->m_BlockLocate.m_Command = BLOCK_DELETE; HandleBlockEnd( &dc );
GetScreen()->m_BlockLocate.SetMessageBlock( this ); break;
HandleBlockEnd( &dc );
break; case ID_POPUP_MIRROR_X_BLOCK:
GetScreen()->m_BlockLocate.m_Command = BLOCK_MIRROR_X;
case ID_POPUP_MIRROR_X_BLOCK: GetScreen()->m_BlockLocate.SetMessageBlock( this );
GetScreen()->m_BlockLocate.m_Command = BLOCK_MIRROR_X; HandleBlockEnd( &dc );
GetScreen()->m_BlockLocate.SetMessageBlock( this ); break;
HandleBlockEnd( &dc );
break; case ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS:
if( gerber_layer )
case ID_GERBVIEW_POPUP_DELETE_DCODE_ITEMS: Delete_DCode_Items( &dc, gerber_layer->m_Selected_Tool,
if( gerber_layer ) ( (PCB_SCREEN*) GetScreen() )->m_Active_Layer );
Delete_DCode_Items( &dc, gerber_layer->m_Selected_Tool, break;
( (PCB_SCREEN*) GetScreen() )->m_Active_Layer );
break; default:
wxMessageBox( wxT( "WinEDA_GerberFrame::Process_Special_Functions error" ) );
default: break;
wxMessageBox( wxT( "WinEDA_GerberFrame::Process_Special_Functions error" ) ); }
break;
} SetToolbars();
}
SetToolbars();
}
/* Called on a double click of left mouse button.
*/
/* Called on a double click of left mouse button. void WinEDA_GerberFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos )
*/ {
void WinEDA_GerberFrame::OnLeftDClick( wxDC* DC, const wxPoint& MousePos ) EDA_BaseStruct* DrawStruct = GetScreen()->GetCurItem();
{
EDA_BaseStruct* DrawStruct = GetScreen()->GetCurItem(); switch( m_ID_current_state )
{
switch( m_ID_current_state ) case 0:
{ if( (DrawStruct == NULL) || (DrawStruct->m_Flags == 0) )
case 0: {
if( (DrawStruct == NULL) || (DrawStruct->m_Flags == 0) ) DrawStruct = GerberGeneralLocateAndDisplay();
{ }
DrawStruct = GerberGeneralLocateAndDisplay();
} break;
break; default:
break;
default: }
break; }
}
}
...@@ -246,7 +246,6 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void ) ...@@ -246,7 +246,6 @@ void WinEDA_GerberFrame::ReCreateHToolbar( void )
// after adding the buttons to the toolbar, must call Realize() to reflect // after adding the buttons to the toolbar, must call Realize() to reflect
// the changes // the changes
m_HToolBar->Realize(); m_HToolBar->Realize();
SetToolbars();
} }
...@@ -272,7 +271,6 @@ void WinEDA_GerberFrame::ReCreateVToolbar( void ) ...@@ -272,7 +271,6 @@ void WinEDA_GerberFrame::ReCreateVToolbar( void )
_( "Delete items" ) ); _( "Delete items" ) );
m_VToolBar->Realize(); m_VToolBar->Realize();
SetToolbars();
} }
...@@ -339,5 +337,4 @@ void WinEDA_GerberFrame::ReCreateOptToolbar( void ) ...@@ -339,5 +337,4 @@ void WinEDA_GerberFrame::ReCreateOptToolbar( void )
m_OptionsToolBar->Realize(); m_OptionsToolBar->Realize();
SetToolbars();
} }
...@@ -44,6 +44,8 @@ public: ...@@ -44,6 +44,8 @@ public:
// ignore mouse events // ignore mouse events
bool m_Block_Enable; // TRUE to accept Block Commands bool m_Block_Enable; // TRUE to accept Block Commands
// useful to avoid false start block in certain cases
// (like switch from a sheet to an other sheet
int m_CanStartBlock; // >= 0 (or >= n) if a block can int m_CanStartBlock; // >= 0 (or >= n) if a block can
// start // start
bool m_PrintIsMirrored; // True when drawing in mirror bool m_PrintIsMirrored; // True when drawing in mirror
...@@ -51,8 +53,6 @@ public: ...@@ -51,8 +53,6 @@ public:
// because arcs are oriented, and // because arcs are oriented, and
// in mirror mode, orientations are // in mirror mode, orientations are
// reversed // reversed
// useful to avoid false start block in certain cases (like switch from a
// sheet to an other sheet
int m_PanelDefaultCursor; // Current mouse cursor default int m_PanelDefaultCursor; // Current mouse cursor default
// shape id for this window // shape id for this window
int m_PanelCursor; // Current mouse cursor shape id int m_PanelCursor; // Current mouse cursor shape id
......
...@@ -104,8 +104,7 @@ public: ...@@ -104,8 +104,7 @@ public:
virtual bool OnRightClick( const wxPoint& MousePos, virtual bool OnRightClick( const wxPoint& MousePos,
wxMenu* PopMenu ) = 0; wxMenu* PopMenu ) = 0;
virtual void ReCreateMenuBar(); virtual void ReCreateMenuBar();
virtual void SetToolID( int id, int new_cursor_id, virtual void SetToolID( int aId, int aCursor, const wxString& aToolMsg );
const wxString& title );
virtual void UpdateStatusBar(); virtual void UpdateStatusBar();
PCB_SCREEN* GetScreen() const PCB_SCREEN* GetScreen() const
......
...@@ -239,8 +239,20 @@ public: ...@@ -239,8 +239,20 @@ public:
virtual void ReCreateVToolbar() = 0; virtual void ReCreateVToolbar() = 0;
virtual void ReCreateMenuBar(); virtual void ReCreateMenuBar();
virtual void ReCreateAuxiliaryToolbar(); virtual void ReCreateAuxiliaryToolbar();
virtual void SetToolID( int id, int new_cursor_id, /** Function SetToolID
const wxString& title ); * Enables the icon of the selected tool in the vertical toolbar.
* (Or tool ID_NO_SELECT_BUTT default if no new selection)
* @param aId = new m_ID_current_state value (if aId >= 0)
* @param aCursor = the new cursor shape
* @param aToolMsg = tool message in status bar
* if (aId >= 0)
* Updates all variables related:
* m_ID_current_state, cursor shape and message in status bar
* If (aId < 0)
* Only updates the cursor shape and message in status bar
* (does not the current m_ID_current_state value
*/
virtual void SetToolID( int aId, int aCursor, const wxString& aToolMsg );
/* Thes 4 functions provide a basic way to sho/hide grid /* Thes 4 functions provide a basic way to sho/hide grid
* and /get/set grid color. * and /get/set grid color.
......
...@@ -288,19 +288,18 @@ GENERAL_COLLECTORS_GUIDE WinEDA_BasePcbFrame::GetCollectorsGuide() ...@@ -288,19 +288,18 @@ GENERAL_COLLECTORS_GUIDE WinEDA_BasePcbFrame::GetCollectorsGuide()
return guide; return guide;
} }
void WinEDA_BasePcbFrame::SetToolID( int id, int new_cursor_id, void WinEDA_BasePcbFrame::SetToolID( int aId, int aCursor, const wxString& aToolMsg )
const wxString& title )
{ {
bool redraw = false; bool redraw = false;
WinEDA_DrawFrame::SetToolID( id, new_cursor_id, title ); WinEDA_DrawFrame::SetToolID( aId, aCursor, aToolMsg );
if( id < 0 ) if( aId < 0 )
return; return;
// handle color changes for transitions in and out of ID_TRACK_BUTT // handle color changes for transitions in and out of ID_TRACK_BUTT
if( ( m_ID_current_state == ID_TRACK_BUTT && id != ID_TRACK_BUTT ) if( ( m_ID_current_state == ID_TRACK_BUTT && aId != ID_TRACK_BUTT )
|| ( m_ID_current_state != ID_TRACK_BUTT && id == ID_TRACK_BUTT ) ) || ( m_ID_current_state != ID_TRACK_BUTT && aId== ID_TRACK_BUTT ) )
{ {
if( DisplayOpt.ContrastModeDisplay ) if( DisplayOpt.ContrastModeDisplay )
redraw = true; redraw = true;
......
...@@ -29,6 +29,7 @@ void WinEDA_PcbFrame::OnFileHistory( wxCommandEvent& event ) ...@@ -29,6 +29,7 @@ void WinEDA_PcbFrame::OnFileHistory( wxCommandEvent& event )
::wxSetWorkingDirectory( ::wxPathOnly( fn ) ); ::wxSetWorkingDirectory( ::wxPathOnly( fn ) );
LoadOnePcbFile( fn ); LoadOnePcbFile( fn );
ReCreateAuxiliaryToolbar(); ReCreateAuxiliaryToolbar();
SetToolbars();
DrawPanel->MouseToCursorSchema(); DrawPanel->MouseToCursorSchema();
} }
} }
...@@ -49,6 +50,7 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event ) ...@@ -49,6 +50,7 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event )
case ID_LOAD_FILE: case ID_LOAD_FILE:
LoadOnePcbFile( GetScreen()->m_FileName, false, true ); LoadOnePcbFile( GetScreen()->m_FileName, false, true );
ReCreateAuxiliaryToolbar(); ReCreateAuxiliaryToolbar();
SetToolbars();
break; break;
case ID_MENU_READ_LAST_SAVED_VERSION_BOARD: case ID_MENU_READ_LAST_SAVED_VERSION_BOARD:
...@@ -84,6 +86,7 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event ) ...@@ -84,6 +86,7 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event )
GetScreen()->m_FileName = fn.GetFullPath(); GetScreen()->m_FileName = fn.GetFullPath();
SetTitle( GetScreen()->m_FileName ); SetTitle( GetScreen()->m_FileName );
ReCreateAuxiliaryToolbar(); ReCreateAuxiliaryToolbar();
SetToolbars();
break; break;
} }
...@@ -98,6 +101,7 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event ) ...@@ -98,6 +101,7 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event )
GetChars( PcbFileExtension ) ); GetChars( PcbFileExtension ) );
SetTitle( GetScreen()->m_FileName ); SetTitle( GetScreen()->m_FileName );
ReCreateLayerBox( NULL ); ReCreateLayerBox( NULL );
SetToolbars();
break; break;
case ID_SAVE_BOARD: case ID_SAVE_BOARD:
......
...@@ -231,6 +231,8 @@ WinEDA_ModuleEditFrame::WinEDA_ModuleEditFrame( wxWindow* father, ...@@ -231,6 +231,8 @@ WinEDA_ModuleEditFrame::WinEDA_ModuleEditFrame( wxWindow* father,
wxAuiPaneInfo( horiz ).Name( wxT( "MsgPanel" ) ).Bottom() ); wxAuiPaneInfo( horiz ).Name( wxT( "MsgPanel" ) ).Bottom() );
m_auimgr.Update(); m_auimgr.Update();
SetToolbars();
} }
......
...@@ -112,6 +112,7 @@ bool WinEDA_App::OnInit() ...@@ -112,6 +112,7 @@ bool WinEDA_App::OnInit()
} }
ScreenPcb = new PCB_SCREEN(); ScreenPcb = new PCB_SCREEN();
ActiveScreen = ScreenPcb;
// read current setup and reopen last directory if no filename to open in command line // read current setup and reopen last directory if no filename to open in command line
bool reopenLastUsedDirectory = argc == 1; bool reopenLastUsedDirectory = argc == 1;
...@@ -140,7 +141,6 @@ Changing extension to .brd." ), GetChars( fn.GetFullPath() ) ); ...@@ -140,7 +141,6 @@ Changing extension to .brd." ), GetChars( fn.GetFullPath() ) );
frame = new WinEDA_PcbFrame( NULL, wxT( "PcbNew" ), wxPoint( 0, 0 ), wxSize( 600, 400 ) ); frame = new WinEDA_PcbFrame( NULL, wxT( "PcbNew" ), wxPoint( 0, 0 ), wxSize( 600, 400 ) );
frame->SetTitle( GetTitle() + wxT( " " ) + GetBuildVersion() ); frame->SetTitle( GetTitle() + wxT( " " ) + GetBuildVersion() );
ActiveScreen = ScreenPcb;
SetTopWindow( frame ); SetTopWindow( frame );
frame->Show( true ); frame->Show( true );
......
...@@ -133,7 +133,6 @@ void WinEDA_ModuleEditFrame::ReCreateHToolbar() ...@@ -133,7 +133,6 @@ void WinEDA_ModuleEditFrame::ReCreateHToolbar()
// after adding the buttons to the toolbar, must call Realize() to reflect // after adding the buttons to the toolbar, must call Realize() to reflect
// the changes // the changes
m_HToolBar->Realize(); m_HToolBar->Realize();
SetToolbars();
} }
...@@ -187,8 +186,6 @@ void WinEDA_ModuleEditFrame::ReCreateVToolbar() ...@@ -187,8 +186,6 @@ void WinEDA_ModuleEditFrame::ReCreateVToolbar()
wxITEM_CHECK ); wxITEM_CHECK );
m_VToolBar->Realize(); m_VToolBar->Realize();
SetToolbars();
} }
...@@ -238,8 +235,6 @@ void WinEDA_ModuleEditFrame::ReCreateOptToolbar() ...@@ -238,8 +235,6 @@ void WinEDA_ModuleEditFrame::ReCreateOptToolbar()
_( "Show Edges Sketch" ), wxITEM_CHECK ); _( "Show Edges Sketch" ), wxITEM_CHECK );
m_OptionsToolBar->Realize(); m_OptionsToolBar->Realize();
SetToolbars();
} }
...@@ -328,6 +323,4 @@ void WinEDA_ModuleEditFrame::ReCreateAuxiliaryToolbar() ...@@ -328,6 +323,4 @@ void WinEDA_ModuleEditFrame::ReCreateAuxiliaryToolbar()
if( m_LastGridSizeId == GetScreen()->m_GridList[i].m_Id ) if( m_LastGridSizeId == GetScreen()->m_GridList[i].m_Id )
m_SelGridBox->SetSelection( i ); m_SelGridBox->SetSelection( i );
} }
SetToolbars();
} }
...@@ -288,7 +288,6 @@ void WinEDA_PcbFrame::ReCreateHToolbar() ...@@ -288,7 +288,6 @@ void WinEDA_PcbFrame::ReCreateHToolbar()
// the changes // the changes
m_HToolBar->Realize(); m_HToolBar->Realize();
SetToolbars();
} }
...@@ -389,7 +388,6 @@ void WinEDA_PcbFrame::ReCreateOptToolbar() ...@@ -389,7 +388,6 @@ void WinEDA_PcbFrame::ReCreateOptToolbar()
m_OptionsToolBar->Realize(); m_OptionsToolBar->Realize();
SetToolbars();
} }
...@@ -475,7 +473,6 @@ void WinEDA_PcbFrame::ReCreateVToolbar() ...@@ -475,7 +473,6 @@ void WinEDA_PcbFrame::ReCreateVToolbar()
wxITEM_CHECK ); wxITEM_CHECK );
m_VToolBar->Realize(); m_VToolBar->Realize();
SetToolbars();
} }
...@@ -517,8 +514,6 @@ void WinEDA_PcbFrame::ReCreateMicrowaveVToolbar() ...@@ -517,8 +514,6 @@ void WinEDA_PcbFrame::ReCreateMicrowaveVToolbar()
_( "Create a polynomial shape for microwave applications" ) ); _( "Create a polynomial shape for microwave applications" ) );
m_AuxVToolBar->Realize(); m_AuxVToolBar->Realize();
SetToolbars();
} }
...@@ -676,8 +671,6 @@ an existing track use its width\notherwise, use current width setting" ), ...@@ -676,8 +671,6 @@ an existing track use its width\notherwise, use current width setting" ),
m_TrackAndViasSizesList_Changed = true; m_TrackAndViasSizesList_Changed = true;
ReCreateLayerBox( NULL ); ReCreateLayerBox( NULL );
SetToolbars();
} }
......
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