diff options
Diffstat (limited to 'misc')
-rwxr-xr-x | misc/gui/beg | 12 | ||||
-rw-r--r-- | misc/gui/table.py | 97 | ||||
-rwxr-xr-x | misc/gui/wxbe | 49 | ||||
-rw-r--r-- | misc/logo.svg | 83 |
4 files changed, 241 insertions, 0 deletions
diff --git a/misc/gui/beg b/misc/gui/beg new file mode 100755 index 0000000..55e537d --- /dev/null +++ b/misc/gui/beg @@ -0,0 +1,12 @@ +#!/usr/bin/env python +import table +from Tkinter import * +from libbe import bugdir + +tk = Tk() +Label(tk, text="Bug list").pack() +mlb = table.MultiListbox(tk, (('Severity', 4), ('Creator', 8), ('Summary', 40))) +for bug in [b for b in bugdir.tree_root(".").list() if b.active]: + mlb.insert(END, (bug.severity, bug.creator, bug.summary)) +mlb.pack(expand=YES,fill=BOTH) +tk.mainloop() diff --git a/misc/gui/table.py b/misc/gui/table.py new file mode 100644 index 0000000..2865f28 --- /dev/null +++ b/misc/gui/table.py @@ -0,0 +1,97 @@ +from Tkinter import * + +class MultiListbox(Frame): + def __init__(self, master, lists): + Frame.__init__(self, master) + self.lists = [] + for l,w in lists: + frame = Frame(self); frame.pack(side=LEFT, expand=YES, fill=BOTH) + Label(frame, text=l, borderwidth=1, relief=RAISED).pack(fill=X) + lb = Listbox(frame, width=w, borderwidth=0, selectborderwidth=0, + relief=FLAT, exportselection=FALSE) + lb.pack(expand=YES, fill=BOTH) + self.lists.append(lb) + lb.bind('<B1-Motion>', lambda e, s=self: s._select(e.y)) + lb.bind('<Button-1>', lambda e, s=self: s._select(e.y)) + lb.bind('<Leave>', lambda e: 'break') + lb.bind('<B2-Motion>', lambda e, s=self: s._b2motion(e.x, e.y)) + lb.bind('<Button-2>', lambda e, s=self: s._button2(e.x, e.y)) + frame = Frame(self); frame.pack(side=LEFT, fill=Y) + Label(frame, borderwidth=1, relief=RAISED).pack(fill=X) + sb = Scrollbar(frame, orient=VERTICAL, command=self._scroll) + sb.pack(expand=YES, fill=Y) + self.lists[0]['yscrollcommand']=sb.set + + def _select(self, y): + row = self.lists[0].nearest(y) + self.selection_clear(0, END) + self.selection_set(row) + return 'break' + + def _button2(self, x, y): + for l in self.lists: l.scan_mark(x, y) + return 'break' + + def _b2motion(self, x, y): + for l in self.lists: l.scan_dragto(x, y) + return 'break' + + def _scroll(self, *args): + for l in self.lists: + apply(l.yview, args) + + def curselection(self): + return self.lists[0].curselection() + + def delete(self, first, last=None): + for l in self.lists: + l.delete(first, last) + + def get(self, first, last=None): + result = [] + for l in self.lists: + result.append(l.get(first,last)) + if last: return apply(map, [None] + result) + return result + + def index(self, index): + self.lists[0].index(index) + + def insert(self, index, *elements): + for e in elements: + i = 0 + for l in self.lists: + l.insert(index, e[i]) + i = i + 1 + + def size(self): + return self.lists[0].size() + + def see(self, index): + for l in self.lists: + l.see(index) + + def selection_anchor(self, index): + for l in self.lists: + l.selection_anchor(index) + + def selection_clear(self, first, last=None): + for l in self.lists: + l.selection_clear(first, last) + + def selection_includes(self, index): + return self.lists[0].selection_includes(index) + + def selection_set(self, first, last=None): + for l in self.lists: + l.selection_set(first, last) + +if __name__ == '__main__': + tk = Tk() + Label(tk, text='MultiListbox').pack() + mlb = MultiListbox(tk, (('Subject', 40), ('Sender', 20), ('Date', 10))) + for i in range(1000): + mlb.insert(END, ('Important Message: %d' % i, 'John Doe', '10/10/%04d' % (1900+i))) + mlb.pack(expand=YES,fill=BOTH) + tk.mainloop() + diff --git a/misc/gui/wxbe b/misc/gui/wxbe new file mode 100755 index 0000000..40c584d --- /dev/null +++ b/misc/gui/wxbe @@ -0,0 +1,49 @@ +#!/usr/bin/env python +from wxPython.wx import * +from wxPython.lib.mixins.listctrl import wxListCtrlAutoWidthMixin +import sys, os.path +sys.path.append(os.path.realpath(os.path.join"..")) +from libbe import bugdir + +class MyApp(wxApp): + def OnInit(self): + frame = wxFrame(NULL, -1, "Bug display") + frame.Show(true) + self.SetTopWindow(frame) + panel = wxPanel(frame, -1, style=(wxVSCROLL | wxHSCROLL)) + panel.SetSize((500, 400)) + sizer = wxBoxSizer(wxVERTICAL) + sizer.Add(panel, wxGROW) + frame.SetSizer(sizer) + bugs = BugList(panel) + bugs.SetSize((400, -1)) +# bugs.SetDimensions(-1, -1, -1, -1) + sizer = wxBoxSizer(wxVERTICAL) + sizer.Add(bugs, wxGROW) + frame.SetSizer(sizer) + return true + +class BugList(wxListCtrl, wxListCtrlAutoWidthMixin): + def __init__(self, parent): + wxListCtrl.__init__(self, parent, -1, + style = wxLC_REPORT|wxLC_VRULES|wxLC_HRULES) + wxListCtrlAutoWidthMixin.__init__(self) + columns = ("Severity", "Creator", "Summary") + for x in range(len(columns)): + self.InsertColumn(x, columns[x]) + self.SetColumnWidth(x, wxLIST_AUTOSIZE_USEHEADER) + for bug in [b for b in bugdir.tree_root(".").list() if b.active]: + id = self.InsertStringItem(self.GetItemCount(), bug.severity) + self.SetStringItem(id, 1, bug.creator) + self.SetStringItem(id, 2, bug.summary) + self.EnsureVisible(id) + for x in range(len(columns)): + self.SetColumnWidth(x, wxLIST_AUTOSIZE) + conts_width = self.GetColumnWidth(x) + self.SetColumnWidth(x, wxLIST_AUTOSIZE_USEHEADER) + if conts_width > self.GetColumnWidth(x): + self.SetColumnWidth(x, conts_width) + + +app = MyApp(0) +app.MainLoop() diff --git a/misc/logo.svg b/misc/logo.svg new file mode 100644 index 0000000..43964b1 --- /dev/null +++ b/misc/logo.svg @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns:xml="http://www.w3.org/XML/1998/namespace" + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://web.resource.org/cc/" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + sodipodi:docname="logo.svg" + sodipodi:docbase="/home/abentley/arch/be" + inkscape:version="0.41" + sodipodi:version="0.32" + id="svg2" + height="297mm" + width="210mm"> + <defs + id="defs3" /> + <sodipodi:namedview + inkscape:window-y="63" + inkscape:window-x="22" + inkscape:window-height="759" + inkscape:window-width="910" + inkscape:current-layer="layer1" + inkscape:document-units="px" + inkscape:cy="836.68762" + inkscape:cx="408.57141" + inkscape:zoom="0.67765957" + inkscape:pageshadow="2" + inkscape:pageopacity="0.0" + borderopacity="1.0" + bordercolor="#666666" + pagecolor="#ffffff" + id="base" /> + <metadata + id="metadata4"> + <rdf:RDF + id="RDF5"> + <cc:Work + id="Work6" + rdf:about=""> + <dc:format + id="format7">image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" + id="type9" /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + id="layer1" + inkscape:groupmode="layer" + inkscape:label="Layer 1"> + <g + id="g2065"> + <text + sodipodi:linespacing="100%" + id="text1291" + y="143.78516" + x="36.981991" + style="font-size:78.161568;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;fill:#000000;fill-opacity:1.0000000;stroke:none;stroke-width:1.0000000pt;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1.0000000;font-family:Attic;text-anchor:start;writing-mode:lr;line-height:100%" + xml:space="preserve"><tspan + y="143.78516" + x="36.981991" + id="tspan1293" + sodipodi:role="line">Bugs Everwhere</tspan></text> + <path + id="path1299" + d="M 435.39129,169.91317 C 435.39129,178.31858 440.70441,153.65014 445.24931,146.30250 C 450.43734,137.91513 453.18058,163.90397 453.46434,166.96184 C 453.55532,167.94222 453.46434,168.92939 453.46434,169.91317" + style="fill:none;fill-opacity:0.75000000;fill-rule:evenodd;stroke:#000000;stroke-width:4.2500000;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1.0000000;stroke-dasharray:none;stroke-miterlimit:4.0000000" /> + <path + id="path1303" + d="M 440.06423,89.055564 C 440.06423,95.774126 450.18051,79.127074 454.66879,73.752225 C 458.94498,68.631300 461.04359,61.697359 464.40532,56.262692 C 469.05687,48.742525 470.05816,49.640806 479.00985,46.424830" + style="stroke-dasharray:none;stroke-opacity:1.0000000;stroke-miterlimit:4.0000000;stroke-linejoin:round;stroke-linecap:round;stroke-width:4.2500000;stroke:#000000;fill-rule:evenodd;fill-opacity:0.75000000;fill:none" /> + <path + id="path1305" + d="M 457.10286,68.286745 C 463.68121,65.923450 451.21494,56.705449 448.58360,50.797213" + style="stroke-dasharray:none;stroke-opacity:1.0000000;stroke-miterlimit:4.0000000;stroke-linejoin:round;stroke-linecap:round;stroke-width:4.2500000;stroke:#000000;fill-rule:evenodd;fill-opacity:0.75000000;fill:none" /> + </g> + </g> +</svg> |