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
93eb6a44
Commit
93eb6a44
authored
Aug 28, 2013
by
Guillaume Seguin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make all toolbar buttons autosized for i18n concerns
parent
ffef877d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
gui.py
printrun/gui.py
+8
-5
No files found.
printrun/gui.py
View file @
93eb6a44
...
...
@@ -30,6 +30,9 @@ from printrun.zbuttons import ZButtons
from
printrun.graph
import
Graph
from
printrun.pronterface_widgets
import
TempGauge
from
printrun.printrun_utils
import
install_locale
install_locale
(
'pronterface'
)
def
make_button
(
parent
,
label
,
callback
,
tooltip
,
container
=
None
,
size
=
wx
.
DefaultSize
,
style
=
0
):
button
=
wx
.
Button
(
parent
,
-
1
,
label
,
style
=
style
,
size
=
size
)
button
.
Bind
(
wx
.
EVT_BUTTON
,
callback
)
...
...
@@ -388,7 +391,7 @@ def MainToolbar(root, parentpanel = None, use_wrapsizer = False):
glob
.
Add
(
root
.
locker
,
0
)
ToolbarSizer
=
wx
.
WrapSizer
if
use_wrapsizer
and
wx
.
VERSION
>
(
2
,
9
)
else
wx
.
BoxSizer
self
=
ToolbarSizer
(
wx
.
HORIZONTAL
)
root
.
rescanbtn
=
make_
sized
_button
(
parentpanel
,
_
(
"Port"
),
root
.
rescanports
,
_
(
"Communication Settings
\n
Click to rescan ports"
))
root
.
rescanbtn
=
make_
autosize
_button
(
parentpanel
,
_
(
"Port"
),
root
.
rescanports
,
_
(
"Communication Settings
\n
Click to rescan ports"
))
self
.
Add
(
root
.
rescanbtn
,
0
,
wx
.
TOP
|
wx
.
LEFT
,
0
)
root
.
serialport
=
wx
.
ComboBox
(
parentpanel
,
-
1
,
choices
=
root
.
scanserial
(),
...
...
@@ -409,16 +412,16 @@ def MainToolbar(root, parentpanel = None, use_wrapsizer = False):
except
:
pass
self
.
Add
(
root
.
baud
)
root
.
connectbtn
=
make_
sized
_button
(
parentpanel
,
_
(
"Connect"
),
root
.
connect
,
_
(
"Connect to the printer"
),
self
)
root
.
connectbtn
=
make_
autosize
_button
(
parentpanel
,
_
(
"Connect"
),
root
.
connect
,
_
(
"Connect to the printer"
),
self
)
root
.
resetbtn
=
make_autosize_button
(
parentpanel
,
_
(
"Reset"
),
root
.
reset
,
_
(
"Reset the printer"
),
self
)
root
.
loadbtn
=
make_autosize_button
(
parentpanel
,
_
(
"Load file"
),
root
.
loadfile
,
_
(
"Load a 3D model file"
),
self
)
root
.
sdbtn
=
make_autosize_button
(
parentpanel
,
_
(
"SD"
),
root
.
sdmenu
,
_
(
"SD Card Printing"
),
self
)
root
.
printerControls
.
append
(
root
.
sdbtn
)
root
.
printbtn
=
make_
sized
_button
(
parentpanel
,
_
(
"Print"
),
root
.
printfile
,
_
(
"Start Printing Loaded File"
),
self
)
root
.
printbtn
=
make_
autosize
_button
(
parentpanel
,
_
(
"Print"
),
root
.
printfile
,
_
(
"Start Printing Loaded File"
),
self
)
root
.
printbtn
.
Disable
()
root
.
pausebtn
=
make_
sized
_button
(
parentpanel
,
_
(
"Pause"
),
root
.
pause
,
_
(
"Pause Current Print"
),
self
)
root
.
offbtn
=
make_
sized
_button
(
parentpanel
,
_
(
"Off"
),
root
.
off
,
_
(
"Turn printer off"
),
self
)
root
.
pausebtn
=
make_
autosize
_button
(
parentpanel
,
_
(
"Pause"
),
root
.
pause
,
_
(
"Pause Current Print"
),
self
)
root
.
offbtn
=
make_
autosize
_button
(
parentpanel
,
_
(
"Off"
),
root
.
off
,
_
(
"Turn printer off"
),
self
)
root
.
printerControls
.
append
(
root
.
offbtn
)
if
root
.
settings
.
lockbox
:
parentpanel
.
SetSizer
(
self
)
...
...
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