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
1798313f
Commit
1798313f
authored
Apr 05, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spin field to set speed factor #526
parent
62f52225
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
controls.py
printrun/gui/controls.py
+10
-2
No files found.
printrun/gui/controls.py
View file @
1798313f
...
...
@@ -192,7 +192,9 @@ def add_extra_controls(self, root, parentpanel, extra_buttons = None, mini_mode
root
.
speed_slider
=
wx
.
Slider
(
speedpanel
,
-
1
,
100
,
1
,
300
)
speedsizer
.
Add
(
root
.
speed_slider
,
1
,
flag
=
wx
.
EXPAND
)
root
.
speed_label
=
wx
.
StaticText
(
speedpanel
,
-
1
,
_
(
"
%
d
%%
"
)
%
100
)
root
.
speed_spin
=
FloatSpin
(
speedpanel
,
-
1
,
value
=
100
,
min_val
=
1
,
max_val
=
300
,
digits
=
0
,
style
=
wx
.
ALIGN_LEFT
,
size
=
(
60
,
-
1
))
speedsizer
.
Add
(
root
.
speed_spin
,
0
,
flag
=
wx
.
ALIGN_CENTER_VERTICAL
)
root
.
speed_label
=
wx
.
StaticText
(
speedpanel
,
-
1
,
_
(
"
%
"
))
speedsizer
.
Add
(
root
.
speed_label
,
flag
=
wx
.
ALIGN_CENTER_VERTICAL
|
wx
.
ALIGN_RIGHT
)
def
speedslider_set
(
event
):
...
...
@@ -204,10 +206,16 @@ def add_extra_controls(self, root, parentpanel, extra_buttons = None, mini_mode
speedpanel
.
SetSizer
(
speedsizer
)
add
(
"speedcontrol"
,
speedpanel
,
flag
=
wx
.
EXPAND
)
def
speedslider_spin
(
event
):
value
=
root
.
speed_spin
.
GetValue
()
root
.
speed_setbtn
.
SetBackgroundColour
(
"red"
)
root
.
speed_slider
.
SetValue
(
value
)
root
.
speed_spin
.
Bind
(
wx
.
EVT_SPINCTRL
,
speedslider_spin
)
def
speedslider_scroll
(
event
):
value
=
root
.
speed_slider
.
GetValue
()
root
.
speed_setbtn
.
SetBackgroundColour
(
"red"
)
root
.
speed_
label
.
SetLabel
(
_
(
"
%
d
%%
"
)
%
value
)
root
.
speed_
spin
.
SetValue
(
value
)
root
.
speed_slider
.
Bind
(
wx
.
EVT_SCROLL
,
speedslider_scroll
)
# Temperature gauges #
...
...
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