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
e28c83c6
Commit
e28c83c6
authored
Sep 08, 2011
by
Kliment Yanev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix listbox to no longer scroll horizontally
parent
1deb61b2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
21 deletions
+21
-21
plater.py
plater.py
+21
-21
No files found.
plater.py
View file @
e28c83c6
...
@@ -16,7 +16,7 @@ class stlwrap:
...
@@ -16,7 +16,7 @@ class stlwrap:
class
showstl
(
wx
.
Window
):
class
showstl
(
wx
.
Window
):
def
__init__
(
self
,
parent
,
size
,
pos
):
def
__init__
(
self
,
parent
,
size
,
pos
):
wx
.
Window
.
__init__
(
self
,
parent
,
size
=
size
,
pos
=
pos
)
wx
.
Window
.
__init__
(
self
,
parent
,
size
=
size
,
pos
=
pos
)
self
.
l
=
wx
.
List
Ctrl
(
self
,
style
=
wx
.
LC_LIST
,
size
=
(
300
,
130
),
pos
=
(
0
,
size
[
1
]
-
130
))
self
.
l
=
wx
.
List
Box
(
self
,
size
=
(
300
,
130
),
pos
=
(
0
,
size
[
1
]
-
130
))
self
.
eb
=
wx
.
Button
(
self
,
label
=
"Export"
,
pos
=
(
300
,
size
[
1
]
-
130
))
self
.
eb
=
wx
.
Button
(
self
,
label
=
"Export"
,
pos
=
(
300
,
size
[
1
]
-
130
))
self
.
sb
=
wx
.
Button
(
self
,
label
=
"Snap to Z=0"
,
pos
=
(
300
,
size
[
1
]
-
105
))
self
.
sb
=
wx
.
Button
(
self
,
label
=
"Snap to Z=0"
,
pos
=
(
300
,
size
[
1
]
-
105
))
self
.
cb
=
wx
.
Button
(
self
,
label
=
"Put at 100,100"
,
pos
=
(
300
,
size
[
1
]
-
80
))
self
.
cb
=
wx
.
Button
(
self
,
label
=
"Put at 100,100"
,
pos
=
(
300
,
size
[
1
]
-
80
))
...
@@ -42,26 +42,26 @@ class showstl(wx.Window):
...
@@ -42,26 +42,26 @@ class showstl(wx.Window):
self
.
prevsel
=-
1
self
.
prevsel
=-
1
def
center
(
self
,
event
):
def
center
(
self
,
event
):
i
=
self
.
l
.
Get
FirstSelected
()
i
=
self
.
l
.
Get
Selection
()
if
i
!=
-
1
:
if
i
!=
-
1
:
m
=
self
.
models
[
self
.
l
.
Get
ItemText
(
i
)]
m
=
self
.
models
[
self
.
l
.
Get
String
(
i
)]
m
.
offsets
=
[
100
,
100
,
m
.
offsets
[
2
]]
m
.
offsets
=
[
100
,
100
,
m
.
offsets
[
2
]]
self
.
Refresh
()
self
.
Refresh
()
def
snap
(
self
,
event
):
def
snap
(
self
,
event
):
i
=
self
.
l
.
Get
FirstSelected
()
i
=
self
.
l
.
Get
Selection
()
if
i
!=
-
1
:
if
i
!=
-
1
:
m
=
self
.
models
[
self
.
l
.
Get
ItemText
(
i
)]
m
=
self
.
models
[
self
.
l
.
Get
String
(
i
)]
m
.
offsets
[
2
]
=-
1.0
*
min
(
m
.
facetsminz
)[
0
]
m
.
offsets
[
2
]
=-
1.0
*
min
(
m
.
facetsminz
)[
0
]
#print m.offsets[2]
#print m.offsets[2]
self
.
Refresh
()
self
.
Refresh
()
def
delete
(
self
,
event
):
def
delete
(
self
,
event
):
i
=
self
.
l
.
Get
FirstSelected
()
i
=
self
.
l
.
Get
Selection
()
if
i
!=
-
1
:
if
i
!=
-
1
:
del
self
.
models
[
self
.
l
.
Get
ItemText
(
i
)]
del
self
.
models
[
self
.
l
.
Get
String
(
i
)]
self
.
l
.
Delete
Item
(
i
)
self
.
l
.
Delete
(
i
)
self
.
l
.
Select
(
self
.
l
.
Get
Item
Count
()
-
1
)
self
.
l
.
Select
(
self
.
l
.
GetCount
()
-
1
)
self
.
Refresh
()
self
.
Refresh
()
def
export
(
self
,
event
):
def
export
(
self
,
event
):
...
@@ -179,24 +179,24 @@ class showstl(wx.Window):
...
@@ -179,24 +179,24 @@ class showstl(wx.Window):
m
.
bitmap
.
SetMask
(
wx
.
Mask
(
m
.
bitmap
,
wx
.
Colour
(
0
,
0
,
0
,
255
)))
m
.
bitmap
.
SetMask
(
wx
.
Mask
(
m
.
bitmap
,
wx
.
Colour
(
0
,
0
,
0
,
255
)))
#print time.time()-t
#print time.time()-t
self
.
l
.
Append
(
[
stlwrap
(
self
.
models
[
newname
],
newname
)]
)
self
.
l
.
Append
(
newname
)
i
=
self
.
l
.
Get
FirstSelected
()
i
=
self
.
l
.
Get
Selection
()
if
i
!=
-
1
:
if
i
==
wx
.
NOT_FOUND
:
self
.
l
.
Select
(
i
,
0
)
self
.
l
.
Select
(
0
)
self
.
l
.
Select
(
self
.
l
.
Get
Item
Count
()
-
1
)
self
.
l
.
Select
(
self
.
l
.
GetCount
()
-
1
)
self
.
Refresh
()
self
.
Refresh
()
#print time.time()-t
#print time.time()-t
def
move
(
self
,
event
):
def
move
(
self
,
event
):
if
event
.
ButtonUp
(
wx
.
MOUSE_BTN_LEFT
):
if
event
.
ButtonUp
(
wx
.
MOUSE_BTN_LEFT
):
if
(
self
.
initpos
is
not
None
):
if
(
self
.
initpos
is
not
None
):
i
=
self
.
l
.
Get
FirstSelected
()
i
=
self
.
l
.
Get
Selection
()
if
i
!=
-
1
:
if
i
!=
wx
.
NOT_FOUND
:
p
=
event
.
GetPositionTuple
()
p
=
event
.
GetPositionTuple
()
#print (p[0]-self.initpos[0]),(p[1]-self.initpos[1])
#print (p[0]-self.initpos[0]),(p[1]-self.initpos[1])
t
=
time
.
time
()
t
=
time
.
time
()
m
=
self
.
models
[
self
.
l
.
Get
ItemText
(
i
)]
m
=
self
.
models
[
self
.
l
.
Get
String
(
i
)]
m
.
offsets
=
[
m
.
offsets
[
0
]
+
0.5
*
(
p
[
0
]
-
self
.
initpos
[
0
]),
m
.
offsets
[
1
]
-
0.5
*
(
p
[
1
]
-
self
.
initpos
[
1
]),
m
.
offsets
[
2
]]
m
.
offsets
=
[
m
.
offsets
[
0
]
+
0.5
*
(
p
[
0
]
-
self
.
initpos
[
0
]),
m
.
offsets
[
1
]
-
0.5
*
(
p
[
1
]
-
self
.
initpos
[
1
]),
m
.
offsets
[
2
]]
#self.models[self.l.GetItemText(i)]=self.models[self.l.GetItemText(i)].translate([0.5*(p[0]-self.initpos[0]),0.5*(p[1]-self.initpos[1]),0])
#self.models[self.l.GetItemText(i)]=self.models[self.l.GetItemText(i)].translate([0.5*(p[0]-self.initpos[0]),0.5*(p[1]-self.initpos[1]),0])
#print time.time()-t
#print time.time()-t
...
@@ -220,10 +220,10 @@ class showstl(wx.Window):
...
@@ -220,10 +220,10 @@ class showstl(wx.Window):
def
rotateafter
(
self
):
def
rotateafter
(
self
):
if
(
self
.
i
!=
self
.
previ
):
if
(
self
.
i
!=
self
.
previ
):
i
=
self
.
l
.
Get
FirstSelected
()
i
=
self
.
l
.
Get
Selection
()
if
i
!=
-
1
:
if
i
!=
wx
.
NOT_FOUND
:
#o=self.models[self.l.GetItemText(i)].offsets
#o=self.models[self.l.GetItemText(i)].offsets
self
.
models
[
self
.
l
.
Get
ItemText
(
i
)]
.
rot
+=
5
*
(
self
.
i
-
self
.
previ
)
self
.
models
[
self
.
l
.
Get
String
(
i
)]
.
rot
+=
5
*
(
self
.
i
-
self
.
previ
)
#self.models[self.l.GetItemText(i)].offsets=o
#self.models[self.l.GetItemText(i)].offsets=o
self
.
previ
=
self
.
i
self
.
previ
=
self
.
i
self
.
Refresh
()
self
.
Refresh
()
...
@@ -234,7 +234,7 @@ class showstl(wx.Window):
...
@@ -234,7 +234,7 @@ class showstl(wx.Window):
def
rot
(
self
,
event
):
def
rot
(
self
,
event
):
z
=
event
.
GetWheelRotation
()
z
=
event
.
GetWheelRotation
()
s
=
self
.
l
.
Get
FirstSelected
()
s
=
self
.
l
.
Get
Selection
()
if
self
.
prevsel
!=
s
:
if
self
.
prevsel
!=
s
:
self
.
i
=
0
self
.
i
=
0
self
.
prevsel
=
s
self
.
prevsel
=
s
...
...
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