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
d46b470d
Commit
d46b470d
authored
Jun 01, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup custom buttons positionning
parent
895c14e4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
25 deletions
+10
-25
gui.py
printrun/gui.py
+5
-3
pronterface.py
pronterface.py
+5
-22
No files found.
printrun/gui.py
View file @
d46b470d
...
...
@@ -390,7 +390,8 @@ class MainWindow(wx.Frame):
rightsizer
=
wx
.
BoxSizer
(
wx
.
VERTICAL
)
extracontrols
=
wx
.
GridBagSizer
()
add_extra_controls
(
extracontrols
,
self
,
page1panel2
,
left_pane
.
extra_buttons
)
rightsizer
.
Add
(
extracontrols
,
1
,
wx
.
ALIGN_CENTER
)
rightsizer
.
AddStretchSpacer
()
rightsizer
.
Add
(
extracontrols
,
0
,
wx
.
ALIGN_CENTER
)
self
.
lowersizer
.
Add
(
leftsizer
,
1
,
wx
.
ALIGN_CENTER
)
self
.
lowersizer
.
Add
(
rightsizer
,
1
,
wx
.
ALIGN_CENTER
)
self
.
mainsizer_page1
.
Add
(
page1panel2
,
1
,
wx
.
EXPAND
)
...
...
@@ -420,7 +421,8 @@ class MainWindow(wx.Frame):
self
.
Bind
(
wx
.
EVT_CLOSE
,
self
.
kill
)
vizpane
.
Detach
(
self
.
centersizer
)
rightsizer
.
Add
(
self
.
centersizer
,
0
,
wx
.
EXPAND
)
rightsizer
.
Add
(
self
.
centersizer
,
0
,
wx
.
ALIGN_CENTER
)
rightsizer
.
AddStretchSpacer
()
self
.
panel
.
SetSizerAndFit
(
self
.
notesizer
)
...
...
@@ -431,7 +433,7 @@ class MainWindow(wx.Frame):
i
.
Disable
()
#self.panel.Fit()
self
.
cbuttons_panel
=
page1panel
self
.
cbuttons_panel
=
page1panel
2
self
.
cbuttons_reload
()
def
createGui
(
self
):
...
...
pronterface.py
View file @
d46b470d
...
...
@@ -723,26 +723,15 @@ class PronterWindow(MainWindow, pronsole.pronsole):
pass
def
cbuttons_reload
(
self
):
allcbs
=
[]
ubs
=
self
.
uppersizer
allcbs
=
getattr
(
self
,
"custombuttonbuttons"
,
[])
cs
=
self
.
centersizer
#for item in ubs.GetChildren():
# if hasattr(item.GetWindow(),"custombutton"):
# allcbs += [(ubs, item.GetWindow())]
for
item
in
cs
.
GetChildren
():
if
hasattr
(
item
.
GetWindow
(),
"custombutton"
):
allcbs
+=
[(
cs
,
item
.
GetWindow
())]
for
sizer
,
button
in
allcbs
:
#sizer.Remove(button)
button
.
Destroy
()
for
button
in
allcbs
:
cs
.
Detach
(
button
)
self
.
custombuttonbuttons
=
[]
newbuttonbuttonindex
=
len
(
self
.
custombuttons
)
while
newbuttonbuttonindex
>
0
and
self
.
custombuttons
[
newbuttonbuttonindex
-
1
]
is
None
:
newbuttonbuttonindex
-=
1
while
len
(
self
.
custombuttons
)
<
13
:
self
.
custombuttons
.
append
(
None
)
for
i
in
xrange
(
len
(
self
.
custombuttons
)):
btndef
=
self
.
custombuttons
[
i
]
for
i
,
btndef
in
enumerate
(
self
.
custombuttons
):
try
:
b
=
wx
.
Button
(
self
.
cbuttons_panel
,
-
1
,
btndef
.
label
,
style
=
wx
.
BU_EXACTFIT
)
b
.
SetToolTip
(
wx
.
ToolTip
(
_
(
"Execute command: "
)
+
btndef
.
command
))
...
...
@@ -768,14 +757,8 @@ class PronterWindow(MainWindow, pronsole.pronsole):
if
btndef
is
not
None
:
b
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
procbutton
)
b
.
Bind
(
wx
.
EVT_MOUSE_EVENTS
,
self
.
editbutton
)
#else:
# b.Bind(wx.EVT_BUTTON, lambda e:e.Skip())
self
.
custombuttonbuttons
.
append
(
b
)
#if i<4:
# ubs.Add(b)
#else:
cs
.
Add
(
b
,
pos
=
((
i
)
/
4
,
(
i
)
%
4
))
self
.
mainsizer
.
Layout
()
cs
.
Add
(
b
,
pos
=
(
i
//
4
,
i
%
4
))
def
help_button
(
self
):
print
_
(
'Defines custom button. Usage: button <num> "title" [/c "colour"] command'
)
...
...
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