X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=blobdiff_plain;f=wx%2Fgui%2Foptions%2Fviewer.py;h=b0e69aca48496cb84538918d5823dc75b385c0a1;hp=18c70af803f9e260f7dbd364d1c8218dedd7813b;hb=f2cd87efc4d91982c932ecb13c19d48980209e7a;hpb=d51c9b672a2a23d9e9c7bc4c2d366ca8d66bda0e;ds=sidebyside diff --git a/wx/gui/options/viewer.py b/wx/gui/options/viewer.py index 18c70af..b0e69ac 100644 --- a/wx/gui/options/viewer.py +++ b/wx/gui/options/viewer.py @@ -25,37 +25,59 @@ import os import wx import operator -import imp -from wx.lib.wordwrap import wordwrap +#import imp +from lib.wordwrap import wordwrap from gui.boldstatictext import BoldStaticText import viewers import gui.fields +import viewers.raw +import viewers.simple +import viewers.rfx +import viewers.flexpaper +import viewers.technoargia + class Viewers: def __init__(self): - self.viewers = [] - self.modules = [] - self.list_viewers() - self.import_viewers() - - def list_viewers(self): - for file in os.listdir('viewers'): - if (file.startswith('.') or file.startswith('_') - or file.endswith(".pyc") or not file.endswith('.py')): - continue - self.viewers.append(os.path.splitext(file)[0]) - - def import_viewers(self): - for file in self.viewers: - _temp = imp.load_source("viewers.%s" % file, os.path.join(os.getcwdu(), "viewers/%s.py" % file)) - self.modules.append(_temp) + self.viewers = [ + 'raw', + 'simple', + 'rfx', + 'flexpaper', + 'technoargia', + ] + self.modules = [ + viewers.raw, + viewers.simple, + viewers.rfx, + viewers.flexpaper, + viewers.technoargia, + ] + + #self.list_viewers() + #self.import_viewers() + + #def list_viewers(self): + # for file in os.listdir('viewers'): + # if (file.startswith('.') or file.startswith('_') + # or file.endswith(".pyc") or not file.endswith('.py')): + # continue + # self.viewers.append(os.path.splitext(file)[0]) + + #def import_viewers(self): + # for file in self.viewers: + # try: + # _temp = imp.load_source("viewers.%s" % file, os.path.join(os.getcwdu(), "viewers/%s.py" % file)) + # self.modules.append(_temp) + # except: + # print "Could not load %s" % file class ViewerBook(wx.Listbook): def __init__(self, parent): wx.Listbook.__init__(self, parent, wx.ID_ANY, style= - wx.BK_DEFAULT + wx.LB_DEFAULT ) self.__mod = [] @@ -77,10 +99,6 @@ class ViewerBook(wx.Listbook): win = self.makePanel(mod) self.AddPage(win, mod, imageId=idx) - # A hack to avoid having the scrollbar be on bottom - # the first time the control is created - self.ListView.Select(self.ListView.GetItemCount()-1) - self.ListView.Select(0) def makePanel(self, mod): p = wx.Panel(self)