##// END OF EJS Templates
Show the input object of the igrid browser as the window tile....
walter.doerwald -
Show More
@@ -224,6 +224,7 b' class IGridGrid(wx.grid.Grid):'
224 224 self.EnableEditing(False)
225 225 self.Bind(wx.EVT_KEY_DOWN, self.key_pressed)
226 226 self.Bind(wx.grid.EVT_GRID_CELL_LEFT_DCLICK, self.cell_doubleclicked)
227 self.Bind(wx.grid.EVT_GRID_CELL_LEFT_CLICK, self.cell_leftclicked)
227 228 self.Bind(wx.grid.EVT_GRID_LABEL_LEFT_DCLICK, self.label_doubleclicked)
228 229 self.Bind(wx.grid.EVT_GRID_LABEL_LEFT_CLICK, self.on_label_leftclick)
229 230 self.Bind(wx.grid.EVT_GRID_RANGE_SELECT, self._on_selected_range)
@@ -265,7 +266,12 b' class IGridGrid(wx.grid.Grid):'
265 266 curitem = self.table.items[row] # Remember where the cursor is now
266 267 # Sort items
267 268 def realkey(item):
268 return key(item)
269 try:
270 return key(item)
271 except (KeyboardInterrupt, SystemExit):
272 raise
273 except Exception:
274 return None
269 275 try:
270 276 self.table.items = ipipe.deque(sorted(self.table.items, key=realkey, reverse=reverse))
271 277 except TypeError, exc:
@@ -283,7 +289,7 b' class IGridGrid(wx.grid.Grid):'
283 289 Sort in ascending order; sorting criteria is the current attribute
284 290 """
285 291 col = self.GetGridCursorCol()
286 attr = self.table._displayattrs[col]
292 attr = self.table._displvayattrs[col]
287 293 frame = self.GetParent().GetParent().GetParent()
288 294 if attr is ipipe.noitem:
289 295 self.error_output("no column under cursor")
@@ -450,6 +456,32 b' class IGridGrid(wx.grid.Grid):'
450 456 self.sortattrdesc()
451 457 else:
452 458 self.sortattrasc()
459 elif keycode == wx.WXK_DOWN:
460 row = self.GetGridCursorRow()
461 try:
462 item = self.table.items[row+1]
463 except IndexError:
464 item = self.table.items[row]
465 self.set_footer(item)
466 event.Skip()
467 elif keycode == wx.WXK_UP:
468 row = self.GetGridCursorRow()
469 if row >= 1:
470 item = self.table.items[row-1]
471 else:
472 item = self.table.items[row]
473 self.set_footer(item)
474 event.Skip()
475 elif keycode == wx.WXK_RIGHT:
476 row = self.GetGridCursorRow()
477 item = self.table.items[row]
478 self.set_footer(item)
479 event.Skip()
480 elif keycode == wx.WXK_LEFT:
481 row = self.GetGridCursorRow()
482 item = self.table.items[row]
483 self.set_footer(item)
484 event.Skip()
453 485 else:
454 486 event.Skip()
455 487
@@ -501,6 +533,10 b' class IGridGrid(wx.grid.Grid):'
501 533 else:
502 534 self._doenter(value)
503 535
536 def set_footer(self, item):
537 frame = self.GetParent().GetParent().GetParent()
538 frame.SetStatusText(" ".join([str(text) for (style, text) in ipipe.xformat(item, "footer", 20)[2]]))
539
504 540 def enter(self, row):
505 541 try:
506 542 value = self.table.items[row]
@@ -545,7 +581,14 b' class IGridGrid(wx.grid.Grid):'
545 581
546 582 def cell_doubleclicked(self, event):
547 583 self.enterattr(event.GetRow(), event.GetCol())
584 event.Skip()
548 585
586 def cell_leftclicked(self, event):
587 row = event.GetRow()
588 item = self.table.items[row]
589 self.set_footer(item)
590 event.Skip()
591
549 592 def pick(self, row):
550 593 """
551 594 pick a single row and return to the IPython prompt
@@ -622,7 +665,8 b' class IGridFrame(wx.Frame):'
622 665 maxtitlelen = 30
623 666
624 667 def __init__(self, parent, input):
625 wx.Frame.__init__(self, None, title="IGrid", size=(640, 480))
668 title = " ".join([str(x[1]) for x in ipipe.xformat(input, "header", 20)[2]])
669 wx.Frame.__init__(self, None, title=title, size=(640, 480))
626 670 self.menubar = wx.MenuBar()
627 671 self.menucounter = 100
628 672 self.m_help = wx.Menu()
@@ -2,6 +2,9 b''
2 2
3 3 * setup.py: Add the igrid help files to the list of data files
4 4 to be installed alongside igrid.
5 * IPython/Extensions/igrid.py: (Patch by Nik Tautenhahn)
6 Show the input object of the igrid browser as the window tile.
7 Show the object the cursor is on in the statusbar.
5 8
6 9 2007-03-15 Ville Vainio <vivainio@gmail.com>
7 10
General Comments 0
You need to be logged in to leave comments. Login now