1 /////////////////////////////////////////////////////////////////////////////
 
   3 // Purpose:     SWIG interface for wxAboutDialog
 
   7 // Created:     08-Oct-2006
 
   9 // Copyright:   (c) 2006 by Total Control Software
 
  10 // Licence:     wxWindows license
 
  11 /////////////////////////////////////////////////////////////////////////////
 
  16 #include <wx/aboutdlg.h>
 
  19 //---------------------------------------------------------------------------
 
  23 DocStr(wxAboutDialogInfo,
 
  24 "`wx.AboutDialogInfo` contains information to be shown in the standard
 
  25 About dialog displayed by the `wx.AboutBox` function.  This class
 
  26 contains the general information about the program, such as its name,
 
  27 version, copyright and so on, as well as lists of the program
 
  28 developers, documentation writers, artists and translators.
 
  30 While all the main platforms have a native implementation of the about
 
  31 dialog, they are often more limited than the generic version provided
 
  32 by wxWidgets and so the generic version is used if
 
  33 `wx.AboutDialogInfo` has any fields not supported by the native
 
  34 version. Currently GTK+ version supports all the possible fields
 
  35 natively but MSW and Mac versions don't support URLs, licence text nor
 
  36 custom icons in the about dialog and if either of those is used,
 
  37 wxAboutBox() will automatically use the generic version so you should
 
  38 avoid specifying these fields to achieve more native look and feel.
 
  41 class wxAboutDialogInfo
 
  48         void , SetName(const wxString& name),
 
  49         "Set the name of the program. If this method is not called, the string
 
  50 returned by `wx.App.GetAppName` will be shown in the dialog.", "");
 
  53         wxString , GetName() const,
 
  54         "Returns the program name.", "");
 
  56     %property(Name, GetName, SetName);
 
  59         void , SetVersion(const wxString& version),
 
  60         "Set the version of the program. The version is in free format,
 
  61 i.e. not necessarily in the x.y.z form but it shouldn't contain the
 
  62 \"version\" word.", "");
 
  65         bool , HasVersion() const,
 
  66         "Returns ``True`` if the version property has been set.", "");
 
  69         wxString , GetVersion() const,
 
  70         "Returns the version value.", "");
 
  72     %property(Version, GetVersion, SetVersion);
 
  76         void , SetDescription(const wxString& desc),
 
  77         "Set brief, but possibly multiline, description of the program.", "");
 
  80         bool , HasDescription() const,
 
  81         "Returns ``True`` if the description property has been set.", "");
 
  84         wxString , GetDescription() const,
 
  85         "Returns the description value.", "");
 
  87     %property(Description, GetDescription, SetDescription);
 
  91         void , SetCopyright(const wxString& copyright),
 
  92         "Set the short string containing the program copyright
 
  93 information. Notice that any occurrences of \"(C)\" in ``copyright``
 
  94 will be replaced by the copyright symbol (circled C) automatically,
 
  95 which means that you can avoid using this symbol in the program source
 
  96 code which can be problematic.", "");
 
  99         bool , HasCopyright() const,
 
 100         "Returns ``True`` if the copyright property has been set.", "");
 
 103         wxString , GetCopyright() const,
 
 104         "Returns the copyright value.", "");
 
 106     %property(Copyright, GetCopyright, SetCopyright);
 
 110         void , SetLicence(const wxString& licence),
 
 111         "Set the long, multiline string containing the text of the program
 
 114 Only GTK+ version supports showing the licence text in the native
 
 115 about dialog currently so the generic version will be used under all
 
 116 the other platforms if this method is called. To preserve the native
 
 117 look and feel it is advised that you do not call this method but
 
 118 provide a separate menu item in the \"Help\" menu for displaying the
 
 119 text of your program licence.
 
 123         void , SetLicense(const wxString& licence),
 
 124         "This is the same as `SetLicence`.", "");
 
 127         bool , HasLicence() const,
 
 128         "Returns ``True`` if the licence property has been set.", "");
 
 131         wxString , GetLicence() const,
 
 132         "Returns the licence value.", "");
 
 134     %property(Licence, GetLicence, SetLicence);
 
 135     %pythoncode { License = Licence }
 
 139         void , SetIcon(const wxIcon& icon),
 
 140         "Set the icon to be shown in the dialog. By default the icon of the
 
 141 main frame will be shown if the native about dialog supports custom
 
 142 icons. If it doesn't but a valid icon is specified using this method,
 
 143 the generic about dialog is used instead so you should avoid calling
 
 144 this function for maximally native look and feel.", "");
 
 147         bool , HasIcon() const,
 
 148         "Returns ``True`` if the icon property has been set.", "");
 
 151         wxIcon , GetIcon() const,
 
 152         "Return the current icon value.", "");
 
 154     %property(Icon, GetIcon, SetIcon);    
 
 157     // web site for the program and its description (defaults to URL itself if
 
 160             void , SetWebSite(const wxString& url, const wxString& desc = wxEmptyString));
 
 161     %Rename(_GetWebSiteURL,
 
 162             wxString , GetWebSiteURL() const);
 
 163     %Rename(_GetWebSiteDescription,
 
 164             wxString , GetWebSiteDescription() const);
 
 165     bool HasWebSite() const;
 
 168         def SetWebSite(self, args):
 
 170             SetWebSite(self, URL, [Description])
 
 172             Set the web site property.  The ``args`` parameter can
 
 173             either be a single string for the URL, to a 2-tuple of
 
 174             (URL, Description) strings.
 
 176             if type(args) in [str, unicode]:
 
 177                 self._SetWebSite(args)
 
 179                 self._SetWebSite(args[0], args[1])
 
 181         def GetWebSite(self):
 
 183             GetWebSite(self) --> (URL, Description)
 
 185             return (self._GetWebSiteURL(), self._GetWebSiteDescription())
 
 187     %property(WebSite, GetWebSite, SetWebSite)
 
 192         void , SetDevelopers(const wxArrayString& developers),
 
 193         "SetDevelopers(self, list developers)",
 
 194         "Set the list of the developers of the program.", "");
 
 197         void , AddDeveloper(const wxString& developer),
 
 198         "Add a string to the list of developers.", "");
 
 201         bool , HasDevelopers() const,
 
 202         "Returns ``True if any developers have been set.", "");
 
 205         const wxArrayString& , GetDevelopers() const,
 
 206         "GetDevelopers(self) --> list",
 
 207         "Returns the list of developers.", "");
 
 209     %property(Developers, GetDevelopers, SetDevelopers);
 
 213         void , SetDocWriters(const wxArrayString& docwriters),
 
 214         "SetDocWriters(self, list docwriters)",
 
 215         "Set the list of the documentation writers.", "");
 
 218         void , AddDocWriter(const wxString& docwriter),
 
 219         "Add a string to the list of documentation writers.", "");
 
 222         bool , HasDocWriters() const,
 
 223         "Returns ``True if any documentation writers have been set.", "");
 
 226         const wxArrayString& , GetDocWriters() const,
 
 227         "GetDocWriters(self) --> list",
 
 228         "Returns the list of documentation writers.", "");
 
 230     %property(DocWriters, GetDocWriters, SetDocWriters);
 
 234         void , SetArtists(const wxArrayString& artists),
 
 235         "SetArtists(self, list artists)", 
 
 236         "Set the list of artists for the program.", "");
 
 239         void , AddArtist(const wxString& artist),
 
 240         "Add a string to the list of artists.", "");
 
 243         bool , HasArtists() const,
 
 244         "Returns ``True`` if any artists have been set.", "");
 
 247         const wxArrayString& , GetArtists() const,
 
 248         "GetArtists(self) --> list",
 
 249         "Returns the list od artists.", "");
 
 251     %property(Artists, GetArtists, SetArtists);
 
 256         void , SetTranslators(const wxArrayString& translators),
 
 257         "SetTranslators(self, list translators)",
 
 258         "Sets the list of program translators.", "");
 
 261         void , AddTranslator(const wxString& translator),
 
 262         "Add a string to the list of translators.", "");
 
 265         bool , HasTranslators() const,
 
 266         "Returns ``True`` if any translators have been set.", "");
 
 269         const wxArrayString& , GetTranslators() const,
 
 270         "GetTranslators(self) --> list",
 
 271         "Returns the list of program translators.", "");
 
 273     %property(Translators, GetTranslators, SetTranslators);
 
 276     // implementation only
 
 277     // -------------------
 
 279     // "simple" about dialog shows only textual information (with possibly
 
 280     // default icon but without hyperlink nor any long texts such as the
 
 282     bool IsSimple() const;
 
 284     // get the description and credits (i.e. all of developers, doc writers,
 
 285     // artists and translators) as a one long multiline string
 
 286     wxString GetDescriptionAndCredits() const;
 
 293        "This function shows the standard about dialog containing the
 
 294 information specified in ``info``. If the current platform has a
 
 295 native about dialog which is capable of showing all the fields in
 
 296 `wx.AboutDialogInfo`, the native dialog is used, otherwise the
 
 297 function falls back to the generic wxWidgets version of the dialog.", "");
 
 299 void wxAboutBox(const wxAboutDialogInfo& info);
 
 302 //---------------------------------------------------------------------------