Start cleaning out wx/wx.h in cpp files

This commit is contained in:
Marek Roszko 2021-06-07 18:20:47 -04:00
parent 8f2819cfa4
commit 69d7a23e1c
5 changed files with 10 additions and 8 deletions

View File

@ -22,7 +22,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <wx/wx.h>
#include <wx/string.h>
#include <wx/translation.h>
#include <ki_exception.h>

View File

@ -25,7 +25,7 @@
#include <cstring>
#include <memory>
#include <wx/wx.h> // _()
#include <wx/translation.h>
#include <macros.h> // TO_UTF8()
#include <lib_id.h>

View File

@ -40,10 +40,10 @@
#include <core/arraydim.h>
#include <core/optional.h>
#include <wx/log.h>
#include <wx/stc/stc.h>
#include <kiplatform/app.h>
#include <wx/wx.h> // for GetForegroundWindow() on wxMSW
#include <kiplatform/ui.h>
///< Stores information about a mouse button state
struct TOOL_DISPATCHER::BUTTON_STATE
@ -450,7 +450,7 @@ void TOOL_DISPATCHER::DispatchWxEvent( wxEvent& aEvent )
#if defined( _WIN32 )
// Mouse events may trigger regardless of window status (windows feature)
// However we need to avoid focus fighting (especially modals)
if( holderWindow && holderWindow->GetHWND() == GetForegroundWindow() )
if( holderWindow && KIPLATFORM::UI::IsWindowActive( holderWindow ) )
#else
if( holderWindow )
#endif

View File

@ -37,8 +37,9 @@
#include <math/util.h> // for KiROUND
#include <widgets/ui_common.h>
#include <class_draw_panel_gal.h>
#include <kiplatform/ui.h>
#include <wx/log.h>
#include <wx/wx.h> // for GetForegroundWindow() on wxMSW
#if defined __WXMSW__
#define USE_MOUSE_CAPTURE
@ -455,7 +456,7 @@ void WX_VIEW_CONTROLS::onEnter( wxMouseEvent& aEvent )
if( m_parentPanel->GetParent() != nullptr )
{
// this assumes the parent panel's parent is the eda window
if( GetForegroundWindow() == m_parentPanel->GetParent()->GetHWND() )
if( KIPLATFORM::UI::IsWindowActive( m_parentPanel->GetParent() ) )
{
m_parentPanel->SetFocus();
}

View File

@ -77,7 +77,7 @@ bool KIPLATFORM::UI::IsWindowActive( wxWindow* aWindow )
{
if(! aWindow )
{
return false;
return false;
}
return ( aWindow->GetHWND() == GetForegroundWindow() );