/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/UI/tableview.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/UI/tableview.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 966 by jonathan, Wed May 21 17:24:40 2003 UTC revision 979 by frank, Thu May 22 11:40:59 2003 UTC
# Line 25  wx_value_type_map = {FIELDTYPE_INT: wxGR Line 25  wx_value_type_map = {FIELDTYPE_INT: wxGR
25    
26  ROW_SELECTED = "ROW_SELECTED"  ROW_SELECTED = "ROW_SELECTED"
27    
28    QUERY_KEY = 'S'
29    
30  class DataTable(wxPyGridTableBase):  class DataTable(wxPyGridTableBase):
31    
# Line 278  class LayerTableFrame(TableFrame): Line 279  class LayerTableFrame(TableFrame):
279                                          _("Add to Selection")])                                          _("Add to Selection")])
280    
281          button_query = wxButton(self, ID_QUERY, _("Query"))          button_query = wxButton(self, ID_QUERY, _("Query"))
282          button_saveas = wxButton(self, ID_SAVEAS, _("Save As..."))          button_saveas = wxButton(self, ID_SAVEAS, _("Export"))
283    
284          self.grid.SetSize((400, 200))          self.grid.SetSize((400, 200))
285    
# Line 300  class LayerTableFrame(TableFrame): Line 301  class LayerTableFrame(TableFrame):
301          sizer.Add(self.choice_comp, 0, wxALL, 4)          sizer.Add(self.choice_comp, 0, wxALL, 4)
302          sizer.Add(self.combo_value, 1, wxEXPAND|wxALL, 4)          sizer.Add(self.combo_value, 1, wxEXPAND|wxALL, 4)
303          sizer.Add(self.choice_action, 0, wxALL, 4)          sizer.Add(self.choice_action, 0, wxALL, 4)
304          sizer.Add(button_query, 0, wxALL, 4)          sizer.Add(button_query, 0, wxALL | wxALIGN_CENTER_VERTICAL, 4)
305          sizer.Add(40, 20, 0, wxALL, 4)          sizer.Add(40, 20, 0, wxALL, 4)
306          sizer.Add(button_saveas, 0, wxALL, 4)          sizer.Add(button_saveas, 0, wxALL | wxALIGN_CENTER_VERTICAL, 4)
307    
308          topBox.Add(sizer, 0, wxEXPAND|wxALL, 4)          topBox.Add(sizer, 0, wxEXPAND|wxALL, 4)
309          topBox.Add(self.grid, 1, wxEXPAND|wxALL, 0)          topBox.Add(self.grid, 1, wxEXPAND|wxALL, 0)
# Line 312  class LayerTableFrame(TableFrame): Line 313  class LayerTableFrame(TableFrame):
313          topBox.Fit(self)          topBox.Fit(self)
314          topBox.SetSizeHints(self)          topBox.SetSizeHints(self)
315    
316            self.grid.SetFocus()
317          EVT_BUTTON(self, ID_QUERY, self.OnQuery)          EVT_BUTTON(self, ID_QUERY, self.OnQuery)
318          EVT_BUTTON(self, ID_SAVEAS, self.OnSaveAs)          EVT_BUTTON(self, ID_SAVEAS, self.OnSaveAs)
319            EVT_KEY_DOWN(self.grid, self.OnKeyDown)
320    
321        def OnKeyDown(self, event):
322            """Catch query key from grid"""
323            print "In OnKeyDown"
324            if event.AltDown() and event.GetKeyCode() == ord(QUERY_KEY):
325                print "Got the Key!"
326                self.combo_fields.SetFocus()
327                self.combo_fields.refocus = True
328            else:
329                event.Skip()
330    
331    
332      def OnQuery(self, event):      def OnQuery(self, event):
333          wxBeginBusyCursor()          wxBeginBusyCursor()

Legend:
Removed from v.966  
changed lines
  Added in v.979

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26