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
a4a933cc
Commit
a4a933cc
authored
Mar 25, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix wrong sizer/panel embedding in gui
parent
9f65a59a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
11 deletions
+18
-11
gui.py
printrun/gui.py
+18
-11
No files found.
printrun/gui.py
View file @
a4a933cc
...
@@ -368,10 +368,14 @@ class ControlsSizer(wx.GridBagSizer):
...
@@ -368,10 +368,14 @@ class ControlsSizer(wx.GridBagSizer):
else
:
self
.
make_standard
(
root
,
parentpanel
,
standalone_mode
)
else
:
self
.
make_standard
(
root
,
parentpanel
,
standalone_mode
)
def
make_standard
(
self
,
root
,
parentpanel
,
standalone_mode
):
def
make_standard
(
self
,
root
,
parentpanel
,
standalone_mode
):
lltspanel
=
root
.
newPanel
(
parentpanel
)
llts
=
wx
.
BoxSizer
(
wx
.
HORIZONTAL
)
llts
=
wx
.
BoxSizer
(
wx
.
HORIZONTAL
)
self
.
Add
(
llts
,
pos
=
(
0
,
0
),
span
=
(
1
,
6
))
lltspanel
.
SetSizer
(
llts
)
self
.
xyzsizer
=
XYZControlsSizer
(
root
,
parentpanel
)
self
.
Add
(
lltspanel
,
pos
=
(
0
,
0
),
span
=
(
1
,
6
))
self
.
Add
(
self
.
xyzsizer
,
pos
=
(
1
,
0
),
span
=
(
1
,
6
),
flag
=
wx
.
ALIGN_CENTER
)
xyzpanel
=
root
.
newPanel
(
parentpanel
)
self
.
xyzsizer
=
XYZControlsSizer
(
root
,
xyzpanel
)
xyzpanel
.
SetSizer
(
self
.
xyzsizer
)
self
.
Add
(
xyzpanel
,
pos
=
(
1
,
0
),
span
=
(
1
,
6
),
flag
=
wx
.
ALIGN_CENTER
)
self
.
extra_buttons
=
{}
self
.
extra_buttons
=
{}
pos_mapping
=
{
"extrude"
:
(
4
,
0
),
pos_mapping
=
{
"extrude"
:
(
4
,
0
),
...
@@ -383,7 +387,8 @@ class ControlsSizer(wx.GridBagSizer):
...
@@ -383,7 +387,8 @@ class ControlsSizer(wx.GridBagSizer):
for
key
,
desc
in
root
.
cpbuttons
.
items
():
for
key
,
desc
in
root
.
cpbuttons
.
items
():
if
not
standalone_mode
and
key
in
[
"extrude"
,
"reverse"
]:
if
not
standalone_mode
and
key
in
[
"extrude"
,
"reverse"
]:
continue
continue
btn
=
make_custom_button
(
root
,
parentpanel
,
desc
)
panel
=
lltspanel
if
key
==
"motorsoff"
else
parentpanel
btn
=
make_custom_button
(
root
,
panel
,
desc
)
if
key
==
"motorsoff"
:
if
key
==
"motorsoff"
:
llts
.
Add
(
btn
)
llts
.
Add
(
btn
)
elif
not
standalone_mode
:
elif
not
standalone_mode
:
...
@@ -391,12 +396,12 @@ class ControlsSizer(wx.GridBagSizer):
...
@@ -391,12 +396,12 @@ class ControlsSizer(wx.GridBagSizer):
else
:
else
:
self
.
extra_buttons
[
key
]
=
btn
self
.
extra_buttons
[
key
]
=
btn
root
.
xyfeedc
=
wx
.
SpinCtrl
(
parent
panel
,
-
1
,
str
(
root
.
settings
.
xy_feedrate
),
min
=
0
,
max
=
50000
,
size
=
(
70
,
-
1
))
root
.
xyfeedc
=
wx
.
SpinCtrl
(
llts
panel
,
-
1
,
str
(
root
.
settings
.
xy_feedrate
),
min
=
0
,
max
=
50000
,
size
=
(
70
,
-
1
))
root
.
xyfeedc
.
SetToolTip
(
wx
.
ToolTip
(
_
(
"Set Maximum Speed for X & Y axes (mm/min)"
)))
root
.
xyfeedc
.
SetToolTip
(
wx
.
ToolTip
(
_
(
"Set Maximum Speed for X & Y axes (mm/min)"
)))
llts
.
Add
(
wx
.
StaticText
(
parent
panel
,
-
1
,
_
(
"XY:"
)),
flag
=
wx
.
ALIGN_RIGHT
|
wx
.
ALIGN_CENTER_VERTICAL
)
llts
.
Add
(
wx
.
StaticText
(
llts
panel
,
-
1
,
_
(
"XY:"
)),
flag
=
wx
.
ALIGN_RIGHT
|
wx
.
ALIGN_CENTER_VERTICAL
)
llts
.
Add
(
root
.
xyfeedc
)
llts
.
Add
(
root
.
xyfeedc
)
llts
.
Add
(
wx
.
StaticText
(
parent
panel
,
-
1
,
_
(
"mm/min Z:"
)),
flag
=
wx
.
ALIGN_RIGHT
|
wx
.
ALIGN_CENTER_VERTICAL
)
llts
.
Add
(
wx
.
StaticText
(
llts
panel
,
-
1
,
_
(
"mm/min Z:"
)),
flag
=
wx
.
ALIGN_RIGHT
|
wx
.
ALIGN_CENTER_VERTICAL
)
root
.
zfeedc
=
wx
.
SpinCtrl
(
parent
panel
,
-
1
,
str
(
root
.
settings
.
z_feedrate
),
min
=
0
,
max
=
50000
,
size
=
(
70
,
-
1
))
root
.
zfeedc
=
wx
.
SpinCtrl
(
llts
panel
,
-
1
,
str
(
root
.
settings
.
z_feedrate
),
min
=
0
,
max
=
50000
,
size
=
(
70
,
-
1
))
root
.
zfeedc
.
SetToolTip
(
wx
.
ToolTip
(
_
(
"Set Maximum Speed for Z axis (mm/min)"
)))
root
.
zfeedc
.
SetToolTip
(
wx
.
ToolTip
(
_
(
"Set Maximum Speed for Z axis (mm/min)"
)))
llts
.
Add
(
root
.
zfeedc
,)
llts
.
Add
(
root
.
zfeedc
,)
...
@@ -505,8 +510,9 @@ class LogPane(wx.BoxSizer):
...
@@ -505,8 +510,9 @@ class LogPane(wx.BoxSizer):
root
.
logbox
.
SetMinSize
((
100
,
-
1
))
root
.
logbox
.
SetMinSize
((
100
,
-
1
))
root
.
logbox
.
SetEditable
(
0
)
root
.
logbox
.
SetEditable
(
0
)
self
.
Add
(
root
.
logbox
,
1
,
wx
.
EXPAND
)
self
.
Add
(
root
.
logbox
,
1
,
wx
.
EXPAND
)
bottom_panel
=
root
.
newPanel
(
parentpanel
)
lbrs
=
wx
.
BoxSizer
(
wx
.
HORIZONTAL
)
lbrs
=
wx
.
BoxSizer
(
wx
.
HORIZONTAL
)
root
.
commandbox
=
wx
.
TextCtrl
(
parent
panel
,
style
=
wx
.
TE_PROCESS_ENTER
)
root
.
commandbox
=
wx
.
TextCtrl
(
bottom_
panel
,
style
=
wx
.
TE_PROCESS_ENTER
)
root
.
commandbox
.
SetToolTip
(
wx
.
ToolTip
(
_
(
"Send commands to printer
\n
(Type 'help' for simple
\n
help function)"
)))
root
.
commandbox
.
SetToolTip
(
wx
.
ToolTip
(
_
(
"Send commands to printer
\n
(Type 'help' for simple
\n
help function)"
)))
root
.
commandbox
.
Bind
(
wx
.
EVT_TEXT_ENTER
,
root
.
sendline
)
root
.
commandbox
.
Bind
(
wx
.
EVT_TEXT_ENTER
,
root
.
sendline
)
root
.
commandbox
.
Bind
(
wx
.
EVT_CHAR
,
root
.
cbkey
)
root
.
commandbox
.
Bind
(
wx
.
EVT_CHAR
,
root
.
cbkey
)
...
@@ -514,9 +520,10 @@ class LogPane(wx.BoxSizer):
...
@@ -514,9 +520,10 @@ class LogPane(wx.BoxSizer):
root
.
commandbox
.
histindex
=
1
root
.
commandbox
.
histindex
=
1
#root.printerControls.append(root.commandbox)
#root.printerControls.append(root.commandbox)
lbrs
.
Add
(
root
.
commandbox
,
1
)
lbrs
.
Add
(
root
.
commandbox
,
1
)
root
.
sendbtn
=
make_button
(
parent
panel
,
_
(
"Send"
),
root
.
sendline
,
_
(
"Send Command to Printer"
),
style
=
wx
.
BU_EXACTFIT
,
container
=
lbrs
)
root
.
sendbtn
=
make_button
(
bottom_
panel
,
_
(
"Send"
),
root
.
sendline
,
_
(
"Send Command to Printer"
),
style
=
wx
.
BU_EXACTFIT
,
container
=
lbrs
)
#root.printerControls.append(root.sendbtn)
#root.printerControls.append(root.sendbtn)
self
.
Add
(
lbrs
,
0
,
wx
.
EXPAND
)
bottom_panel
.
SetSizer
(
lbrs
)
self
.
Add
(
bottom_panel
,
0
,
wx
.
EXPAND
)
class
ToggleablePane
(
wx
.
BoxSizer
):
class
ToggleablePane
(
wx
.
BoxSizer
):
...
...
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