-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsummary.py
More file actions
125 lines (97 loc) · 4.34 KB
/
Copy pathsummary.py
File metadata and controls
125 lines (97 loc) · 4.34 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# summary.py -
import wx
#-------------------------------------------------------------------------------
# SummaryDialog
#-------------------------------------------------------------------------------
class SummaryDialog(wx.Dialog):
def __init__(self, filename=None, values=None):
super(SummaryDialog, self).__init__(None)
self.SetSize((550, 250))
self.SetTitle(f'Summary of file {filename}')
# Spacings
left_pad = 15
top_pad = 15
horiz_spacing = 10
interline = 5
lbl_font = wx.Font(9, wx.DEFAULT, wx.NORMAL, wx.BOLD)
vbox = wx.BoxSizer(wx.VERTICAL)
# Banner
b = wx.BoxSizer(wx.HORIZONTAL)
t = wx.StaticText(self, -1, label='Banner : ')
t.SetFont(lbl_font)
b.Add(t, flag=wx.LEFT, border=left_pad)
t = wx.StaticText(self, -1, label=f" {values['banner']}", style=wx.BORDER_SIMPLE)
# t = wx.RichTextCtrl(self)
# t.Freeze()
# t.WriteText(values['banner'])
# t.Thaw()
# t.SetMargins((3, 3))
t.SetBackgroundColour('white')
b.Add(t, flag=wx.LEFT, border=horiz_spacing)
vbox.Add(b, proportion=0, flag=wx.TOP, border=top_pad)
# Data cell
b = wx.BoxSizer(wx.HORIZONTAL)
t = wx.StaticText(self, -1, label=values['data_cell'])
t.SetBackgroundColour('white')
b.Add(t, flag=wx.LEFT, border=left_pad)
t = wx.StaticText(self, -1, label=values['states'])
t.SetBackgroundColour('white')
b.Add(t, flag=wx.LEFT, border=horiz_spacing)
t = wx.StaticText(self, -1, label=values['src_date'])
t.SetBackgroundColour('white')
b.Add(t, flag=wx.LEFT, border=horiz_spacing)
t = wx.StaticText(self, -1, label=values['qualifier'])
t.SetBackgroundColour('white')
b.Add(t, flag=wx.LEFT, border=horiz_spacing)
t = wx.StaticText(self, -1, label=values['scale'])
t.SetBackgroundColour('white')
b.Add(t, flag=wx.LEFT, border=horiz_spacing)
t = wx.StaticText(self, -1, label=values['section'])
t.SetBackgroundColour('white')
b.Add(t, flag=wx.LEFT, border=horiz_spacing)
vbox.Add(b, proportion=0, flag=wx.TOP, border=interline)
# Category
b = wx.BoxSizer(wx.HORIZONTAL)
t = wx.StaticText(self, -1, label='Category : ')
t.SetFont(lbl_font)
b.Add(t, flag=wx.LEFT, border=left_pad)
t = wx.StaticText(self, -1, label=f" {values['category']} ", style=wx.BORDER_SIMPLE)
t.SetBackgroundColour('white')
b.Add(t, flag=wx.LEFT, border=horiz_spacing)
vbox.Add(b, proportion=0, flag=wx.TOP, border=interline)
# Nodes
b = wx.BoxSizer(wx.HORIZONTAL)
b.Add(wx.StaticText(self, -1, label='Nodes : '), flag=wx.LEFT, border=left_pad)
t = wx.StaticText(self, -1, label=str(values['nb_nodes']))
t.SetBackgroundColour('white')
b.Add(t)
vbox.Add(b, proportion=0, flag=wx.TOP, border=interline)
# Areas
b = wx.BoxSizer(wx.HORIZONTAL)
b.Add(wx.StaticText(self, -1, label='Areas : '), flag=wx.LEFT, border=left_pad)
t = wx.StaticText(self, -1, label=str(values['nb_areas']))
t.SetBackgroundColour('white')
b.Add(t)
vbox.Add(b, proportion=0, flag=wx.TOP, border=interline)
# Lines
b = wx.BoxSizer(wx.HORIZONTAL)
b.Add(wx.StaticText(self, -1, label='Lines : '), flag=wx.LEFT, border=left_pad)
t = wx.StaticText(self, -1, label=str(values['nb_lines']))
t.SetBackgroundColour('white')
b.Add(t)
vbox.Add(b, proportion=0, flag=wx.TOP, border=interline)
# button
b = wx.BoxSizer(wx.HORIZONTAL)
btn = wx.Button(self, label='Close')
btn.Bind(wx.EVT_BUTTON, self.OnClose)
b.Add(btn, flag=wx.LEFT, border=left_pad)
vbox.Add(b, proportion=0, flag=wx.TOP, border=interline)
self.SetSizer(vbox)
self.Layout()
def OnClose(self, e):
self.Destroy()
#===============================================================================
# main
#===============================================================================
if __name__ == '__main__':
print('This module is not meant to be executed directly.')