Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
Printrun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
machinery
Printrun
Commits
d2c97fba
Commit
d2c97fba
authored
Apr 03, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow setting an empty background color to use default window color
parent
70727b20
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
11 deletions
+18
-11
__init__.py
printrun/gui/__init__.py
+2
-2
controls.py
printrun/gui/controls.py
+4
-4
graph.py
printrun/gui/graph.py
+1
-1
viz.py
printrun/gui/viz.py
+2
-2
pronterface.py
printrun/pronterface.py
+9
-2
No files found.
printrun/gui/__init__.py
View file @
d2c97fba
...
@@ -124,14 +124,14 @@ class MainWindow(wx.Frame):
...
@@ -124,14 +124,14 @@ class MainWindow(wx.Frame):
def
newPanel
(
self
,
parent
,
add_to_list
=
True
):
def
newPanel
(
self
,
parent
,
add_to_list
=
True
):
panel
=
wx
.
Panel
(
parent
)
panel
=
wx
.
Panel
(
parent
)
panel
.
SetBackgroundColour
(
self
.
settings
.
bgcolor
)
panel
.
SetBackgroundColour
(
self
.
bgcolor
)
if
add_to_list
:
self
.
panels
.
append
(
panel
)
if
add_to_list
:
self
.
panels
.
append
(
panel
)
return
panel
return
panel
def
createTabbedGui
(
self
):
def
createTabbedGui
(
self
):
self
.
notesizer
=
wx
.
BoxSizer
(
wx
.
VERTICAL
)
self
.
notesizer
=
wx
.
BoxSizer
(
wx
.
VERTICAL
)
self
.
notebook
=
wx
.
Notebook
(
self
.
panel
)
self
.
notebook
=
wx
.
Notebook
(
self
.
panel
)
self
.
notebook
.
SetBackgroundColour
(
self
.
settings
.
bgcolor
)
self
.
notebook
.
SetBackgroundColour
(
self
.
bgcolor
)
page1panel
=
self
.
newPanel
(
self
.
notebook
)
page1panel
=
self
.
newPanel
(
self
.
notebook
)
page2panel
=
self
.
newPanel
(
self
.
notebook
)
page2panel
=
self
.
newPanel
(
self
.
notebook
)
self
.
mainsizer_page1
=
wx
.
BoxSizer
(
wx
.
VERTICAL
)
self
.
mainsizer_page1
=
wx
.
BoxSizer
(
wx
.
VERTICAL
)
...
...
printrun/gui/controls.py
View file @
d2c97fba
...
@@ -28,9 +28,9 @@ class XYZControlsSizer(wx.GridBagSizer):
...
@@ -28,9 +28,9 @@ class XYZControlsSizer(wx.GridBagSizer):
def
__init__
(
self
,
root
,
parentpanel
=
None
):
def
__init__
(
self
,
root
,
parentpanel
=
None
):
super
(
XYZControlsSizer
,
self
)
.
__init__
()
super
(
XYZControlsSizer
,
self
)
.
__init__
()
if
not
parentpanel
:
parentpanel
=
root
.
panel
if
not
parentpanel
:
parentpanel
=
root
.
panel
root
.
xyb
=
XYButtons
(
parentpanel
,
root
.
moveXY
,
root
.
homeButtonClicked
,
root
.
spacebarAction
,
root
.
settings
.
bgcolor
,
zcallback
=
root
.
moveZ
)
root
.
xyb
=
XYButtons
(
parentpanel
,
root
.
moveXY
,
root
.
homeButtonClicked
,
root
.
spacebarAction
,
root
.
bgcolor
,
zcallback
=
root
.
moveZ
)
self
.
Add
(
root
.
xyb
,
pos
=
(
0
,
1
),
flag
=
wx
.
ALIGN_CENTER
)
self
.
Add
(
root
.
xyb
,
pos
=
(
0
,
1
),
flag
=
wx
.
ALIGN_CENTER
)
root
.
zb
=
ZButtons
(
parentpanel
,
root
.
moveZ
,
root
.
settings
.
bgcolor
)
root
.
zb
=
ZButtons
(
parentpanel
,
root
.
moveZ
,
root
.
bgcolor
)
self
.
Add
(
root
.
zb
,
pos
=
(
0
,
2
),
flag
=
wx
.
ALIGN_CENTER
)
self
.
Add
(
root
.
zb
,
pos
=
(
0
,
2
),
flag
=
wx
.
ALIGN_CENTER
)
wx
.
CallAfter
(
root
.
xyb
.
SetFocus
)
wx
.
CallAfter
(
root
.
xyb
.
SetFocus
)
...
@@ -391,10 +391,10 @@ class ControlsSizer(wx.GridBagSizer):
...
@@ -391,10 +391,10 @@ class ControlsSizer(wx.GridBagSizer):
def
make_mini
(
self
,
root
,
parentpanel
):
def
make_mini
(
self
,
root
,
parentpanel
):
root
.
xyb
=
XYButtonsMini
(
parentpanel
,
root
.
moveXY
,
root
.
homeButtonClicked
,
root
.
xyb
=
XYButtonsMini
(
parentpanel
,
root
.
moveXY
,
root
.
homeButtonClicked
,
root
.
spacebarAction
,
root
.
settings
.
bgcolor
,
root
.
spacebarAction
,
root
.
bgcolor
,
zcallback
=
root
.
moveZ
)
zcallback
=
root
.
moveZ
)
self
.
Add
(
root
.
xyb
,
pos
=
(
1
,
0
),
span
=
(
1
,
4
),
flag
=
wx
.
ALIGN_CENTER
)
self
.
Add
(
root
.
xyb
,
pos
=
(
1
,
0
),
span
=
(
1
,
4
),
flag
=
wx
.
ALIGN_CENTER
)
root
.
zb
=
ZButtonsMini
(
parentpanel
,
root
.
moveZ
,
root
.
settings
.
bgcolor
)
root
.
zb
=
ZButtonsMini
(
parentpanel
,
root
.
moveZ
,
root
.
bgcolor
)
self
.
Add
(
root
.
zb
,
pos
=
(
0
,
4
),
span
=
(
2
,
1
),
flag
=
wx
.
ALIGN_CENTER
)
self
.
Add
(
root
.
zb
,
pos
=
(
0
,
4
),
span
=
(
2
,
1
),
flag
=
wx
.
ALIGN_CENTER
)
wx
.
CallAfter
(
root
.
xyb
.
SetFocus
)
wx
.
CallAfter
(
root
.
xyb
.
SetFocus
)
...
...
printrun/gui/graph.py
View file @
d2c97fba
...
@@ -305,7 +305,7 @@ class Graph(BufferedCanvas):
...
@@ -305,7 +305,7 @@ class Graph(BufferedCanvas):
if
self
.
window
:
self
.
window
.
graph
.
StopPlotting
()
if
self
.
window
:
self
.
window
.
graph
.
StopPlotting
()
def
draw
(
self
,
dc
,
w
,
h
):
def
draw
(
self
,
dc
,
w
,
h
):
dc
.
SetBackground
(
wx
.
Brush
(
self
.
root
.
settings
.
bgcolor
))
dc
.
SetBackground
(
wx
.
Brush
(
self
.
root
.
bgcolor
))
dc
.
Clear
()
dc
.
Clear
()
gc
=
wx
.
GraphicsContext
.
Create
(
dc
)
gc
=
wx
.
GraphicsContext
.
Create
(
dc
)
self
.
width
=
w
self
.
width
=
w
...
...
printrun/gui/viz.py
View file @
d2c97fba
...
@@ -61,7 +61,7 @@ class VizPane(wx.BoxSizer):
...
@@ -61,7 +61,7 @@ class VizPane(wx.BoxSizer):
build_dimensions
=
root
.
build_dimensions_list
,
build_dimensions
=
root
.
build_dimensions_list
,
grid
=
(
root
.
settings
.
preview_grid_step1
,
root
.
settings
.
preview_grid_step2
),
grid
=
(
root
.
settings
.
preview_grid_step1
,
root
.
settings
.
preview_grid_step2
),
extrusion_width
=
root
.
settings
.
preview_extrusion_width
,
extrusion_width
=
root
.
settings
.
preview_extrusion_width
,
bgcolor
=
root
.
settings
.
bgcolor
)
bgcolor
=
root
.
bgcolor
)
root
.
gviz
.
SetToolTip
(
wx
.
ToolTip
(
_
(
"Click to examine / edit
\n
layers of loaded file"
)))
root
.
gviz
.
SetToolTip
(
wx
.
ToolTip
(
_
(
"Click to examine / edit
\n
layers of loaded file"
)))
root
.
gviz
.
showall
=
1
root
.
gviz
.
showall
=
1
root
.
gviz
.
Bind
(
wx
.
EVT_LEFT_DOWN
,
root
.
show_viz_window
)
root
.
gviz
.
Bind
(
wx
.
EVT_LEFT_DOWN
,
root
.
show_viz_window
)
...
@@ -82,7 +82,7 @@ class VizPane(wx.BoxSizer):
...
@@ -82,7 +82,7 @@ class VizPane(wx.BoxSizer):
root
.
gwindow
=
gviz
.
GvizWindow
(
build_dimensions
=
root
.
build_dimensions_list
,
root
.
gwindow
=
gviz
.
GvizWindow
(
build_dimensions
=
root
.
build_dimensions_list
,
grid
=
(
root
.
settings
.
preview_grid_step1
,
root
.
settings
.
preview_grid_step2
),
grid
=
(
root
.
settings
.
preview_grid_step1
,
root
.
settings
.
preview_grid_step2
),
extrusion_width
=
root
.
settings
.
preview_extrusion_width
,
extrusion_width
=
root
.
settings
.
preview_extrusion_width
,
bgcolor
=
root
.
settings
.
bgcolor
)
bgcolor
=
root
.
bgcolor
)
root
.
gwindow
.
Bind
(
wx
.
EVT_CLOSE
,
lambda
x
:
root
.
gwindow
.
Hide
())
root
.
gwindow
.
Bind
(
wx
.
EVT_CLOSE
,
lambda
x
:
root
.
gwindow
.
Hide
())
if
not
isinstance
(
root
.
gviz
,
NoViz
):
if
not
isinstance
(
root
.
gviz
,
NoViz
):
self
.
Add
(
root
.
gviz
.
widget
,
1
,
flag
=
wx
.
EXPAND
|
wx
.
ALIGN_CENTER_HORIZONTAL
)
self
.
Add
(
root
.
gviz
.
widget
,
1
,
flag
=
wx
.
EXPAND
|
wx
.
ALIGN_CENTER_HORIZONTAL
)
printrun/pronterface.py
View file @
d2c97fba
...
@@ -181,7 +181,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
...
@@ -181,7 +181,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
self
.
p
.
xy_feedrate
=
self
.
settings
.
xy_feedrate
self
.
p
.
xy_feedrate
=
self
.
settings
.
xy_feedrate
self
.
p
.
z_feedrate
=
self
.
settings
.
z_feedrate
self
.
p
.
z_feedrate
=
self
.
settings
.
z_feedrate
self
.
panel
.
SetBackgroundColour
(
self
.
settings
.
bgcolor
)
self
.
panel
.
SetBackgroundColour
(
self
.
bgcolor
)
customdict
=
{}
customdict
=
{}
try
:
try
:
execfile
(
configfile
(
"custombtn.txt"
),
customdict
)
execfile
(
configfile
(
"custombtn.txt"
),
customdict
)
...
@@ -324,6 +324,13 @@ class PronterWindow(MainWindow, pronsole.pronsole):
...
@@ -324,6 +324,13 @@ class PronterWindow(MainWindow, pronsole.pronsole):
wx
.
CallAfter
(
self
.
gwindow
.
Destroy
)
wx
.
CallAfter
(
self
.
gwindow
.
Destroy
)
wx
.
CallAfter
(
self
.
Destroy
)
wx
.
CallAfter
(
self
.
Destroy
)
def
_get_bgcolor
(
self
):
if
self
.
settings
.
bgcolor
:
return
self
.
settings
.
bgcolor
else
:
return
wx
.
SystemSettings
.
GetColour
(
wx
.
SYS_COLOUR_WINDOWFRAME
)
bgcolor
=
property
(
_get_bgcolor
)
# --------------------------------------------------------------
# --------------------------------------------------------------
# Main interface actions
# Main interface actions
# --------------------------------------------------------------
# --------------------------------------------------------------
...
@@ -745,7 +752,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
...
@@ -745,7 +752,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
return
return
if
not
self
.
excluder
:
if
not
self
.
excluder
:
self
.
excluder
=
Excluder
()
self
.
excluder
=
Excluder
()
self
.
excluder
.
pop_window
(
self
.
fgcode
,
bgcolor
=
self
.
settings
.
bgcolor
,
self
.
excluder
.
pop_window
(
self
.
fgcode
,
bgcolor
=
self
.
bgcolor
,
build_dimensions
=
self
.
build_dimensions_list
)
build_dimensions
=
self
.
build_dimensions_list
)
def
about
(
self
,
event
):
def
about
(
self
,
event
):
...
...
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