Beispiel #1
0
 def OnInit(self):
     wx.InitAllImageHandlers()
     frame_terminal = TerminalFrame(None, -1, "")
     self.SetTopWindow(frame_terminal)
     frame_terminal.Show(True)
     return 1
Beispiel #2
0
 def __init__(self, object):
     self.object = object
     wx.InitAllImageHandlers()
     wx.App.__init__(self, 1, 'debug.log')
     self.MainLoop()
     object.print_traits()
Beispiel #3
0
 def OnInit(self):
     wx.InitAllImageHandlers()
     SkeinforgeQuickEditDialog(None, -1, "")
     return 1
Beispiel #4
0
 def OnInit(self):
     wx.InitAllImageHandlers()
     mainframe = myFrame(None, wx.ID_ANY, "")
     self.SetTopWindow(mainframe)
     mainframe.Show()
     return 1
Beispiel #5
0
#
#
#

from string import *
from os import access, listdir
import sys, os
import wx
#from wxPython.wx import *
#from wxPython.stc import *
from wxPython.lib.buttons import *
from wxPython.lib.colourselect import *

import wx.richtext as rt

wx.InitAllImageHandlers(
)  #I insert the handlers to support all types of image in our case gif
files = {}  #list with all configuration files

files['default_dir'] = os.path.abspath(os.path.dirname(sys.argv[0])) + "/"
files['default_dir'] = replace(files['default_dir'], "\\", "/")
files['default_dir'] = replace(files['default_dir'], "library.zip", "")
variables = files[
    'default_dir'] + "variables"  ##path to the file of the global variables

execfile(variables)  #gets all the pre-assigned variables


############# function to handle fatal errors ##################
def error(number, lol):
    file = open(files['default_dir'] + "/errors", "r")
    stringa = file.readlines()
Beispiel #6
0
 def OnInit(self):
     wx.InitAllImageHandlers()
     frame_Visualizador = Visualizador(None, -1, "")
     self.SetTopWindow(frame_Visualizador)
     frame_Visualizador.Show()
     return 1
Beispiel #7
0
def main():
    """Sets the GRASS display driver
    """
    driver = UserSettings.Get(group='display', key='driver', subkey='type')
    if driver == 'png':
        os.environ['GRASS_RENDER_IMMEDIATE'] = 'png'
    else:
        os.environ['GRASS_RENDER_IMMEDIATE'] = 'cairo'

    # TODO: message format should not be GUI
    # TODO: should messages here be translatable?
    # (for test its great, for translator not)

    options, flags = grass.parser()
    test = options['test']

    app = wx.App()
    if not CheckWxVersion([2, 9]):
        wx.InitAllImageHandlers()

    map_ = Map()

    if options['raster']:
        names = options['raster']
        for name in names.split(','):
            cmdlist = ['d.rast', 'map=%s' % name]
            map_.AddLayer(ltype='raster',
                          command=cmdlist,
                          active=True,
                          name=name,
                          hidden=False,
                          opacity=1.0,
                          render=True)
    if options['vector']:
        names = options['vector']
        for name in names.split(','):
            cmdlist = ['d.vect', 'map=%s' % name]
            map_.AddLayer(ltype='vector',
                          command=cmdlist,
                          active=True,
                          name=name,
                          hidden=False,
                          opacity=1.0,
                          render=True)

    giface = MapdispGrassInterface(map_=map_)
    tester = Tester()

    if test == 'mapwindow':
        tester.testMapWindow(giface, map_)
    elif test == 'mapdisplay':
        tester.testMapDisplay(giface, map_)
    elif test == 'apitest':
        tester.testMapWindowApi(giface, map_)
    elif test == 'distance':
        tester.testMapWindowDistance(giface, map_)
    elif test == 'profile':
        tester.testMapWindowProfile(giface, map_)
    elif test == 'rlisetup':
        tester.testMapWindowRlisetup(map_)
    else:
        # TODO: this should not happen but happens
        import grass.script as sgrass
        sgrass.fatal(_("Unknown value %s of test parameter." % test))

    app.MainLoop()
Beispiel #8
0
 def OnInit(self):
     wx.InitAllImageHandlers()
     same_name = SameName(None, wx.ID_ANY, "")
     self.SetTopWindow(same_name)
     same_name.Show()
     return 1
Beispiel #9
0
 def OnInit(self):
     """Create the font for use later"""
     wx.InitAllImageHandlers()
     self.font = wxfont.wxBitmapFont(FontStyle(size=1.5), )
Beispiel #10
0
 def OnInit(self):
     wx.InitAllImageHandlers()
     self.main_frame = maptiler.MainFrame(None, -1, "")
     self.SetTopWindow(self.main_frame)
     self.SetAppName("MapTiler")
     return True
Beispiel #11
0
 def OnInit(self):
     wx.InitAllImageHandlers()
     return True
Beispiel #12
0
 def OnInit(self):
     wx.InitAllImageHandlers()
     main_frame = MainFrame(None, -1, "")
     self.SetTopWindow(main_frame)
     main_frame.Show()
     return 1
Beispiel #13
0
 def OnInit(self):
     wx.InitAllImageHandlers()
     frame1 = oadb(None, -1, "")
     self.SetTopWindow(frame1)
     frame1.Show()
     return 1
Beispiel #14
0
def main():
    gscript.set_raise_on_error(False)
    options, flags = gscript.parser()

    import wx

    from grass.script.setup import set_gui_path
    set_gui_path()

    from core.settings import UserSettings
    from core.globalvar import CheckWxVersion
    from core.giface import StandaloneGrassInterface
    from core.utils import _
    from iclass.frame import IClassMapFrame

    group_name = subgroup_name = map_name = trainingmap_name = None

    if options['group']:
        if not options['subgroup']:
            gscript.fatal(_("Name of subgroup required"))
        group_name = gscript.find_file(name=options['group'],
                                       element='group')['name']
        if not group_name:
            gscript.fatal(_("Group <%s> not found") % options['group'])
        subgroups = gscript.read_command('i.group',
                                         group=group_name,
                                         flags='sg').splitlines()
        if options['subgroup'] not in subgroups:
            gscript.fatal(_("Subgroup <%s> not found") % options['subgroup'])
        subgroup_name = options['subgroup']

    if options['map']:
        map_name = gscript.find_file(name=options['map'],
                                     element='cell')['fullname']
        if not map_name:
            gscript.fatal(_("Raster map <%s> not found") % options['map'])

    if options['trainingmap']:
        trainingmap_name = gscript.find_file(name=options['trainingmap'],
                                             element='vector')['fullname']
        if not trainingmap_name:
            gscript.fatal(
                _("Vector map <%s> not found") % options['trainingmap'])

    # define display driver
    driver = UserSettings.Get(group='display', key='driver', subkey='type')
    if driver == 'png':
        os.environ['GRASS_RENDER_IMMEDIATE'] = 'png'
    else:
        os.environ['GRASS_RENDER_IMMEDIATE'] = 'cairo'

    # launch application
    app = wx.App()
    if not CheckWxVersion([2, 9]):
        wx.InitAllImageHandlers()

    # show main frame
    giface = StandaloneGrassInterface()
    frame = IClassMapFrame(parent=None, giface=giface)
    if not flags['m']:
        frame.CenterOnScreen()
    if group_name:
        frame.SetGroup(group_name, subgroup_name)
    if map_name:
        giface.WriteLog(_("Loading raster map <%s>...") % map_name)
        frame.trainingMapManager.AddLayer(map_name)
    if trainingmap_name:
        giface.WriteLog(_("Loading training map <%s>...") % trainingmap_name)
        frame.ImportAreas(trainingmap_name)

    frame.Show()
    if flags['m']:
        frame.Maximize()
    app.MainLoop()
Beispiel #15
0
 def OnInit(self):
     wx.InitAllImageHandlers()
     frame = DemoFrame(None)
     frame.Show(True)
     self.SetTopWindow(frame)
     return True
Beispiel #16
0
 def OnInit(self):
     wx.InitAllImageHandlers()
     self.frame = py.editor.EditorFrame(filename=self.filename)
     self.frame.Show()
     self.SetTopWindow(self.frame)
     return True
Beispiel #17
0
 def OnInit(self):
     wx.InitAllImageHandlers()
     Env.Azienda.DB.testdb()
     db = adb.DB()
     db.Connect()
     return True
Beispiel #18
0
 def __init__(self):
     wx.InitAllImageHandlers()
     wx.App.__init__(self, 1, 'debug.log')
     self.MainLoop()
Beispiel #19
0
 def OnInit(self):
     wx.InitAllImageHandlers()
     frame = MyParentFrame()
     frame.Show(True)
     self.SetTopWindow(frame)
     return True
Beispiel #20
0
 def OnInit(self):
     wx.InitAllImageHandlers()
     frameMain = PyAUIFrame(None, -1, "")
     self.SetTopWindow(frameMain)
     frameMain.Show()
     return 1
Beispiel #21
0
    def __init__( self, parent, log ):
        wx.Panel.__init__(self, parent, wx.ID_ANY)
        self.log = log

        self.panel = panel = wx.Panel(self, wx.ID_ANY)
        topsizer = wx.BoxSizer(wx.VERTICAL)

        # Difference between using PropertyGridManager vs PropertyGrid is that
        # the manager supports multiple pages and a description box.
        self.pg = pg = wxpg.PropertyGridManager(panel,
                        style=wxpg.PG_SPLITTER_AUTO_CENTER |
                              wxpg.PG_AUTO_SORT |
                              wxpg.PG_TOOLBAR)

        # Show help as tooltips
        pg.SetExtraStyle(wxpg.PG_EX_HELP_AS_TOOLTIPS)

        pg.Bind( wxpg.EVT_PG_CHANGED, self.OnPropGridChange )
        pg.Bind( wxpg.EVT_PG_PAGE_CHANGED, self.OnPropGridPageChange )
        pg.Bind( wxpg.EVT_PG_SELECTED, self.OnPropGridSelect )
        pg.Bind( wxpg.EVT_PG_RIGHT_CLICK, self.OnPropGridRightClick )

        # Needed by custom image editor
        wx.InitAllImageHandlers()

        #
        # Let's use some simple custom editor
        #
        # NOTE: Editor must be registered *before* adding a property that
        # uses it.
        if not TestPanel.AreEditorsRegistered:
            pg.RegisterEditor(TrivialPropertyEditor)
            pg.RegisterEditor(SampleMultiButtonEditor)
            pg.RegisterEditor(LargeImageEditor)
            TestPanel.AreEditorsRegistered = True

        #
        # Add properties
        #

        pg.AddPage( "Page 1 - Testing All" )

        pg.Append( wxpg.PropertyCategory("1 - Basic Properties") )
        pg.Append( wxpg.StringProperty("String",value="Some Text") )
        pg.Append( wxpg.IntProperty("Int",value=100) )
        pg.Append( wxpg.FloatProperty("Float",value=100.0) )
        pg.Append( wxpg.BoolProperty("Bool",value=True) )
        pg.Append( wxpg.BoolProperty("Bool_with_Checkbox",value=True) )
        pg.SetPropertyAttribute("Bool_with_Checkbox", "UseCheckbox", True)

        pg.Append( wxpg.PropertyCategory("2 - More Properties") )
        pg.Append( wxpg.LongStringProperty("LongString",
            value="This is a\\nmulti-line string\\nwith\\ttabs\\nmixed\\tin."))
        pg.Append( wxpg.DirProperty("Dir",value="C:\\Windows") )
        pg.Append( wxpg.FileProperty("File",value="C:\\Windows\\system.ini") )
        pg.Append( wxpg.ArrayStringProperty("ArrayString",value=['A','B','C']) )

        pg.Append( wxpg.EnumProperty("Enum","Enum",
                                     ['wxPython Rules',
                                      'wxPython Rocks',
                                      'wxPython Is The Best'],
                                     [10,11,12],
                                     0) )
        pg.Append( wxpg.EditEnumProperty("EditEnum","EditEnumProperty",
                                         ['A','B','C'],
                                         [0,1,2],
                                         "Text Not in List") )

        pg.Append( wxpg.PropertyCategory("3 - Advanced Properties") )
        pg.Append( wxpg.DateProperty("Date",value=wx.DateTime_Now()) )
        pg.Append( wxpg.FontProperty("Font",value=panel.GetFont()) )
        pg.Append( wxpg.ColourProperty("Colour",
                                       value=panel.GetBackgroundColour()) )
        pg.Append( wxpg.SystemColourProperty("SystemColour") )
        pg.Append( wxpg.ImageFileProperty("ImageFile") )
        pg.Append( wxpg.MultiChoiceProperty("MultiChoice",
                    choices=['wxWidgets','QT','GTK+']) )

        pg.Append( wxpg.PropertyCategory("4 - Additional Properties") )
        #pg.Append( wxpg.PointProperty("Point",value=panel.GetPosition()) )
        #pg.Append( SizeProperty("Size",value=panel.GetSize()) )
        #pg.Append( wxpg.FontDataProperty("FontData") )
        pg.Append( wxpg.IntProperty("IntWithSpin",value=256) )
        pg.SetPropertyEditor("IntWithSpin","SpinCtrl")

        pg.SetPropertyAttribute( "File", wxpg.PG_FILE_SHOW_FULL_PATH, 0 )
        pg.SetPropertyAttribute( "File", wxpg.PG_FILE_INITIAL_PATH,
                                 "C:\\Program Files\\Internet Explorer" )
        pg.SetPropertyAttribute( "Date", wxpg.PG_DATE_PICKER_STYLE,
                                 wx.DP_DROPDOWN|wx.DP_SHOWCENTURY )

        pg.Append( wxpg.PropertyCategory("5 - Custom Properties and Editors") )
        pg.Append( IntProperty2("IntProperty2", value=1024) )

        pg.Append( PyObjectProperty("PyObjectProperty") )

        pg.Append( DirsProperty("Dirs1",value=['C:/Lib','C:/Bin']) )
        pg.Append( DirsProperty("Dirs2",value=['/lib','/bin']) )

        # Test another type of delimiter
        pg.SetPropertyAttribute("Dirs2", "Delimiter", '"')

        # SampleMultiButtonEditor
        pg.Append( wxpg.LongStringProperty("MultipleButtons") );
        pg.SetPropertyEditor("MultipleButtons", "SampleMultiButtonEditor");
        pg.Append( SingleChoiceProperty("SingleChoiceProperty") )

        # Custom editor samples
        prop = pg.Append( wxpg.StringProperty("StringWithCustomEditor",
                                              value="test value") )
        pg.SetPropertyEditor(prop, "TrivialPropertyEditor")

        pg.Append( wxpg.ImageFileProperty("ImageFileWithLargeEditor") )
        pg.SetPropertyEditor("ImageFileWithLargeEditor", "LargeImageEditor")

        # When page is added, it will become the target page for AutoFill
        # calls (and for other property insertion methods as well)
        pg.AddPage( "Page 2 - Results of AutoFill will appear here" )

        topsizer.Add(pg, 1, wx.EXPAND)

        rowsizer = wx.BoxSizer(wx.HORIZONTAL)
        but = wx.Button(panel,-1,"SetPropertyValues")
        but.Bind( wx.EVT_BUTTON, self.OnSetPropertyValues )
        rowsizer.Add(but,1)
        but = wx.Button(panel,-1,"GetPropertyValues")
        but.Bind( wx.EVT_BUTTON, self.OnGetPropertyValues )
        rowsizer.Add(but,1)
        topsizer.Add(rowsizer,0,wx.EXPAND)
        rowsizer = wx.BoxSizer(wx.HORIZONTAL)
        but = wx.Button(panel,-1,"GetPropertyValues(as_strings=True)")
        but.Bind( wx.EVT_BUTTON, self.OnGetPropertyValues2 )
        rowsizer.Add(but,1)
        but = wx.Button(panel,-1,"AutoFill")
        but.Bind( wx.EVT_BUTTON, self.OnAutoFill )
        rowsizer.Add(but,1)
        topsizer.Add(rowsizer,0,wx.EXPAND)
        rowsizer = wx.BoxSizer(wx.HORIZONTAL)
        but = wx.Button(panel,-1,"Delete")
        but.Bind( wx.EVT_BUTTON, self.OnDeleteProperty )
        rowsizer.Add(but,1)
        but = wx.Button(panel,-1,"Run Tests")
        but.Bind( wx.EVT_BUTTON, self.RunTests )
        rowsizer.Add(but,1)
        topsizer.Add(rowsizer,0,wx.EXPAND)

        panel.SetSizer(topsizer)
        topsizer.SetSizeHints(panel)

        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(panel, 1, wx.EXPAND)
        self.SetSizer(sizer)
        self.SetAutoLayout(True)
Beispiel #22
0
 def OnInit(self):
     wx.InitAllImageHandlers()
     dlg = PreferencesDlg()
     dlg.show_modal()
     return 1
Beispiel #23
0
 def OnInit(self):
     wx.InitAllImageHandlers()
     frame_1 = MyFrame(None, -1, "")
     self.SetTopWindow(frame_1)
     frame_1.Show()
     return 1
Beispiel #24
0
def main():
    """
    Sets the GRASS display driver
    """
    options, flags = gscript.parser()

    import wx

    from grass.script.setup import set_gui_path
    set_gui_path()

    from core.settings import UserSettings
    from core.globalvar import CheckWxVersion
    from core.giface import StandaloneGrassInterface
    from image2target.ii2t_manager import GCPWizard

    driver = UserSettings.Get(group='display', key='driver', subkey='type')
    if driver == 'png':
        os.environ['GRASS_RENDER_IMMEDIATE'] = 'png'
    else:
        os.environ['GRASS_RENDER_IMMEDIATE'] = 'cairo'

#    if options['source_location']:
#        src_loc = options['source_location']
#    else:
#        gscript.fatal(_("No georeferenced source location provided"))

#    if options['source_mapset']:
#        src_mpt = options['source_mapset']
#    else:
#        gscript.fatal(_("No georeferenced source mapset provided"))

#    if options['source_group']:
#        src_grp = options['source_group']
#    else:
#        gscript.fatal(_("Please provide a source group name to process"))

#    if options['source_image']:
#        src_ras = options['source_image']
#    else:
#        gscript.fatal(_("Please provide a source image map name to process"))

#    if options['target_image']:
#        tgt_ras = options['target_image']
#    else:
#        gscript.fatal(_("No georeferenced target map provided"))

#    if options['camera']:
#        camera = options['camera']
#    else:
#        gscript.fatal(_("Please provide a camera name (generated by i.ortho.camera)"))

#    if options['order']:
#        order = options['order']
#    else:
#        gscript.fatal(_("Please provive an order value"))

#    if options['extension']:
#        extension = options['extension']
#    else:
#        gscript.fatal(_("Please provide an output file extension"))

    app = wx.App()
    if not CheckWxVersion([2, 9]):
        wx.InitAllImageHandlers()


#    wizard = GCPWizard(parent=None, giface=StandaloneGrassInterface(),
#            srcloc=src_loc,srcmpt=src_mpt,srcgrp=src_grp,srcras=src_ras,
#            tgtras=tgt_ras,camera=camera, order=order, extension=extension)

    wizard = GCPWizard(parent=None, giface=StandaloneGrassInterface())
    app.MainLoop()
Beispiel #25
0
 def OnInit(self):
     wx.InitAllImageHandlers()
     self.main = Frame5.create(None)
     self.main.Show()
     self.SetTopWindow(self.main)
     return True
Beispiel #26
0
 def OnInit(self):
     wx.InitAllImageHandlers()
     self.fillingFrame = FillingFrame()
     self.fillingFrame.Show(True)
     self.SetTopWindow(self.fillingFrame)
     return True
    def OnInit(self):
        wx.InitAllImageHandlers()
        frame = AtomLoaderFrame(None, -1, "SuperApp", [20, 20], [500, 340])
        frame.Show(True)

        return True
 def OnInit(self):
     wx.InitAllImageHandlers()
     file_handler = FileHandler(None, -1, "")
     self.SetTopWindow(file_handler)
     file_handler.Show()
     return 1
Beispiel #29
0
        sizer_29.Add(self.age_label, 0, wx.ALIGN_CENTER_VERTICAL, 0)
        sizer_29.Add(self.age_ctrl, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 4)
        sizer_26.Add(sizer_29, 1, wx.EXPAND, 0)
        sizer_25.Add(sizer_26, 1, wx.EXPAND, 0)
        sizer_25.Add(self.msg_label, 0, wx.LEFT, 10)
        sizer_25.Add(
            self.msg_panel, 1, wx.ALL | wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL
            | wx.ALIGN_CENTER_VERTICAL, 4)
        button_sizer.Add(self.ack_button, 0,
                         wx.ALL | wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_BOTTOM,
                         4)
        button_sizer.Add(self.act_button, 0,
                         wx.ALL | wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_BOTTOM,
                         4)
        sizer_25.Add(button_sizer, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, 0)
        sizer_24.Add(sizer_25, 1, wx.EXPAND, 0)
        self.SetSizer(sizer_24)
        self.Layout()
        # end wxGlade


# end of class MyFrame1

if __name__ == "__main__":
    app = wx.PySimpleApp(0)
    wx.InitAllImageHandlers()
    frame_1 = repeater_gui()
    app.SetTopWindow(frame_1)
    frame_1.Show()
    app.MainLoop()
Beispiel #30
0
def main():
    grass.set_raise_on_error(False)

    options, flags = grass.parser()

    # import wx only after running parser
    # to avoid issues with complex imports when only interface is needed
    import wx

    from grass.script.setup import set_gui_path
    set_gui_path()

    from core.globalvar import CheckWxVersion
    from core.render import Map
    from mapdisp.frame import MapFrame
    from mapdisp.main import DMonGrassInterface
    from core.settings import UserSettings
    from vdigit.main import haveVDigit, errorMsg
    from grass.exceptions import CalledModuleError

    # define classes which needs imports as local
    # for longer definitions, a separate file would be a better option
    class VDigitMapFrame(MapFrame):

        def __init__(self, vectorMap):
            MapFrame.__init__(
                self, parent=None, Map=Map(), giface=DMonGrassInterface(None),
                title=_("GRASS GIS Vector Digitizer"), size=(850, 600))
            # this giface issue not solved yet, we must set mapframe aferwards
            self._giface._mapframe = self
            # load vector map
            mapLayer = self.GetMap().AddLayer(
                ltype='vector', name=vectorMap,
                command=['d.vect', 'map=%s' % vectorMap],
                active=True, hidden=False, opacity=1.0, render=True)

            # switch toolbar
            self.AddToolbar('vdigit', fixed=True)

            # start editing
            self.toolbars['vdigit'].StartEditing(mapLayer)

    if not haveVDigit:
        grass.fatal(_("Vector digitizer not available. %s") % errorMsg)

    if not grass.find_file(name=options['map'], element='vector',
                           mapset=grass.gisenv()['MAPSET'])['fullname']:
        if not flags['c']:
            grass.fatal(_("Vector map <%s> not found in current mapset. "
                          "New vector map can be created by providing '-c' flag.") %
                        options['map'])
        else:
            grass.verbose(_("New vector map <%s> created") % options['map'])
            try:
                grass.run_command(
                    'v.edit', map=options['map'],
                    tool='create', quiet=True)
            except CalledModuleError:
                grass.fatal(
                    _("Unable to create new vector map <%s>") %
                    options['map'])

    # allow immediate rendering
    driver = UserSettings.Get(group='display', key='driver', subkey='type')
    if driver == 'png':
        os.environ['GRASS_RENDER_IMMEDIATE'] = 'png'
    else:
        os.environ['GRASS_RENDER_IMMEDIATE'] = 'cairo'

    app = wx.App()
    if not CheckWxVersion([2, 9]):
        wx.InitAllImageHandlers()
    frame = VDigitMapFrame(options['map'])
    frame.Show()

    app.MainLoop()