printrun-src/printrun/gui/log.py

Fri, 03 Jun 2016 21:14:09 +0200

author
mbayer
date
Fri, 03 Jun 2016 21:14:09 +0200
changeset 19
234037fbca4b
parent 15
0bbb006204fc
child 46
cce0af6351f0
permissions
-rw-r--r--

Bugfixing, Added M400 magic

15
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
1 # This file is part of the Printrun suite.
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
2 #
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
3 # Printrun is free software: you can redistribute it and/or modify
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
4 # it under the terms of the GNU General Public License as published by
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
5 # the Free Software Foundation, either version 3 of the License, or
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
6 # (at your option) any later version.
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
7 #
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
8 # Printrun is distributed in the hope that it will be useful,
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
11 # GNU General Public License for more details.
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
12 #
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
13 # You should have received a copy of the GNU General Public License
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
14 # along with Printrun. If not, see <http://www.gnu.org/licenses/>.
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
15
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
16 import wx
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
17
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
18 from .utils import make_button
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
19
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
20 class LogPane(wx.BoxSizer):
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
21
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
22 def __init__(self, root, parentpanel = None):
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
23 super(LogPane, self).__init__(wx.VERTICAL)
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
24 if not parentpanel: parentpanel = root.panel
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
25 root.logbox = wx.TextCtrl(parentpanel, style = wx.TE_MULTILINE, size = (350, -1))
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
26 root.logbox.SetMinSize((100, -1))
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
27 root.logbox.SetEditable(0)
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
28 self.Add(root.logbox, 1, wx.EXPAND)
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
29 bottom_panel = root.newPanel(parentpanel)
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
30 lbrs = wx.BoxSizer(wx.HORIZONTAL)
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
31 root.commandbox = wx.TextCtrl(bottom_panel, style = wx.TE_PROCESS_ENTER)
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
32 root.commandbox.SetToolTip(wx.ToolTip(_("Send commands to printer\n(Type 'help' for simple\nhelp function)")))
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
33 root.commandbox.Bind(wx.EVT_TEXT_ENTER, root.sendline)
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
34 root.commandbox.Bind(wx.EVT_CHAR, root.cbkey)
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
35 root.commandbox.history = [u""]
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
36 root.commandbox.histindex = 1
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
37 lbrs.Add(root.commandbox, 1)
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
38 root.sendbtn = make_button(bottom_panel, _("Send"), root.sendline, _("Send Command to Printer"), style = wx.BU_EXACTFIT, container = lbrs)
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
39 bottom_panel.SetSizer(lbrs)
0bbb006204fc Added printrun sourcecode from
mbayer
parents:
diff changeset
40 self.Add(bottom_panel, 0, wx.EXPAND)

mercurial