Commit 0b9f39fa authored by jean-pierre charras's avatar jean-pierre charras

Fix 3D frame issue when iconized (Windows only).

parent 04bf11c2
...@@ -106,7 +106,7 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( CVPCB_MAINFRAME* father, ...@@ -106,7 +106,7 @@ DISPLAY_FOOTPRINTS_FRAME::DISPLAY_FOOTPRINTS_FRAME( CVPCB_MAINFRAME* father,
wxAuiPaneInfo( vert ).Name( wxT( "m_VToolBar" ) ).Right() ); wxAuiPaneInfo( vert ).Name( wxT( "m_VToolBar" ) ).Right() );
m_auimgr.AddPane( DrawPanel, m_auimgr.AddPane( DrawPanel,
wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() ); wxAuiPaneInfo().Name( wxT( "DisplayFrame" ) ).CentrePane() );
m_auimgr.AddPane( MsgPanel, m_auimgr.AddPane( MsgPanel,
wxAuiPaneInfo( horiz ).Name( wxT( "MsgPanel" ) ).Bottom() ); wxAuiPaneInfo( horiz ).Name( wxT( "MsgPanel" ) ).Bottom() );
...@@ -126,7 +126,7 @@ DISPLAY_FOOTPRINTS_FRAME::~DISPLAY_FOOTPRINTS_FRAME() ...@@ -126,7 +126,7 @@ DISPLAY_FOOTPRINTS_FRAME::~DISPLAY_FOOTPRINTS_FRAME()
delete GetScreen(); delete GetScreen();
SetScreen( NULL ); SetScreen( NULL );
( (CVPCB_MAINFRAME*) wxGetApp().GetTopWindow() )->DrawFrame = NULL; ( (CVPCB_MAINFRAME*) wxGetApp().GetTopWindow() )->m_DisplayFootprintFrame = NULL;
} }
/* Called when the frame is closed /* Called when the frame is closed
...@@ -134,12 +134,8 @@ DISPLAY_FOOTPRINTS_FRAME::~DISPLAY_FOOTPRINTS_FRAME() ...@@ -134,12 +134,8 @@ DISPLAY_FOOTPRINTS_FRAME::~DISPLAY_FOOTPRINTS_FRAME()
*/ */
void DISPLAY_FOOTPRINTS_FRAME::OnCloseWindow( wxCloseEvent& event ) void DISPLAY_FOOTPRINTS_FRAME::OnCloseWindow( wxCloseEvent& event )
{ {
wxPoint pos; if( m_Draw3DFrame )
wxSize size; m_Draw3DFrame->Close(true);
size = GetSize();
pos = GetPosition();
SaveSettings(); SaveSettings();
Destroy(); Destroy();
} }
...@@ -408,6 +404,10 @@ void DISPLAY_FOOTPRINTS_FRAME::Show3D_Frame( wxCommandEvent& event ) ...@@ -408,6 +404,10 @@ void DISPLAY_FOOTPRINTS_FRAME::Show3D_Frame( wxCommandEvent& event )
{ {
if( m_Draw3DFrame ) if( m_Draw3DFrame )
{ {
// Raising the window does not show the window on Windows if iconized.
// This should work on any platform.
if( m_Draw3DFrame->IsIconized() )
m_Draw3DFrame->Iconize( false );
m_Draw3DFrame->Raise(); m_Draw3DFrame->Raise();
// Raising the window does not set the focus on Linux. This should work on any platform. // Raising the window does not set the focus on Linux. This should work on any platform.
......
...@@ -244,7 +244,7 @@ void FOOTPRINTS_LISTBOX::OnLeftClick( wxListEvent& event ) ...@@ -244,7 +244,7 @@ void FOOTPRINTS_LISTBOX::OnLeftClick( wxListEvent& event )
Module = GetParent()->m_footprints.GetModuleInfo( FootprintName ); Module = GetParent()->m_footprints.GetModuleInfo( FootprintName );
wxASSERT(Module); wxASSERT(Module);
if( GetParent()->DrawFrame ) if( GetParent()->m_DisplayFootprintFrame )
{ {
GetParent()->CreateScreenCmp(); /* refresh general */ GetParent()->CreateScreenCmp(); /* refresh general */
} }
......
This diff is collapsed.
...@@ -17,7 +17,6 @@ class COMPONENTS_LISTBOX; ...@@ -17,7 +17,6 @@ class COMPONENTS_LISTBOX;
class DISPLAY_FOOTPRINTS_FRAME; class DISPLAY_FOOTPRINTS_FRAME;
/** /**
* The CVPcb application main window. * The CVPcb application main window.
*/ */
...@@ -28,7 +27,7 @@ public: ...@@ -28,7 +27,7 @@ public:
bool m_KeepCvpcbOpen; bool m_KeepCvpcbOpen;
FOOTPRINTS_LISTBOX* m_FootprintList; FOOTPRINTS_LISTBOX* m_FootprintList;
COMPONENTS_LISTBOX* m_ListCmp; COMPONENTS_LISTBOX* m_ListCmp;
DISPLAY_FOOTPRINTS_FRAME* DrawFrame; DISPLAY_FOOTPRINTS_FRAME* m_DisplayFootprintFrame;
EDA_TOOLBAR* m_HToolBar; EDA_TOOLBAR* m_HToolBar;
wxFileName m_NetlistFileName; wxFileName m_NetlistFileName;
wxArrayString m_ModuleLibNames; wxArrayString m_ModuleLibNames;
...@@ -45,8 +44,7 @@ protected: ...@@ -45,8 +44,7 @@ protected:
bool m_isEESchemaNetlist; bool m_isEESchemaNetlist;
PARAM_CFG_ARRAY m_projectFileParams; PARAM_CFG_ARRAY m_projectFileParams;
public: public: CVPCB_MAINFRAME( const wxString& title,
CVPCB_MAINFRAME( const wxString& title,
long style = KICAD_DEFAULT_DRAWFRAME_STYLE ); long style = KICAD_DEFAULT_DRAWFRAME_STYLE );
~CVPCB_MAINFRAME(); ~CVPCB_MAINFRAME();
...@@ -108,7 +106,7 @@ public: ...@@ -108,7 +106,7 @@ public:
* fills m_footprints * fills m_footprints
* @return true if libraries are found, false otherwise. * @return true if libraries are found, false otherwise.
*/ */
bool LoadFootprintFiles( ); bool LoadFootprintFiles();
/** /**
* function GenNetlistPcbnew * function GenNetlistPcbnew
......
...@@ -31,28 +31,32 @@ void CVPCB_MAINFRAME::CreateScreenCmp() ...@@ -31,28 +31,32 @@ void CVPCB_MAINFRAME::CreateScreenCmp()
FootprintName = m_FootprintList->GetSelectedFootprint(); FootprintName = m_FootprintList->GetSelectedFootprint();
if( DrawFrame == NULL ) if( m_DisplayFootprintFrame == NULL )
{ {
DrawFrame = new DISPLAY_FOOTPRINTS_FRAME( this, _( "Module" ), m_DisplayFootprintFrame = new DISPLAY_FOOTPRINTS_FRAME( this, _( "Module" ),
wxPoint( 0, 0 ), wxPoint( 0, 0 ),
wxSize( 600, 400 ), wxSize( 600, 400 ),
KICAD_DEFAULT_DRAWFRAME_STYLE ); KICAD_DEFAULT_DRAWFRAME_STYLE );
IsNew = true; IsNew = true;
DrawFrame->Show( true ); m_DisplayFootprintFrame->Show( true );
} }
else else
{ {
DrawFrame->Raise(); // Raising the window does not show the window on Windows if iconized.
// This should work on any platform.
if( m_DisplayFootprintFrame->IsIconized() )
m_DisplayFootprintFrame->Iconize( false );
m_DisplayFootprintFrame->Raise();
// Raising the window does not set the focus on Linux. This should work on any platform. // Raising the window does not set the focus on Linux. This should work on any platform.
if( wxWindow::FindFocus() != DrawFrame ) if( wxWindow::FindFocus() != m_DisplayFootprintFrame )
DrawFrame->SetFocus(); m_DisplayFootprintFrame->SetFocus();
} }
if( !FootprintName.IsEmpty() ) if( !FootprintName.IsEmpty() )
{ {
msg = _( "Footprint: " ) + FootprintName; msg = _( "Footprint: " ) + FootprintName;
DrawFrame->SetTitle( msg ); m_DisplayFootprintFrame->SetTitle( msg );
FOOTPRINT_INFO* Module = m_footprints.GetModuleInfo( FootprintName ); FOOTPRINT_INFO* Module = m_footprints.GetModuleInfo( FootprintName );
msg = _( "Lib: " ); msg = _( "Lib: " );
...@@ -61,32 +65,32 @@ void CVPCB_MAINFRAME::CreateScreenCmp() ...@@ -61,32 +65,32 @@ void CVPCB_MAINFRAME::CreateScreenCmp()
else else
msg += wxT( "???" ); msg += wxT( "???" );
DrawFrame->SetStatusText( msg, 0 ); m_DisplayFootprintFrame->SetStatusText( msg, 0 );
if( DrawFrame->GetBoard()->m_Modules.GetCount() ) if( m_DisplayFootprintFrame->GetBoard()->m_Modules.GetCount() )
{ {
// there is only one module in the list // there is only one module in the list
DrawFrame->GetBoard()->m_Modules.DeleteAll(); m_DisplayFootprintFrame->GetBoard()->m_Modules.DeleteAll();
} }
MODULE* mod = DrawFrame->Get_Module( FootprintName ); MODULE* mod = m_DisplayFootprintFrame->Get_Module( FootprintName );
if( mod ) if( mod )
DrawFrame->GetBoard()->m_Modules.PushBack( mod ); m_DisplayFootprintFrame->GetBoard()->m_Modules.PushBack( mod );
DrawFrame->Zoom_Automatique( false ); m_DisplayFootprintFrame->Zoom_Automatique( false );
DrawFrame->DrawPanel->Refresh(); m_DisplayFootprintFrame->DrawPanel->Refresh();
DrawFrame->UpdateStatusBar(); /* Display new cursor coordinates and zoom value */ m_DisplayFootprintFrame->UpdateStatusBar(); /* Display new cursor coordinates and zoom value */
if( DrawFrame->m_Draw3DFrame ) if( m_DisplayFootprintFrame->m_Draw3DFrame )
DrawFrame->m_Draw3DFrame->NewDisplay(); m_DisplayFootprintFrame->m_Draw3DFrame->NewDisplay();
} }
else if( !IsNew ) else if( !IsNew )
{ {
DrawFrame->Refresh(); m_DisplayFootprintFrame->Refresh();
if( DrawFrame->m_Draw3DFrame ) if( m_DisplayFootprintFrame->m_Draw3DFrame )
DrawFrame->m_Draw3DFrame->NewDisplay(); m_DisplayFootprintFrame->m_Draw3DFrame->NewDisplay();
} }
} }
......
...@@ -168,6 +168,8 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event ) ...@@ -168,6 +168,8 @@ void PCB_EDIT_FRAME::Process_Special_Functions( wxCommandEvent& event )
} }
else else
{ {
if( m_ModuleEditFrame->IsIconized() )
m_ModuleEditFrame->Iconize( false );
m_ModuleEditFrame->Raise(); m_ModuleEditFrame->Raise();
// Raising the window does not set the focus on Linux. This should work on // Raising the window does not set the focus on Linux. This should work on
......
...@@ -325,6 +325,10 @@ void WinEDA_ModuleEditFrame::Show3D_Frame( wxCommandEvent& event ) ...@@ -325,6 +325,10 @@ void WinEDA_ModuleEditFrame::Show3D_Frame( wxCommandEvent& event )
{ {
if( m_Draw3DFrame ) if( m_Draw3DFrame )
{ {
// Raising the window does not show the window on Windows if iconized.
// This should work on any platform.
if( m_Draw3DFrame->IsIconized() )
m_Draw3DFrame->Iconize( false );
m_Draw3DFrame->Raise(); m_Draw3DFrame->Raise();
// Raising the window does not set the focus on Linux. This should work on any platform. // Raising the window does not set the focus on Linux. This should work on any platform.
......
...@@ -483,6 +483,10 @@ void PCB_EDIT_FRAME::Show3D_Frame( wxCommandEvent& event ) ...@@ -483,6 +483,10 @@ void PCB_EDIT_FRAME::Show3D_Frame( wxCommandEvent& event )
{ {
if( m_Draw3DFrame ) if( m_Draw3DFrame )
{ {
// Raising the window does not show the window on Windows if iconized.
// This should work on any platform.
if( m_Draw3DFrame->IsIconized() )
m_Draw3DFrame->Iconize( false );
m_Draw3DFrame->Raise(); m_Draw3DFrame->Raise();
// Raising the window does not set the focus on Linux. This should work on any platform. // Raising the window does not set the focus on Linux. This should work on any platform.
......
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