26 changed files with 168 additions and 535 deletions
-
29common/eda_draw_frame.cpp
-
1common/pgm_base.cpp
-
1eeschema/CMakeLists.txt
-
8eeschema/toolbars_sch_editor.cpp
-
5eeschema/tools/ee_actions.cpp
-
1eeschema/tools/ee_actions.h
-
11eeschema/tools/sch_editor_control.cpp
-
1eeschema/tools/sch_editor_control.h
-
5include/eda_draw_frame.h
-
5include/kiface_ids.h
-
1include/kiway.h
-
8pcbnew/CMakeLists.txt
-
53pcbnew/dialogs/dialog_scripting.cpp
-
39pcbnew/dialogs/dialog_scripting.h
-
43pcbnew/dialogs/dialog_scripting_base.cpp
-
202pcbnew/dialogs/dialog_scripting_base.fbp
-
51pcbnew/dialogs/dialog_scripting_base.h
-
31pcbnew/pcb_edit_frame.cpp
-
5pcbnew/pcb_edit_frame.h
-
7pcbnew/pcbnew.cpp
-
14pcbnew/swig/pcbnew_scripting_helpers.cpp
-
2pcbnew/toolbars_pcb_editor.cpp
-
1qa/eeschema/CMakeLists.txt
-
1scripting/kicad_scripting_main.cpp
-
155scripting/python_scripting.cpp
-
23scripting/python_scripting.h
@ -1,53 +0,0 @@ |
|||
/*
|
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2012-2014 Miguel Angel Ajo <miguelangel@nbee.es> |
|||
* Copyright (C) 1992-2014 KiCad Developers, see AUTHORS.txt for contributors. |
|||
* |
|||
* This program is free software; you can redistribute it and/or |
|||
* modify it under the terms of the GNU General Public License |
|||
* as published by the Free Software Foundation; either version 2 |
|||
* of the License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program; if not, you may find one here: |
|||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|||
* or you may search the http://www.gnu.org website for the version 2 license,
|
|||
* or you may write to the Free Software Foundation, Inc., |
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|||
*/ |
|||
|
|||
/**
|
|||
* @file dialog_scripting.cpp |
|||
*/ |
|||
|
|||
|
|||
#include <Python.h>
|
|||
#undef HAVE_CLOCK_GETTIME // macro is defined in Python.h and causes redefine warning
|
|||
|
|||
#include <pcb_edit_frame.h>
|
|||
#include <dialog_scripting.h>
|
|||
|
|||
|
|||
DIALOG_SCRIPTING::DIALOG_SCRIPTING( wxWindow* parent ) |
|||
: DIALOG_SCRIPTING_BASE( parent ) |
|||
{ |
|||
SetFocus(); |
|||
|
|||
} |
|||
|
|||
|
|||
|
|||
void DIALOG_SCRIPTING::OnRunButtonClick( wxCommandEvent& event ) |
|||
{ |
|||
wxCharBuffer buffer = m_txScript->GetValue().ToUTF8(); |
|||
int retv = PyRun_SimpleString( buffer.data()) ; |
|||
|
|||
if( retv != 0 ) |
|||
wxLogError( "Python error %d occurred running command:\n\n`%s`", retv, buffer ); |
|||
} |
|||
@ -1,39 +0,0 @@ |
|||
/* |
|||
* This program source code file is part of KiCad, a free EDA CAD application. |
|||
* |
|||
* Copyright (C) 2012-2014 Miguel Angel Ajo <miguelangel@nbee.es> |
|||
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors. |
|||
* |
|||
* This program is free software; you can redistribute it and/or |
|||
* modify it under the terms of the GNU General Public License |
|||
* as published by the Free Software Foundation; either version 2 |
|||
* of the License, or (at your option) any later version. |
|||
* |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program; if not, you may find one here: |
|||
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html |
|||
* or you may search the http://www.gnu.org website for the version 2 license, |
|||
* or you may write to the Free Software Foundation, Inc., |
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
|||
*/ |
|||
|
|||
#ifndef _DIALOG_SCRIPTING_H_ |
|||
#define _DIALOG_SCRIPTING_H_ |
|||
|
|||
#include <dialog_scripting_base.h> |
|||
|
|||
class DIALOG_SCRIPTING: public DIALOG_SCRIPTING_BASE |
|||
{ |
|||
public: |
|||
DIALOG_SCRIPTING( wxWindow * parent ); |
|||
|
|||
private: |
|||
void OnRunButtonClick( wxCommandEvent& event ) override; |
|||
}; |
|||
|
|||
#endif // _DIALOG_SCRIPTING_H_ |
|||
@ -1,43 +0,0 @@ |
|||
///////////////////////////////////////////////////////////////////////////
|
|||
// C++ code generated with wxFormBuilder (version Nov 23 2018)
|
|||
// http://www.wxformbuilder.org/
|
|||
//
|
|||
// PLEASE DO *NOT* EDIT THIS FILE!
|
|||
///////////////////////////////////////////////////////////////////////////
|
|||
|
|||
#include "dialog_scripting_base.h"
|
|||
|
|||
///////////////////////////////////////////////////////////////////////////
|
|||
|
|||
DIALOG_SCRIPTING_BASE::DIALOG_SCRIPTING_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style ) |
|||
{ |
|||
this->SetSizeHints( wxDefaultSize, wxDefaultSize ); |
|||
|
|||
wxBoxSizer* bSizerMain; |
|||
bSizerMain = new wxBoxSizer( wxVERTICAL ); |
|||
|
|||
m_txScript = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxTE_MULTILINE ); |
|||
m_txScript->SetMinSize( wxSize( 480,500 ) ); |
|||
|
|||
bSizerMain->Add( m_txScript, 1, wxALL|wxEXPAND, 5 ); |
|||
|
|||
m_btRun = new wxButton( this, wxID_ANY, _("&Run"), wxDefaultPosition, wxDefaultSize, 0 ); |
|||
bSizerMain->Add( m_btRun, 0, wxALL, 5 ); |
|||
|
|||
|
|||
this->SetSizer( bSizerMain ); |
|||
this->Layout(); |
|||
bSizerMain->Fit( this ); |
|||
|
|||
this->Centre( wxBOTH ); |
|||
|
|||
// Connect Events
|
|||
m_btRun->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SCRIPTING_BASE::OnRunButtonClick ), NULL, this ); |
|||
} |
|||
|
|||
DIALOG_SCRIPTING_BASE::~DIALOG_SCRIPTING_BASE() |
|||
{ |
|||
// Disconnect Events
|
|||
m_btRun->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_SCRIPTING_BASE::OnRunButtonClick ), NULL, this ); |
|||
|
|||
} |
|||
@ -1,202 +0,0 @@ |
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> |
|||
<wxFormBuilder_Project> |
|||
<FileVersion major="1" minor="15" /> |
|||
<object class="Project" expanded="1"> |
|||
<property name="class_decoration"></property> |
|||
<property name="code_generation">C++</property> |
|||
<property name="disconnect_events">1</property> |
|||
<property name="disconnect_mode">source_name</property> |
|||
<property name="disconnect_php_events">0</property> |
|||
<property name="disconnect_python_events">0</property> |
|||
<property name="embedded_files_path">res</property> |
|||
<property name="encoding">UTF-8</property> |
|||
<property name="event_generation">connect</property> |
|||
<property name="file">dialog_scripting_base</property> |
|||
<property name="first_id">1000</property> |
|||
<property name="help_provider">none</property> |
|||
<property name="indent_with_spaces"></property> |
|||
<property name="internationalize">1</property> |
|||
<property name="name">DIALOG_SCRIPTING_BASE</property> |
|||
<property name="namespace"></property> |
|||
<property name="path">.</property> |
|||
<property name="precompiled_header"></property> |
|||
<property name="relative_path">1</property> |
|||
<property name="skip_lua_events">1</property> |
|||
<property name="skip_php_events">1</property> |
|||
<property name="skip_python_events">1</property> |
|||
<property name="ui_table">UI</property> |
|||
<property name="use_enum">0</property> |
|||
<property name="use_microsoft_bom">0</property> |
|||
<object class="Frame" expanded="1"> |
|||
<property name="aui_managed">0</property> |
|||
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property> |
|||
<property name="bg"></property> |
|||
<property name="center">wxBOTH</property> |
|||
<property name="context_help"></property> |
|||
<property name="context_menu">1</property> |
|||
<property name="enabled">1</property> |
|||
<property name="event_handler">impl_virtual</property> |
|||
<property name="extra_style"></property> |
|||
<property name="fg"></property> |
|||
<property name="font"></property> |
|||
<property name="hidden">0</property> |
|||
<property name="id">wxID_ANY</property> |
|||
<property name="maximum_size"></property> |
|||
<property name="minimum_size"></property> |
|||
<property name="name">DIALOG_SCRIPTING_BASE</property> |
|||
<property name="pos"></property> |
|||
<property name="size">-1,-1</property> |
|||
<property name="style">wxDEFAULT_FRAME_STYLE</property> |
|||
<property name="subclass"></property> |
|||
<property name="title">Scripting Test Window</property> |
|||
<property name="tooltip"></property> |
|||
<property name="window_extra_style"></property> |
|||
<property name="window_name"></property> |
|||
<property name="window_style">wxTAB_TRAVERSAL</property> |
|||
<property name="xrc_skip_sizer">1</property> |
|||
<object class="wxBoxSizer" expanded="1"> |
|||
<property name="minimum_size"></property> |
|||
<property name="name">bSizerMain</property> |
|||
<property name="orient">wxVERTICAL</property> |
|||
<property name="permission">none</property> |
|||
<object class="sizeritem" expanded="1"> |
|||
<property name="border">5</property> |
|||
<property name="flag">wxALL|wxEXPAND</property> |
|||
<property name="proportion">1</property> |
|||
<object class="wxTextCtrl" expanded="1"> |
|||
<property name="BottomDockable">1</property> |
|||
<property name="LeftDockable">1</property> |
|||
<property name="RightDockable">1</property> |
|||
<property name="TopDockable">1</property> |
|||
<property name="aui_layer"></property> |
|||
<property name="aui_name"></property> |
|||
<property name="aui_position"></property> |
|||
<property name="aui_row"></property> |
|||
<property name="best_size"></property> |
|||
<property name="bg"></property> |
|||
<property name="caption"></property> |
|||
<property name="caption_visible">1</property> |
|||
<property name="center_pane">0</property> |
|||
<property name="close_button">1</property> |
|||
<property name="context_help"></property> |
|||
<property name="context_menu">1</property> |
|||
<property name="default_pane">0</property> |
|||
<property name="dock">Dock</property> |
|||
<property name="dock_fixed">0</property> |
|||
<property name="docking">Left</property> |
|||
<property name="enabled">1</property> |
|||
<property name="fg"></property> |
|||
<property name="floatable">1</property> |
|||
<property name="font"></property> |
|||
<property name="gripper">0</property> |
|||
<property name="hidden">0</property> |
|||
<property name="id">wxID_ANY</property> |
|||
<property name="max_size"></property> |
|||
<property name="maximize_button">0</property> |
|||
<property name="maximum_size"></property> |
|||
<property name="maxlength">0</property> |
|||
<property name="min_size"></property> |
|||
<property name="minimize_button">0</property> |
|||
<property name="minimum_size">480,500</property> |
|||
<property name="moveable">1</property> |
|||
<property name="name">m_txScript</property> |
|||
<property name="pane_border">1</property> |
|||
<property name="pane_position"></property> |
|||
<property name="pane_size"></property> |
|||
<property name="permission">protected</property> |
|||
<property name="pin_button">1</property> |
|||
<property name="pos"></property> |
|||
<property name="resize">Resizable</property> |
|||
<property name="show">1</property> |
|||
<property name="size"></property> |
|||
<property name="style">wxHSCROLL|wxTE_MULTILINE</property> |
|||
<property name="subclass"></property> |
|||
<property name="toolbar_pane">0</property> |
|||
<property name="tooltip"></property> |
|||
<property name="validator_data_type"></property> |
|||
<property name="validator_style">wxFILTER_NONE</property> |
|||
<property name="validator_type">wxDefaultValidator</property> |
|||
<property name="validator_variable"></property> |
|||
<property name="value"></property> |
|||
<property name="window_extra_style"></property> |
|||
<property name="window_name"></property> |
|||
<property name="window_style"></property> |
|||
</object> |
|||
</object> |
|||
<object class="sizeritem" expanded="1"> |
|||
<property name="border">5</property> |
|||
<property name="flag">wxALL</property> |
|||
<property name="proportion">0</property> |
|||
<object class="wxButton" expanded="1"> |
|||
<property name="BottomDockable">1</property> |
|||
<property name="LeftDockable">1</property> |
|||
<property name="RightDockable">1</property> |
|||
<property name="TopDockable">1</property> |
|||
<property name="aui_layer"></property> |
|||
<property name="aui_name"></property> |
|||
<property name="aui_position"></property> |
|||
<property name="aui_row"></property> |
|||
<property name="best_size"></property> |
|||
<property name="bg"></property> |
|||
<property name="bitmap"></property> |
|||
<property name="caption"></property> |
|||
<property name="caption_visible">1</property> |
|||
<property name="center_pane">0</property> |
|||
<property name="close_button">1</property> |
|||
<property name="context_help"></property> |
|||
<property name="context_menu">1</property> |
|||
<property name="current"></property> |
|||
<property name="default">0</property> |
|||
<property name="default_pane">0</property> |
|||
<property name="disabled"></property> |
|||
<property name="dock">Dock</property> |
|||
<property name="dock_fixed">0</property> |
|||
<property name="docking">Left</property> |
|||
<property name="enabled">1</property> |
|||
<property name="fg"></property> |
|||
<property name="floatable">1</property> |
|||
<property name="focus"></property> |
|||
<property name="font"></property> |
|||
<property name="gripper">0</property> |
|||
<property name="hidden">0</property> |
|||
<property name="id">wxID_ANY</property> |
|||
<property name="label">&Run</property> |
|||
<property name="margins"></property> |
|||
<property name="markup">0</property> |
|||
<property name="max_size"></property> |
|||
<property name="maximize_button">0</property> |
|||
<property name="maximum_size"></property> |
|||
<property name="min_size"></property> |
|||
<property name="minimize_button">0</property> |
|||
<property name="minimum_size"></property> |
|||
<property name="moveable">1</property> |
|||
<property name="name">m_btRun</property> |
|||
<property name="pane_border">1</property> |
|||
<property name="pane_position"></property> |
|||
<property name="pane_size"></property> |
|||
<property name="permission">protected</property> |
|||
<property name="pin_button">1</property> |
|||
<property name="pos"></property> |
|||
<property name="position"></property> |
|||
<property name="pressed"></property> |
|||
<property name="resize">Resizable</property> |
|||
<property name="show">1</property> |
|||
<property name="size"></property> |
|||
<property name="style"></property> |
|||
<property name="subclass"></property> |
|||
<property name="toolbar_pane">0</property> |
|||
<property name="tooltip"></property> |
|||
<property name="validator_data_type"></property> |
|||
<property name="validator_style">wxFILTER_NONE</property> |
|||
<property name="validator_type">wxDefaultValidator</property> |
|||
<property name="validator_variable"></property> |
|||
<property name="window_extra_style"></property> |
|||
<property name="window_name"></property> |
|||
<property name="window_style"></property> |
|||
<event name="OnButtonClick">OnRunButtonClick</event> |
|||
</object> |
|||
</object> |
|||
</object> |
|||
</object> |
|||
</object> |
|||
</wxFormBuilder_Project> |
|||
@ -1,51 +0,0 @@ |
|||
/////////////////////////////////////////////////////////////////////////// |
|||
// C++ code generated with wxFormBuilder (version Nov 23 2018) |
|||
// http://www.wxformbuilder.org/ |
|||
// |
|||
// PLEASE DO *NOT* EDIT THIS FILE! |
|||
/////////////////////////////////////////////////////////////////////////// |
|||
|
|||
#pragma once |
|||
|
|||
#include <wx/artprov.h> |
|||
#include <wx/xrc/xmlres.h> |
|||
#include <wx/intl.h> |
|||
#include <wx/string.h> |
|||
#include <wx/textctrl.h> |
|||
#include <wx/gdicmn.h> |
|||
#include <wx/font.h> |
|||
#include <wx/colour.h> |
|||
#include <wx/settings.h> |
|||
#include <wx/bitmap.h> |
|||
#include <wx/image.h> |
|||
#include <wx/icon.h> |
|||
#include <wx/button.h> |
|||
#include <wx/sizer.h> |
|||
#include <wx/frame.h> |
|||
|
|||
/////////////////////////////////////////////////////////////////////////// |
|||
|
|||
|
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
/// Class DIALOG_SCRIPTING_BASE |
|||
/////////////////////////////////////////////////////////////////////////////// |
|||
class DIALOG_SCRIPTING_BASE : public wxFrame |
|||
{ |
|||
private: |
|||
|
|||
protected: |
|||
wxTextCtrl* m_txScript; |
|||
wxButton* m_btRun; |
|||
|
|||
// Virtual event handlers, overide them in your derived class |
|||
virtual void OnRunButtonClick( wxCommandEvent& event ) { event.Skip(); } |
|||
|
|||
|
|||
public: |
|||
|
|||
DIALOG_SCRIPTING_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Scripting Test Window"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL ); |
|||
|
|||
~DIALOG_SCRIPTING_BASE(); |
|||
|
|||
}; |
|||
|
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue