2019-09-24 14:46:02 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
#
|
|
|
|
# RoarWindowMelp.py
|
|
|
|
# Copyright (c) 2018, 2019 Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de>
|
|
|
|
#
|
|
|
|
|
|
|
|
import os, wx
|
|
|
|
|
|
|
|
class RoarWindowMelp(wx.Dialog):
|
|
|
|
def onButtonRoar(self, event):
|
|
|
|
self.Destroy()
|
|
|
|
|
|
|
|
def __init__(self, parent, minSize=(320, 300), title="melp?"):
|
|
|
|
super().__init__(parent, size=minSize, title=title)
|
|
|
|
self.panel, self.sizer = wx.Panel(self), wx.BoxSizer(wx.VERTICAL)
|
2019-10-24 19:14:00 +00:00
|
|
|
self.panel.SetBackgroundColour(wx.Colour(0, 0, 0)); self.panel.SetForegroundColour(wx.Colour(0, 187, 0));
|
2019-09-24 14:46:02 +00:00
|
|
|
|
2019-09-28 10:08:52 +00:00
|
|
|
with open(os.path.join("assets", "text", "melp.txt"), "r") as fileObject:
|
2019-09-24 14:46:02 +00:00
|
|
|
helpLabel = "".join(fileObject.readlines())
|
|
|
|
self.title = wx.StaticText(self.panel, label=helpLabel, style=wx.ALIGN_LEFT)
|
|
|
|
self.title.SetFont(wx.Font(8, wx.MODERN, wx.NORMAL, wx.NORMAL, underline=False))
|
2019-09-24 14:59:51 +00:00
|
|
|
self.buttonRoar = wx.Button(self.panel, label="&explodes.")
|
2019-09-24 14:46:02 +00:00
|
|
|
self.buttonRoar.Bind(wx.EVT_BUTTON, self.onButtonRoar)
|
|
|
|
self.sizer.AddMany(((self.title, 1, wx.ALL | wx.CENTER | wx.EXPAND, 4), (self.buttonRoar, 0, wx.ALL | wx.CENTER, 4),))
|
|
|
|
self.panel.SetSizerAndFit(self.sizer)
|
|
|
|
newSize = self.sizer.ComputeFittingWindowSize(self)
|
2019-10-01 19:34:42 +00:00
|
|
|
self.SetSize((newSize[0] + 128, newSize[1],)); self.Center();
|
2019-09-24 14:46:02 +00:00
|
|
|
self.SetTitle(title)
|
|
|
|
|
|
|
|
self.ShowModal()
|
|
|
|
|
|
|
|
# vim:expandtab foldmethod=marker sw=4 ts=4 tw=120
|