Fix about dialog

This commit is contained in:
Marcel Stör 2016-12-29 01:01:12 +01:00
parent 1f71d3af2b
commit 4400a20988
5 changed files with 38 additions and 49 deletions

View File

@ -1,74 +1,63 @@
import sys
import wx # This module uses the new wx namespace # coding=utf-8
import wx
import wx.html import wx.html
import wx.lib.wxpTag import wx.lib.wxpTag
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
class MyAboutBox(wx.Dialog): class MyAboutBox(wx.Dialog):
text = ''' text = '''
<html> <html>
<body bgcolor="#AC76DE"> <body>
<center><table bgcolor="#458154" width="100%%" cellspacing="0" <style>
cellpadding="0" border="1"> body {
<tr> font-family: Arial
<td align="center"> }
<h1>wxPython %s</h1> a {
(%s)<br> color: #004CE5
Running on Python %s<br> }
</td> </style>
</tr> <center>
</table> <img src="images/python-256.png" width="64" height="64">
<img src="images/icon-256.png" width="64" height="64">
<img src="images/espressif-256.png" width="64" height="64">
<img src="images/wxpython-256.png" width="64" height="43">
<p><b>wxPython</b> is a Python extension module that <h1>NodeMCU PyFlasher</h1>
encapsulates the wxWindows GUI classes.</p>
<p>This demo shows off some of the capabilities <p>Version %s</p>
of <b>wxPython</b>. Select items from the menu or tree control,
sit back and enjoy. Be sure to take a peek at the source code for each
demo item so you can learn how to use the classes yourself.</p>
<p><b>wxPython</b> is brought to you by <b>Robin Dunn</b> and<br> <p>Fork the <a href="https://github.com/marcelstoer/nodemcu-pyflasher">project on GitHub</a> and help improve it
<b>Total Control Software,</b> Copyright (c) 1997-2011.</p> for all!</p>
<p>© 2016-2017 Marcel Stör. Licensed under MIT.</p>
<p> <p>
<font size="-1">Please see <i>license.txt</i> for licensing information.</font> <wxp module="wx" class="Button">
</p> <param name="label" value="Close">
<p><wxp module="wx" class="Button">
<param name="label" value="Okay">
<param name="id" value="ID_OK"> <param name="id" value="ID_OK">
</wxp></p> </wxp>
</p>
</center> </center>
</body> </body>
</html> </html>
''' '''
def __init__(self, parent):
wx.Dialog.__init__(self, parent, -1, 'About the wxPython demo',) def __init__(self, parent, version):
wx.Dialog.__init__(self, parent, -1, "About NodeMCU PyFlasher")
html = wx.html.HtmlWindow(self, -1, size=(420, -1)) html = wx.html.HtmlWindow(self, -1, size=(420, -1))
if "gtk2" in wx.PlatformInfo or "gtk3" in wx.PlatformInfo: if "gtk2" in wx.PlatformInfo or "gtk3" in wx.PlatformInfo:
html.SetStandardFonts() html.SetStandardFonts()
py_version = sys.version.split()[0] txt = self.text % version
txt = self.text % (wx.VERSION_STRING,
", ".join(wx.PlatformInfo[1:]),
py_version
)
html.SetPage(txt) html.SetPage(txt)
btn = html.FindWindowById(wx.ID_OK)
ir = html.GetInternalRepresentation() ir = html.GetInternalRepresentation()
html.SetSize((ir.GetWidth() + 25, ir.GetHeight() + 25)) html.SetSize((ir.GetWidth() + 25, ir.GetHeight() + 25))
self.SetClientSize(html.GetSize()) self.SetClientSize(html.GetSize())
self.CentreOnParent(wx.BOTH) self.CentreOnParent(wx.BOTH)
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
if __name__ == '__main__':
app = wx.App()
dlg = MyAboutBox(None)
dlg.ShowModal()
dlg.Destroy()
app.MainLoop()

View File

@ -263,7 +263,7 @@ class NodeMcuFlasher(wx.Frame):
def __on_help_about(self, event): def __on_help_about(self, event):
from About import MyAboutBox from About import MyAboutBox
about = MyAboutBox(self) about = MyAboutBox(self, __version__)
about.ShowModal() about.ShowModal()
about.Destroy() about.Destroy()

BIN
images/espressif-256.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

BIN
images/python-256.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
images/wxpython-256.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB