Changeset 30764
- Timestamp:
- Mar 27, 2008, 9:33:54 AM (16 years ago)
- File:
-
- 1 edited
-
grass/trunk/gui/wxpython/gis_set.py (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
grass/trunk/gui/wxpython/gis_set.py
r30759 r30764 132 132 # textinputs 133 133 self.tgisdbase = wx.TextCtrl(parent=self.panel, id=wx.ID_ANY, value="", size=(300, -1), 134 style=wx.TE_ LEFT)134 style=wx.TE_PROCESS_ENTER) 135 135 136 136 # Locations … … 161 161 self.lblocations.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnSelectLocation) 162 162 self.lbmapsets.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnSelectMapset) 163 self. Bind(wx.EVT_KEY_DOWN, self.OnKeyPressedInDbase, self.tgisdbase)163 self.tgisdbase.Bind(wx.EVT_TEXT_ENTER, self.OnSetDatabase) 164 164 self.Bind(wx.EVT_CLOSE, self.OnCloseWindow) 165 165 … … 527 527 self.lblocations.InsertItems(self.listOfLocations, 0) 528 528 529 if len(self.listOfLocations) > 0: 530 self.lblocations.SetSelection(0) 531 else: 532 self.lblocations.SetSelection(wx.NOT_FOUND) 533 529 534 return self.listOfLocations 530 535 … … 575 580 """Location selected""" 576 581 if event: 577 try: 578 self.lblocations.SetSelection(event.GetIndex()) 579 except AttributeError: 580 self.lblocations.SetSelection(0) 582 self.lblocations.SetSelection(event.GetIndex()) 581 583 582 if self.lblocations.GetSelection() > -1:584 if self.lblocations.GetSelection() != wx.NOT_FOUND: 583 585 self.UpdateMapsets(os.path.join(self.gisdbase, 584 586 self.listOfLocations[self.lblocations.GetSelection()])) … … 595 597 self.lbmapsets.Clear() 596 598 self.lbmapsets.InsertItems(self.listOfMapsets, 0, disabled=disabled) 597 598 self.lbmapsets.SetSelection(0) 599 600 if len(self.listOfMapsets) > 0: 601 self.lbmapsets.SetSelection(0) 602 else: 603 self.lbmapsets.SetSelection(wx.NOT_FOUND) 599 604 600 605 def OnSelectMapset(self, event): … … 618 623 if self.listOfLocations != []: 619 624 self.lblocations.SetSelection(0) 620 621 self.OnSelectLocation(event) 625 else: 626 self.lblocations.SetSelection(wx.NOT_FOUND) 627 628 self.OnSelectLocation(None) 622 629 623 630 def OnBrowse(self, event): … … 633 640 634 641 self.OnSetDatabase(event) 635 636 def OnKeyPressedInDbase(self,event):637 """GIS data directory changed"""638 if wx.WXK_RETURN == event.KeyCode:639 self.OnSetDatabase(event)640 else:641 event.Skip()642 642 643 643 def OnCreateMapset(self,event):
Note:
See TracChangeset
for help on using the changeset viewer.
