Beremiz.py
changeset 120 8c3150858dd3
parent 119 f3819d2e8eff
child 121 ccb1812f8323
equal deleted inserted replaced
119:f3819d2e8eff 120:8c3150858dd3
    58     
    58     
    59     bmp = wx.Image(os.path.join(CWD,"images","splash.png")).ConvertToBitmap()
    59     bmp = wx.Image(os.path.join(CWD,"images","splash.png")).ConvertToBitmap()
    60     splash=wx.SplashScreen(bmp,wx.SPLASH_CENTRE_ON_SCREEN, 1000, None)
    60     splash=wx.SplashScreen(bmp,wx.SPLASH_CENTRE_ON_SCREEN, 1000, None)
    61     wx.Yield()
    61     wx.Yield()
    62 
    62 
    63 import wx.lib.buttons, wx.lib.statbmp 
    63 import wx.lib.buttons, wx.lib.statbmp , wx.html
    64 import types, time, re, platform, time, traceback, commands
    64 import types, time, re, platform, time, traceback, commands
    65 
    65 
    66 from plugger import PluginsRoot
    66 from plugger import PluginsRoot
       
    67 base_folder = os.path.split(sys.path[0])[0]
       
    68 CanFestivalPath = os.path.join(base_folder, "CanFestival-3")
       
    69 sys.path.append(os.path.join(CanFestivalPath, "objdictgen"))
       
    70 from objdictedit import *
       
    71 from doc_index.DS301_index import *
    67 
    72 
    68 SCROLLBAR_UNIT = 10
    73 SCROLLBAR_UNIT = 10
    69 WINDOW_COLOUR = wx.Colour(240,240,240)
    74 WINDOW_COLOUR = wx.Colour(240,240,240)
    70 TITLE_COLOUR = wx.Colour(200,200,220)
    75 TITLE_COLOUR = wx.Colour(200,200,220)
    71 CHANGED_TITLE_COLOUR = wx.Colour(220,200,220)
    76 CHANGED_TITLE_COLOUR = wx.Colour(220,200,220)
   197 
   202 
   198 [ID_BEREMIZHELPMENUITEMS0, ID_BEREMIZHELPMENUITEMS1, 
   203 [ID_BEREMIZHELPMENUITEMS0, ID_BEREMIZHELPMENUITEMS1, 
   199 ] = [wx.NewId() for _init_coll_HelpMenu_Items in range(2)]
   204 ] = [wx.NewId() for _init_coll_HelpMenu_Items in range(2)]
   200 
   205 
   201 class Beremiz(wx.Frame):
   206 class Beremiz(wx.Frame):
   202     
   207 	
   203     def _init_coll_FileMenu_Items(self, parent):
   208     def _init_coll_FileMenu_Items(self, parent):
   204         parent.Append(help='', id=ID_BEREMIZFILEMENUITEMS0,
   209         parent.Append(help='', id=ID_BEREMIZFILEMENUITEMS0,
   205               kind=wx.ITEM_NORMAL, text=u'New\tCTRL+N')
   210               kind=wx.ITEM_NORMAL, text=u'New\tCTRL+N')
   206         parent.Append(help='', id=ID_BEREMIZFILEMENUITEMS1,
   211         parent.Append(help='', id=ID_BEREMIZFILEMENUITEMS1,
   207               kind=wx.ITEM_NORMAL, text=u'Open\tCTRL+O')
   212               kind=wx.ITEM_NORMAL, text=u'Open\tCTRL+O')
  1177     
  1182     
  1178     def OnSaveLogMenu(self, event):
  1183     def OnSaveLogMenu(self, event):
  1179         event.Skip()
  1184         event.Skip()
  1180     
  1185     
  1181     def OnBeremizMenu(self, event):
  1186     def OnBeremizMenu(self, event):
       
  1187         if wx.Platform == '__WXMSW__':
       
  1188             readerpath = get_acroversion()
       
  1189             readerexepath = os.path.join(readerpath,"AcroRd32.exe")
       
  1190             if(os.path.isfile(readerexepath)):
       
  1191                 os.spawnl(os.P_DETACH, readerexepath, "AcroRd32.exe", '"%s"'%os.path.join(CWD,"doc","manual_beremiz.pdf"))
       
  1192         else:
       
  1193             os.system("xpdf -remote BEREMIZ %s %d &"%(os.path.join(CWD,"doc","manual_beremiz.pdf",16)))
  1182         event.Skip()
  1194         event.Skip()
  1183     
  1195     
  1184     def OnAboutMenu(self, event):
  1196     def OnAboutMenu(self, event):
       
  1197         about_html = objdictedit(self)
       
  1198         about_html.OpenHtmlFrame("About Beremiz", os.path.join(CWD,"doc","about.html"),wx.Size(500,600))
  1185         event.Skip()
  1199         event.Skip()
  1186     
  1200     
  1187     def OnAddButton(self, event):
  1201     def OnAddButton(self, event):
  1188         PluginType = self.PluginChilds.GetStringSelection()
  1202         PluginType = self.PluginChilds.GetStringSelection()
  1189         if PluginType != "":
  1203         if PluginType != "":