Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kicad-source-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
kicad-source-mirror
Commits
ba2c7632
Commit
ba2c7632
authored
Jun 18, 2014
by
jean-pierre charras
Browse files
Options
Browse Files
Download
Plain Diff
better management of Python console.
parents
2ff53e95
688dbe5d
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
40 deletions
+55
-40
wxPcbStruct.h
include/wxPcbStruct.h
+4
-2
menubar_pcbframe.cpp
pcbnew/menubar_pcbframe.cpp
+2
-2
pcbframe.cpp
pcbnew/pcbframe.cpp
+38
-31
tool_pcb.cpp
pcbnew/tool_pcb.cpp
+5
-5
toolbars_update_user_interface.cpp
pcbnew/toolbars_update_user_interface.cpp
+6
-0
No files found.
include/wxPcbStruct.h
View file @
ba2c7632
...
...
@@ -107,7 +107,7 @@ protected:
#ifdef KICAD_SCRIPTING_WXPYTHON
// Panel used to let user talk with internal scripting
wxWindow
*
m_pythonPanel
;
bool
m_pythonPanel
Hidden
;
bool
m_pythonPanel
Show
;
///< Visibility flag for Python Console
#endif
PCB_LAYER_WIDGET
*
m_Layers
;
...
...
@@ -1524,7 +1524,9 @@ public:
* Function ScriptingConsoleEnableDisable
* enables or disabled the scripting console
*/
void
ScriptingConsoleEnableDisable
(
wxCommandEvent
&
event
);
void
ScriptingConsoleEnableDisable
(
wxCommandEvent
&
aEvent
);
void
OnUpdateScriptingConsoleState
(
wxUpdateUIEvent
&
aEvent
);
void
OnSelectAutoPlaceMode
(
wxCommandEvent
&
aEvent
);
...
...
pcbnew/menubar_pcbframe.cpp
View file @
ba2c7632
...
...
@@ -534,8 +534,8 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
#if defined(KICAD_SCRIPTING_WXPYTHON)
AddMenuItem
(
toolsMenu
,
ID_TOOLBARH_PCB_SCRIPTING_CONSOLE
,
_
(
"&Scripting Console"
),
_
(
"Show/Hide the Scripting console"
),
KiBitmap
(
book
_xpm
)
);
_
(
"Show/Hide the
Python
Scripting console"
),
KiBitmap
(
py_script
_xpm
)
);
#endif
wxMenu
*
designRulesMenu
=
new
wxMenu
;
...
...
pcbnew/pcbframe.cpp
View file @
ba2c7632
...
...
@@ -72,6 +72,8 @@
#if defined(KICAD_SCRIPTING) || defined(KICAD_SCRIPTING_WXPYTHON)
#include <python_scripting.h>
// The name of the pane info handling the python console:
#define PYTHONCONSOLE_STRID wxT( "PythonPanel" )
#endif
#include <class_draw_panel_gal.h>
...
...
@@ -203,6 +205,8 @@ BEGIN_EVENT_TABLE( PCB_EDIT_FRAME, PCB_BASE_FRAME )
EVT_TOOL
(
ID_TOOLBARH_PCB_FREEROUTE_ACCESS
,
PCB_EDIT_FRAME
::
Access_to_External_Tool
)
#ifdef KICAD_SCRIPTING_WXPYTHON
EVT_TOOL
(
ID_TOOLBARH_PCB_SCRIPTING_CONSOLE
,
PCB_EDIT_FRAME
::
ScriptingConsoleEnableDisable
)
EVT_UPDATE_UI
(
ID_TOOLBARH_PCB_SCRIPTING_CONSOLE
,
PCB_EDIT_FRAME
::
OnUpdateScriptingConsoleState
)
#endif
// Option toolbar
EVT_TOOL
(
ID_TB_OPTIONS_DRC_OFF
,
...
...
@@ -316,13 +320,13 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
m_RecordingMacros
=
-
1
;
m_microWaveToolBar
=
NULL
;
m_useCmpFileForFpNames
=
true
;
m_rotationAngle
=
900
;
#ifdef KICAD_SCRIPTING_WXPYTHON
#if defined(KICAD_SCRIPTING_WXPYTHON)
m_pythonPanel
=
NULL
;
m_pythonPanelShow
=
false
;
#endif
m_rotationAngle
=
900
;
for
(
int
i
=
0
;
i
<
10
;
i
++
)
m_Macros
[
i
].
m_Record
.
clear
();
...
...
@@ -415,7 +419,8 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
if
(
m_microWaveToolBar
)
// The auxiliary vertical right toolbar (currently microwave tools)
m_auimgr
.
AddPane
(
m_microWaveToolBar
,
wxAuiPaneInfo
(
vert
).
Name
(
wxT
(
"m_microWaveToolBar"
)
).
Right
().
Layer
(
1
).
Position
(
1
).
Hide
()
);
wxAuiPaneInfo
(
vert
).
Name
(
wxT
(
"m_microWaveToolBar"
)
).
Right
().
Layer
(
1
).
Position
(
1
).
Hide
()
);
if
(
m_drawToolBar
)
// The main right vertical toolbar
m_auimgr
.
AddPane
(
m_drawToolBar
,
...
...
@@ -445,23 +450,6 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
m_auimgr
.
AddPane
(
m_messagePanel
,
wxAuiPaneInfo
(
mesg
).
Name
(
wxT
(
"MsgPanel"
)
).
Bottom
().
Layer
(
10
)
);
#if defined(KICAD_SCRIPTING_WXPYTHON)
// Add the scripting panel
EDA_PANEINFO
pythonAuiInfo
;
pythonAuiInfo
.
ScriptingToolbarPane
();
pythonAuiInfo
.
Caption
(
wxT
(
"Python Scripting"
)
);
pythonAuiInfo
.
MinSize
(
wxSize
(
200
,
100
)
);
pythonAuiInfo
.
BestSize
(
wxSize
(
GetClientSize
().
x
/
2
,
200
)
);
pythonAuiInfo
.
Hide
();
m_pythonPanel
=
CreatePythonShellWindow
(
this
);
m_auimgr
.
AddPane
(
m_pythonPanel
,
pythonAuiInfo
.
Name
(
wxT
(
"PythonPanel"
)
).
Bottom
().
Layer
(
9
)
);
m_pythonPanelHidden
=
true
;
#endif
ReFillLayerWidget
();
// this is near end because contents establish size
m_Layers
->
ReFillRender
();
// Update colors in Render after the config is read
...
...
@@ -1093,19 +1081,38 @@ void PCB_EDIT_FRAME::UpdateTitle()
#if defined(KICAD_SCRIPTING_WXPYTHON)
void
PCB_EDIT_FRAME
::
ScriptingConsoleEnableDisable
(
wxCommandEvent
&
aEvent
)
{
if
(
m_pythonPanelHidden
)
{
m_auimgr
.
GetPane
(
m_pythonPanel
).
Show
();
m_pythonPanelHidden
=
false
;
}
else
if
(
m_pythonPanel
==
NULL
)
{
m_auimgr
.
GetPane
(
m_pythonPanel
).
Hide
();
m_pythonPanelHidden
=
true
;
// Add the scripting panel
EDA_PANEINFO
pythonAuiPane
;
pythonAuiPane
.
ScriptingToolbarPane
();
pythonAuiPane
.
Caption
(
wxT
(
"Python Scripting"
)
);
pythonAuiPane
.
MinSize
(
300
,
150
);
pythonAuiPane
.
BestSize
(
600
,
200
);
#if 1 // Set to 0 to use the old behavior (dockable Python console)
// The console is not dockable. Reasons:
// * When docked there is an issue with accelerator keys used in the main menu:
// these keys are not sent to the console, even if it has the focus
// * The console is more easy to move, resize, ... if it is not dockable
pythonAuiPane
.
Dockable
(
false
).
Float
();
// Gives a reasonnable position to the console
wxPoint
pos
=
m_canvas
->
GetScreenPosition
();
pythonAuiPane
.
FloatingPosition
(
pos
.
x
+
10
,
pos
.
y
+
10
);
pythonAuiPane
.
FloatingSize
(
600
,
200
);
#else
pythonAuiPane
.
LeftDockable
(
false
).
RightDockable
(
false
);
#endif
m_pythonPanel
=
CreatePythonShellWindow
(
this
);
m_auimgr
.
AddPane
(
m_pythonPanel
,
pythonAuiPane
.
Name
(
PYTHONCONSOLE_STRID
).
Bottom
().
Layer
(
9
)
);
}
m_auimgr
.
Update
();
m_pythonPanelShow
=
!
m_pythonPanelShow
;
m_auimgr
.
GetPane
(
PYTHONCONSOLE_STRID
).
Show
(
m_pythonPanelShow
);
m_auimgr
.
Update
();
}
#endif
...
...
pcbnew/tool_pcb.cpp
View file @
ba2c7632
...
...
@@ -307,16 +307,16 @@ void PCB_EDIT_FRAME::ReCreateHToolbar()
KiBitmap
(
web_support_xpm
),
_
(
"Fast access to the Web Based FreeROUTE advanced router"
)
);
m_mainToolBar
->
AddSeparator
();
// Access to the scripting console
#ifdef KICAD_SCRIPTING_WXPYTHON
m_mainToolBar
->
AddSeparator
();
m_mainToolBar
->
AddTool
(
ID_TOOLBARH_PCB_SCRIPTING_CONSOLE
,
wxEmptyString
,
KiBitmap
(
py_script_xpm
),
_
(
"Show/Hide the Scripting console"
)
);
m_mainToolBar
->
AddSeparator
();
_
(
"Show/Hide the Python Scripting console"
),
wxITEM_CHECK
);
#endif
// after adding the buttons to the toolbar, must call Realize() to reflect the changes
m_mainToolBar
->
Realize
();
}
...
...
pcbnew/toolbars_update_user_interface.cpp
View file @
ba2c7632
...
...
@@ -109,6 +109,12 @@ void PCB_EDIT_FRAME::OnUpdateLayerSelectBox( wxUpdateUIEvent& aEvent )
m_SelLayerBox
->
SetLayerSelection
(
GetActiveLayer
()
);
}
#ifdef KICAD_SCRIPTING_WXPYTHON
void
PCB_EDIT_FRAME
::
OnUpdateScriptingConsoleState
(
wxUpdateUIEvent
&
aEvent
)
{
aEvent
.
Check
(
m_pythonPanelShow
);
}
#endif
void
PCB_EDIT_FRAME
::
OnUpdateZoneDisplayStyle
(
wxUpdateUIEvent
&
aEvent
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment