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
1ac50591
Commit
1ac50591
authored
May 23, 2012
by
Kliment Yanev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add button to reset view (no icon)
parent
0603d9c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
gviz.py
gviz.py
+8
-0
No files found.
gviz.py
View file @
1ac50591
...
...
@@ -27,6 +27,7 @@ class window(wx.Frame):
toolbar
.
AddSeparator
()
toolbar
.
AddSimpleTool
(
3
,
wx
.
Image
(
'./images/arrow_up.png'
,
wx
.
BITMAP_TYPE_PNG
)
.
ConvertToBitmap
(),
'Move Up a Layer [U]'
,
''
)
toolbar
.
AddSimpleTool
(
4
,
wx
.
Image
(
'./images/arrow_down.png'
,
wx
.
BITMAP_TYPE_PNG
)
.
ConvertToBitmap
(),
'Move Down a Layer [D]'
,
''
)
toolbar
.
AddSimpleTool
(
5
,
wx
.
EmptyBitmap
(
16
,
16
),
'Reset view'
,
''
)
toolbar
.
AddSeparator
()
#toolbar.AddSimpleTool(5, wx.Image('./images/inject.png', wx.BITMAP_TYPE_PNG).ConvertToBitmap(), 'Insert Code at start of this layer', '')
toolbar
.
Realize
()
...
...
@@ -36,8 +37,10 @@ class window(wx.Frame):
self
.
Bind
(
wx
.
EVT_TOOL
,
lambda
x
:
self
.
p
.
zoom
(
200
,
200
,
1
/
1.2
),
id
=
2
)
self
.
Bind
(
wx
.
EVT_TOOL
,
lambda
x
:
self
.
p
.
layerup
(),
id
=
3
)
self
.
Bind
(
wx
.
EVT_TOOL
,
lambda
x
:
self
.
p
.
layerdown
(),
id
=
4
)
self
.
Bind
(
wx
.
EVT_TOOL
,
self
.
resetview
,
id
=
5
)
#self.Bind(wx.EVT_TOOL, lambda x:self.p.inject(), id=5)
self
.
CreateStatusBar
(
1
);
self
.
SetStatusText
(
"Layer number and Z position show here when you scroll"
);
#self.bu=wx.Button(self.p,-1,"U",pos=(0,100),size=(40,140))
...
...
@@ -72,6 +75,11 @@ class window(wx.Frame):
self
.
p
.
Bind
(
wx
.
EVT_MOUSE_EVENTS
,
self
.
mouse
)
self
.
Bind
(
wx
.
EVT_MOUSE_EVENTS
,
self
.
mouse
)
def
resetview
(
self
,
event
):
self
.
p
.
translate
=
[
0.0
,
0.0
]
self
.
p
.
scale
=
self
.
p
.
basescale
self
.
p
.
zoom
(
0
,
0
,
1.0
)
def
mouse
(
self
,
event
):
if
event
.
ButtonUp
(
wx
.
MOUSE_BTN_LEFT
):
if
(
self
.
initpos
is
not
None
):
...
...
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