[GRASS-SVN] r43743 -
grass/branches/releasebranch_6_4/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Sep 30 04:53:46 EDT 2010
Author: mmetz
Date: 2010-09-30 08:53:46 +0000 (Thu, 30 Sep 2010)
New Revision: 43743
Modified:
grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gcpmanager.py
Log:
solved TODO: use arrow images for column sorting (backport from trunk r43172, r43740)
Modified: grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gcpmanager.py
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gcpmanager.py 2010-09-30 08:52:26 UTC (rev 43742)
+++ grass/branches/releasebranch_6_4/gui/wxpython/gui_modules/gcpmanager.py 2010-09-30 08:53:46 UTC (rev 43743)
@@ -62,6 +62,8 @@
gmpath = os.path.join(globalvar.ETCWXDIR, "icons")
sys.path.append(gmpath)
+imgpath = os.path.join(globalvar.ETCWXDIR, "images")
+
#
# global variables
#
@@ -73,31 +75,22 @@
tgt_map = ''
maptype = 'cell'
-def getSmallUpArrowData():
- return \
-'\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x10\x00\x00\x00\x10\x08\x06\
-\x00\x00\x00\x1f\xf3\xffa\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\
-\x00\x00<IDAT8\x8dcddbf\xa0\x040Q\xa4{h\x18\xf0\xff\xdf\xdf\xffd\x1b\x00\xd3\
-\x8c\xcf\x10\x9c\x06\xa0k\xc2e\x08m\xc2\x00\x97m\xd8\xc41\x0c \x14h\xe8\xf2\
-\x8c\xa3)q\x10\x18\x00\x00R\xd8#\xec\xb2\xcd\xc1Y\x00\x00\x00\x00IEND\xaeB`\
-\x82'
-
def getSmallUpArrowImage():
- stream = cStringIO.StringIO(getSmallUpArrowData())
- return wx.ImageFromStream(stream)
+ stream = open(os.path.join(imgpath, 'small_up_arrow.png'), 'rb')
+ try:
+ img = wx.ImageFromStream(stream)
+ finally:
+ stream.close()
+ return img
-def getSmallDnArrowData():
- return \
-"\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x10\x00\x00\x00\x10\x08\x06\
-\x00\x00\x00\x1f\xf3\xffa\x00\x00\x00\x04sBIT\x08\x08\x08\x08|\x08d\x88\x00\
-\x00\x00HIDAT8\x8dcddbf\xa0\x040Q\xa4{\xd4\x00\x06\x06\x06\x06\x06\x16t\x81\
-\xff\xff\xfe\xfe'\xa4\x89\x91\x89\x99\x11\xa7\x0b\x90%\ti\xc6j\x00>C\xb0\x89\
-\xd3.\x10\xd1m\xc3\xe5*\xbc.\x80i\xc2\x17.\x8c\xa3y\x81\x01\x00\xa1\x0e\x04e\
-?\x84B\xef\x00\x00\x00\x00IEND\xaeB`\x82"
-
def getSmallDnArrowImage():
- stream = cStringIO.StringIO(getSmallDnArrowData())
- return wx.ImageFromStream(stream)
+ stream = open(os.path.join(imgpath, 'small_down_arrow.png'), 'rb')
+ try:
+ img = wx.ImageFromStream(stream)
+ finally:
+ stream.close()
+ stream.close()
+ return img
class GCPWizard(object):
"""
@@ -948,16 +941,8 @@
# CheckListCtrlMixin must set an ImageList first
self.il = self.list.GetImageList(wx.IMAGE_LIST_SMALL)
- use_art_provider = False
- if use_art_provider:
- i_size = wx.Size(12, 12)
- SmallUpArrow = wx.ArtProvider.GetBitmap(id=wx.ART_GO_UP,
- client=wx.ART_FRAME_ICON, size=i_size)
- SmallDnArrow = wx.ArtProvider.GetBitmap(id=wx.ART_GO_DOWN,
- client=wx.ART_FRAME_ICON, size=i_size)
- else:
- SmallUpArrow = wx.BitmapFromImage(getSmallUpArrowImage())
- SmallDnArrow = wx.BitmapFromImage(getSmallDnArrowImage())
+ SmallUpArrow = wx.BitmapFromImage(getSmallUpArrowImage())
+ SmallDnArrow = wx.BitmapFromImage(getSmallDnArrowImage())
self.sm_dn = self.il.Add(SmallDnArrow)
self.sm_up = self.il.Add(SmallUpArrow)
More information about the grass-commit
mailing list