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
a6b824ca
Commit
a6b824ca
authored
Mar 28, 2014
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename centersizer to cbuttonssizer
Better name will ease understanding the code :)
parent
daa62329
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
__init__.py
printrun/gui/__init__.py
+7
-7
pronterface.py
printrun/pronterface.py
+6
-6
No files found.
printrun/gui/__init__.py
View file @
a6b824ca
...
@@ -163,11 +163,11 @@ class MainWindow(wx.Frame):
...
@@ -163,11 +163,11 @@ class MainWindow(wx.Frame):
self
.
Bind
(
wx
.
EVT_CLOSE
,
self
.
kill
)
self
.
Bind
(
wx
.
EVT_CLOSE
,
self
.
kill
)
# Custom buttons
# Custom buttons
if
wx
.
VERSION
>
(
2
,
9
):
self
.
c
enter
sizer
=
wx
.
WrapSizer
(
wx
.
HORIZONTAL
)
if
wx
.
VERSION
>
(
2
,
9
):
self
.
c
buttons
sizer
=
wx
.
WrapSizer
(
wx
.
HORIZONTAL
)
else
:
self
.
c
enter
sizer
=
wx
.
GridBagSizer
()
else
:
self
.
c
buttons
sizer
=
wx
.
GridBagSizer
()
self
.
c
enter
sizer
=
wx
.
GridBagSizer
()
self
.
c
buttons
sizer
=
wx
.
GridBagSizer
()
self
.
centerpanel
=
self
.
newPanel
(
page1panel2
)
self
.
centerpanel
=
self
.
newPanel
(
page1panel2
)
self
.
centerpanel
.
SetSizer
(
self
.
c
enter
sizer
)
self
.
centerpanel
.
SetSizer
(
self
.
c
buttons
sizer
)
rightsizer
.
Add
(
self
.
centerpanel
,
0
,
wx
.
ALIGN_CENTER
)
rightsizer
.
Add
(
self
.
centerpanel
,
0
,
wx
.
ALIGN_CENTER
)
rightsizer
.
AddStretchSpacer
()
rightsizer
.
AddStretchSpacer
()
...
@@ -214,10 +214,10 @@ class MainWindow(wx.Frame):
...
@@ -214,10 +214,10 @@ class MainWindow(wx.Frame):
logpanel
=
self
.
newPanel
(
left_real_panel
)
logpanel
=
self
.
newPanel
(
left_real_panel
)
viz_pane
=
VizPane
(
self
,
vizpanel
)
viz_pane
=
VizPane
(
self
,
vizpanel
)
# Custom buttons
# Custom buttons
if
wx
.
VERSION
>
(
2
,
9
):
self
.
c
enter
sizer
=
wx
.
WrapSizer
(
wx
.
HORIZONTAL
)
if
wx
.
VERSION
>
(
2
,
9
):
self
.
c
buttons
sizer
=
wx
.
WrapSizer
(
wx
.
HORIZONTAL
)
else
:
self
.
c
enter
sizer
=
wx
.
GridBagSizer
()
else
:
self
.
c
buttons
sizer
=
wx
.
GridBagSizer
()
self
.
centerpanel
=
self
.
newPanel
(
vizpanel
)
self
.
centerpanel
=
self
.
newPanel
(
vizpanel
)
self
.
centerpanel
.
SetSizer
(
self
.
c
enter
sizer
)
self
.
centerpanel
.
SetSizer
(
self
.
c
buttons
sizer
)
viz_pane
.
Add
(
self
.
centerpanel
,
0
,
flag
=
wx
.
ALIGN_CENTER
)
viz_pane
.
Add
(
self
.
centerpanel
,
0
,
flag
=
wx
.
ALIGN_CENTER
)
vizpanel
.
SetSizer
(
viz_pane
)
vizpanel
.
SetSizer
(
viz_pane
)
if
compact
:
if
compact
:
...
...
printrun/pronterface.py
View file @
a6b824ca
...
@@ -1000,7 +1000,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
...
@@ -1000,7 +1000,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
def
cbuttons_reload
(
self
):
def
cbuttons_reload
(
self
):
allcbs
=
getattr
(
self
,
"custombuttons_widgets"
,
[])
allcbs
=
getattr
(
self
,
"custombuttons_widgets"
,
[])
for
button
in
allcbs
:
for
button
in
allcbs
:
self
.
c
enter
sizer
.
Detach
(
button
)
self
.
c
buttons
sizer
.
Detach
(
button
)
button
.
Destroy
()
button
.
Destroy
()
self
.
custombuttons_widgets
=
[]
self
.
custombuttons_widgets
=
[]
custombuttons
=
self
.
custombuttons
[:]
+
[
None
]
custombuttons
=
self
.
custombuttons
[:]
+
[
None
]
...
@@ -1028,10 +1028,10 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
...
@@ -1028,10 +1028,10 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
b
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
procbutton
)
b
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
procbutton
)
b
.
Bind
(
wx
.
EVT_MOUSE_EVENTS
,
self
.
editbutton
)
b
.
Bind
(
wx
.
EVT_MOUSE_EVENTS
,
self
.
editbutton
)
self
.
custombuttons_widgets
.
append
(
b
)
self
.
custombuttons_widgets
.
append
(
b
)
if
type
(
self
.
c
enter
sizer
)
==
wx
.
GridBagSizer
:
if
type
(
self
.
c
buttons
sizer
)
==
wx
.
GridBagSizer
:
self
.
c
enter
sizer
.
Add
(
b
,
pos
=
(
i
//
4
,
i
%
4
),
flag
=
wx
.
EXPAND
)
self
.
c
buttons
sizer
.
Add
(
b
,
pos
=
(
i
//
4
,
i
%
4
),
flag
=
wx
.
EXPAND
)
else
:
else
:
self
.
c
enter
sizer
.
Add
(
b
,
flag
=
wx
.
EXPAND
)
self
.
c
buttons
sizer
.
Add
(
b
,
flag
=
wx
.
EXPAND
)
self
.
centerpanel
.
Layout
()
self
.
centerpanel
.
Layout
()
self
.
centerpanel
.
GetContainingSizer
()
.
Layout
()
self
.
centerpanel
.
GetContainingSizer
()
.
Layout
()
...
@@ -1223,9 +1223,9 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
...
@@ -1223,9 +1223,9 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
#if dst is None and self.panel.GetScreenRect().Contains(scrpos):
#if dst is None and self.panel.GetScreenRect().Contains(scrpos):
# # try to check if it is after buttons at the end
# # try to check if it is after buttons at the end
# tspos = self.panel.ClientToScreen(self.toolbarsizer.GetPosition())
# tspos = self.panel.ClientToScreen(self.toolbarsizer.GetPosition())
# bspos = self.panel.ClientToScreen(self.c
enter
sizer.GetPosition())
# bspos = self.panel.ClientToScreen(self.c
buttons
sizer.GetPosition())
# tsrect = wx.Rect(*(tspos.Get()+self.toolbarsizer.GetSize().Get()))
# tsrect = wx.Rect(*(tspos.Get()+self.toolbarsizer.GetSize().Get()))
# bsrect = wx.Rect(*(bspos.Get()+self.c
enter
sizer.GetSize().Get()))
# bsrect = wx.Rect(*(bspos.Get()+self.c
buttons
sizer.GetSize().Get()))
# lbrect = btns[-1].GetScreenRect()
# lbrect = btns[-1].GetScreenRect()
# p = scrpos.Get()
# p = scrpos.Get()
# if len(btns)<4 and tsrect.Contains(scrpos):
# if len(btns)<4 and tsrect.Contains(scrpos):
...
...
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