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
3930fe4b
Commit
3930fe4b
authored
12 years ago
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix custom buttons placement under wx2.9
parent
06954dd2
master
printrun-20150310
printrun-20140801
printrun-20140730
printrun-20140406
printrun-20140328
printrun-20140126
printrun-20131019
printrun-20130711
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
13 deletions
+18
-13
gui.py
printrun/gui.py
+14
-9
pronterface.py
pronterface.py
+4
-4
No files found.
printrun/gui.py
View file @
3930fe4b
...
...
@@ -293,8 +293,6 @@ class VizPane(wx.BoxSizer):
root
.
gwindow
.
Bind
(
wx
.
EVT_CLOSE
,
lambda
x
:
root
.
gwindow
.
Hide
())
if
not
isinstance
(
root
.
gviz
,
NoViz
):
self
.
Add
(
root
.
gviz
.
widget
,
1
,
flag
=
wx
.
SHAPED
|
wx
.
ALIGN_CENTER_HORIZONTAL
)
root
.
centersizer
=
wx
.
GridBagSizer
()
self
.
Add
(
root
.
centersizer
,
0
,
flag
=
wx
.
ALIGN_CENTER
)
class
LogPane
(
wx
.
BoxSizer
):
...
...
@@ -420,8 +418,11 @@ class MainWindow(wx.Frame):
self
.
panel
.
Bind
(
wx
.
EVT_MOUSE_EVENTS
,
self
.
editbutton
)
self
.
Bind
(
wx
.
EVT_CLOSE
,
self
.
kill
)
vizpane
.
Detach
(
self
.
centersizer
)
rightsizer
.
Add
(
self
.
centersizer
,
0
,
wx
.
ALIGN_CENTER
)
# Custom buttons
self
.
centersizer
=
wx
.
GridBagSizer
()
self
.
centerpanel
=
self
.
newPanel
(
page1panel2
)
self
.
centerpanel
.
SetSizer
(
self
.
centersizer
)
rightsizer
.
Add
(
self
.
centerpanel
,
0
,
wx
.
ALIGN_CENTER
)
rightsizer
.
AddStretchSpacer
()
self
.
panel
.
SetSizerAndFit
(
self
.
notesizer
)
...
...
@@ -432,8 +433,6 @@ class MainWindow(wx.Frame):
for
i
in
self
.
printerControls
:
i
.
Disable
()
#self.panel.Fit()
self
.
cbuttons_panel
=
page1panel2
self
.
cbuttons_reload
()
def
createGui
(
self
,
compact
=
False
):
...
...
@@ -449,7 +448,15 @@ class MainWindow(wx.Frame):
left_sizer
=
wx
.
BoxSizer
(
wx
.
VERTICAL
)
left_sizer
.
Add
(
left_pane
,
0
)
self
.
lowersizer
.
Add
(
left_sizer
,
0
,
wx
.
EXPAND
)
self
.
lowersizer
.
Add
(
VizPane
(
self
,
lowerpanel
),
1
,
wx
.
EXPAND
|
wx
.
ALIGN_CENTER
)
vizpanel
=
self
.
newPanel
(
lowerpanel
)
viz_pane
=
VizPane
(
self
,
vizpanel
)
# Custom buttons
self
.
centersizer
=
wx
.
GridBagSizer
()
self
.
centerpanel
=
self
.
newPanel
(
vizpanel
)
self
.
centerpanel
.
SetSizer
(
self
.
centersizer
)
viz_pane
.
Add
(
self
.
centerpanel
,
0
,
flag
=
wx
.
ALIGN_CENTER
)
vizpanel
.
SetSizer
(
viz_pane
)
self
.
lowersizer
.
Add
(
vizpanel
,
1
,
wx
.
EXPAND
|
wx
.
ALIGN_CENTER
)
logpanel
=
self
.
newPanel
(
lowerpanel
)
log_pane
=
LogPane
(
self
,
logpanel
)
logpanel
.
SetSizer
(
log_pane
)
...
...
@@ -480,6 +487,4 @@ class MainWindow(wx.Frame):
for
i
in
self
.
printerControls
:
i
.
Disable
()
#self.panel.Fit()
self
.
cbuttons_panel
=
lowerpanel
self
.
cbuttons_reload
()
This diff is collapsed.
Click to expand it.
pronterface.py
View file @
3930fe4b
...
...
@@ -736,7 +736,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
custombuttons
=
self
.
custombuttons
[:]
+
[
None
]
for
i
,
btndef
in
enumerate
(
custombuttons
):
try
:
b
=
wx
.
Button
(
self
.
c
buttons_
panel
,
-
1
,
btndef
.
label
,
style
=
wx
.
BU_EXACTFIT
)
b
=
wx
.
Button
(
self
.
c
enter
panel
,
-
1
,
btndef
.
label
,
style
=
wx
.
BU_EXACTFIT
)
b
.
SetToolTip
(
wx
.
ToolTip
(
_
(
"Execute command: "
)
+
btndef
.
command
))
if
btndef
.
background
:
b
.
SetBackgroundColour
(
btndef
.
background
)
...
...
@@ -745,13 +745,13 @@ class PronterWindow(MainWindow, pronsole.pronsole):
b
.
SetForegroundColour
(
"#ffffff"
)
except
:
if
i
==
len
(
custombuttons
)
-
1
:
self
.
newbuttonbutton
=
b
=
wx
.
Button
(
self
.
c
buttons_
panel
,
-
1
,
"+"
,
size
=
(
19
,
18
),
style
=
wx
.
BU_EXACTFIT
)
self
.
newbuttonbutton
=
b
=
wx
.
Button
(
self
.
c
enter
panel
,
-
1
,
"+"
,
size
=
(
19
,
18
),
style
=
wx
.
BU_EXACTFIT
)
#b.SetFont(wx.Font(12, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_BOLD))
b
.
SetForegroundColour
(
"#4444ff"
)
b
.
SetToolTip
(
wx
.
ToolTip
(
_
(
"click to add new custom button"
)))
b
.
Bind
(
wx
.
EVT_BUTTON
,
self
.
cbutton_edit
)
else
:
b
=
wx
.
Button
(
self
.
c
buttons_
panel
,
-
1
,
"."
,
size
=
(
1
,
1
))
b
=
wx
.
Button
(
self
.
c
enter
panel
,
-
1
,
"."
,
size
=
(
1
,
1
))
#b = wx.StaticText(self.panel,-1, "", size = (72, 22), style = wx.ALIGN_CENTRE+wx.ST_NO_AUTORESIZE) #+wx.SIMPLE_BORDER
b
.
Disable
()
#continue
...
...
@@ -762,7 +762,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
b
.
Bind
(
wx
.
EVT_MOUSE_EVENTS
,
self
.
editbutton
)
self
.
custombuttonbuttons
.
append
(
b
)
self
.
centersizer
.
Add
(
b
,
pos
=
(
i
//
4
,
i
%
4
))
self
.
centersizer
.
Layout
()
self
.
panel
.
GetSizer
()
.
Layout
()
def
help_button
(
self
):
print
_
(
'Defines custom button. Usage: button <num> "title" [/c "colour"] command'
)
...
...
This diff is collapsed.
Click to expand it.
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