Push KIWAY_HOLDER down a level so we can move a bunch of stuff that doesn't belong there out.
This commit is contained in:
parent
d323fb57a7
commit
6025256e07
|
@ -38,7 +38,7 @@
|
|||
#include <bitmaps.h>
|
||||
#include <pgm_base.h>
|
||||
#include <eda_base_frame.h>
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
|
||||
|
||||
struct SCALED_BITMAP_ID {
|
||||
|
|
|
@ -65,15 +65,16 @@ END_EVENT_TABLE()
|
|||
|
||||
|
||||
DIALOG_SHIM::DIALOG_SHIM( wxWindow* aParent, wxWindowID id, const wxString& title,
|
||||
const wxPoint& pos, const wxSize& size, long style, const wxString& name ) :
|
||||
wxDialog( aParent, id, title, pos, size, style, name ),
|
||||
KIWAY_HOLDER( nullptr ),
|
||||
m_units( MILLIMETRES ),
|
||||
m_firstPaintEvent( true ),
|
||||
m_initialFocusTarget( nullptr ),
|
||||
m_qmodal_loop( nullptr ),
|
||||
m_qmodal_showing( false ),
|
||||
m_qmodal_parent_disabler( nullptr )
|
||||
const wxPoint& pos, const wxSize& size, long style,
|
||||
const wxString& name ) :
|
||||
wxDialog( aParent, id, title, pos, size, style, name ),
|
||||
KIWAY_HOLDER( nullptr, KIWAY_HOLDER::DIALOG ),
|
||||
m_units( MILLIMETRES ),
|
||||
m_firstPaintEvent( true ),
|
||||
m_initialFocusTarget( nullptr ),
|
||||
m_qmodal_loop( nullptr ),
|
||||
m_qmodal_showing( false ),
|
||||
m_qmodal_parent_disabler( nullptr )
|
||||
{
|
||||
KIWAY_HOLDER* kiwayHolder = nullptr;
|
||||
|
||||
|
@ -88,34 +89,34 @@ DIALOG_SHIM::DIALOG_SHIM( wxWindow* aParent, wxWindowID id, const wxString& titl
|
|||
}
|
||||
}
|
||||
|
||||
if( kiwayHolder )
|
||||
{
|
||||
// Inherit units from parent
|
||||
m_units = kiwayHolder->GetUserUnits();
|
||||
// Inherit units from parent
|
||||
if( kiwayHolder && kiwayHolder->GetType() == KIWAY_HOLDER::FRAME )
|
||||
m_units = static_cast<EDA_BASE_FRAME*>( kiwayHolder )->GetUserUnits();
|
||||
else if( kiwayHolder && kiwayHolder->GetType() == KIWAY_HOLDER::DIALOG )
|
||||
m_units = static_cast<DIALOG_SHIM*>( kiwayHolder )->GetUserUnits();
|
||||
|
||||
// Don't mouse-warp after a dialog run from the context menu
|
||||
TOOL_MANAGER* toolMgr = kiwayHolder->GetToolManager();
|
||||
// Don't mouse-warp after a dialog run from the context menu
|
||||
if( kiwayHolder && kiwayHolder->GetType() == KIWAY_HOLDER::FRAME )
|
||||
{
|
||||
TOOL_MANAGER* toolMgr = static_cast<EDA_BASE_FRAME*>( kiwayHolder )->GetToolManager();
|
||||
|
||||
if( toolMgr )
|
||||
toolMgr->VetoContextMenuMouseWarp();
|
||||
|
||||
// Set up the message bus
|
||||
SetKiway( this, &kiwayHolder->Kiway() );
|
||||
}
|
||||
|
||||
// Set up the message bus
|
||||
if( kiwayHolder )
|
||||
SetKiway( this, &kiwayHolder->Kiway() );
|
||||
|
||||
Bind( wxEVT_CLOSE_WINDOW, &DIALOG_SHIM::OnCloseWindow, this );
|
||||
Bind( wxEVT_BUTTON, &DIALOG_SHIM::OnButton, this );
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
// On Windows, the app top windows can be brought to the foreground
|
||||
// (at least temporary) in certain circumstances,
|
||||
// for instance when calling an external tool in Eeschema BOM generation.
|
||||
// So set the parent KIWAY_PLAYER kicad frame (if exists) to top window
|
||||
// to avoid this annoying behavior
|
||||
KIWAY_PLAYER* parent_kiwayplayer = dynamic_cast<KIWAY_PLAYER*>( aParent );
|
||||
|
||||
if( parent_kiwayplayer )
|
||||
Pgm().App().SetTopWindow( parent_kiwayplayer );
|
||||
// On Windows, the app top windows can be brought to the foreground (at least temporarily)
|
||||
// in certain circumstances such as when calling an external tool in Eeschema BOM generation.
|
||||
// So set the parent frame (if exists) to top window to avoid this annoying behavior.
|
||||
if( kiwayHolder && kiwayHolder->GetType() == KIWAY_HOLDER::FRAME )
|
||||
Pgm().App().SetTopWindow( (EDA_BASE_FRAME*) kiwayHolder );
|
||||
#endif
|
||||
|
||||
Connect( wxEVT_PAINT, wxPaintEventHandler( DIALOG_SHIM::OnPaint ) );
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include <gr_basic.h>
|
||||
#include <base_struct.h>
|
||||
#include <title_block.h>
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <ws_data_model.h>
|
||||
#include <base_screen.h>
|
||||
#include <wildcards_and_files_ext.h>
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include "dialog_print_generic.h"
|
||||
|
||||
#include <confirm.h>
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <printout.h>
|
||||
#include <enabler.h>
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
#include <fctsys.h>
|
||||
#include <macros.h>
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <kicad_string.h>
|
||||
#include <dialog_helpers.h>
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <kiface_i.h>
|
||||
#include <confirm.h>
|
||||
|
||||
|
|
|
@ -80,9 +80,10 @@ BEGIN_EVENT_TABLE( EDA_BASE_FRAME, wxFrame )
|
|||
END_EVENT_TABLE()
|
||||
|
||||
EDA_BASE_FRAME::EDA_BASE_FRAME( wxWindow* aParent, FRAME_T aFrameType,
|
||||
const wxString& aTitle, const wxPoint& aPos, const wxSize& aSize,
|
||||
long aStyle, const wxString& aFrameName ) :
|
||||
wxFrame( aParent, wxID_ANY, aTitle, aPos, aSize, aStyle, aFrameName )
|
||||
const wxString& aTitle, const wxPoint& aPos, const wxSize& aSize,
|
||||
long aStyle, const wxString& aFrameName, KIWAY* aKiway ) :
|
||||
wxFrame( aParent, wxID_ANY, aTitle, aPos, aSize, aStyle, aFrameName ),
|
||||
KIWAY_HOLDER( aKiway, KIWAY_HOLDER::FRAME )
|
||||
{
|
||||
m_Ident = aFrameType;
|
||||
m_hasAutoSave = false;
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#include <fctsys.h>
|
||||
#include <eda_dde.h>
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <id.h>
|
||||
#include <common.h>
|
||||
#include <macros.h>
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include <eda_dockart.h>
|
||||
#include <wx/aui/tabart.h>
|
||||
#include <wx/aui/auibook.h>
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
|
||||
void EDA_DOCKART::DrawBorder( wxDC& aDC, wxWindow* aWindow, const wxRect& aRect,
|
||||
wxAuiPaneInfo& aPane )
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#include <id.h>
|
||||
#include <base_screen.h>
|
||||
#include <msgpanel.h>
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <confirm.h>
|
||||
#include <dialog_helpers.h>
|
||||
#include <lockfile.h>
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
#include <eda_base_frame.h>
|
||||
#include <macros.h>
|
||||
#include <menus_helpers.h>
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
|
||||
#include <tool/tool_manager.h>
|
||||
|
||||
|
|
|
@ -37,18 +37,6 @@ PROJECT& KIWAY_HOLDER::Prj() const
|
|||
}
|
||||
|
||||
|
||||
EDA_UNITS_T KIWAY_HOLDER::GetUserUnits() const
|
||||
{
|
||||
return MILLIMETRES;
|
||||
}
|
||||
|
||||
|
||||
TOOL_MANAGER* KIWAY_HOLDER::GetToolManager() const
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
// this is not speed critical, hide it out of line.
|
||||
void KIWAY_HOLDER::SetKiway( wxWindow* aDest, KIWAY* aKiway )
|
||||
{
|
||||
|
|
|
@ -43,8 +43,7 @@ END_EVENT_TABLE()
|
|||
KIWAY_PLAYER::KIWAY_PLAYER( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType,
|
||||
const wxString& aTitle, const wxPoint& aPos, const wxSize& aSize,
|
||||
long aStyle, const wxString& aWdoName ) :
|
||||
EDA_BASE_FRAME( aParent, aFrameType, aTitle, aPos, aSize, aStyle, aWdoName ),
|
||||
KIWAY_HOLDER( aKiway ),
|
||||
EDA_BASE_FRAME( aParent, aFrameType, aTitle, aPos, aSize, aStyle, aWdoName, aKiway ),
|
||||
m_modal( false ),
|
||||
m_modal_loop( 0 ), m_modal_resultant_parent( 0 )
|
||||
{
|
||||
|
@ -55,8 +54,7 @@ KIWAY_PLAYER::KIWAY_PLAYER( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrameType
|
|||
KIWAY_PLAYER::KIWAY_PLAYER( wxWindow* aParent, wxWindowID aId, const wxString& aTitle,
|
||||
const wxPoint& aPos, const wxSize& aSize, long aStyle,
|
||||
const wxString& aWdoName ) :
|
||||
EDA_BASE_FRAME( aParent, (FRAME_T) aId, aTitle, aPos, aSize, aStyle, aWdoName ),
|
||||
KIWAY_HOLDER( 0 ),
|
||||
EDA_BASE_FRAME( aParent, (FRAME_T) aId, aTitle, aPos, aSize, aStyle, aWdoName, nullptr ),
|
||||
m_modal( false ),
|
||||
m_modal_loop( 0 ),
|
||||
m_modal_resultant_parent( 0 ),
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <origin_viewitem.h>
|
||||
#include <gal/graphics_abstraction_layer.h>
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include <gr_basic.h>
|
||||
#include <common.h>
|
||||
#include <base_screen.h>
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <title_block.h>
|
||||
#include <build_version.h>
|
||||
#include <ws_draw_item.h>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
#include <ws_proxy_undo_item.h>
|
||||
#include <ws_data_model.h>
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <macros.h>
|
||||
|
||||
using namespace KIGFX;
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
#include <wx/richmsgdlg.h>
|
||||
|
||||
#include <pgm_base.h>
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <eda_base_frame.h>
|
||||
#include <macros.h>
|
||||
#include <config_params.h>
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
*/
|
||||
|
||||
#include <status_popup.h>
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
|
||||
STATUS_POPUP::STATUS_POPUP( wxWindow* aParent ) :
|
||||
wxPopupWindow( aParent ),
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include <tool/action_manager.h>
|
||||
#include <tool/tool_manager.h>
|
||||
#include <tool/tool_action.h>
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
|
||||
#include <hotkeys_basic.h>
|
||||
#include <cctype>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
*/
|
||||
|
||||
#include <functional>
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <tool/actions.h>
|
||||
#include <tool/tool_event.h>
|
||||
#include <tool/tool_manager.h>
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include <bitmaps.h>
|
||||
#include <tool/actions.h>
|
||||
#include <tool/tool_manager.h>
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <class_draw_panel_gal.h>
|
||||
#include <view/view.h>
|
||||
#include <view/view_controls.h>
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include <tool/grid_menu.h>
|
||||
#include <id.h>
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <base_screen.h>
|
||||
#include <tool/actions.h>
|
||||
#include <bitmaps.h>
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#include <tool/tool_event.h>
|
||||
#include <tool/tool_manager.h>
|
||||
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <eda_base_frame.h>
|
||||
|
||||
bool TOOL_BASE::IsToolActive() const
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include <view/wx_view_controls.h>
|
||||
|
||||
#include <class_draw_panel_gal.h>
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <pcbnew_id.h>
|
||||
|
||||
#include <core/optional.h>
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
#include <tool/action_manager.h>
|
||||
|
||||
#include <class_draw_panel_gal.h>
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
|
||||
/// Struct describing the current execution state of a TOOL
|
||||
struct TOOL_MANAGER::TOOL_STATE
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <tool/tool_menu.h>
|
||||
#include <tool/tool_interactive.h>
|
||||
#include <tool/action_menu.h>
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
#include <tool/zoom_menu.h>
|
||||
#include <id.h>
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <base_screen.h>
|
||||
#include <tool/actions.h>
|
||||
#include <bitmaps.h>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
|
||||
#include <class_draw_panel_gal.h>
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <id.h>
|
||||
#include <preview_items/selection_area.h>
|
||||
#include <tool/actions.h>
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include <wx/textentry.h>
|
||||
#include <limits>
|
||||
#include <base_units.h>
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <confirm.h>
|
||||
|
||||
#include "widgets/unit_binder.h"
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
#include <wx/statline.h>
|
||||
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <dialog_shim.h>
|
||||
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#define SCH_BASE_FRAME_H_
|
||||
|
||||
#include <lib_id.h>
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
|
||||
#include <sch_screen.h>
|
||||
#include <sch_draw_panel.h>
|
||||
|
|
|
@ -103,7 +103,7 @@ static GRID_TYPE SchematicGridList[] = {
|
|||
|
||||
SCH_SCREEN::SCH_SCREEN( KIWAY* aKiway ) :
|
||||
BASE_SCREEN( SCH_SCREEN_T ),
|
||||
KIWAY_HOLDER( aKiway ),
|
||||
KIWAY_HOLDER( aKiway, KIWAY_HOLDER::HOLDER_TYPE::SCREEN ),
|
||||
m_paper( wxT( "A4" ) )
|
||||
{
|
||||
m_modification_sync = 0;
|
||||
|
|
|
@ -22,16 +22,10 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file sch_screen.h
|
||||
* @brief Definitions for the Eeschema program SCH_SCREEN class.
|
||||
*/
|
||||
|
||||
#ifndef SCREEN_H
|
||||
#define SCREEN_H
|
||||
|
||||
#include <unordered_set>
|
||||
|
||||
#include <macros.h>
|
||||
#include <dlist.h>
|
||||
#include <sch_item.h>
|
||||
|
@ -39,7 +33,7 @@
|
|||
#include <base_screen.h>
|
||||
#include <title_block.h>
|
||||
#include <page_info.h>
|
||||
#include <kiway_player.h>
|
||||
#include <kiway_holder.h>
|
||||
#include <sch_marker.h>
|
||||
#include <bus_alias.h>
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ LIB_VIEW_FRAME::LIB_VIEW_FRAME( KIWAY* aKiway, wxWindow* aParent, FRAME_T aFrame
|
|||
// Force the frame name used in config. the lib viewer frame has a name
|
||||
// depending on aFrameType (needed to identify the frame by wxWidgets),
|
||||
// but only one configuration is preferable.
|
||||
m_configFrameName = LIB_VIEW_NAME;
|
||||
m_configName = LIB_VIEW_NAME;
|
||||
|
||||
// Give an icon
|
||||
wxIcon icon;
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#include <sch_preview_panel.h>
|
||||
#include <pgm_base.h>
|
||||
#include <sch_painter.h>
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
|
||||
|
||||
SYMBOL_PREVIEW_WIDGET::SYMBOL_PREVIEW_WIDGET( wxWindow* aParent, KIWAY& aKiway,
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
*/
|
||||
|
||||
#include <fctsys.h>
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <sch_draw_panel.h>
|
||||
#include <sch_view.h>
|
||||
#include <general.h>
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include <pgm_base.h>
|
||||
#include <config_params.h>
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <layers_id_colors_and_visibility.h>
|
||||
#include <gerbview.h>
|
||||
#include <convert_to_biu.h>
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#ifndef BASE_SCREEN_H
|
||||
#define BASE_SCREEN_H
|
||||
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <base_struct.h>
|
||||
#include <undo_redo_container.h>
|
||||
#include <common.h>
|
||||
|
|
|
@ -130,7 +130,7 @@ public:
|
|||
|
||||
void OnPaint( wxPaintEvent &event );
|
||||
|
||||
EDA_UNITS_T GetUserUnits() const override { return m_units; }
|
||||
EDA_UNITS_T GetUserUnits() const { return m_units; }
|
||||
|
||||
protected:
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
#include <frame_type.h>
|
||||
#include "hotkeys_basic.h"
|
||||
#include <tool/action_toolbar.h>
|
||||
#include <kiway_holder.h>
|
||||
|
||||
#ifdef USE_WX_OVERLAY
|
||||
#include <wx/overlay.h>
|
||||
|
@ -98,7 +99,7 @@ enum id_librarytype {
|
|||
* and that class is not a player.
|
||||
* </p>
|
||||
*/
|
||||
class EDA_BASE_FRAME : public wxFrame
|
||||
class EDA_BASE_FRAME : public wxFrame, public KIWAY_HOLDER
|
||||
{
|
||||
/**
|
||||
* (with its unexpected name so it does not collide with the real OnWindowClose()
|
||||
|
@ -115,32 +116,29 @@ class EDA_BASE_FRAME : public wxFrame
|
|||
wxWindow* findQuasiModalDialog();
|
||||
|
||||
protected:
|
||||
FRAME_T m_Ident; ///< Id Type (pcb, schematic, library..)
|
||||
FRAME_T m_Ident; // Id Type (pcb, schematic, library..)
|
||||
wxPoint m_FramePos;
|
||||
wxSize m_FrameSize;
|
||||
|
||||
wxString m_configFrameName; ///< prefix used in config to identify some params (frame size...)
|
||||
///< if empty, the frame name defined in CTOR is used
|
||||
|
||||
wxString m_AboutTitle; ///< Name of program displayed in About.
|
||||
wxString m_AboutTitle; // Name of program displayed in About.
|
||||
|
||||
wxAuiManager m_auimgr;
|
||||
|
||||
/// Flag to indicate if this frame supports auto save.
|
||||
wxString m_configName; // prefix used to identify some params (frame size...)
|
||||
// and to name some config files (legacy hotkey files)
|
||||
|
||||
TOOL_MANAGER* m_toolManager;
|
||||
|
||||
bool m_hasAutoSave;
|
||||
|
||||
/// Flag to indicate the last auto save state.
|
||||
bool m_autoSaveState;
|
||||
|
||||
/// The auto save interval time in seconds.
|
||||
int m_autoSaveInterval;
|
||||
|
||||
/// The timer used to implement the auto save feature;
|
||||
int m_autoSaveInterval; // The auto save interval time in seconds.
|
||||
wxTimer* m_autoSaveTimer;
|
||||
|
||||
wxString m_perspective; ///< wxAuiManager perspective.
|
||||
wxString m_perspective; // wxAuiManager perspective.
|
||||
|
||||
wxString m_mruPath; ///< Most recently used path.
|
||||
wxString m_mruPath; // Most recently used path.
|
||||
|
||||
EDA_UNITS_T m_UserUnits;
|
||||
|
||||
///> Default style flags used for wxAUI toolbars
|
||||
static constexpr int KICAD_AUI_TB_STYLE = wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_PLAIN_BACKGROUND;
|
||||
|
@ -189,15 +187,40 @@ protected:
|
|||
|
||||
virtual wxString help_name();
|
||||
|
||||
/**
|
||||
* Called when when the units setting has changed to allow for any derived classes
|
||||
* to handle refreshing and controls that have units based measurements in them. The
|
||||
* default version only updates the status bar. Don't forget to call the default
|
||||
* in your derived class or the status bar will not get updated properly.
|
||||
*/
|
||||
virtual void unitsChangeRefresh() { }
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
public:
|
||||
EDA_BASE_FRAME( wxWindow* aParent, FRAME_T aFrameType,
|
||||
const wxString& aTitle, const wxPoint& aPos, const wxSize& aSize,
|
||||
long aStyle, const wxString& aFrameName );
|
||||
long aStyle, const wxString& aFrameName, KIWAY* aKiway );
|
||||
|
||||
~EDA_BASE_FRAME();
|
||||
|
||||
/**
|
||||
* Return the user units currently in use.
|
||||
*/
|
||||
EDA_UNITS_T GetUserUnits() const { return m_UserUnits; }
|
||||
void SetUserUnits( EDA_UNITS_T aUnits ) { m_UserUnits = aUnits; }
|
||||
|
||||
void ChangeUserUnits( EDA_UNITS_T aUnits )
|
||||
{
|
||||
SetUserUnits( aUnits );
|
||||
unitsChangeRefresh();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the MVC controller.
|
||||
*/
|
||||
TOOL_MANAGER* GetToolManager() const { return m_toolManager; }
|
||||
|
||||
/**
|
||||
* Override the default process event handler to implement the auto save feature.
|
||||
*
|
||||
|
@ -254,17 +277,15 @@ public:
|
|||
virtual void SaveSettings( wxConfigBase* aCfg );
|
||||
|
||||
/**
|
||||
* @return a base name prefix used in Load/Save settings to build
|
||||
* the full name of keys used in config.
|
||||
* This is usually the name of the frame set by CTOR, unless m_configFrameName
|
||||
* contains a base name.
|
||||
* this is the case of frames which can be shown in normal or modal mode.
|
||||
* This is needed because we want only one base name prefix,
|
||||
* regardless the mode used.
|
||||
* @return a base name prefix used in Load/Save settings to build the full name of keys
|
||||
* used in config.
|
||||
* This is usually the name of the frame set by CTOR, except for frames shown in multiple
|
||||
* modes in which case the m_configName must be set to the base name so that a single
|
||||
* config can be used.
|
||||
*/
|
||||
wxString ConfigBaseName()
|
||||
{
|
||||
wxString baseCfgName = m_configFrameName.IsEmpty() ? GetName() : m_configFrameName;
|
||||
wxString baseCfgName = m_configName.IsEmpty() ? GetName() : m_configName;
|
||||
return baseCfgName;
|
||||
}
|
||||
|
||||
|
|
|
@ -113,10 +113,8 @@ protected:
|
|||
// is at scale = 1
|
||||
int m_UndoRedoCountMax; ///< default Undo/Redo command Max depth, to be handed
|
||||
// to screens
|
||||
EDA_UNITS_T m_UserUnits;
|
||||
bool m_PolarCoords; //< for those frames that support polar coordinates
|
||||
|
||||
TOOL_MANAGER* m_toolManager;
|
||||
TOOL_DISPATCHER* m_toolDispatcher;
|
||||
ACTIONS* m_actions;
|
||||
|
||||
|
@ -174,13 +172,7 @@ protected:
|
|||
|
||||
double bestZoom( double sizeX, double sizeY, double scaleFactor, wxPoint centre );
|
||||
|
||||
/**
|
||||
* Called when when the units setting has changed to allow for any derived classes
|
||||
* to handle refreshing and controls that have units based measurements in them. The
|
||||
* default version only updates the status bar. Don't forget to call the default
|
||||
* in your derived class or the status bar will not get updated properly.
|
||||
*/
|
||||
virtual void unitsChangeRefresh();
|
||||
void unitsChangeRefresh() override;
|
||||
|
||||
void CommonSettingsChanged() override;
|
||||
|
||||
|
@ -256,18 +248,6 @@ public:
|
|||
*/
|
||||
virtual const wxSize GetPageSizeIU() const = 0;
|
||||
|
||||
/**
|
||||
* Return the user units currently in use.
|
||||
*/
|
||||
EDA_UNITS_T GetUserUnits() const override { return m_UserUnits; }
|
||||
void SetUserUnits( EDA_UNITS_T aUnits ) { m_UserUnits = aUnits; }
|
||||
|
||||
void ChangeUserUnits( EDA_UNITS_T aUnits )
|
||||
{
|
||||
SetUserUnits( aUnits );
|
||||
unitsChangeRefresh();
|
||||
}
|
||||
|
||||
/**
|
||||
* For those frames that support polar coordinates.
|
||||
*/
|
||||
|
@ -701,11 +681,6 @@ public:
|
|||
EDA_DRAW_PANEL_GAL* GetGalCanvas() const { return m_galCanvas; }
|
||||
void SetGalCanvas( EDA_DRAW_PANEL_GAL* aPanel ) { m_galCanvas = aPanel; }
|
||||
|
||||
/**
|
||||
* Return the tool manager instance, if any.
|
||||
*/
|
||||
TOOL_MANAGER* GetToolManager() const override { return m_toolManager; }
|
||||
|
||||
/**
|
||||
* A way to pass info to draw functions. the base class has no knowledge about
|
||||
* these options. It is virtual because this function must be overloaded to
|
|
@ -25,11 +25,10 @@
|
|||
#define KIWAY_HOLDER_H_
|
||||
|
||||
#include <wx/frame.h>
|
||||
#include <base_units.h>
|
||||
|
||||
|
||||
class KIWAY;
|
||||
class PROJECT;
|
||||
class TOOL_MANAGER;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -40,10 +39,15 @@ class TOOL_MANAGER;
|
|||
class KIWAY_HOLDER
|
||||
{
|
||||
public:
|
||||
KIWAY_HOLDER( KIWAY* aKiway ) :
|
||||
m_kiway( aKiway )
|
||||
enum HOLDER_TYPE { DIALOG, FRAME, PANEL, SCREEN };
|
||||
|
||||
KIWAY_HOLDER( KIWAY* aKiway, HOLDER_TYPE aType ) :
|
||||
m_kiway( aKiway ),
|
||||
m_type( aType )
|
||||
{}
|
||||
|
||||
HOLDER_TYPE GetType() { return m_type; }
|
||||
|
||||
/**
|
||||
* Function Kiway
|
||||
* returns a reference to the KIWAY that this object has an opportunity
|
||||
|
@ -61,21 +65,6 @@ public:
|
|||
*/
|
||||
PROJECT& Prj() const;
|
||||
|
||||
/**
|
||||
* Function GetUserUnits
|
||||
* Allows participation in KEYWAY_PLAYER/DIALOG_SHIM userUnits inheritance.
|
||||
*
|
||||
* This would fit better in KEYWAY_PLAYER, but DIALOG_SHIMs can only use mix-ins
|
||||
* because their primary superclass must be wxDialog.
|
||||
*/
|
||||
virtual EDA_UNITS_T GetUserUnits() const;
|
||||
|
||||
/**
|
||||
* Function GetToolManager
|
||||
* Return the tool manager instance, if any.
|
||||
*/
|
||||
virtual TOOL_MANAGER* GetToolManager() const;
|
||||
|
||||
/**
|
||||
* Function SetKiway
|
||||
*
|
||||
|
@ -90,6 +79,7 @@ public:
|
|||
private:
|
||||
// private, all setting is done through SetKiway().
|
||||
KIWAY* m_kiway; // no ownership.
|
||||
HOLDER_TYPE m_type;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ class WX_EVENT_LOOP;
|
|||
#ifdef SWIG
|
||||
class KIWAY_PLAYER : public wxFrame, public KIWAY_HOLDER
|
||||
#else
|
||||
class KIWAY_PLAYER : public EDA_BASE_FRAME, public KIWAY_HOLDER
|
||||
class KIWAY_PLAYER : public EDA_BASE_FRAME
|
||||
#endif
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
#include <vector>
|
||||
#include <boost/interprocess/exceptions.hpp>
|
||||
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <base_struct.h>
|
||||
#include <eda_text.h> // EDA_DRAW_MODE_T
|
||||
#include <richio.h>
|
||||
|
|
|
@ -76,7 +76,7 @@ enum TreeFileType {
|
|||
/**
|
||||
* The main KiCad project manager frame. It is not a KIWAY_PLAYER.
|
||||
*/
|
||||
class KICAD_MANAGER_FRAME : public EDA_BASE_FRAME, public KIWAY_HOLDER
|
||||
class KICAD_MANAGER_FRAME : public EDA_BASE_FRAME
|
||||
{
|
||||
public:
|
||||
KICAD_MANAGER_FRAME( wxWindow* parent, const wxString& title,
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
*/
|
||||
|
||||
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <panel_hotkeys_editor.h>
|
||||
#include <gestfich.h>
|
||||
#include <kiway.h>
|
||||
|
@ -57,8 +57,7 @@
|
|||
KICAD_MANAGER_FRAME::KICAD_MANAGER_FRAME( wxWindow* parent,
|
||||
const wxString& title, const wxPoint& pos, const wxSize& size ) :
|
||||
EDA_BASE_FRAME( parent, KICAD_MAIN_FRAME_T, title, pos, size,
|
||||
KICAD_DEFAULT_DRAWFRAME_STYLE, KICAD_MANAGER_FRAME_NAME ),
|
||||
KIWAY_HOLDER( &::Kiway )
|
||||
KICAD_DEFAULT_DRAWFRAME_STYLE, KICAD_MANAGER_FRAME_NAME, &::Kiway )
|
||||
{
|
||||
m_active_project = false;
|
||||
m_mainToolBar = nullptr;
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
|
||||
#include <config_params.h>
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <pl_editor_screen.h>
|
||||
#include <pl_editor_layout.h>
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include "dialog_pns_diff_pair_dimensions.h"
|
||||
#include <widgets/text_ctrl_eval.h>
|
||||
#include <router/pns_sizes_settings.h>
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <confirm.h>
|
||||
|
||||
DIALOG_PNS_DIFF_PAIR_DIMENSIONS::DIALOG_PNS_DIFF_PAIR_DIMENSIONS( EDA_DRAW_FRAME* aParent,
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include <router/pns_meander_placer.h>
|
||||
#include <widgets/text_ctrl_eval.h>
|
||||
#include <bitmaps.h>
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
|
||||
// TODO validators
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
#include <confirm.h>
|
||||
#include <widgets/text_ctrl_eval.h>
|
||||
#include <core/optional.h>
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
|
||||
#include "board_design_settings.h"
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include <class_module.h>
|
||||
#include <class_board.h>
|
||||
#include <mutex>
|
||||
#include <draw_frame.h>
|
||||
#include <eda_draw_frame.h>
|
||||
#include <utility>
|
||||
#include <make_unique.h>
|
||||
#include <colors_design_settings.h>
|
||||
|
@ -248,7 +248,7 @@ FOOTPRINT_PREVIEW_PANEL::FOOTPRINT_PREVIEW_PANEL( KIWAY* aKiway, wxWindow* aPare
|
|||
std::unique_ptr<KIGFX::GAL_DISPLAY_OPTIONS> aOpts,
|
||||
GAL_TYPE aGalType )
|
||||
: PCB_DRAW_PANEL_GAL ( aParent, -1, wxPoint( 0, 0 ), wxSize(200, 200), *aOpts, aGalType ),
|
||||
KIWAY_HOLDER( aKiway ),
|
||||
KIWAY_HOLDER( aKiway, KIWAY_HOLDER::PANEL ),
|
||||
m_DisplayOptions( std::move( aOpts ) ),
|
||||
m_footprintDisplayed( true )
|
||||
{
|
||||
|
|
|
@ -134,7 +134,7 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent
|
|||
// Force the frame name used in config. the footprint viewer frame has a name
|
||||
// depending on aFrameType (needed to identify the frame by wxWidgets),
|
||||
// but only one configuration is preferable.
|
||||
m_configFrameName = FOOTPRINT_VIEWER_FRAME_NAME;
|
||||
m_configName = FOOTPRINT_VIEWER_FRAME_NAME;
|
||||
|
||||
m_showAxis = true; // true to draw axis.
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "draw_frame.h"
|
||||
#include "eda_draw_frame.h"
|
||||
#include "pns_tune_status_popup.h"
|
||||
#include "pns_router.h"
|
||||
#include "pns_meander_placer.h"
|
||||
|
|
Loading…
Reference in New Issue