aboutsummaryrefslogtreecommitdiffstats
path: root/misc/gui/wxbe
diff options
context:
space:
mode:
authorAaron Bentley <aaron.bentley@utoronto.ca>2005-05-18 22:33:53 +0000
committerAaron Bentley <aaron.bentley@utoronto.ca>2005-05-18 22:33:53 +0000
commit8a9a710c4044f3f27ca8d7f05482155a4bf254c3 (patch)
tree6455d7d6e224029d7bc0f084f9d5cbed420dbbe8 /misc/gui/wxbe
parent55e3933f494155ef9814b9135c93ffaa625e7bde (diff)
downloadbugseverywhere-8a9a710c4044f3f27ca8d7f05482155a4bf254c3.tar.gz
Added logo
Diffstat (limited to 'misc/gui/wxbe')
-rwxr-xr-xmisc/gui/wxbe49
1 files changed, 49 insertions, 0 deletions
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()