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
261a09c4
Commit
261a09c4
authored
Nov 07, 2011
by
Duane Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed that the background was repainted as white instead of transparent
parent
8b56bbe5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
4 deletions
+14
-4
bufferedcanvas.py
bufferedcanvas.py
+2
-0
xybuttons.py
xybuttons.py
+6
-1
zbuttons.py
zbuttons.py
+6
-3
No files found.
bufferedcanvas.py
View file @
261a09c4
...
@@ -111,6 +111,8 @@ class BufferedCanvas(wx.Panel):
...
@@ -111,6 +111,8 @@ class BufferedCanvas(wx.Panel):
Causes the canvas to be updated.
Causes the canvas to be updated.
"""
"""
dc
=
wx
.
MemoryDC
()
dc
=
wx
.
MemoryDC
()
width
,
height
=
self
.
GetClientSizeTuple
()
self
.
backbuffer
=
wx
.
EmptyBitmap
(
width
,
height
)
dc
.
SelectObject
(
self
.
backbuffer
)
dc
.
SelectObject
(
self
.
backbuffer
)
dc
.
BeginDrawing
()
dc
.
BeginDrawing
()
self
.
draw
(
dc
)
self
.
draw
(
dc
)
...
...
xybuttons.py
View file @
261a09c4
...
@@ -60,6 +60,7 @@ class XYButtons(BufferedCanvas):
...
@@ -60,6 +60,7 @@ class XYButtons(BufferedCanvas):
self
.
Bind
(
wx
.
EVT_LEFT_DOWN
,
self
.
OnLeftDown
)
self
.
Bind
(
wx
.
EVT_LEFT_DOWN
,
self
.
OnLeftDown
)
self
.
Bind
(
wx
.
EVT_LEFT_DCLICK
,
self
.
OnLeftDown
)
self
.
Bind
(
wx
.
EVT_LEFT_DCLICK
,
self
.
OnLeftDown
)
self
.
Bind
(
wx
.
EVT_MOTION
,
self
.
OnMotion
)
self
.
Bind
(
wx
.
EVT_MOTION
,
self
.
OnMotion
)
self
.
Bind
(
wx
.
EVT_LEAVE_WINDOW
,
self
.
OnLeaveWindow
)
parent
.
Bind
(
wx
.
EVT_CHAR_HOOK
,
self
.
onKey
)
parent
.
Bind
(
wx
.
EVT_CHAR_HOOK
,
self
.
onKey
)
def
onKey
(
self
,
evt
):
def
onKey
(
self
,
evt
):
...
@@ -156,6 +157,11 @@ class XYButtons(BufferedCanvas):
...
@@ -156,6 +157,11 @@ class XYButtons(BufferedCanvas):
else
:
else
:
self
.
setKeypadIndex
(
idx
)
self
.
setKeypadIndex
(
idx
)
def
OnLeaveWindow
(
self
,
evt
):
self
.
quadrant
=
None
self
.
concentric
=
None
self
.
update
()
def
drawPartialPie
(
self
,
dc
,
center
,
r1
,
r2
,
angle1
,
angle2
):
def
drawPartialPie
(
self
,
dc
,
center
,
r1
,
r2
,
angle1
,
angle2
):
parts
=
64
parts
=
64
angle_dist
=
angle2
-
angle1
angle_dist
=
angle2
-
angle1
...
@@ -205,7 +211,6 @@ class XYButtons(BufferedCanvas):
...
@@ -205,7 +211,6 @@ class XYButtons(BufferedCanvas):
self
.
drawPartialPie
(
dc
,
center
,
r1
-
inner_ring_radius
,
r2
-
inner_ring_radius
,
a1
+
fudge
,
a2
-
fudge
)
self
.
drawPartialPie
(
dc
,
center
,
r1
-
inner_ring_radius
,
r2
-
inner_ring_radius
,
a1
+
fudge
,
a2
-
fudge
)
def
draw
(
self
,
dc
):
def
draw
(
self
,
dc
):
dc
.
Clear
()
center
=
wx
.
Point
(
XYButtons
.
center
[
0
],
XYButtons
.
center
[
1
])
center
=
wx
.
Point
(
XYButtons
.
center
[
0
],
XYButtons
.
center
[
1
])
dc
.
SetPen
(
wx
.
Pen
(
wx
.
Colour
(
100
,
100
,
100
,
172
),
4
))
dc
.
SetPen
(
wx
.
Pen
(
wx
.
Colour
(
100
,
100
,
100
,
172
),
4
))
...
...
zbuttons.py
View file @
261a09c4
...
@@ -29,6 +29,7 @@ class ZButtons(BufferedCanvas):
...
@@ -29,6 +29,7 @@ class ZButtons(BufferedCanvas):
self
.
Bind
(
wx
.
EVT_LEFT_DOWN
,
self
.
OnLeftDown
)
self
.
Bind
(
wx
.
EVT_LEFT_DOWN
,
self
.
OnLeftDown
)
self
.
Bind
(
wx
.
EVT_LEFT_DCLICK
,
self
.
OnLeftDown
)
self
.
Bind
(
wx
.
EVT_LEFT_DCLICK
,
self
.
OnLeftDown
)
self
.
Bind
(
wx
.
EVT_MOTION
,
self
.
OnMotion
)
self
.
Bind
(
wx
.
EVT_MOTION
,
self
.
OnMotion
)
self
.
Bind
(
wx
.
EVT_LEAVE_WINDOW
,
self
.
OnLeaveWindow
)
def
lookupRange
(
self
,
ydist
):
def
lookupRange
(
self
,
ydist
):
idx
=
-
1
idx
=
-
1
...
@@ -79,10 +80,12 @@ class ZButtons(BufferedCanvas):
...
@@ -79,10 +80,12 @@ class ZButtons(BufferedCanvas):
if
self
.
homeCallback
:
if
self
.
homeCallback
:
self
.
homeCallback
()
self
.
homeCallback
()
def
draw
(
self
,
dc
):
def
OnLeaveWindow
(
self
,
evt
):
dc
.
Clear
()
self
.
range
=
None
# center = wx.Point(XYButtons.center[0], XYButtons.center[1])
self
.
direction
=
None
self
.
update
()
def
draw
(
self
,
dc
):
dc
.
SetPen
(
wx
.
Pen
(
wx
.
Colour
(
100
,
100
,
100
,
172
),
4
))
dc
.
SetPen
(
wx
.
Pen
(
wx
.
Colour
(
100
,
100
,
100
,
172
),
4
))
dc
.
SetBrush
(
wx
.
Brush
(
wx
.
Colour
(
0
,
0
,
0
,
128
)))
dc
.
SetBrush
(
wx
.
Brush
(
wx
.
Colour
(
0
,
0
,
0
,
128
)))
...
...
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