Changeset 30759
- Timestamp:
- Mar 27, 2008, 7:30:56 AM (16 years ago)
- File:
-
- 1 edited
-
grass/trunk/gui/wxpython/gis_set.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
grass/trunk/gui/wxpython/gis_set.py
r30746 r30759 144 144 self.mpanel = wx.Panel(parent=self.panel, id=wx.ID_ANY) 145 145 self.lbmapsets = GListBox(parent=self.mpanel, 146 id=wx.ID_ANY, size=(1 50, 200),146 id=wx.ID_ANY, size=(180, 200), 147 147 choices=self.listOfMapsets) 148 148 … … 546 546 547 547 # disable mapset with denied permission 548 locationName = os.path.basename(location) 549 if self._getRCValue("LOCATION_NAME") == "<UNKNOWN>": 550 gcmd.Command(["g.gisenv", 551 "set=GISDBASE=%s" % self.gisdbase]) 552 gcmd.Command(["g.gisenv", 553 "set=LOCATION_NAME=%s" % locationName]) 554 gcmd.Command(["g.gisenv", 555 "set=MAPSET=PERMANENT"]) 556 548 557 for line in gcmd.Command(['g.mapset', 549 558 '-l', 550 'location=%s' % os.path.basename(location),559 'location=%s' % locationName, 551 560 'gisdbase=%s' % self.gisdbase]).ReadStdOutput(): 552 561 self.listOfMapsetsSelectable += line.split(' ') … … 566 575 """Location selected""" 567 576 if event: 568 self.lblocations.SetSelection(event.GetIndex()) 577 try: 578 self.lblocations.SetSelection(event.GetIndex()) 579 except AttributeError: 580 self.lblocations.SetSelection(0) 569 581 570 582 if self.lblocations.GetSelection() > -1: … … 717 729 self.Layout() 718 730 719 class GListBox(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin): 731 # class GListBox(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin): 732 class GListBox(wx.ListCtrl): 720 733 """Use wx.ListCtrl instead of wx.ListBox, different style for 721 734 non-selectable items (e.g. mapsets with denied permission)""" … … 724 737 725 738 wx.ListCtrl.__init__(self, parent, id, size=size, 726 style=wx.LC_REPORT | wx.LC_NO_HEADER | wx.LC_SINGLE_SEL) 727 728 listmix.ListCtrlAutoWidthMixin.__init__(self) 739 style=wx.LC_REPORT | wx.LC_NO_HEADER | wx.LC_SINGLE_SEL | 740 wx.BORDER_RAISED) 741 742 self.width = size[0] - 20 # FIXME (width of vertical scrollbar) 743 744 # listmix.ListCtrlAutoWidthMixin.__init__(self) 729 745 730 746 self.InsertColumn(0, '') … … 748 764 self.SetItemTextColour(idx, wx.Colour(150, 150, 150)) 749 765 idx += 1 766 767 for col in range(self.GetColumnCount()): 768 self.SetColumnWidth(col, self.width) 750 769 751 770 def Clear(self):
Note:
See TracChangeset
for help on using the changeset viewer.
