def OnInit(self): if not globalvar.CheckWxVersion([2, 9]): wx.InitAllImageHandlers() if __name__ == "__main__": self.cmdTimeStamp = os.path.getmtime(monFile['cmd']) self.Map = Map(cmdfile=monFile['cmd'], mapfile=monFile['map'], envfile=monFile['env'], monitor=monName) else: self.Map = None self.mapFrm = MapFrame(parent=None, id=wx.ID_ANY, Map=self.Map, size=monSize) # self.SetTopWindow(Map) self.mapFrm.Show() if __name__ == "__main__": self.timer = wx.PyTimer(self.watcher) #check each 0.5s global mtime mtime = 500 self.timer.Start(mtime) return True
def OnInit(self): """ Initialize all available image handlers :return: True """ if not globalvar.CheckWxVersion([2, 9]): wx.InitAllImageHandlers() # create splash screen introImagePath = os.path.join(globalvar.IMGDIR, "splash_screen.png") introImage = wx.Image(introImagePath, wx.BITMAP_TYPE_PNG) introBmp = introImage.ConvertToBitmap() if SC and sys.platform != 'darwin': # AdvancedSplash is buggy on the Mac as of 2.8.12.1 # and raises annoying (though seemingly harmless) errors everytime # the GUI is started splash = SC.AdvancedSplash(bitmap=introBmp, timeout=2000, parent=None, id=wx.ID_ANY) splash.SetText(_('Starting GRASS GUI...')) splash.SetTextColour(wx.Colour(45, 52, 27)) splash.SetTextFont( wx.Font(pointSize=15, family=wx.DEFAULT, style=wx.NORMAL, weight=wx.BOLD)) splash.SetTextPosition((150, 430)) else: if globalvar.wxPythonPhoenix: import wx.adv as wxadv wxadv.SplashScreen(bitmap=introBmp, splashStyle=wxadv.SPLASH_CENTRE_ON_SCREEN | wxadv.SPLASH_TIMEOUT, milliseconds=2000, parent=None, id=wx.ID_ANY) else: wx.SplashScreen(bitmap=introBmp, splashStyle=wx.SPLASH_CENTRE_ON_SCREEN | wx.SPLASH_TIMEOUT, milliseconds=2000, parent=None, id=wx.ID_ANY) wx.Yield() # create and show main frame from lmgr.frame import GMFrame mainframe = GMFrame(parent=None, id=wx.ID_ANY, workspace=self.workspaceFile) mainframe.Show() self.SetTopWindow(mainframe) return True
def OnInit(self): if not globalvar.CheckWxVersion([2, 9]): wx.InitAllImageHandlers() StartUp = GRASSStartup() StartUp.CenterOnScreen() self.SetTopWindow(StartUp) StartUp.Show() StartUp.SuggestDatabase() return 1
def OnInit(self): if not globalvar.CheckWxVersion([2, 9]): wx.InitAllImageHandlers() grass.set_raise_on_error(True) # actual use of StandaloneGrassInterface not yet tested # needed for adding functionality in future self._giface = DMonGrassInterface(None) return True
def __init__(self, parent, command, text, skipDescription, **kwargs): """If command is given, the corresponding HTML help file will be presented, with all links pointing to absolute paths of local files. If 'skipDescription' is True, the HTML corresponding to SYNOPSIS will be skipped, thus only presenting the help file from the DESCRIPTION section onwards. If 'text' is given, it must be the HTML text to be presented in the Panel. """ self.parent = parent if not globalvar.CheckWxVersion([2, 9]): wx.InitAllImageHandlers() HtmlWindow.__init__(self, parent=parent, **kwargs) self.loaded = False self.history = list() self.historyIdx = 0 self.fspath = os.path.join(os.getenv("GISBASE"), "docs", "html") self.SetStandardFonts(size=10) self.SetBorders(10) if text is None: if skipDescription: url = os.path.join(self.fspath, command + ".html") self.fillContentsFromFile(url, skipDescription=skipDescription) self.history.append(url) self.loaded = True else: # FIXME: calling LoadPage() is strangely time-consuming (only first call) # self.LoadPage(self.fspath + command + ".html") self.loaded = False else: self.SetPage(text) self.loaded = True
def OnInit(self): if not globalvar.CheckWxVersion([2, 9]): wx.InitAllImageHandlers() # actual use of StandaloneGrassInterface not yet tested # needed for adding functionality in future giface = DMonGrassInterface(None) if __name__ == "__main__": self.cmdTimeStamp = os.path.getmtime(monFile['cmd']) self.Map = DMonMap(giface=giface, cmdfile=monFile['cmd'], mapfile=monFile['map']) else: self.Map = None self.mapFrm = DMonFrame(parent=None, id=wx.ID_ANY, Map=self.Map, giface=giface, size=monSize) # FIXME: hack to solve dependency giface._mapframe = self.mapFrm # self.SetTopWindow(Map) self.mapFrm.GetMapWindow().SetAlwaysRenderEnabled(True) self.Map.saveToFile.connect(lambda cmd: self.mapFrm.DOutFile(cmd)) self.Map.dToRast.connect(lambda cmd: self.mapFrm.DToRast(cmd)) self.Map.query.connect( lambda ltype, maps: self.mapFrm.SetQueryLayersAndActivate( ltype=ltype, maps=maps)) self.mapFrm.Show() if __name__ == "__main__": self.timer = wx.PyTimer(self.watcher) #check each 0.5s global mtime mtime = 500 self.timer.Start(mtime) return True
def OnInit(self): if not globalvar.CheckWxVersion([2, 9]): wx.InitAllImageHandlers() StartUp = GRASSStartup() StartUp.CenterOnScreen() self.SetTopWindow(StartUp) StartUp.Show() if StartUp.GetRCValue("LOCATION_NAME") == "<UNKNOWN>": # TODO: This is not ideal, either it should be checked elsewhere # where other checks are performed or it should use some public # API. There is no reason for not exposing it. # TODO: another question is what should be warning, hint or message StartUp._showWarning( _('GRASS needs a directory (GRASS database) ' 'in which to store its data. ' 'Create one now if you have not already done so. ' 'A popular choice is "grassdata", located in ' 'your home directory. ' 'Press Browse button to select the directory.')) return 1
def OnInit(self): if not globalvar.CheckWxVersion([2, 9]): wx.InitAllImageHandlers() StartUp = GRASSStartup() StartUp.CenterOnScreen() self.SetTopWindow(StartUp) StartUp.Show() if StartUp.GetRCValue("LOCATION_NAME") == "<UNKNOWN>": wx.MessageBox( parent=StartUp, caption=_('Starting GRASS for the first time'), message=_( 'GRASS needs a directory in which to store its data. ' 'Create one now if you have not already done so. ' 'A popular choice is "grassdata", located in ' 'your home directory.'), style=wx.OK | wx.ICON_ERROR | wx.CENTRE) StartUp.OnBrowse(None) return 1