Exemple #1
0
    def OnAbout(self, event):
        self.log_debug("OnAbout")
        
        from wx.lib.wordwrap import wordwrap
        import pytestemb

        description = "Control Test is a script manager\n"
        description += "\n PyTestEmb-version : %s\n" % pytestemb.VERSION_STRING
        description += "\n WX-version : %s" % wx.VERSION_STRING
        description += "\n WX-plateform : %s" % wx.Platform
        description += "\n Python-version : %s" % platform.python_version()
        description += "\n Plateform : %s" % platform.platform(terse=True)
        description += "\n"
        
        info = wx.AboutDialogInfo()
        info.Name = APP_NAME
        info.Version = APP_VERSION
        info.Copyright = "GNU GENERAL PUBLIC LICENSE v3"
        info.Description = wordwrap(description, 350, wx.ClientDC(self))
        info.WebSite = ("http://developer.berlios.de/projects/pytestemb/", "berlios home page")
        info.Developers = [ "Jean-Marc Beguinet" ]
        
        licenseText = "GNU GENERAL PUBLIC LICENSE v3\n"
        licenseText += "Please report to :\n"
        licenseText += "http://www.gnu.org/licenses/licenses.html"
        info.License = wordwrap(licenseText, 500, wx.ClientDC(self))

        wx.AboutBox(info)
Exemple #2
0
    def run(self):
        # First we create and fill the info object
        info = wx.AboutDialogInfo()
        info.Name = "geoi"
        info.Version = "1.0.0"
        info.Copyright = "(C) 2008 http://www.Etumos.org"
        info.Description = wordwrap(
            "Graphical User Interface enabling to create a python file\n"
            "for the simulation of a geochemical or a                 \n"
            "geochemical-transport problem with:                      \n"
            " - PHREEQC as geochemical tool,                          \n"
            " - and MT450 or Elmer as transport tools                 \n"
            "                                        \n"
            "The problem is saturated, unsaturated problems will      \n"
            "be treated in the next version of the software.          \n"
            "developments granted from the unemployement fund         \n",
            550, wx.ClientDC(self.getParent()))
        info.WebSite = ("http://www.gnu.org", "GNU home page")
        #("http://www.etumos.org", "ETUMOS home page"))
        info.Developers = [ "Alain Dimier:" ]

        info.License = wordwrap(LICENSE, 500, wx.ClientDC(self.getParent()))

        # Then we call wx.AboutBox giving it that info object
        wx.AboutBox(info)
Exemple #3
0
 def about_mitemOnMenuSelection(self, event):
     try:
         # noinspection PyPackageRequirements
         from wx.lib.wordwrap import wordwrap
         info = AboutDialogInfo()
         info.Name = "Lattice Viewer"
         info.Version = "0.1.0"
         info.Copyright = "(C) 2016 Tong Zhang, SINAP, CAS"
         info.Description = wordwrap(
             "This is application is created for showing the lattice elements "
             "and configurations in tree style.", 350, wx.ClientDC(self))
         info.Developers = ["Tong Zhang <*****@*****.**>", ]
         lt = "Lattice Viewer is free software; you can redistribute it " \
              + "and/or modify it under the terms of the GNU General Public " \
              + "License as published by the Free Software Foundation; " \
              + "either version 3 of the License, or (at your option) any " \
              + "later version.\n" \
              + "\nLattice Viewer is distributed in the hope that it will be " \
              + "useful, but WITHOUT ANY WARRANTY; without even the implied " \
              + "warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR " \
              + "PURPOSE. See the GNU General Public License for more details.\n" \
              + "\nYou should have received a copy of the GNU General Public License " \
              + "along with Lattice Viewer; if not, write to the Free Software " \
              + "Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA"
         info.License = wordwrap(lt, 500, wx.ClientDC(self))
         AboutBox(info)
     except:
         dial = wx.MessageDialog(self,
                                 "Cannot show about informaion, sorry!",
                                 "Unknown Error",
                                 style=wx.OK | wx.CANCEL | wx.ICON_ERROR |
                                       wx.CENTRE)
         if dial.ShowModal() == wx.ID_OK:
             dial.Destroy()
Exemple #4
0
    def OnButton(self, evt):
        # First we create and fill the info object
        info = wx.adv.AboutDialogInfo()
        info.Name = "Hello World"
        info.Version = "1.2.3"
        info.Copyright = "(c) 2016 Programmers and Coders Everywhere"
        info.Description = wordwrap(
            "A \"hello world\" program is a software program that prints out "
            "\"Hello world!\" on a display device. It is used in many introductory "
            "tutorials for teaching a programming language."

            "\n\nSuch a program is typically one of the simplest programs possible "
            "in a computer language. A \"hello world\" program can be a useful "
            "sanity test to make sure that a language's compiler, development "
            "environment, and run-time environment are correctly installed.",
            350, wx.ClientDC(self))
        info.WebSite = ("http://en.wikipedia.org/wiki/Hello_world", "Hello World home page")
        info.Developers = [ "Joe Programmer",
                            "Jane Coder",
                            "Vippy the Mascot" ]

        info.License = wordwrap(licenseText, 500, wx.ClientDC(self))

        # Then we call wx.AboutBox giving it that info object
        wx.adv.AboutBox(info)
 def ShowAbout(self, e):
     ''' ShowAbout function displays the About information of the application
     '''
     info = wx.AboutDialogInfo()
     info.Name = "Karthika"
     info.Version = "0.2.0"
     info.Copyright = "(c) Arunmozhi 2011"
     info.Description = wordwrap("Kathika is a offline Dictionary build "
                                 "using the Wiktionary data of the WikiMedia"
                                 "Foundation. It is build using Python with"
                                 "wxPython for the GUI. The underlying data "
                                 "is extracted from the XML dumps of the "
                                 "Wiktionary site.The indexing and searching"
                                 "is using the Whoosh Search Engine.",
                                 400, wx.ClientDC(self))
     info.WebSite = ("https://github.com/tecoholic/tawiktionary-offline",
                     "Project GitHub Page")
     info.Developers = ["Arunmozhi"]
     info.License = wordwrap("No License has been decided yet. You are free"
                             "to modify and distribute the program as per"
                             "your needs without any kind of attribution of"
                             "credits whatsoever for the original developer."
                             "But requested to maintain the resulting "
                             "software name as Karthika.",
                             400, wx.ClientDC(self))
     wx.AboutBox(info)
Exemple #6
0
    def __init__(self, *args, **kwds):
        # First we create and fill the info object
        parent = args[0]

        info = wx.AboutDialogInfo()
        info.Name = "pyspread"
        info.Version = config["version"]
        info.Copyright = "(C) Martin Manns"
        info.Description = wordwrap(
            _("A non-traditional Python spreadsheet application.\nPyspread is "
              "based on and written in the programming language Python."),
            350, wx.ClientDC(parent))
        info.WebSite = ("http://manns.github.io/pyspread/",
                        _("Pyspread Web site"))
        info.Developers = ["Martin Manns"]
        info.DocWriters = ["Martin Manns", "Bosko Markovic"]
        info.Translators = ["Joe Hansen", "Mark Haanen", "Yuri Chornoivan",
                            u"Mario Blättermann", "Christian Kirbach",
                            "Martin Manns", "Andreas Noteng"]

        license_file = open(get_program_path() + "/COPYING", "r")
        license_text = license_file.read()
        license_file.close()

        info.License = wordwrap(license_text, 500, wx.ClientDC(parent))

        # Then we call wx.AboutBox giving it that info object
        wx.AboutBox(info)
    def OnAboutDialog(self, evt):
        licenseText = "GPL"
        # First we create and fill the info object
        info = wx.AboutDialogInfo()
        info.Name = "JBrew Controls"
        info.Version = "1.0"
        info.Copyright = "(C) 2012 JBrew Home Brewery"
        info.Description = wordwrap(
            "\"JBrew Controls\" is a program that uses an Arduino micro controller "
            "to interface with food grade pumps, temperature sensors, and a heating element "
            "in a Heat Exchange Recirculating Mashing System (HERMS). "
            "\n\nTo use \"Jbrew Controls\", simply select file->Change Brew Name to change "
            "the name of the Brew to your name, then enter a target mashing temperature and "
            "corresponding mashing time in the right control panel. Hit \"Start\" and the timer "
            "plus the Proportional Integral Differential (PID) closed loop feedback system will "
            "take care of the temperature control process for you. "
            "\n\n\"Jbrew Controls\" was written in wx Python, and the SpeedMeter control module "
            "written by Andrea Gavana, was used to aide in producing the meter drawings for the "
            "mash and HLT meters.", 350, wx.ClientDC(self))
        info.WebSite = ("Coming Soon", "Jbrew Controls web monitor")
        info.Developers = [ "Jordan Kagan - Lead Developer",
                            "Andrea Gavana - SpeedMeter controls module",
                          ]

        info.License = wordwrap(licenseText, 500, wx.ClientDC(self))

        # Then we call wx.AboutBox giving it that info object
        wx.AboutBox(info)
Exemple #8
0
    def on_about(self, event):
        """
        About Menu Clicked Event
        :return: Wx.Dailog Box
        """
        licenseText = "This work is licensed under the Apache License \n" \
                      "(Version 2.0). To view a copy of this license, \n" \
                      "visit http://www.apache.org/licenses/LICENSE-2.0.html"
        info = wx.AboutDialogInfo()
        info.Name = '{Q}Sheet'
        info.Version = __version__
        info.Copyright = 'Angel Broadcasting Network Private Limited'
        info.Description = wordwrap(
            "QSheet is a database application. "
            "A front end GUI app to replace paper trail. "
            "It enables a television network. "
            "to track its video assets and enables. "
            "people to review and approve them. "
            ,350, wx.ClientDC(self))
        info.WebSite = ("http://github.com/atvkumar/Qsheet", '{Q}Sheet Website')
        info.Developers = [__author__,
                           __contact__]

        info.License = wordwrap(licenseText, 500, wx.ClientDC(self))

        # Then we call wx.AboutBox giving it that info object
        wx.AboutBox(info)
Exemple #9
0
	def menuAbout( self, event ):
		# First we create and fill the info object
		info = wx.AboutDialogInfo()
		info.Name = Version.AppVerName
		info.Version = ''
		info.Copyright = "(C) 2013"
		info.Description = wordwrap(
			"Combine CrossMgr results into a Series.\n\n"
			"",
			500, wx.ClientDC(self))
		info.WebSite = ("http://sites.google.com/site/crossmgrsoftware/", "CrossMgr Home Page")
		info.Developers = [
					"Edward Sitarski ([email protected])"
					]

		licenseText = "User Beware!\n\n" \
			"This program is experimental, under development and may have bugs.\n" \
			"Feedback is sincerely appreciated.\n\n" \
			"Donations are also appreciated - see website for details.\n\n" \
			"CRITICALLY IMPORTANT MESSAGE!\n" \
			"This program is not warrented for any use whatsoever.\n" \
			"It may not produce correct results, it might lose your data.\n" \
			"The authors of this program assume no reponsibility or liability for data loss or erronious results produced by this program.\n\n" \
			"Use entirely at your own risk.\n" \
			"Do not come back and tell me that this program screwed up your event!\n" \
			"Computers fail, screw-ups happen.  Always use a paper manual backup."
		info.License = wordwrap(licenseText, 500, wx.ClientDC(self))

		wx.AboutBox(info)
    def onAbout(self, event):
        # se crea y completa un objeto info
        info = wx.AboutDialogInfo()
        info.Name = "Skanban"
        info.Version = "1.0.0"
        info.Copyright = "(C) 2013 "
        info.Description = wordwrap(
            "Este programa ha sido disenado para el curso " 
            "CC6401-1 Taller de Metodologias Agiles de Desarrollo de Software "

            "\n\n Utilizalo con sabiduria.",
            350, wx.ClientDC(self.frame))
        info.WebSite = ("https://github.com/cc6401-skanban/skanban", "Repositorio GitHub")
        info.Developers = [ "Javiera A. Born B.",
                            "Eduardo E. A. Frias M.",
                            "Francisco Y. Hafon A.",
                            "Felipe A. Hernandez G.",
                            "Nicolas M. Miranda C.",
                            "Ivan Pliouchtchai",
                            "Matias Toro I."]

        licenseText = "Copyright (C) 2013  Equipo Skanban\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see <http://www.gnu.org/licenses/>."

        info.License = wordwrap(licenseText, 500, wx.ClientDC(self.frame))

        # Se llama a wx.AboutBox dandole el objeto info
        wx.AboutBox(info)
    def OnAbout(self, evt = None):
        # First we create and fill the info object
        info = wx.AboutDialogInfo()
        info.Name = appInfo.title
        info.Version = appInfo.version
        info.Copyright = appInfo.copyright
        info.Description = wordwrap(
            '\nMyTerm is a RS232 serial port communication utility.'
            
            '\n\nAiming at debugging easily, We added some special '
            'functions to "MyTerm for-YellowStone":'
            '\n >Transmit data as hexadecimal.'
            '\n >Set columns width when save log to a file'
            '\n >Read data from scripts and transmit them'
            '\n\nSpecial Thanks to Xiuru Chen. He has helped '
            'me fix many bugs and given many suggestions.'
            ,
            335, wx.ClientDC(self.frame))
        info.WebSite = (appInfo.url, "Home Page")
        info.Developers = [ appInfo.author ]
        info.License = wordwrap(appInfo.copyright, 500, wx.ClientDC(self.frame))

        info.Icon = icon32.geticon32Icon()

        # Then we call wx.AboutBox giving it that info object
        wx.AboutBox(info)
Exemple #12
0
 def onAbout(self, event):
     try:
         from wx.lib.wordwrap import wordwrap
     except:
         dial = wx.MessageDialog(
             self,
             message=u"Cannot show about information, sorry!",
             caption=u"Unknow Error",
             style=wx.OK | wx.CANCEL | wx.ICON_ERROR | wx.CENTRE)
         if dial.ShowModal() == wx.ID_OK:
             dial.Destroy()
     info = wx.adv.AboutDialogInfo()
     info.Name = "DataWorkshop"
     info.Version = self.appversion
     info.Copyright = "(C) 2014-2015 Tong Zhang, SINAP, CAS"
     info.Description = wordwrap(
         "This application is created for data post-processing.\n"
         "It is designed by Python language, using GUI module of wxPython.",
         350, wx.ClientDC(self))
     info.WebSite = (
         "", "Cornalyzer home page")  # fill it when webpage is ready
     info.Developers = ["Tong Zhang <*****@*****.**>"]
     licenseText = "DataWorkshop is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.\n" + "\nDataWorkshop is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n" + "\nYou should have received a copy of the GNU General Public License along with DataWorkshop; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA"
     info.License = wordwrap(licenseText, 500, wx.ClientDC(self))
     wx.adv.AboutBox(info)
 def OnAbout(self, event):
     info = wx.AboutDialogInfo()
     info.Name = "Yijing in Translation"
     info.Version = "1.0.0"
     info.Copyright = "(C) 2012 Matt Pagan\n"
     info.WebSite = ("http://yijingintranslation.com", "Yijing in Translation")
     info.Description = wordwrap(            
         "Yijing in Translation is written using wxPython. This program "
         "provides access to several different translations of the Yijing. "
         "This program can be used for divination, for semantic analysis, or as an e-reader for this ancient text."
         "\n\nThis work is dedicated with gratitude to my former "
         "professor Robert Ford Campany, who revealed to me the pernicious "
         "issue of translating ancient Chinese into modern English.\n",
         350, wx.ClientDC(self))
     info.License = wordwrap(
         "This program is free software: you can redistribute it and/or "
         "modify it under the terms of the GNU General Public License as "
         "published by the Free Software Foundation, either version 3 of "
         "the License, or (at your option) any later version. \n\nThis "
         "program is distributed in the hope that it will be useful, but "
         "WITHOUT ANY WARRANTY; without even the implied warranty of "
         "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU "
         "General Public License for more details. ",
         350, wx.ClientDC(self))
     wx.AboutBox(info)
    def OnAbout(self, evt):
        licenseText = """This work is licensed under the GNU Public License (GPL).
        To view a copy of this license,
        visit http://www.gnu.org/copyleft/gpl.html
        """
        info = wx.AboutDialogInfo()
        info.Name = "mkArabicReverser"
        info.Version = "1.0.1"
        info.Copyright = "(C) 2013 Kumaran S/O Murugun"
        info.Description = wordwrap(
            "mkArabicReverser is an Arabic text reverser "
            "It takes your Arabic text from your source "
            "example: Word Processor, Web Browser, etc "
            "And it converts it into a format that is "
            "ready for your media applications "
            "\nexample: Photoshop, Illustrator, etc"
            "\nUTF-8,Unicode Support",
            350, wx.ClientDC(self))
        info.WebSite = ("http://github.com/atvkumar", "mkArabicReverser")
        info.Developers = [ "Kumaran",
                            "*****@*****.**",
                            "Abd Allah Diab",
                            "*****@*****.**" ]

        info.License = wordwrap(licenseText, 500, wx.ClientDC(self))

        # Then we call wx.AboutBox giving it that info object
        wx.AboutBox(info)
Exemple #15
0
def About(class_instance):
    licenseText = (
"Permission is hereby granted, free of charge, to any person obtaining a copy"
"of this software and associated documentation files (the 'Software'), to deal"
"in the Software without restriction, including without limitation the rights"
"to use, copy, modify, merge, publish, distribute, sublicense, and/or sell"
"copies of the Software, and to permit persons to whom the Software is"
"furnished to do so, subject to the following conditions:"
"The above copyright notice and this permission notice shall be included in"
"all copies or substantial portions of the Software."
"THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR"
"IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,"
"FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE"
"AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER"
"LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,"
"OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN"
"THE SOFTWARE.")

    info = wx.AboutDialogInfo()
    info.Name = "PyPEELF - Multi-Platform Binary Editor"
    info.Version = "1.0"
    info.Copyright = "Copyright (c) 2009 Nahuel Cayetano Riva <*****@*****.**>"
    info.Description = wordwrap(
                        "PyPEELF is a multi-platform binary editor. PyPEELF lets you"
                        "view and edit PE32, PE32+ and ELF binary files.",
                        450, wx.ClientDC(class_instance))
    info.Website = ("http://crackinglandia.blogspot.com", "PyPEELF Home Page")
    info.Developers = ["Nahuel Cayetano Riva ([email protected])", "Matias Bordese ([email protected])"]
    info.License = wordwrap(licenseText, 650, wx.ClientDC(class_instance))
    info.SetDocWriters(["Jacob Soo ([email protected])"])
    info.SetArtists(["Jacob Soo ([email protected])"])
    
    wx.AboutBox(info)
    def onAbout(self, event): 
        from app import APP_NAME
        from app import APP_VERSION
        from wx.lib.wordwrap import wordwrap
        import platform

        description = "Octopylog is a sink for trace coming from different source\n"
        description += "\n WX-version : %s" % wx.VERSION_STRING
        description += "\n WX-plateform : %s" % wx.Platform
        description += "\n Python-version : %s" % platform.python_version()
        description += "\n Plateform : %s" % platform.platform(terse=True)
        description += "\n"
        
        info = wx.AboutDialogInfo()
        _icon = wx.EmptyIcon()
        _icon.CopyFromBitmap(wx.Bitmap("images/octopylog_logo.png", wx.BITMAP_TYPE_ANY))
        
        info.Icon = _icon 
        info.Name = APP_NAME
        info.Version = APP_VERSION
        info.Copyright = "GNU GENERAL PUBLIC LICENSE v3"
        info.Description = wordwrap(description, 350, wx.ClientDC(self))
        info.WebSite = ("http://developer.berlios.de/projects/octopylog/", "berlios home page")
        info.Developers = [ "Jean-Marc Beguinet" ]
        
        licenseText = "GNU GENERAL PUBLIC LICENSE v3\n"
        licenseText += "Please report to :\n"
        licenseText += "http://www.gnu.org/licenses/licenses.html"
        info.License = wordwrap(licenseText, 500, wx.ClientDC(self))

        wx.AboutBox(info)

        event.Skip()
Exemple #17
0
    def action(self, index=-1, multiplier=1):
        from wx.lib.wordwrap import wordwrap
        
        info = wx.AboutDialogInfo()
        info.Name = substitutes['prog']
        info.Version = substitutes['version']
        info.Copyright = substitutes['copyright']
        info.Description = wordwrap("%s\n\nUsing wxPython %s" % (substitutes['description'], wx.version()), 350, wx.ClientDC(self.frame))
        info.WebSite = (__url__, "%(prog)s home page" % substitutes)
        devs = [ substitutes['author'],
                 "",
                 _("Contributions by:"),
                 ]
        people = {}
        for author in authors.keys():
            people[author] = 1
        for author in credits.keys():
            people[author] = 1
        for copyright in copyrights.values():
            people[copyright['author']] = 1
        #dprint(people.keys())
        devs.extend(people.keys())
        info.Developers = devs
        #dprint(info.Developers)

        info.License = wordwrap(substitutes['license_text'], 500, wx.ClientDC(self.frame))

        # Then we call wx.AboutBox giving it that info object
        wx.AboutBox(info)
 def UdpListenerStopped(self):
     global playerCount
     Publisher.unsubscribe(self.UdpListenerStopped, 'listener_stop')
     Publisher.unsubscribe(self.HostFound, 'host_found')
     if self.hostSearch:
         self.hostSearch = False
         if playerCount == 0:
             self.prgDialog.Update(100)
             if HOST_SYS == HOST_WIN:
                 self.prgDialog.Destroy()
                 if platform.release() == "XP":
                     dlgWin = wx.MessageDialog(self,wordwrap(tr("no_players_found"), 300, wx.ClientDC(self)), tr("no_player"), style=wx.OK)
                     result = dlgWin.ShowModal()
                     self.parent.Close()
             dlg = wx.SingleChoiceDialog(self,wordwrap(tr("no_players_found"), 300, wx.ClientDC(self)), tr("no_player"), ["Enter IP Address", tr("rescan"), tr("exit")])
             result = dlg.ShowModal()
             selection = dlg.GetSelection()
             if result == wx.ID_OK:
                 if selection == 0: # ENTER IP
                     ipDlg = wx.TextEntryDialog(self, "Enter the IP of your RaspMedia Player or Exit application with cancel.", "Enter IP Address");
                     if ipDlg.ShowModal() == wx.ID_OK:
                         ipAddress = ipDlg.GetValue()
                         self.HostFound([ipAddress, "RaspMedia"], "RaspMedia")
                         self.LoadControlWindowForCurrentHostList()
                     else:
                         self.parent.Close()
                 elif selection == 1: # RESCAN
                     self.SearchHosts()
                 elif selection == 2: # EXIT
                     self.parent.Close()
             elif result == wx.ID_CANCEL:
                 self.parent.Close()
         else:
             self.LoadControlWindowForCurrentHostList()
Exemple #19
0
 def __init__(self, *args, **kwds):
     # First we create and fill the info object
     parent = args[0]
     
     info = wx.AboutDialogInfo()
     info.Name = "pyspread"
     info.Version = config["version"]
     info.Copyright = "(C) Martin Manns 2008-2011"
     info.Description = wordwrap( 
         "A cross-platform Python spreadsheet application.\nPyspread is "
         "based on and written in the programming language Python.",
         350, wx.ClientDC(parent))
     info.WebSite = ("http://pyspread.sourceforge.net", 
                     "Pyspread Web site")
     info.Developers = ["Martin Manns"]
     info.DocWriters = ["Martin Manns", "Bosko Markovic"]
     
     license_file = open(get_program_path() + "/COPYING", "r")
     license_text = license_file.read()
     license_file.close()
     
     info.License = wordwrap(license_text, 500, wx.ClientDC(parent))
     
     # Then we call wx.AboutBox giving it that info object
     wx.AboutBox(info)
Exemple #20
0
 def OnAbout(self, event):
     # create and show an about dialog box
     info = wx.AboutDialogInfo()
     info.SetName("Mna Currency Converter")
     info.SetVersion(self.VERSION)
     info.SetCopyright("Copyright (C) 2012-2015, Petros Kyladitis")
     info.Description = wordwrap("A currency converter program for Python, using wxPython for the GUI and urllib2 library with Google Finance service to retrieve updated exchange data.", 350, wx.ClientDC(self))
     info.SetWebSite("http://www.multipetros.gr")
     info.License = wordwrap("This program is free software, distributed under the terms and conditions of the FreeBSD License. For full licensing info see the \"license.txt\" file, distributed with this program", 350, wx.ClientDC(self))
     info.SetIcon(self.ico) # Declared at self.__set_properties()
     wx.AboutBox(info)
 def MenuAbout(self,e=None):
     from wx.lib.wordwrap import wordwrap
     info = wx.AboutDialogInfo()
     info.Name = "Hunter Chess"
     info.Version = "0.1.0"
     info.Description = wordwrap(
     'HunterChess是一个棋类游戏。游戏规则详见README文件。\n作者:刘浩杰\n邮件:[email protected]'.decode('gbk')
     ,500, wx.ClientDC(self))
     info.WebSite = ("https://github.com/sadnoodles/HunterChess", "HunterChess @github")
     info.License = wordwrap('Use and redistribute Under the terms of GNU GENERAL PUBLIC LICENSE.See the LICENSE file for detail.', 500, wx.ClientDC(self))
     wx.AboutBox(info)
Exemple #22
0
    def OnAbout(self, e):
        """Shows the about text of FixCat."""
        info = wx.AboutDialogInfo()
        info.Name = 'FixCat'
        info.Version = '0.9'
        info.Copyright = 'GNU GPLv3'
        info.Description = wordwrap('FixCat is a tool for processing eyetracking data', 400, wx.ClientDC(self))
        info.WebSite = ('https://github.com/KopierKatze/FixCat', 'GitHub project page')
        info.Developers = ["Alexandra Weiss", "Franz Gregor"]
        info.License = wordwrap(License.gpl, 400, wx.ClientDC(self))

        wx.AboutBox(info)
 def OnAbout(self, event):
     aboutinfo = wx.AboutDialogInfo()
     aboutinfo.Name = "My About Box"
     aboutinfo.Version = "1.0.0 Beta"
     aboutinfo.Copyright = "(C) 2016 S'up yo"
     aboutinfo.Description = wordwrap(
         "This is an example application written in wxPython to "
         "act as a step-by-step wizard",
         350, wx.ClientDC(self.view))
     aboutinfo.Developers = ["David LePage"]
     aboutinfo.License = wordwrap("Completely and totally open source!", 550, wx.ClientDC(self.view))
     wx.AboutBox(aboutinfo)
Exemple #24
0
    def __init__(self, frame):
        """Initialize the dialog"""

        wx.AboutDialogInfo.__init__(self)

        self.Name = "Pymodoro"
        self.Version = "0.1.1"
        self.Copyright = "(C) Foobar 2009"
        self.Description = wordwrap(desc, 350, wx.ClientDC(frame))
        self.WebSite = "http://www.no-sync.com"
        self.Developers = ["Foo Bar", "John Doe"]
        self.License = wordwrap(desc, 500, wx.ClientDC(frame))
Exemple #25
0
    def OnAboutInfo(self, event):
        info = wx.AboutDialogInfo()
        info.Name = u"YouMoney"
        info.Version = version.VERSION
        info.Copyright = "(C) 2010 zhaoweikid"
        info.Description = wordwrap(_("YouMoney is a opensource personal finance software write by Python language.") + '\n',
            350, wx.ClientDC(self))
        info.WebSite = ("http://code.google.com/p/youmoney", _("YouMoney home page"))
        info.Developers = ["zhaoweikid"]

        info.License = wordwrap("GPL", 500, wx.ClientDC(self))
        wx.AboutBox(info)
 def display_about_box(self):
     info = wx.AboutDialogInfo()
     info.Name = "Ward Directory Creator"
     info.Version = __version__
     info.Copyright = "(C) 2007-2015 David Ernstrom"
     info.Description = wordwrap(BLOB, 350, wx.ClientDC(self))
     info.WebSite = ("http://directory.ernstrom.net",
                     "Ward Directory Creator")
     info.Developers = ["David Ernstrom", "Tina Ernstrom"]
     info.License = wordwrap(LICENSE_TEXT, 500, wx.ClientDC(self))
     # Then we call wx.AboutBox giving it that info object
     wx.AboutBox(info)
Exemple #27
0
    def OnInitWidgets(self):
        self._panel = wx.Panel(self)

        self.titleText = wx.StaticText(self._panel, -1,
            'Clock Punch v%s' % self._ver)

        titleFont = wx.Font(14, wx.DECORATIVE, wx.NORMAL, wx.BOLD)
        self.titleText.SetFont(titleFont)

        self.webLink = _wgt.CustomHyperlink(self._panel,
            self._idHyperlink,
            label = 'Written using Python',
            url = "http://en.wikipedia.org/wiki/Python_programming_language"
            )

        description = wordwrap(
           "This is the Clock Puncher."
           " \n-The original Time Punch application re-written."
           " \nIt allows you to easily send the various time punch"
           " emails at the click of a button."
           "\n\nPlease do not report any issues with this program to DS IT as"
           " it is not an officially supported application.",
           350, wx.ClientDC(self))

        self.descText = wx.StaticText(self._panel, -1, description)

        self.licenseHeader = wx.StaticText(self._panel, -1, 'Licensing:')
        licenseFont = wx.Font(12, wx.DECORATIVE, wx.NORMAL, wx.BOLD)
        self.licenseHeader.SetFont(licenseFont)

        license = wordwrap('Main program: GPL v3'
            '\nPython: PSF License'
            '\npyWin32: PSF License'
            '\nWMI: MIT License'
            '\nwxPython: wxWidgets License',
            350, wx.ClientDC(self))

        self.licenseText = wx.StaticText(self._panel, -1, license)

        self.devHeader = wx.StaticText(self._panel, -1, 'Developer(s):')
        devFont = wx.Font(12, wx.DECORATIVE, wx.NORMAL, wx.BOLD)
        self.devHeader.SetFont(devFont)

        developers = wordwrap(
            'Program Writer:'
            '\nMichael Stover',
            500, wx.ClientDC(self))

        self.devText = wx.StaticText(self._panel, -1, developers)

        self.btnOk = _wgt.CustomPB(self._panel,
            id=wx.ID_OK, label='OK', size=(50,-1))
 def __OnAbout(self, event):
     """ Show the about dialog with information about the application """
     
     info = wx.AboutDialogInfo()
     info.Icon = wx.IconFromBitmap(guitarportfolio_icon.getBitmap())
     info.Name = appcfg.APP_TITLE
     info.Version = appcfg.APP_VERSION
     info.Copyright = "(C) 2007 Jorgen Bodde, ImpossibleSoft"
     info.Description = wordwrap(appcfg.description, 350, wx.ClientDC(self))
     info.WebSite = (appcfg.site_url[0], appcfg.site_url[1])
     info.Developers = [ "Jorgen Bodde ([email protected])" ]
     info.License = wordwrap(appcfg.licensetext, 500, wx.ClientDC(self))
     wx.AboutBox(info)
Exemple #29
0
 def __init__(self, parent):
     self.parent = parent
     info = AboutDialogInfo()
     info.Name = data.app_name
     info.Version = data.version
     info.Copyright = data.copyright
     info.Description = wordwrap(data.description, 350, ClientDC(parent))
     info.WebSite = data.website
     info.Developers = data.developers
     info.License = wordwrap(data.license, 500, ClientDC(parent))
     # Then we call wx.AboutBox giving it that info object
     AboutBox(info)
     #self.ShowModal()
Exemple #30
0
	def onAboutDlg(self, event):
		info = wx.AboutDialogInfo()
		info.Name = "File Fetcher"
		info.Version = "0.0.1 Beta"
		info.Copyright = "(C) 2008 Gavin Hinfey"
		info.Description = wordwrap(
		"For use in the Film/Television Post Production industry." ,
		350, wx.ClientDC(self.panel))
		info.WebSite = ("https://github.com/hinfeyg2/File-Fetcher", "GitHub Page")
		info.Developers = ["Gavin Hinfey"]
		info.License = wordwrap("Currently completely and totally open source!", 500,
				    wx.ClientDC(self.panel))
		wx.AboutBox(info)
    def OnAbout(self, event):
        # wx.MessageBox("(c) Andy Bulka, 2012")

        from wx.lib.wordwrap import wordwrap

        info = wx.AboutDialogInfo()
        # info.SetIcon(wx.Icon('Images\\img_uml01.png', wx.BITMAP_TYPE_PNG))
        info.SetName(PY_PLANTUML_ABOUT_APPNAME)
        info.SetVersion(str(PY_PLANTUML_APP_VERSION))
        # info.SetDescription(ABOUT_MSG)
        info.Description = wordwrap(PY_PLANTUML_ABOUT_MSG, 350, wx.ClientDC(self))
        info.SetCopyright(ABOUT_AUTHOR)
        # info.SetWebSite(WEB_PYNSOURCE_HOME_URL)
        info.WebSite = (WEB_PYNSOURCE_HOME_URL, "Home Page")
        info.WebSite = (PY_PLANTUML_HOME_URL, "Plantuml Home Page")
        info.SetLicence(ABOUT_LICENSE)
        # info.AddDeveloper(ABOUT_AUTHOR)
        # info.AddDocWriter(ABOUT_FEATURES)
        # info.AddArtist('Blah')
        # info.AddTranslator('Blah')

        wx.AboutBox(info)
Exemple #32
0
def Info(self):

	info = wx.AboutDialogInfo()
	info.Name = u"Утилита программирования\nППКОП \"Офицер\" 04"
	info.Version = u"0.5"
	info.Copyright = u"(C) 2016 ГПБ Ураган"
	info.Description = wordwrap(
		u"Основное назначение:\n"
		u"Программирование панели по протоколу modbus."

		u"\n\nИспользуемые библиотеки:\n"
		u"wxPython(ver 3.0.2.0)\n"
		u"pymodbus(ver 1.2.0)\n"
		u"pyserial(ver 2.7)\n"
		u"",
		350, wx.ClientDC(self))
	info.WebSite = (u"http://www.officer24.ru", u"Officer")
	info.Developers = [ u"Vladimir Komarov",
						u"Roman Tayursky",
						u"Anatoly Zamyatin" ]

	wx.AboutBox(info)
Exemple #33
0
 def ShowAboutBox(self, evt):
     import eos.config
     v = sys.version_info
     info = wx.AboutDialogInfo()
     info.Name = "pyfa"
     info.Version = gui.aboutData.versionString
     info.Description = wordwrap(
         gui.aboutData.description + "\n\nDevelopers:\n\t" +
         "\n\t".join(gui.aboutData.developers) +
         "\n\nAdditional credits:\n\t" +
         "\n\t".join(gui.aboutData.credits) + "\n\nLicenses:\n\t" +
         "\n\t".join(gui.aboutData.licenses) + "\n\nEVE Data: \t" +
         eos.config.gamedata_version + "\nPython: \t\t" +
         '{}.{}.{}'.format(v.major, v.minor, v.micro) + "\nwxPython: \t" +
         wx.__version__ + "\nSQLAlchemy: \t" + sqlalchemy.__version__, 500,
         wx.ClientDC(self))
     if "__WXGTK__" in wx.PlatformInfo:
         forumUrl = "http://forums.eveonline.com/default.aspx?g=posts&amp;t=466425"
     else:
         forumUrl = "http://forums.eveonline.com/default.aspx?g=posts&t=466425"
     info.WebSite = (forumUrl, "pyfa thread at EVE Online forum")
     wx.AboutBox(info)
Exemple #34
0
	def Draw(self, grid, attr, dc, rect, row, col, isSelected):
		text = grid.GetCellValue(row, col)

		### if cell is path
		if os.path.isdir(os.path.dirname(text)):
			text = os.path.basename(text)

		dc.SetFont( attr.GetFont() )
		text = wordwrap.wordwrap(text, grid.GetColSize(col), dc, breakLongWords = False)
		hAlign, vAlign = attr.GetAlignment()
		if isSelected:
			bg = grid.GetSelectionBackground()
			fg = grid.GetSelectionForeground()
		else:
			bg = attr.GetBackgroundColour()
			fg = attr.GetTextColour()
		dc.SetTextBackground(bg)
		dc.SetTextForeground(fg)
		dc.SetBrush(wx.Brush(bg, wx.SOLID))
		dc.SetPen(wx.TRANSPARENT_PEN)
		dc.DrawRectangleRect(rect) if wx.VERSION_STRING < '4.0' else wx.DC.DrawRectangle(dc, rect)
		grid.DrawTextRectangle(dc, text, rect, hAlign, vAlign)
Exemple #35
0
    def GetBestSize(self, grid, attr, dc, row, col):
        """The width will be between values `col size` and `max col size`
        These can be changed in user preferences.
        """
        text = grid.GetCellValue(row, col)

        _font = attr.GetFont()
        dc.SetFont(_font)

        if len(text) == 0:
            return dc.GetTextExtent("  ")  # self.default_width

        w, h = dc.GetTextExtent(text + " ")

        if self.auto_fit:
            suggest_width = grid.GetColSize(col)

        if self.word_wrap:
            if self.auto_fit:
                col_width = min(w, self.max_width)
                suggest_width = grid.GetColSize(col)
            else:
                col_width = self.default_width
                suggest_width = col_width
            text = wordwrap.wordwrap(text,
                                     suggest_width,
                                     dc,
                                     breakLongWords=False)
            w, h = dc.GetMultiLineTextExtent(text)
            row_height = h
        else:
            row_height = h
            if self.auto_fit:
                col_width = min(w, self.max_width)
            else:
                col_width = min(w, grid.GetColSize(col))

        return wx.Size(col_width, row_height)
Exemple #36
0
    def InitStatusUI(self):
        statusBox = wx.BoxSizer(orient=wx.VERTICAL)

        # init status labels
        numPlayers = len(self.hosts)
        if numPlayers == 1:
            players = tr("one_player_found")
        else:
            players = "%s %d %s" % (tr("multiple_players_one"), numPlayers,
                                    tr("multiple_players_two"))

        #for host in self.hosts:
        #    players += host['name'] + "\n"

        status = wordwrap(
            "%s\n\n%s %s\n%d %s\n" %
            (players, tr("usb_at_drive"), self.usbPath, len(
                self.filesToCopy), tr("images_available")), 300,
            wx.ClientDC(self))

        statusLabel = wx.StaticText(self, -1, label=status)

        #usbTxt = wx.TextCtrl(self, -1, size=(300,280), style = wx.TE_READONLY | wx.TE_MULTILINE)

        #for file in self.filesToCopy:
        #    usbTxt.AppendText(file + "\n")

        imgPrevH = 480 - statusLabel.GetSize()[1]

        imageView = scrollable.ScrollableImageView(self, -1, (300, imgPrevH),
                                                   sorted(self.filePaths))

        # add to status view sizer
        statusBox.Add(statusLabel, flag=wx.LEFT | wx.TOP | wx.RIGHT, border=5)
        statusBox.Add(imageView, flag=wx.LEFT | wx.BOTTOM | wx.RIGHT, border=5)

        # add to main sizer
        self.mainSizer.Add(statusBox, (0, 0), span=(4, 1))
Exemple #37
0
    def __init__(self, parent):
        super(AboutDlg, self).__init__(parent,
                                       wx.ID_ANY,
                                       title="About",
                                       size=(300, 360))

        image = bitmap_from_base64(icon_robot_b64)

        name = 'Auto MO'
        description = wordwrap(
            "Program to automate the tedious job of hand writing prescriptions everyday."
            "", 250, wx.ClientDC(self))
        version = __version__
        website = "https://github.com/aliaafee/automo"
        copyrights = "(C) 2017 Ali Aafee"

        sizer = wx.BoxSizer(wx.VERTICAL)

        ctrl = wx.StaticText(self,
                             label=name + " " + version,
                             size=wx.Size(-1, -1))
        ctrl.SetFont(wx.Font(18, wx.FONTFAMILY_TELETYPE, wx.NORMAL, wx.BOLD))
        sizer.Add(ctrl, 0, wx.ALIGN_CENTER | wx.TOP, border=20)

        ctrl = wx.StaticBitmap(self, 1, image, (10, 5),
                               (image.GetWidth(), image.GetHeight()))
        sizer.Add(ctrl, 0, wx.ALIGN_CENTER | wx.ALL, border=10)

        ctrl = wx.StaticText(self, label=description, size=wx.Size(-1, -1))
        sizer.Add(ctrl, 0, wx.ALIGN_CENTER | wx.ALL, border=10)

        ctrl = hl.HyperLinkCtrl(self, -1, website, URL=website)
        sizer.Add(ctrl, 0, wx.ALIGN_CENTER | wx.ALL, border=10)

        ctrl = wx.StaticText(self, label=copyrights, size=wx.Size(-1, -1))
        sizer.Add(ctrl, 0, wx.ALIGN_CENTER | wx.ALL, border=10)

        self.SetSizer(sizer)
Exemple #38
0
    def OnAbout(self, event):
        # First we create and fill the info object
        info = wx.AboutDialogInfo()
        info.Name = "Monkey Master"
        info.Version = "2.0.3"
        info.Copyright = "(C) 2012 Motorola Mobility Corporation"
        info.Description = wordwrap(
            "\"Monkey Master\" program is a cross-platform GUI Tool for android test.\n"
            "It can be used on both user and userdebug release.\n"
            "Based on Google monkey tool. \nDesigned for Stability&&Memory test. \n\n"
            
            "Evolve from monkey master 1.X\n"
            "Specially thanks Hao Xi(hcr387), Xu Yimin(pwj674)'s contribution to this tool.\n"
            "Motorola Mobility -- China System Test, CT458"
            ,
            350, wx.ClientDC(self))
        info.WebSite = ("https://sites.google.com/a/motorola.com/ct458-automation/auto-tools-release/mm20", "Monkey Master home page")
        info.Developers = [ "Wang Xuanyu (xwm763)" ]

        #info.License = wordwrap(licenseText, 500, wx.ClientDC(self))

        # Then we call wx.AboutBox giving it that info object
        wx.AboutBox(info)
    def GetBestSize(self, grid, attr, dc, row, col):
        """ Get best size depending of the colom type
		"""
        text = grid.GetCellValue(row, col)
        dc.SetFont(attr.GetFont())
        text = wordwrap.wordwrap(text,
                                 grid.GetColSize(col),
                                 dc,
                                 breakLongWords=False)
        ### if colom info (mutliline)
        if col == 2:
            w, h, lineHeight = dc.GetMultiLineTextExtent(
                text
            ) if wx.VERSION_STRING < '4.0' else dc.GetFullMultiLineTextExtent(
                text)
            return wx.Size(w, h)
        ### if colom label
        elif col == 0:
            w, h, lineHeight, a = dc.GetFullTextExtent(text)
            return wx.Size(w, h)
        ### if colom choices elem
        else:
            return attr.GetSize()
Exemple #40
0
    def __init__(self, main_frame):
        info = wx.AboutDialogInfo()
#        info.Icon = wx.Icon("../resources/clone.ico", wx.BITMAP_TYPE_ICO)
        info.Name = "Clone"
        info.Version = "2.0.6"
        info.Copyright = "2012 - Axxiom Solucoes Tecnologicas SA"
        info.License = "GNU General Public License"
        info.Description = wordwrap(
            "The Clone utility was developed using the programming language "
            "Python and wxPython GUI library.\n\n Clone's initial proposal was "
            "to work as an utility to compile Borland's C++Builder programs, "
            "but the architecture has been generalized to allow some "
            "development team to \"plug\" the Clone in any compiler, allowing "
            "parallelization capability and all other features of the Clone.",
            450, wx.ClientDC(main_frame))
        info.WebSite = ("192.168.46.31:8181/wiki/Wiki.jsp?page=CloneBuilder",
                        "Clone's Website")
        info.Developers = ["Cleber Gomes", 
                           "Gustavo Santos",
                           "Rafael Campos",
                           "Rodrigo Muzzi"]
        
        wx.AboutBox(info)
Exemple #41
0
    def __init__(self, parent, msg):
        wx.Dialog.__init__(self, parent, -1,
                           _("An unexpected error occured"),
                           name="DlgBugReport")

        text = _("An unexpected error occured. Do you want to send this bug report to the developers of %s?") % Constants.APP_NAME

        stBmp = wx.StaticBitmap(
            self, -1,
            wx.ArtProvider.GetBitmap(wx.ART_ERROR, size=wx.Size(32, 32)))
        stMsg = wx.StaticText(self, -1, wordwrap(text, 300, wx.ClientDC(self)))

        szTop = wx.BoxSizer(wx.HORIZONTAL)
        szTop.Add(stBmp, 0, wx.ALIGN_CENTER_VERTICAL | wx.ALL, 8)
        szTop.Add(stMsg, 0, wx.ALL, 8)

        self.tcMsg = wx.TextCtrl(
            self, -1, msg,
            style=wx.TE_MULTILINE | wx.TE_READONLY | wx.TE_DONTWRAP)

        szCmd = self.CreateSeparatedButtonSizer(wx.YES | wx.NO)

        szMain = wx.BoxSizer(wx.VERTICAL)
        szMain.Add(szTop, 0)
        szMain.Add(self.tcMsg, 1, wx.EXPAND | wx.ALL, 4)
        szMain.Add(szCmd, 0, wx.EXPAND | wx.ALL, 4)

        self.SetSizer(szMain)

        self.Bind(wx.EVT_BUTTON, self.OnNo, id=wx.ID_NO)
        self.Bind(wx.EVT_BUTTON, self.OnYes, id=wx.ID_YES)

        self.SetAffirmativeId(wx.ID_YES)
        self.SetEscapeId(wx.ID_NO)
        self.SetInitialSize(self.GetEffectiveMinSize())
        self.CenterOnParent()
        self.SetFocus()
Exemple #42
0
    def do_about(self, evt):
        info = wx.AboutDialogInfo()
        info.Name = self.title
        info.Version = Constants.__version__
        info.Copyright = Constants.__copyright__
        info.Description = (
            "Visual Template designer for PyFPDF (using wxPython OGL library)\n"
            "Input files are CSV format describing the layout, separated by ;\n"
            "Use toolbar buttons to open, save, print (preview) your template, "
            "and there are buttons to find, add, remove or duplicate elements.\n"
            "Over an element, a double left click opens edit text dialog, "
            "and a right click opens edit properties dialog. \n"
            "Multiple element can be selected with shift left click. \n"
            "Use arrow keys or drag-and-drop to move elements.\n"
            "For further information see project webpage:"
            )
        info.WebSite = ("https://github.com/reingart/pyfpdf/blob/master/docs/Templates.md",
                        "pyfpdf GitHub Project")
        info.Developers = [Constants.__author__]

        info.License = wordwrap(Constants.__license__, 500, wx.ClientDC(self))

        # Then we call wx.AboutBox giving it that info object
        wx.AboutBox(info)
Exemple #43
0
def about(prnt):
    from wx.lib.wordwrap import wordwrap

    info = wx.AboutDialogInfo()
    info.Name = "Molecular View"
    info.Version = "0.0.2 beta"
    info.Copyright = "(C) 2007 Tatiana Al-Chueyr Pereira Martins"
    info.Description = wordwrap(
        "Molecular View program is a software program that shows 3D models "
        "related to PDB (Protein Data Base) files on the display device. "
        "\n\nThe software also allows generating the correspondent VRML or STL "
        "files, so the user can build up Molecular Rapid Prototyping physical "
        "models.", 350, wx.ClientDC(prnt))
    info.WebSite = ("http://code.google.com/p/molecular-view/",
                    "Molecular View Website")
    info.Developers = [
        "Tatiana Al-Chueyr Pereira Martins",
        "\nPaulo Henrique Junqueira Amorim", "\nFelipe Faria de Souza"
    ]

    info.License = "GPL (General Public License) version 2"

    # Then we call wx.AboutBox giving its info object
    wx.AboutBox(info)
Exemple #44
0
    def __init__(self,
                 parent=None,
                 id=wx.ID_ANY,
                 title="About",
                 pos=wx.DefaultPosition,
                 size=wx.DefaultSize,
                 style=wx.DEFAULT_DIALOG_STYLE,
                 show_name=True,
                 show_notice=True,
                 show_link=True,
                 show_link_docs=False,
                 info="..."):
        wx.Dialog.__init__(self, parent, id, title, pos, size, style)

        # Display the application's icon in the title bar.
        icon = wx.Icon(resource(PROG_ICON), wx.BITMAP_TYPE_ICO)
        self.SetIcon(icon)

        # Set the font for this window and all child windows (widgets) from the
        # parent window, or from the system defaults if no parent is given.
        # A dialog box does not inherit font info from its parent, so we will
        # explicitly get it from the parent and apply it to the dialog box.
        if parent is not None:
            font = parent.GetFont()
            self.SetFont(font)

        # Display program name and version.
        if show_name:
            prog = wx.StaticText(self,
                                 wx.ID_ANY,
                                 label=(APP_NAME + " " + APP_VERSION))
            font = prog.GetFont()
            font.SetPointSize(font.GetPointSize() + 1)
            font.SetWeight(wx.BOLD)
            prog.SetFont(font)

        # Display copyright notice.
        if show_notice:
            copyright = wx.StaticText(self, wx.ID_ANY, label=APP_COPYRIGHT)

        # Display hyperlink to the Reflectometry home page and/or doc page.
        if show_link:
            hyper1 = HyperLinkCtrl(self,
                                   wx.ID_ANY,
                                   label=APP_PROJECT_TAG,
                                   URL=APP_PROJECT_URL)
        if show_link_docs:
            hyper2 = HyperLinkCtrl(self,
                                   wx.ID_ANY,
                                   label=APP_TUTORIAL_TAG,
                                   URL=APP_TUTORIAL_URL)

        # Display the body of text for this about dialog box.
        info = wx.StaticText(self,
                             wx.ID_ANY,
                             label=wordwrap(info, 530, wx.ClientDC(self)))
        # Create the OK button control.
        ok_button = wx.Button(self, wx.ID_OK, "OK")
        ok_button.SetDefault()

        # Use a vertical box sizer to manage the widget layout..
        sizer = wx.BoxSizer(wx.VERTICAL)
        if show_name:
            sizer.Add(prog, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, border=10)
        if show_notice:
            sizer.Add(copyright,
                      0,
                      wx.ALL | wx.ALIGN_CENTER_HORIZONTAL,
                      border=10)
        sizer.Add(info, 0, wx.ALL, border=10)
        if show_link:
            sizer.Add(hyper1, 0, wx.ALL, border=10)
        if show_link_docs:
            sizer.Add(hyper2, 0, wx.ALL, border=10)
        sizer.Add(ok_button, 0, wx.ALL | wx.ALIGN_CENTER_HORIZONTAL, border=10)

        # Finalize the sizer and establish the dimensions of the dialog box.
        self.SetSizer(sizer)
        sizer.Fit(self)
Exemple #45
0
    def LayoutPanel(self):
        wordWrapWidth = 350
        self.SetBackgroundColour(wx.WHITE) # this overrides color of enclosing panel
        shPnlSiz = wx.GridBagSizer(1, 1)

        gRow = 0
        shPnlSiz.Add(wx.StaticText(self, -1, self.stStaLabel),
            pos=(gRow, 0), span=(1, 3), flag=wx.ALIGN_LEFT|wx.TOP|wx.LEFT|wx.BOTTOM, border=5)
 
#        gRow += 1
#        shPnlSiz.Add(wx.StaticLine(self), pos=(gRow, 0), span=(1, 3), flag=wx.EXPAND)
        
        gRow += 1
        self.tcStationName = wx.TextCtrl(self)
        shPnlSiz.Add(self.tcStationName, pos=(gRow, 0), span=(1, 3), 
            flag=wx.EXPAND|wx.LEFT|wx.RIGHT, border=5)

        gRow += 1

        stAboutLL = 'Processing requires longitude to calculate solar time (latitude is ' \
                'unused). Choose Site or enter lat/lon for each station. ' \
                'Within a degree is typically accurate enough.'
        stWr = wordwrap(stAboutLL, wordWrapWidth, wx.ClientDC(self))
        shPnlSiz.Add(wx.StaticText(self, -1, stWr),
                     pos=(gRow, 0), span=(1, 3), flag=wx.TOP|wx.LEFT|wx.BOTTOM, border=5)

        gRow += 1
        shPnlSiz.Add(wx.StaticText(self, -1, 'Site'),
            pos=(gRow, 0), span=(1, 1), flag=wx.ALIGN_RIGHT|wx.LEFT|wx.BOTTOM, border=5)
        self.cbxFldSites = wx.ComboBox(self, ID_CBX_SEL_SITE, style=wx.CB_READONLY)
        self.cbxFldSites.Bind(wx.EVT_COMBOBOX, self.onCbxTasks)
        # txSiteLLMsg will not be emplaced till later, but needed now for fillSitesList
        self.txSiteLLMsg = wx.StaticText(self, -1, label='Site lat/lon:')
        self.fillSitesList()
        shPnlSiz.Add(self.cbxFldSites, pos=(gRow, 1), span=(1, 1), 
            flag=wx.EXPAND|wx.LEFT|wx.RIGHT, border=5)

        SibHorizSizer = wx.BoxSizer(wx.HORIZONTAL)

        btnAddSite = wx.Button(self, label="New", size=(32, 20))
        btnAddSite.Bind(wx.EVT_BUTTON, lambda evt, str=btnAddSite.GetLabel(): self.onClick_BtnWorkOnSite(evt, str))
        SibHorizSizer.Add(btnAddSite)

        btnEditSite = wx.Button(self, label="Edit", size=(32, 20))
        btnEditSite.Bind(wx.EVT_BUTTON, lambda evt, str=btnEditSite.GetLabel(): self.onClick_BtnWorkOnSite(evt, str))
        SibHorizSizer.Add(btnEditSite)

        shPnlSiz.Add(SibHorizSizer, pos=(gRow, 2), span=(1, 1))

        gRow += 1
        shPnlSiz.Add(self.txSiteLLMsg,
            pos=(gRow, 0), span=(1, 3), flag=wx.ALIGN_LEFT|wx.LEFT|wx.BOTTOM, border=5)

        gRow += 1
        shPnlSiz.Add(wx.StaticLine(self), pos=(gRow, 0), span=(1, 3), 
            flag=wx.EXPAND|wx.BOTTOM, border=1)

        gRow += 1
        stAboutSLL = 'You only need to enter Station latitude and longitude if ' \
                'you want to override the Site latitude and longitude.'
        stWr1 = wordwrap(stAboutSLL, wordWrapWidth, wx.ClientDC(self))
        shPnlSiz.Add(wx.StaticText(self, -1, stWr1),
                     pos=(gRow, 0), span=(1, 3), flag=wx.TOP|wx.LEFT|wx.BOTTOM, border=5)

        gRow += 1
        shPnlSiz.Add(wx.StaticText(self, -1, 'Station latitude'),
            pos=(gRow, 0), span=(1, 1), flag=wx.ALIGN_RIGHT|wx.LEFT|wx.BOTTOM, border=5)
        self.tcLat = wx.TextCtrl(self)
        shPnlSiz.Add(self.tcLat, pos=(gRow, 1), span=(1, 2), 
            flag=wx.EXPAND|wx.LEFT|wx.RIGHT, border=5)

        gRow += 1
        shPnlSiz.Add(wx.StaticText(self, -1, 'Station longitude'),
            pos=(gRow, 0), span=(1, 1), flag=wx.ALIGN_RIGHT|wx.LEFT|wx.BOTTOM, border=5)
        self.tcLon = wx.TextCtrl(self)
        shPnlSiz.Add(self.tcLon, pos=(gRow, 1), span=(1, 2), 
            flag=wx.EXPAND|wx.LEFT|wx.RIGHT, border=5)

        gRow += 1
        self.btnSave = wx.Button(self, label="Save", size=(90, 28))
        self.btnSave.Bind(wx.EVT_BUTTON, lambda evt: self.onClick_BtnSave(evt))
        shPnlSiz.Add(self.btnSave, pos=(gRow, 0), flag=wx.LEFT|wx.BOTTOM, border=5)
        self.btnCancel = wx.Button(self, label="Cancel", size=(90, 28))
        self.btnCancel.Bind(wx.EVT_BUTTON, lambda evt: self.onClick_BtnCancel(evt))
        shPnlSiz.Add(self.btnCancel, pos=(gRow, 1), flag=wx.LEFT|wx.BOTTOM, border=5)

        self.SetSizer(shPnlSiz)
        self.SetAutoLayout(1)
        self.SetupScrolling()
Exemple #46
0
            dlg.Destroy()
        elif button.GetName() == 'btn_player_name':
            dlg = wx.TextEntryDialog(self, tr("new_name")+":", tr("player_name"), self.playerNameLabel.GetLabel())
            if dlg.ShowModal() == wx.ID_OK:
                newName = dlg.GetValue()
                self.playerNameLabel.SetLabel(newName)
                msgData = network.messages.getConfigUpdateMessage("player_name", str(newName))
                network.udpconnector.sendMessage(msgData, self.host)
                time.sleep(0.2)
                self.LoadConfig()
            dlg.Destroy()
        elif button.GetName() == 'btn_update':
            Publisher.subscribe(self.RebootComplete, 'boot_complete')

            self.prgDialog = wx.ProgressDialog("Updating...", wordwrap(tr("update_message"), 350, wx.ClientDC(self)))
            self.prgDialog.Pulse()

            msgData = network.messages.getMessage(PLAYER_UPDATE)
            network.udpconnector.sendMessage(msgData, self.host, UDP_UPDATE_TIMEOUT)
        elif button.GetName() == 'btn_setup_wifi':
            self.ShowWifiSettings()

    def ShowWifiSettings(self, event=None):
        wifiDlg = wifi.WifiDialog(self, -1, tr("wifi_settings"), self.host)
        wifiDlg.ShowModal()

    def RebootComplete(self):
        # print "SETTING FRAME - BOOT COMPLETE RECEIVED"
        self.prgDialog.Update(100)
        if platform.system() == "Windows":
Exemple #47
0
    def onPaint(self, event):
        if DEBUGGING: print('SetupStimuliDialog.onPaint()')

        event.Skip()
        dc = wx.PaintDC(self)
        dc.Clear()

        ### draw experimental & response stimuli
        for i in range(2):
            if i == 0:
                st = "es"
                dc.SetBrush(wx.Brush(wx.Colour(100, 100, 100)))
            elif i == 1:
                st = "rs"
                dc.SetBrush(wx.Brush(wx.Colour(50, 50, 50)))
            rects = self.return_val["rects_of_%s" % (st)]
            if rects != None:
                for idx in range(len(rects)):
                    sType = str(self.return_val["types_of_%s" %
                                                (st)][idx])  # stimulus type
                    r = rects[idx]
                    x = r[0]
                    y = r[1]
                    w = r[2]
                    h = r[3]
                    if sType != 'None':
                        sp = self.return_val["paths_of_%s" % (st)][idx][
                            0]  # first stimulus of the stimulus at 'idx'
                    if sType == 'None':
                        if w == -1: w = self.ds_sz[0]
                        if h == -1: h = self.ds_sz[1]
                        x = int(x * self.w_sz[0]) - w / 2
                        y = int(y * self.w_sz[1]) - h / 2
                        dc.DrawRectangle(x, y, w, h)
                    elif sType == 'txt':
                        if "_c" in sp:
                            sp = sp[:sp.find(
                                "_c")]  # cut off correct stimulus tag
                        font = self.parent.parent.base_script_font
                        dc.SetFont(font)
                        if w != -1:
                            sp = wordwrap(sp, w, dc)
                            nl = sp.count('\n') + 1
                            tSz = (w, font.GetPixelSize()[1] * nl)
                        else:
                            tSz = (font.GetPixelSize()[0] * len(sp),
                                   font.GetPixelSize()[1])
                        dc.SetBrush(wx.Brush(wx.Colour(50, 50, 50)))
                        x = x * self.parent.parent.w_sz[0] - tSz[0] / 2
                        y = y * self.parent.parent.w_sz[1] - tSz[1] / 2
                        dc.DrawText(sp, x, y)
                    elif sType in ['img', 'snd', 'mov']:
                        if sType == 'img': img = load_img(sp)
                        elif sType == 'snd':
                            img = load_img("input/img_musical_note.png")
                        elif sType == 'mov':
                            img = load_img("input/img_movie.png")
                        new_sz = list(img.GetSize())
                        if w != -1: new_sz[0] = w
                        if h != -1: new_sz[1] = h
                        if w != -1 or h != -1:
                            img = img.Rescale(new_sz[0], new_sz[1])
                        changed_img_sz = img.GetSize()
                        x = int(
                            x *
                            self.parent.parent.w_sz[0]) - changed_img_sz[0] / 2
                        y = int(
                            y *
                            self.parent.parent.w_sz[1]) - changed_img_sz[1] / 2
                        bmp = wx.Bitmap(img)
                        dc.DrawBitmap(bmp, x, y, True)
                    elif sType == 'slider':
                        if w == -1: w = 300
                        h = self.sliders[idx].GetSize()[1]
                        x = x * self.parent.parent.w_sz[0] - w / 2
                        y = y * self.parent.parent.w_sz[1] - h / 2
                        if self.sliders[idx] != None:
                            self.sliders[idx].SetPosition((x, y))
                            self.sliders[idx].SetSize((w, h))
Exemple #48
0
    def createButtons(self):
        """ Create buttons to be used in game """
        # Crate grid sizer for buttons
        self.btn_sizer = wx.GridSizer(rows=3, cols=3, vgap=0, hgap=0)

        # Create buttons for game
        size = (200, 200)
        self.btn1 = buttons.GenToggleButton(self,
                                            size=size,
                                            style=wx.NO_BORDER
                                            | wx.ALIGN_CENTRE)
        self.btn2 = buttons.GenToggleButton(self,
                                            size=size,
                                            style=wx.NO_BORDER)
        self.btn3 = buttons.GenToggleButton(self,
                                            size=size,
                                            style=wx.NO_BORDER)
        self.btn4 = buttons.GenToggleButton(self,
                                            size=size,
                                            style=wx.NO_BORDER)
        self.btn5 = buttons.GenToggleButton(self,
                                            size=size,
                                            style=wx.NO_BORDER)
        self.btn6 = buttons.GenToggleButton(self,
                                            size=size,
                                            style=wx.NO_BORDER)
        self.btn7 = buttons.GenToggleButton(self,
                                            size=size,
                                            style=wx.NO_BORDER)
        self.btn8 = buttons.GenToggleButton(self,
                                            size=size,
                                            style=wx.NO_BORDER)
        self.btn9 = buttons.GenToggleButton(self,
                                            size=size,
                                            style=wx.NO_BORDER)
        #self.btn9 = wx.Button(self, id=wx.ID_ANY, label="test", size=size, style=wx.NO_BORDER)
        #self.btn9 = wx.BitmapButton(self, wx.ID_ANY, self.contbmp, pos=(150,300), style=wx.NO_BORDER)

        #self.btn1.SetBackgroundColour("Blue")

        txt = "I'm as clever as you."
        wrapped_txt = wordwrap(txt, 200, wx.ClientDC(self))
        self.btn1.SetLabel(wrapped_txt)
        # Get normal button color
        self.normal_btn_color = self.btn1.GetBackgroundColour()

        # Add buttons to a list
        self.btn_list = [
            self.btn1, self.btn2, self.btn3, self.btn4, self.btn5, self.btn6,
            self.btn7, self.btn8, self.btn9
        ]

        # Horizontal Wins
        self.btn_wins = [
            (self.btn1, self.btn2, self.btn3),
            (self.btn4, self.btn5, self.btn6),
            (self.btn7, self.btn8, self.btn9),
            # Vertical Wins
            (self.btn1, self.btn4, self.btn7),
            (self.btn2, self.btn5, self.btn8),
            (self.btn3, self.btn6, self.btn9),
            # Diagnol wins
            (self.btn1, self.btn5, self.btn9),
            (self.btn3, self.btn5, self.btn7)
        ]

        # Add buttons to btn_sizer and set font for each button
        for btn in self.btn_list:
            btn.SetFont(self.btn_font)
            #btn.setBackgroundColor("#9aeafe")
            self.btn_sizer.Add(btn)
            self.Bind(wx.EVT_BUTTON, self.onToggle, btn)

        self.restart_btn = wx.Button(self, -1, "Restart Game")
Exemple #49
0
 def _getInstructions(self):
     instr = self.configuration['tasks'][self.current]['instructions'] if 'instructions' in self.configuration['tasks'][self.current] else ''
     return wordwrap(instr, self.GetClientSize()[0] - 10, wx.ClientDC(self))
Exemple #50
0
 def OnAbout(self, evt):
     info = wx.AboutDialogInfo()
     info = afinfo.getInfo(info)
     info.Description = wordwrap(info.Description, 350, wx.ClientDC(self))
     info.License = wordwrap(info.Licence, 500, wx.ClientDC(self))
     wx.AboutBox(info)
Exemple #51
0
    def __init__(self, parent, ID=-1, title="About " + APP_NAME):
        AboutDialog.__init__(self, parent, ID, title)
        self.set_program_name(APP_NAME + " - a wxPython port of Synfig Studio")
        self.set_version("Python: " + sys.version[0:6] + ", wx: " +
                         wx.version())
        self.set_comment("2D vector animation studio")
        self.set_website("http://synfig.org/")
        self.set_copyright(
            "Copyright 2001-2013\nRobert B. Quattlebaum Jr.,\nAdrian Bentley and Synfig contributors"
        )
        license = wordwrap(
            "This program is free software; you can redistribute it and/or modify "
            "it under the terms of the GNU General Public License as published by "
            "the Free Software Foundation; either version 2 of the License, or "
            "(at your option) any later version.\n\n"
            "This program is distributed in the hope that it will be useful, "
            "but WITHOUT ANY WARRANTY; without even the implied warranty of "
            "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the "
            "GNU General Public License for more details.\n\n"
            "You should have received a copy of the GNU General Public License along "
            "with this program; if not, write to the Free Software Foundation, Inc., "
            "51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or visit: http://www.gnu.org/",
            550, wx.ClientDC(self))
        self.set_license(license)

        authors = []
        authors.append("wxSynfig Developer:")
        authors.append("")
        authors.append("Austin Aigbe")
        authors.append("")
        authors.append("Original developers of Synfig:")
        authors.append("")
        authors.append("Robert B. Quattlebaum Jr (darco)")
        authors.append("Adrian Bentley")
        authors.append("")
        authors.append("Contributors:")
        authors.append("")
        authors.append("Adrian Winchell (SnapSilverlight)")
        authors.append("Andreas Jochens")
        authors.append("Brendon Higgins")
        authors.append("Carlos López González (genete)")
        authors.append("Carlos A. Sosa Navarro")
        authors.append("Chris Moore (dooglus)")
        authors.append("Chris Norman (pixelgeek)")
        authors.append("Cyril Brulebois (KiBi)")
        authors.append("Daniel Fort")
        authors.append("Daniel Hornung (rubikcube)")
        authors.append("David Roden (Bombe)")
        authors.append("Denis Zdorovtsov (trizer)")
        authors.append("Dmitriy Pomerantsev (Atrus)")
        authors.append("Douglas Lau")
        authors.append("Evgenij Katunov")
        authors.append("Gerald Young (Yoyobuae)")
        authors.append("Gerco Ballintijn")
        authors.append("IL'dar AKHmetgaleev (AkhIL)")
        authors.append("Ivan Mahonin")
        authors.append("Jerome Blanchi (d.j.a.y.)")
        authors.append("Konstantin Dmitriev (zelgadis)")
        authors.append("Luka Pravica")
        authors.append("Nikita Kitaev (nikitakit)")
        authors.append("Martin Michlmayr (tbm)")
        authors.append("Max May (Permutatrix)")
        authors.append("Miguel Gea Milvaques (xerakko)")
        authors.append("Paul Wise (pabs)")
        authors.append("Ralf Corsepius")
        authors.append("Ramon Miranda")
        authors.append("Ray Frederikson")
        authors.append("Timo Paulssen (timonator)")
        authors.append("Yu Chen (jcome)")
        authors.append("Yue Shi Lai")
        self.set_authors(authors)

        artists = []
        artists.append("Aurore D (rore)")
        artists.append("Bertrand Grégoire (berteh)")
        artists.append("Carl-Christian Gehl (Razputin)")
        artists.append("Carlos López González (genete)")
        artists.append("Chris Norman (pixelgeek)")
        artists.append("Daniel Hornung (rubikcube)")
        artists.append("David Rylander (rylleman)")
        artists.append("Franco Iacomella (Yaco)")
        artists.append("Gerald Young (Yoyobuae)")
        artists.append("Henrique Lopes Barone")
        artists.append("Konstantin Dmitriev (zelgadis)")
        artists.append("Madeleine Crubellier (mad0)")
        artists.append("Nikolai Mamashev (solkap)")
        artists.append("Robert B. Quattlebaum Jr. (darco)")
        artists.append("Thimotee Guiet (satrip)")
        artists.append("Yu Chen (jcome)")
        self.set_artists(artists)

        self.CenterOnScreen()
 def OnUpdateProgress(self, event):
     self.thread_proc.queue = self.thread_proc.queue - 1
     self.gauge.Pulse()
     wrp = wordwrap(event.info_str, self.GetSize()[0], wx.ClientDC(self))
     self.info.SetLabel(wrp)
Exemple #53
0
    def Draw(self, grid, attr, dc, rect, row, col, isSelected):
        self.grid = grid

        # Dessine le fond
        couleur_fond = self.GetCouleur()
        dc.SetBackgroundMode(wx.SOLID)
        dc.SetBrush(wx.Brush(couleur_fond, wx.SOLID))
        dc.SetPen(wx.TRANSPARENT_PEN)
        if 'phoenix' in wx.PlatformInfo:
            dc.DrawRectangle(rect)
        else:
            dc.DrawRectangleRect(rect)

        dc.SetBackgroundMode(wx.TRANSPARENT)
        dc.SetFont(attr.GetFont())

        # Ecrit la suggestion
        if self.case.suggestion != None:
            texte = str(self.case.suggestion)

            dc.SetFont(
                wx.Font(8, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL,
                        wx.FONTWEIGHT_NORMAL, False, 'Arial'))
            dc.SetBrush(wx.Brush(wx.Colour(245, 245, 245)))
            dc.SetPen(wx.TRANSPARENT_PEN)
            dc.SetTextForeground(wx.Colour(170, 170, 170))

            # Calculs
            largeurTexte, hauteurTexte = dc.GetTextExtent(texte)

            # Rond rouge
            padding = 1
            xRond = rect.x + 3
            yRond = rect.y + 3
            hauteurRond = hauteurTexte + padding * 2
            largeurRond = largeurTexte + padding * 2 + hauteurRond / 2.0
            if largeurRond < hauteurRond:
                largeurRond = hauteurRond

            if 'phoenix' in wx.PlatformInfo:
                dc.DrawRoundedRectangle(
                    wx.Rect(xRond, yRond, largeurRond, hauteurRond),
                    hauteurRond / 2.0)
            else:
                dc.DrawRoundedRectangleRect(
                    wx.Rect(xRond, yRond, largeurRond, hauteurRond),
                    hauteurRond / 2.0)

            # Texte
            xTexte = xRond + largeurRond / 2.0 - largeurTexte / 2.0
            yTexte = yRond + hauteurRond / 2.0 - hauteurTexte / 2.0
            dc.DrawText(texte, xTexte, yTexte)

            # dc.SetTextForeground(wx.Colour(180, 180, 180))
            # dc.DrawText(texte, rect.x + 5, rect.y + 2)

        # Ecrit la valeur
        texte = grid.GetCellValue(row, col)
        texte = texte.replace("<b>", "")
        texte = texte.replace("</b>", "")

        dc.SetTextForeground(wx.Colour(0, 0, 0))

        if "numerique" in self.case.categorieColonne:
            dc.SetFont(
                wx.Font(10, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL,
                        wx.FONTWEIGHT_NORMAL, False, 'Arial'))
            largeurTexte, hauteurTexte = dc.GetTextExtent(texte)
            dc.DrawText(texte, rect.x + rect.width - 10 - largeurTexte,
                        rect.y + rect.height / 2.0 - hauteurTexte / 2.0)

        if "texte" in self.case.categorieColonne:
            tailleFont = 7
            dc.SetFont(
                wx.Font(tailleFont, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL,
                        wx.FONTWEIGHT_NORMAL, False, 'Arial'))
            texte = wordwrap.wordwrap(texte, rect.width, dc)
            y = rect.y + 2
            hauteurLigne = tailleFont + 3
            listeLignes = texte.split("\n")
            indexLigne = 0
            for ligne in listeLignes:
                dc.DrawText(ligne, rect.x + 3, y)
                y += hauteurLigne
                if (y + hauteurLigne) >= (rect.y + rect.height):
                    if indexLigne < len(listeLignes) - 1:
                        dc.DrawText("...", rect.x + rect.width - 10,
                                    rect.y + rect.height - 12)
                    break
                indexLigne += 1
Exemple #54
0
    def DrawText(self, dc):
        """Draws the ticker text at the current offset using the provided DC"""
        defaultFont = self.GetFont()
        dc.SetFont(defaultFont)

        # Extrait le titre s'il y en a un
        titre = u""
        try:
            if self._text.startswith("<t>") and "</t>" in self._text:
                position = self._text.index("</t>")
                titre = self._text[3:position]
                texte = self._text[position + 4:]
            else:
                texte = self._text
        except:
            texte = ""

        # Adapte la longueur du texte
        texte = wordwrap(texte, self.GetSize()[0], dc, breakLongWords=True)
        self.UpdateExtent(dc, texte)

        # Calcule le décalage à appliquer
        y = self.GetSize()[1] - self.decalage

        # Titre
        self.headingHeight = 0
        if len(titre) > 0:

            # Titre - Style 1
            if self.headingStyle == 1:
                dc.SetBrush(wx.Brush((200, 200, 200)))
                dc.SetPen(wx.TRANSPARENT_PEN)
                dc.DrawRectangle(0, y + 8, dc.GetTextExtent(titre)[0] + 20, 10)
                dc.SetFont(wx.Font(6, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, ""))
                dc.SetTextForeground(self.GetBackgroundColour())
                dc.DrawText(titre, 10, y + 6)
                self.headingHeight = 21

            # Titre - Style 2
            if self.headingStyle == 2:
                dc.SetBrush(wx.Brush((200, 200, 200)))
                dc.SetPen(wx.TRANSPARENT_PEN)
                dc.SetFont(wx.Font(6, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, ""))
                dc.DrawRectangle(0, y + 13, dc.GetTextExtent(titre)[0] + 15, 1)
                dc.SetTextForeground((200, 200, 200))
                dc.DrawText(titre, 0, y)
                self.headingHeight = 16

            # Titre - Style 3
            if self.headingStyle == 3:
                dc.SetBrush(wx.Brush((200, 200, 200)))
                dc.SetPen(wx.Pen((200, 200, 200)))
                dc.SetFont(wx.Font(6, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, ""))
                largeurTitre, hauteurTitre = dc.GetTextExtent(titre)
                yTitre = 7
                dc.DrawLine(0, y + yTitre, 10, y + yTitre)
                dc.DrawLine(largeurTitre + 14, y + yTitre, largeurTitre + 24,
                            y + yTitre)
                dc.SetTextForeground((200, 200, 200))
                dc.DrawText(titre, 12, y)
                self.headingHeight = 14

            # Titre - Style 4
            if self.headingStyle == 4:
                dc.SetBrush(wx.Brush((200, 200, 200)))
                dc.SetPen(wx.Pen((200, 200, 200)))
                dc.SetFont(wx.Font(6, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, ""))
                dc.DrawRectangle(2, y + 5, 3, 3)
                dc.SetTextForeground((200, 200, 200))
                dc.DrawText(titre, 7, y)
                self.headingHeight = 12

            # Titre - Style 5
            if self.headingStyle == 5:
                dc.SetFont(wx.Font(6, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, ""))
                dc.SetTextForeground((200, 200, 200))
                dc.DrawText(titre, 0, y)
                self.headingHeight = 13

        # Texte
        dc.SetTextForeground(self.GetForegroundColour())
        dc.SetFont(defaultFont)
        dc.DrawLabel(
            texte,
            wx.Rect(x=0,
                    y=y + self.headingHeight,
                    width=self.GetSize()[0],
                    height=self.GetSize()[1]))
    def __init__(self, parent, id=-1):
        wx.Panel.__init__(self, parent, id)
        main_sizer = wx.BoxSizer(wx.VERTICAL)
        self.SetSizer(main_sizer)

        btn_ok = wx.Button(self, wx.ID_OK)
        btn_cancel = wx.Button(self, wx.ID_CANCEL)
        btn_ok.SetDefault()
        sizer_btn = wx.BoxSizer(wx.HORIZONTAL)
        sizer_btn.Add(btn_ok, 0, wx.ALL | wx.EXPAND, 5)
        sizer_btn.Add(wx.BoxSizer(), 1, wx.ALL | wx.EXPAND, 5)
        sizer_btn.Add(btn_cancel, 0, wx.ALL | wx.EXPAND, 5)

        plt_list = [
            'Select Pollutant', 'E_ALD', 'E_CO', 'E_CSL', 'E_ECI', 'E_ECJ',
            'E_ETH', 'E_HC3', 'E_HC5', 'E_HC8', 'E_HCHO', 'E_ISO', 'E_KET',
            'E_NH3', 'E_NO', 'E_NO3I', 'E_NO3J', 'E_OL2', 'E_OLI', 'E_OLT',
            'E_ORA2', 'E_ORGI', 'E_ORGJ', 'E_PM25I', 'E_PM25J', 'E_PM_10',
            'E_SO2', 'E_SO4I', 'E_SO4J', 'E_TOL', 'E_XYL'
        ]
        self.plt_list = plt_list
        self.choice_plt = wx.ComboBox(self, -1, choices=plt_list)
        self.choice_plt.SetSelection(0)
        txt_label = wx.StaticText(self, -1, "Pollutant: ")
        sizer_plt = wx.BoxSizer(wx.HORIZONTAL)
        sizer_plt.Add(txt_label, 1, wx.ALL | wx.EXPAND, 5)
        sizer_plt.Add(self.choice_plt, 2, wx.ALL | wx.EXPAND, 5)

        self.sheet_list = []
        self.choice_sheet = wx.Choice(self, -1, choices=self.sheet_list)
        txt_sheet_label = wx.StaticText(self, -1, "Worksheet: ")
        sizer_sheet = wx.BoxSizer(wx.HORIZONTAL)
        sizer_sheet.Add(txt_sheet_label, 1, wx.ALL | wx.EXPAND, 5)
        sizer_sheet.Add(self.choice_sheet, 2, wx.ALL | wx.EXPAND, 5)

        self.te_conv_f = commons.GrayTextCtrl(
            self,
            -1,
            'Default value: 1.0)',
            validator=commons.EvalNumberTextValidator(True))
        sizer_conv_header = wx.BoxSizer(wx.HORIZONTAL)
        sizer_conv_header.Add(wx.StaticText(self, -1, "Conversion Factor "), 0,
                              wx.ALL | wx.EXPAND, 0)
        sizer_conv_header.Add(wx.StaticLine(self, -1), 1, wx.CENTER, 5)

        self.te_row_start = commons.GrayTextCtrl(
            self,
            -1,
            'Starting Row (e.g.: 2)',
            validator=commons.NumberTextValidator())
        self.te_row_end = commons.GrayTextCtrl(
            self,
            -1,
            'Ending Row (e.g.: 101)',
            validator=commons.NumberTextValidator())
        sizer_sz = wx.BoxSizer(wx.HORIZONTAL)
        sizer_sz.Add(self.te_row_start, 1, wx.ALL | wx.EXPAND, 5)
        sizer_sz.Add(self.te_row_end, 1, wx.ALL | wx.EXPAND, 5)
        sizer_sz_header = wx.BoxSizer(wx.HORIZONTAL)
        sizer_sz_header.Add(wx.StaticText(self, -1, "Data Rows "), 0,
                            wx.ALL | wx.EXPAND, 0)
        sizer_sz_header.Add(wx.StaticLine(self, -1), 1, wx.CENTER, 5)

        self.te_emiss_column = commons.GrayTextCtrl(
            self,
            -1,
            'Column (e.g. A)',
            validator=commons.AlphaTextValidator())
        sizer_emiss_header = wx.BoxSizer(wx.HORIZONTAL)
        sizer_emiss_header.Add(wx.StaticText(self, -1, "Emission Column "), 0,
                               wx.ALL | wx.EXPAND, 0)
        sizer_emiss_header.Add(wx.StaticLine(self, -1), 1, wx.CENTER, 5)

        self.te_lat_column = commons.GrayTextCtrl(
            self,
            -1,
            'Column (e.g. B)',
            validator=commons.AlphaTextValidator())
        sizer_lat_header = wx.BoxSizer(wx.HORIZONTAL)
        sizer_lat_header.Add(wx.StaticText(self, -1, "Latitude Column "), 0,
                             wx.ALL | wx.EXPAND, 0)
        sizer_lat_header.Add(wx.StaticLine(self, -1), 1, wx.CENTER, 5)
        self.te_lon_column = commons.GrayTextCtrl(
            self,
            -1,
            'Column (e.g. C)',
            validator=commons.AlphaTextValidator())
        sizer_lon_header = wx.BoxSizer(wx.HORIZONTAL)
        sizer_lon_header.Add(wx.StaticText(self, -1, "Longitude Column "), 0,
                             wx.ALL | wx.EXPAND, 0)
        sizer_lon_header.Add(wx.StaticLine(self, -1), 1, wx.CENTER, 5)

        self.te_x_column = commons.GrayTextCtrl(
            self,
            -1,
            'Column (e.g. D)',
            validator=commons.AlphaTextValidator())
        sizer_x_header = wx.BoxSizer(wx.HORIZONTAL)
        sizer_x_header.Add(wx.StaticText(self, -1, "X Column "), 0,
                           wx.ALL | wx.EXPAND, 0)
        sizer_x_header.Add(wx.StaticLine(self, -1), 1, wx.CENTER, 5)
        self.te_y_column = commons.GrayTextCtrl(
            self,
            -1,
            'Column (e.g. E)',
            validator=commons.AlphaTextValidator())
        sizer_y_header = wx.BoxSizer(wx.HORIZONTAL)
        sizer_y_header.Add(wx.StaticText(self, -1, "Y Column "), 0,
                           wx.ALL | wx.EXPAND, 0)
        sizer_y_header.Add(wx.StaticLine(self, -1), 1, wx.CENTER, 5)

        main_sizer.Add(sizer_plt, 0, wx.ALL | wx.EXPAND, 0)
        main_sizer.Add(sizer_sheet, 0, wx.ALL | wx.EXPAND, 0)
        txt_desc = wordwrap(
            u"Use conversion factor to convert unit to mol/km\u00b2/hour", 300,
            wx.ClientDC(self))
        main_sizer.Add(wx.StaticText(self, -1, txt_desc), 0,
                       wx.ALL | wx.EXPAND, 5)

        main_sizer.Add(sizer_conv_header, 0, wx.ALL | wx.EXPAND, 5)
        main_sizer.Add(self.te_conv_f, 0, wx.ALL | wx.EXPAND, 5)
        main_sizer.Add(sizer_sz_header, 0, wx.ALL | wx.EXPAND, 5)
        main_sizer.Add(sizer_sz, 0, wx.ALL | wx.EXPAND, 0)
        main_sizer.Add(sizer_emiss_header, 0, wx.ALL | wx.EXPAND, 5)
        main_sizer.Add(self.te_emiss_column, 0, wx.ALL | wx.EXPAND, 5)
        main_sizer.Add(sizer_lat_header, 0, wx.ALL | wx.EXPAND, 5)
        main_sizer.Add(self.te_lat_column, 0, wx.ALL | wx.EXPAND, 5)
        main_sizer.Add(sizer_lon_header, 0, wx.ALL | wx.EXPAND, 5)
        main_sizer.Add(self.te_lon_column, 0, wx.ALL | wx.EXPAND, 5)
        main_sizer.Add(sizer_x_header, 0, wx.ALL | wx.EXPAND, 5)
        main_sizer.Add(self.te_x_column, 0, wx.ALL | wx.EXPAND, 5)
        main_sizer.Add(sizer_y_header, 0, wx.ALL | wx.EXPAND, 5)
        main_sizer.Add(self.te_y_column, 0, wx.ALL | wx.EXPAND, 5)
        main_sizer.Add(wx.StaticLine(self, -1), 1, wx.ALL | wx.EXPAND, 5)
        main_sizer.Add(sizer_btn, 0, wx.ALL | wx.EXPAND, 0)

        self.Bind(wx.EVT_BUTTON, self.OnOk, btn_ok)
Exemple #56
0
    def __init__(self, parent, torrents):
        canEdit = False
        single = len(torrents) == 1
        if single and torrents[0].hasChannel():
            state = torrents[0].channel.getState()
            canEdit = state >= ChannelCommunity.CHANNEL_OPEN

        wx.Dialog.__init__(
            self,
            parent,
            -1,
            'Are you sure you want to remove the selected torrent%s?' %
            ('' if single else 's'),
            size=(600, -1),
            name="RemoveTorrent")
        bitmap = wx.ArtProvider.GetBitmap(wx.ART_QUESTION, wx.ART_MESSAGE_BOX)
        hSizer = wx.BoxSizer(wx.HORIZONTAL)
        hSizer.Add(wx.StaticBitmap(self, -1, bitmap), 0, wx.RIGHT, 10)

        vSizer = wx.BoxSizer(wx.VERTICAL)
        firstLine = StaticText(self, -1, '')
        _set_font(firstLine, fontweight=wx.FONTWEIGHT_BOLD)
        if single:
            firstLineMsg = "Delete '%s' from disk, or just remove it from your downloads?" % torrents[
                0].name
        else:
            firstLineMsg = "Delete %s torrents from disk, or just remove them from your downloads?" % len(
                torrents)
        cdc = wx.ClientDC(firstLine)
        cdc.SetFont(firstLine.GetFont())
        firstLineMsg = wordwrap(firstLineMsg,
                                self.GetSize()[0] - bitmap.GetSize()[0] - 30,
                                cdc,
                                breakLongWords=True,
                                margin=0)
        firstLine.SetLabel(firstLineMsg)
        firstLine.SetMinSize((1, -1))
        vSizer.Add(firstLine, 0, wx.EXPAND | wx.BOTTOM, 3)
        vSizer.Add(
            StaticText(
                self, -1,
                "Removing from disk will move the selected item%s to your trash."
                % ('' if single else 's')), 0, wx.EXPAND)

        vSizer.AddStretchSpacer()

        self.newName = None
        if single and canEdit:
            vSizer.Add(
                StaticText(
                    self, -1,
                    "While we're at it, can you improve the name of this torrent?"
                ), 0, wx.EXPAND | wx.BOTTOM, 3)
            self.newName = EditText(self, torrents[0].name)
            vSizer.Add(self.newName, 0, wx.EXPAND)
            vSizer.AddStretchSpacer()

        bSizer = wx.BoxSizer(wx.HORIZONTAL)
        bSizer.AddStretchSpacer()

        bSizer.Add(wx.Button(self, wx.ID_CANCEL), 0, wx.RIGHT, 3)
        bSizer.Add(
            wx.Button(self, wx.ID_DEFAULT, 'Only delete from downloads'), 0,
            wx.RIGHT, 3)
        bSizer.Add(wx.Button(self, wx.ID_DELETE, 'Also delete from disk'))

        vSizer.Add(bSizer, 0, wx.ALIGN_RIGHT | wx.TOP, 7)
        hSizer.Add(vSizer, 1, wx.EXPAND)

        border = wx.BoxSizer()
        border.Add(hSizer, 1, wx.ALL | wx.EXPAND, 10)

        self.Bind(wx.EVT_BUTTON, lambda event: self.EndModal(event.GetId()))
        self.SetSizer(border)
        self.SetSize((-1, self.GetBestSize()[1]))
        self.Layout()
        self.CenterOnParent()
Exemple #57
0
    def Draw(self, grid, dc, rect, col):
        # Couleur de fond
        if self.couleurFond != None:
            dc.SetBrush(wx.Brush(self.couleurFond))
            dc.SetPen(wx.TRANSPARENT_PEN)
            dc.DrawRectangleRect(rect)

        # Label


##        if self.font == None :
##            self.font = dc.GetFont()
##            dc.SetFont(self.font)
        dc.SetFont(
            wx.Font(9, wx.FONTFAMILY_DEFAULT, wx.FONTSTYLE_NORMAL,
                    wx.FONTWEIGHT_BOLD))
        hAlign, vAlign = grid.GetColLabelAlignment()
        texte = grid.GetColLabelValue(col)
        texte = wordwrap.wordwrap(texte, rect.width, dc)
        self.DrawBorder(grid, dc, rect)
        largTexte, hautTexte = dc.GetTextExtent(texte)
        x = rect.width / 2.0 - largTexte / 2.0 + rect.x
        dc.DrawText(texte, x, 2)

        # Graduations
        padding = PADDING_MULTIHORAIRES["horizontal"]

        graduationMin = UTILS_Dates.HeuresEnDecimal(self.heure_min)
        graduationMax = UTILS_Dates.HeuresEnDecimal(self.heure_max)
        graduationStep = 25
        hautTraitHeures = 4
        hautTraitDHeures = 2.5
        hautTraitQHeures = 1

        if graduationMax == 0: graduationMax = 2400

        # Initialisation pour la graduation
        listeGraduations = range(graduationMin, graduationMax + graduationStep,
                                 graduationStep)
        nbreGraduations = len(listeGraduations)
        largeurDc = rect.width - padding * 2
        step = largeurDc / round(nbreGraduations - 1, 1)

        # Création de la graduation
        j = k = 0
        i = rect.x

        posY = rect.height - 17

        dc.SetPen(wx.Pen("black"))
        dc.SetTextForeground("black")
        dc.SetFont(wx.Font(7, wx.SWISS, wx.NORMAL, wx.NORMAL))

        for etape in range(nbreGraduations):

            if k == 4: k = 0
            if k == 1 or k == 3:
                hauteurTrait = hautTraitQHeures  # 1/4 d'heures
            if k == 2: hauteurTrait = hautTraitDHeures  # Demi-Heures
            if k == 0:
                hauteurTrait = hautTraitHeures
                texte = str(listeGraduations[j] / 100) + "h"
                largTexte, hautTexte = dc.GetTextExtent(texte)
                # Dessin du texte
                if step >= 4.0:
                    dc.DrawText(texte, i - (largTexte / 2) + padding, posY + 2)
            # Dessin du trait
            dc.DrawLine(i + padding,
                        posY + hautTexte + hautTraitHeures - hauteurTrait,
                        i + padding, posY + hautTexte + hautTraitHeures)
            i = i + step
            j = j + 1
            k = k + 1