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
437f0699
Commit
437f0699
authored
Nov 08, 2011
by
Duane Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix issue with XYButtons stealing keys. Added ESC key to blur.
parent
50d340f9
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
pronterface.py
pronterface.py
+1
-1
xybuttons.py
xybuttons.py
+14
-2
No files found.
pronterface.py
View file @
437f0699
...
...
@@ -67,6 +67,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
wx
.
Frame
.
__init__
(
self
,
None
,
title
=
_
(
"Printer Interface"
),
size
=
size
);
self
.
SetIcon
(
wx
.
Icon
(
"P-face.ico"
,
wx
.
BITMAP_TYPE_ICO
))
self
.
panel
=
wx
.
Panel
(
self
,
-
1
,
size
=
size
)
self
.
panel
.
SetBackgroundColour
(
"white"
)
self
.
statuscheck
=
False
self
.
tempreport
=
""
self
.
monitor
=
0
...
...
@@ -120,7 +121,6 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self
.
starttime
=
0
self
.
curlayer
=
0
self
.
cur_button
=
None
self
.
SetBackgroundColour
(
"white"
)
def
startcb
(
self
):
self
.
starttime
=
time
.
time
()
...
...
xybuttons.py
View file @
437f0699
...
...
@@ -36,7 +36,14 @@ class XYButtons(BufferedCanvas):
self
.
Bind
(
wx
.
EVT_LEFT_DCLICK
,
self
.
OnLeftDown
)
self
.
Bind
(
wx
.
EVT_MOTION
,
self
.
OnMotion
)
self
.
Bind
(
wx
.
EVT_LEAVE_WINDOW
,
self
.
OnLeaveWindow
)
wx
.
GetTopLevelParent
(
self
)
.
Bind
(
wx
.
EVT_CHAR_HOOK
,
self
.
onKey
)
self
.
Bind
(
wx
.
EVT_KEY_UP
,
self
.
onKey
)
wx
.
GetTopLevelParent
(
self
)
.
Bind
(
wx
.
EVT_CHAR_HOOK
,
self
.
onTopLevelKey
)
def
onTopLevelKey
(
self
,
evt
):
# Let user press escape on any control, and return focus here
if
evt
.
GetKeyCode
()
==
wx
.
WXK_ESCAPE
:
self
.
SetFocus
()
evt
.
Skip
()
def
onKey
(
self
,
evt
):
if
self
.
keypad_idx
>=
0
:
...
...
@@ -52,11 +59,13 @@ class XYButtons(BufferedCanvas):
self
.
quadrant
=
0
else
:
evt
.
Skip
()
return
False
return
if
self
.
moveCallback
:
self
.
concentric
=
self
.
keypad_idx
x
,
y
=
self
.
getMovement
()
self
.
moveCallback
(
x
,
y
)
evt
.
Skip
()
def
rotateKeypadIndex
(
self
):
...
...
@@ -124,6 +133,9 @@ class XYButtons(BufferedCanvas):
self
.
update
()
def
OnLeftDown
(
self
,
event
):
# Take focus when clicked so that arrow keys can control movement
self
.
SetFocus
()
mpos
=
event
.
GetPosition
()
idx
=
self
.
mouseOverKeypad
(
mpos
)
...
...
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