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
8eb89b20
Commit
8eb89b20
authored
Nov 12, 2011
by
kliment
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #84 from canadaduane/master
Added visual indicator for increment values on mouseover
parents
4e1e71d9
470ab934
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
3 deletions
+32
-3
xybuttons.py
xybuttons.py
+17
-2
zbuttons.py
zbuttons.py
+15
-1
No files found.
xybuttons.py
View file @
8eb89b20
...
...
@@ -18,6 +18,12 @@ class XYButtons(BufferedCanvas):
}
corner_size
=
(
49
,
49
)
corner_inset
=
(
8
,
6
)
label_overlay_positions
=
{
0
:
(
142
,
105
,
11
),
1
:
(
160
,
85
,
13
),
2
:
(
179
,
65
,
15
),
3
:
(
201
,
42
,
16
)
}
concentric_circle_radii
=
[
11
,
45
,
69
,
94
,
115
]
center
=
(
124
,
121
)
spacer
=
7
...
...
@@ -206,14 +212,23 @@ class XYButtons(BufferedCanvas):
pos
=
XYButtons
.
keypad_positions
[
self
.
keypad_idx
]
pos
=
(
pos
[
0
]
-
padw
/
2
-
3
,
pos
[
1
]
-
padh
/
2
-
3
)
gc
.
DrawBitmap
(
self
.
keypad_bmp
,
pos
[
0
],
pos
[
1
],
padw
,
padh
)
# Draw label overlays
gc
.
SetPen
(
wx
.
Pen
(
wx
.
Colour
(
255
,
255
,
255
,
128
),
1
))
gc
.
SetBrush
(
wx
.
Brush
(
wx
.
Colour
(
255
,
255
,
255
,
128
+
64
)))
for
idx
,
kpos
in
XYButtons
.
label_overlay_positions
.
items
():
if
idx
!=
self
.
concentric
:
r
=
kpos
[
2
]
gc
.
DrawEllipse
(
kpos
[
0
]
-
r
,
kpos
[
1
]
-
r
,
r
*
2
,
r
*
2
)
else
:
gc
.
SetPen
(
wx
.
Pen
(
wx
.
Colour
(
255
,
255
,
255
,
0
),
4
))
gc
.
SetBrush
(
wx
.
Brush
(
wx
.
Colour
(
255
,
255
,
255
,
128
)))
gc
.
DrawRectangle
(
0
,
0
,
w
,
h
)
# Used to check exact position of keypad dots, should we ever resize the bg image
# for idx, kpos in XYButtons.
keypad
_positions.items():
# dc.DrawCircle(kpos[0], kpos[1],
6
)
# for idx, kpos in XYButtons.
label_overlay
_positions.items():
# dc.DrawCircle(kpos[0], kpos[1],
kpos[2]
)
## ------ ##
## Events ##
...
...
zbuttons.py
View file @
8eb89b20
...
...
@@ -12,6 +12,12 @@ def sign(n):
class
ZButtons
(
BufferedCanvas
):
button_ydistances
=
[
7
,
30
,
55
,
83
,
112
]
center
=
(
30
,
118
)
label_overlay_positions
=
{
0
:
(
1
,
18
,
11
),
1
:
(
1
,
41
,
13
),
2
:
(
1
,
67
,
15
),
3
:
None
}
def
__init__
(
self
,
parent
,
moveCallback
=
None
,
ID
=-
1
):
self
.
bg_bmp
=
wx
.
Image
(
imagefile
(
"control_z.png"
),
wx
.
BITMAP_TYPE_PNG
)
.
ConvertToBitmap
()
...
...
@@ -74,9 +80,17 @@ class ZButtons(BufferedCanvas):
gc
.
DrawBitmap
(
self
.
bg_bmp
,
0
,
0
,
w
,
h
)
if
self
.
enabled
:
# Draw label overlays
gc
.
SetPen
(
wx
.
Pen
(
wx
.
Colour
(
255
,
255
,
255
,
128
),
1
))
gc
.
SetBrush
(
wx
.
Brush
(
wx
.
Colour
(
255
,
255
,
255
,
128
+
64
)))
for
idx
,
kpos
in
ZButtons
.
label_overlay_positions
.
items
():
if
kpos
and
idx
!=
self
.
range
:
r
=
kpos
[
2
]
gc
.
DrawEllipse
(
ZButtons
.
center
[
0
]
-
kpos
[
0
]
-
r
,
ZButtons
.
center
[
1
]
-
kpos
[
1
]
-
r
,
r
*
2
,
r
*
2
)
# Top 'layer' is the mouse-over highlights
gc
.
SetPen
(
wx
.
Pen
(
wx
.
Colour
(
100
,
100
,
100
,
172
),
4
))
gc
.
SetBrush
(
wx
.
Brush
(
wx
.
Colour
(
0
,
0
,
0
,
128
)))
if
self
.
range
!=
None
and
self
.
direction
!=
None
:
self
.
highlight
(
gc
,
self
.
range
,
self
.
direction
)
else
:
...
...
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