aboutsummaryrefslogtreecommitdiffstats
path: root/interfaces/gui/beg/table.py
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2009-12-31 15:54:12 -0500
committerW. Trevor King <wking@drexel.edu>2009-12-31 15:54:12 -0500
commitb0b5341c4045dd27cfbb3e2585cb2614ed9ad903 (patch)
tree37c7c2d011617ccd7a6f28a24ea77bb1b3cddfe7 /interfaces/gui/beg/table.py
parenta06030436d3940dddfba37b344f90651366d67e1 (diff)
parent2d1562d951e763fed71fe60e77cc9921be9abdc9 (diff)
downloadbugseverywhere-b0b5341c4045dd27cfbb3e2585cb2614ed9ad903.tar.gz
Merged be.restructure, major internal reorganization.
Added a bunch of classes to make the commands, user interfaces, and storage backends more abstract and distinct. This should make it much easier to extend and maintain BE. Features: * Directory restructured: becommands/ -> libbe/commands submods sorted by functionality. * Lots of new classes: Option, Argument, Command InputOutput, StorageCallbacks, UserInterface Storage * Consolidated ID handling in libbe.util.id * Transitioned VCS backends for Python-based VCSs from subprocess calss to internal python calls. Plus the user-visible changes: * New bugdir/bug/comment ID format replaces old bug:comment format. * Deprecated support for `be diff` on Arch and Darcs <= 2.3.1. A new backend abstraction (Storage) makes the former implementation ungainly. * Improved command completion. * Removed commands close, open, email_bugs, * Flipped some arguments `be assign BUG-ID [ASSIGNEE]` -> `be status ASSIGNED BUG-ID ...` `be severity BUG-ID SEVERITY` -> `be severity SEVERITY BUG-ID ...` `be status BUG-ID STATUS` -> `be status STATUS BUG-ID ...` In the merge: * Added 'commit' to list of pagerless commands. * Updated doc/README.dev See #bea86499-824e-4e77-b085-2d581fa9ccab/1100c966-9671-4bc6-8b68-6d408a910da1# for a discussion of why the changes were made and some of the difficulties en-route.
Diffstat (limited to 'interfaces/gui/beg/table.py')
-rw-r--r--interfaces/gui/beg/table.py97
1 files changed, 0 insertions, 97 deletions
diff --git a/interfaces/gui/beg/table.py b/interfaces/gui/beg/table.py
deleted file mode 100644
index 2865f28..0000000
--- a/interfaces/gui/beg/table.py
+++ /dev/null
@@ -1,97 +0,0 @@
-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()
-