dialogs/AboutDialog.py
changeset 3909 c29a95aebfbf
parent 3906 f831ff63ca6e
equal deleted inserted replaced
3907:394c130196b0 3909:c29a95aebfbf
     1 #!/usr/bin/env python
     1 #!/usr/bin/env python
     2 # -*- coding: utf-8 -*-
     2 # -*- coding: utf-8 -*-
     3 
     3 
     4 # This file is part of Beremiz, a Integrated Development Environment for
       
     5 # programming IEC 61131-3 automates supporting plcopen standard and CanFestival.
       
     6 # This file is based on code written for Whyteboard project.
       
     7 #
       
     8 # Copyright (c) 2009, 2010 by Steven Sproat
     4 # Copyright (c) 2009, 2010 by Steven Sproat
     9 # Copyright (c) 2016 by Andrey Skvortsov <andrej.skvortzov@gmail.com>
     5 # Copyright (c) 2016 by Andrey Skvortsov <andrej.skvortzov@gmail.com>
    10 #
     6 # Copyright (c) 2024 by Edouard Tisserant
       
     7 
    11 # See COPYING file for copyrights details.
     8 # See COPYING file for copyrights details.
    12 #
       
    13 # This program is free software; you can redistribute it and/or
       
    14 # modify it under the terms of the GNU General Public License
       
    15 # as published by the Free Software Foundation; either version 2
       
    16 # of the License, or (at your option) any later version.
       
    17 #
       
    18 # This program is distributed in the hope that it will be useful,
       
    19 # but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    21 # GNU General Public License for more details.
       
    22 #
       
    23 # You should have received a copy of the GNU General Public License
       
    24 # along with this program; if not, write to the Free Software
       
    25 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
       
    26 #
       
    27 
       
    28 
       
    29 """
       
    30 This module contains classes extended from wx.Dialog used by the GUI.
       
    31 """
       
    32 
       
    33 
       
    34 
     9 
    35 import os
    10 import os
    36 import wx
    11 import wx
    37 import wx.adv
    12 import wx.adv
    38 from wx.lib.agw.hyperlink import HyperLinkCtrl
    13 from wx.lib.agw.hyperlink import HyperLinkCtrl
    39 
    14 
    40 
    15 
    41 class AboutDialog(wx.Dialog):
    16 class AboutDialog(wx.Dialog):
    42     """
    17     """
    43     A replacement About Dialog for Windows, as it uses a generic frame that
    18     Simpler replacement of About Dialog that shows LongVersion
    44     well...sucks.
       
    45     """
    19     """
    46     def __init__(self, parent, info):
    20     def __init__(self, parent, info):
    47         title = _("About") + " " + info.Name
    21         title = _("About") + " " + info.Name
    48         wx.Dialog.__init__(self, parent, title=title)
    22         wx.Dialog.__init__(self, parent, title=title)
    49         self.info = info
    23         self.info = info
   171 
   145 
   172         close.Bind(wx.EVT_BUTTON, lambda evt: self.Destroy())
   146         close.Bind(wx.EVT_BUTTON, lambda evt: self.Destroy())
   173 
   147 
   174 
   148 
   175 def ShowAboutDialog(parent, info):
   149 def ShowAboutDialog(parent, info):
   176     if os.name == "nt":
   150     AboutDialog(parent, info)
   177         AboutDialog(parent, info)
       
   178     else:
       
   179         wx.adv.AboutBox(info)