-
Notifications
You must be signed in to change notification settings - Fork 2
/
message.py
74 lines (54 loc) · 2.11 KB
/
message.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import sys
import os.path
import setpath
import hmrlib.lib as lib
import clr
import System.Array
clr.AddReference('System.Windows.Forms')
clr.AddReference('System.Drawing')
from System.Drawing import Color, Font, FontStyle, Point, Size
from System.Windows.Forms import (Application, BorderStyle, Button, CheckBox, Form, Label, Panel, RadioButton, ComboBox, TextBox)
def message_window(input = "Everything's fine"):
class DebugWindow(Form):
def __init__(self):
self.Text = "Message"
self.Width = 750
self.Height = 850
self.setupMessageWindow()
self.setupOKButtons()
self.Controls.Add(self.MessageWindow)
self.Controls.Add(self.OKbuttonPanel)
def bigPanel(self, x, y):
panel = Panel()
panel.Width = 750
panel.Height = 700
panel.Location = Point(x, y)
panel.BorderStyle = BorderStyle.None
return panel
def miniPanel(self, x, y):
panel = Panel()
panel.Width = 750
panel.Height = 150
panel.Location = Point(x, y)
panel.BorderStyle = BorderStyle.None
return panel
def setupMessageWindow(self):
self.MessageWindow = self.bigPanel(0, 0)
self.Label1 = Label()
self.Label1.Text = input
self.Label1.Location = Point(25, 25)
self.Label1.Font = Font("Arial", 10)
self.Label1.AutoSize = True
self.MessageWindow.Controls.Add(self.Label1)
def cancelClicked(self, sender, args):
self.Close()
def setupOKButtons(self):
self.OKbuttonPanel = self.miniPanel(0, 750)
cancelButton = Button()
cancelButton.Text = "Cancel"
cancelButton.Location = Point(25,25)
self.CancelButton = cancelButton
cancelButton.Click += self.cancelClicked
self.OKbuttonPanel.Controls.Add(cancelButton)
form = DebugWindow()
Application.Run(form)