Skip to content

Commit

Permalink
Merge pull request #15 from fronzbot/add-about-menu
Browse files Browse the repository at this point in the history
Add About Menu
  • Loading branch information
fronzbot authored Oct 30, 2023
2 parents 713d6a5 + 99fdf7b commit 21e8071
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ build-backend = "setuptools.build_meta"
[project]
name = "wafer-view"
version = "1.0.0-alpha"
license = "Apache-2.0"
license = {file = "LICENSE"}
description = "An open source semi.org xml wafer viewer"
readme = "README.rst"
authors = [
{name = "Kevin Fronczak", email = "[email protected]"},
{name = "Kevin Fronczak", email = "[email protected]"}
]
maintainers = [
{name = "Kevin Fronczak", email = "[email protected]"},
Expand Down
59 changes: 59 additions & 0 deletions waferview/gui/gui.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
"""GUI module."""
import importlib.metadata
import wx
import wx.adv
import wx.lib.scrolledpanel as scrolled
from waferview.gui import semimap
from waferview.gui import constants

__version__ = importlib.metadata.version("wafer-view")


def run():
"""Run the GUI."""
Expand Down Expand Up @@ -194,6 +198,61 @@ def initialize(self):
filemenu.Append(wx.ID_EXIT, "E&xit\tAlt-X", "Close window and exit program")
self.parent.Bind(wx.EVT_MENU, self.file_browser, id=wx.ID_OPEN)

helpmenu = wx.Menu()
self.Append(helpmenu, "&Help")
helpmenu.Append(wx.ID_ABOUT, "", "About Waferview")
self.parent.Bind(wx.EVT_MENU, self.about_screen, id=wx.ID_ABOUT)

def about_screen(self, event):
"""Open the About dialog on event."""
about = wx.Frame(None, title="About Waferview")
panel = wx.Panel(about, 0)

sizer_top = wx.BoxSizer(wx.VERTICAL)
flex_sizer = wx.FlexGridSizer(1, 6, 2)

title_font = wx.Font(wx.FontInfo(16).Bold())

title_str = wx.StaticText(
panel,
label="Wafer View: Open Source Wafer Map Viewer",
style=wx.ALIGN_CENTER,
)
version_str = wx.StaticText(
panel, label=f"Version: {__version__}", style=wx.ALIGN_CENTER
)
license_str = wx.StaticText(
panel, label="License: Apache 2.0", style=wx.ALIGN_CENTER
)
author_str = wx.StaticText(
panel,
label="Author: Kevin Fronczak <[email protected]>",
style=wx.ALIGN_CENTER,
)
source_str = wx.adv.HyperlinkCtrl(
panel,
label="View Source Code",
url="https://github.com/fronzbot/wafer-view",
)
copy_str = wx.StaticText(panel, label="(c) 2023", style=wx.ALIGN_CENTER)

title_str.SetFont(title_font)

flex_sizer.AddMany(
[
(title_str, 1, wx.ALIGN_CENTER),
(version_str, 1, wx.ALIGN_CENTER),
(license_str, 1, wx.ALIGN_LEFT),
(author_str, 1, wx.ALIGN_LEFT),
(source_str, 1, wx.ALIGN_CENTER),
(copy_str, 1, wx.ALIGN_CENTER),
]
)
sizer_top.Add(flex_sizer, 0, wx.ALL | wx.EXPAND, border=constants.BORDER_SIZE)
panel.SetSizerAndFit(sizer_top)
about.Centre()
about.Show()

def file_browser(self, event):
"""Open the file browser on event."""
with wx.FileDialog(
Expand Down

0 comments on commit 21e8071

Please sign in to comment.