Use qualified window names when searching for 3D viewers.
Just searching in children didn't work because the windows aren't actually in the child window lists. Fixes: lp:1831774 * https://bugs.launchpad.net/kicad/+bug/1831774
This commit is contained in:
parent
c6af38477d
commit
64b18ea06a
|
@ -158,7 +158,7 @@ EDA_3D_VIEWER::EDA_3D_VIEWER( KIWAY *aKiway, PCB_BASE_FRAME *aParent,
|
|||
KIWAY_PLAYER( aKiway, aParent,
|
||||
FRAME_PCB_DISPLAY3D, aTitle,
|
||||
wxDefaultPosition, wxDefaultSize,
|
||||
style, VIEWER3D_FRAMENAME )
|
||||
style, QUALIFIED_VIEWER3D_FRAMENAME( aParent ) )
|
||||
{
|
||||
wxLogTrace( m_logTrace, "EDA_3D_VIEWER::EDA_3D_VIEWER %s", aTitle );
|
||||
|
||||
|
|
|
@ -47,6 +47,8 @@
|
|||
#define KICAD_DEFAULT_3D_DRAWFRAME_STYLE (wxDEFAULT_FRAME_STYLE | wxWANTS_CHARS)
|
||||
|
||||
#define VIEWER3D_FRAMENAME wxT( "Viewer3DFrameName" )
|
||||
#define QUALIFIED_VIEWER3D_FRAMENAME( parent ) \
|
||||
( wxString( VIEWER3D_FRAMENAME ) + wxT( ":" ) + parent->GetName() )
|
||||
|
||||
/**
|
||||
* Create and handle a window for the 3d viewer connected to a Kiway and a pcbboard
|
||||
|
|
|
@ -114,7 +114,7 @@ PCB_BASE_FRAME::~PCB_BASE_FRAME()
|
|||
|
||||
EDA_3D_VIEWER* PCB_BASE_FRAME::Get3DViewerFrame()
|
||||
{
|
||||
return dynamic_cast<EDA_3D_VIEWER*>( FindWindow( VIEWER3D_FRAMENAME ) );
|
||||
return dynamic_cast<EDA_3D_VIEWER*>( FindWindowByName( QUALIFIED_VIEWER3D_FRAMENAME( this ) ) );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue