Package pallavi :: Package plugins :: Module AboutDialog
[hide private]
[frames] | no frames]

Source Code for Module pallavi.plugins.AboutDialog

 1  # Copyright (c) 2006-2007 Dusty Phillips 
 2   
 3  # Permission is hereby granted, free of charge, to any person obtaining a 
 4  # copy of this software and associated documentation files (the "Software"), 
 5  # to deal in the Software without restriction, including without limitation 
 6  # the rights to use, copy, modify, merge, publish, distribute, sublicense, 
 7  # and/or sell copies of the Software, and to permit persons to whom the 
 8  # Software is furnished to do so, subject to the following conditions: 
 9   
10  # The above copyright notice and this permission notice shall be included in 
11  # all copies or substantial portions of the Software. 
12   
13  # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
14  # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
15  # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
16  # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
17  # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
18  # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
19  # DEALINGS IN THE SOFTWARE. 
20   
21  '''Plugin provides an action to display a simple about Dialog. 
22  Also adds the button to a menubar if one exists 
23   
24  This plugin provides the following actions: 
25  ShowAboutDialog 
26          Display a simple about dialog 
27           
28  This plugin invokes the following actions: 
29  BindMenuAction 
30          Bind the action to a help menu''' 
31           
32  from pallavi.EventActionManager import Action 
33  import wx 
34  from wx.lib.wordwrap import wordwrap 
35           
36 -def setup():
37 actions.AddAction(Action("ShowAboutDialog", ShowAbout, "About", "Display an About Dialog box for Pallavi")) 38 actions.Invoke('BindMenuAction', "&Help", "ShowAboutDialog")
39
40 -def ShowAbout():
41 info = wx.AboutDialogInfo() 42 info.Name = "Pallavi" 43 info.Version = "0.6" 44 info.Copyright = "(C) 2006-2007 Dusty Phillips" 45 info.Description = wordwrap( 46 "Pallavi is an extremely versatile and extensible text editor" 47 " written in Python using the wxPython toolkit. The primary" 48 " focus is to keep the core very small and streamlined, while" 49 " providing an extensible plugin mechanism and widely varied" 50 " set of plugins to allow the system to be used for anything" 51 " anything from a simple Notepad replacement to a full-fledged" 52 " integrated development environment for development in any" 53 " language.", 54 350, wx.ClientDC(pallavi.focusedView)) 55 info.WebSite = ("http://pallavi.sourceforge.net/", "Pallavi home page") 56 info.Developers = [ "Dusty Phillips <dusty@buchuki.com>" ] 57 58 info.License = wordwrap( 59 "Permission is hereby granted, free of charge, to any person obtaining a" 60 " copy of this software and associated documentation files (the \"Software\")," 61 " to deal in the Software without restriction, including without limitation" 62 " the rights to use, copy, modify, merge, publish, distribute, sublicense," 63 " and/or sell copies of the Software, and to permit persons to whom the" 64 " Software is furnished to do so, subject to the following conditions:" 65 "\n\n" 66 " The above copyright notice and this permission notice shall be included in" 67 " all copies or substantial portions of the Software." 68 "\n\n" 69 " THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR" 70 " IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY," 71 " FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL" 72 " THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER" 73 " LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING" 74 " FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER" 75 " DEALINGS IN THE SOFTWARE.", 76 500, wx.ClientDC(pallavi.focusedView)) 77 78 # Then we call wx.AboutBox giving it that info object 79 wx.AboutBox(info)
80