OSDN Git Service

Merge branch 'hotfix/singleton_with_db_accessor_generator_problem'
[amulettoolsmh4/main.git] / view / mainframeview.py
1 # -*- coding: utf-8 -*-
2
3 # GUIのメインフレーム
4 # 2013/12/15 written by kei9
5 import wx
6 from wx import xrc
7 import wx.grid
8
9 import constnumbers
10 from notebookflowview import NoteBookFlowView
11 from notebooksettingview import NoteBookSettingView
12 from notebookseed1view import NoteBookSeed1View
13 from notebookseed2view import NoteBookSeed2View
14 from notebookskill2view import NoteBookSkill2View
15 from notebookskill1view import NoteBookSkill1View
16 from notebookamuletview import NoteBookAmuletView
17 from notebookalchemysimulatorview import NoteBookAlchemySimulatorView
18
19 class MainFrameView():
20     u""" メインのフレームクラス """
21     def __init__(self, filename):
22         self.res = wx.xrc.XmlResource(filename)
23         self._init_frame()
24
25     def _init_frame(self):
26         # load controls
27         self.frame = self.res.LoadFrame(None, "MainFrame")
28         self.note_book = xrc.XRCCTRL(self.frame, "NoteBookMain")
29
30         # menu
31         self.ID_MENU_ITEM_EXIT = xrc.XRCID("wxID_EXIT") # same as wx.ID_EXIT
32         self.ID_MENU_ITEM_ABOUT = xrc.XRCID("wxID_ABOUT") # same as wx.ID_ABOUT
33         self.ID_MENU_MEMO = xrc.XRCID("MenuItemMemo") # open memo dialog
34
35         # seed1 decision view
36         self.notebook_seed1_view = NoteBookSeed1View(self.frame)
37
38         # seed2 decision view
39         self.notebook_seed2_view = NoteBookSeed2View(self.frame)
40
41         # skill2 search from seed2 view
42         self.notebook_skill2_view = NoteBookSkill2View(self.frame)
43
44         # skill2 search from seed2 view
45         self.notebook_skill1_view = NoteBookSkill1View(self.frame)
46
47         # simulator view
48         self.notebook_simulator_view = NoteBookAlchemySimulatorView(self.frame)
49
50         # amulet view
51         self.notebook_amulet_view = NoteBookAmuletView(self.frame)
52
53         # flow view
54         self.notebook_flow_view = NoteBookFlowView(self.frame)
55
56         # setting view
57         self.notebook_setting_view = NoteBookSettingView(self.frame)
58
59     def Show(self):
60         self.frame.Show()
61
62     def Close(self):
63         self.frame.Close(True)
64
65     def DisableNoteBook(self):
66         self.note_book.Disable()
67
68     def EnableNoteBook(self):
69         self.note_book.Enable()
70
71     def OnAboutBox(self, evt):
72         u""" Show About Box """
73         info = wx.AboutDialogInfo()
74         info.Name = constnumbers.NAME
75         info.Version = constnumbers.VERSION
76         info.Copyright = constnumbers.COPYRIGHT
77         info.Description = constnumbers.DESCRIPTION
78         info.WebSite = (constnumbers.WEBSITE_LINK, constnumbers.WEBSITE_TEXT)
79         info.Developers = constnumbers.DEVELOPERS
80         info.License = constnumbers.LICENSE_TEXT
81         wx.AboutBox(info)
82
83         # amulet view
84         self.notebook_amulet_view = NoteBookAmuletView(self.frame)
85
86         # flow view
87         self.notebook_flow_view = NoteBookFlowView(self.frame)
88
89         # setting view
90         self.notebook_setting_view = NoteBookSettingView(self.frame)
91
92     def Show(self):
93         self.frame.Show()
94
95     def Close(self):
96         self.frame.Close(True)
97
98     def DisableNoteBook(self):
99         self.note_book.Disable()
100
101     def EnableNoteBook(self):
102         self.note_book.Enable()
103
104     def OnAboutBox(self, evt):
105         u""" Show About Box """
106         info = wx.AboutDialogInfo()
107         info.Name = constnumbers.NAME
108         info.Version = constnumbers.VERSION
109         info.Copyright = constnumbers.COPYRIGHT
110         info.Description = constnumbers.DESCRIPTION
111         info.WebSite = (constnumbers.WEBSITE_LINK, constnumbers.WEBSITE_TEXT)
112         info.Developers = constnumbers.DEVELOPERS
113         info.License = constnumbers.LICENSE_TEXT
114         wx.AboutBox(info)
115
116         # amulet view
117         self.notebook_amulet_view = NoteBookAmuletView(self.frame)
118
119         # flow view
120         self.notebook_flow_view = NoteBookFlowView(self.frame)
121
122         # setting view
123         self.notebook_setting_view = NoteBookSettingView(self.frame)
124
125     def Show(self):
126         self.frame.Show()
127
128     def Close(self):
129         self.frame.Close(True)
130
131     def DisableNoteBook(self):
132         self.note_book.Disable()
133
134     def EnableNoteBook(self):
135         self.note_book.Enable()
136
137     def OnAboutBox(self, evt):
138         u""" Show About Box """
139         info = wx.AboutDialogInfo()
140         info.Name = constnumbers.NAME
141         info.Version = constnumbers.VERSION
142         info.Copyright = constnumbers.COPYRIGHT
143         info.Description = constnumbers.DESCRIPTION
144         info.WebSite = (constnumbers.WEBSITE_LINK, constnumbers.WEBSITE_TEXT)
145         info.Developers = constnumbers.DEVELOPERS
146         info.License = constnumbers.LICENSE_TEXT
147         wx.AboutBox(info)
148
149     def GetAboutInfo(self):
150         u""" create About info """
151         info = wx.AboutDialogInfo()
152         info.Name = constnumbers.NAME
153         info.Version = constnumbers.VERSION
154         info.Copyright = constnumbers.COPYRIGHT
155         info.Description = constnumbers.DESCRIPTION
156         info.WebSite = (constnumbers.WEBSITE_LINK, constnumbers.WEBSITE_TEXT)
157         info.Developers = constnumbers.DEVELOPERS
158         info.License = constnumbers.LICENSE_TEXT
159         return info
160
161 if __name__ == "__main__":
162     app = wx.App(False)
163     mainframe = MainFrameView(u"mainframe.xrc")
164     mainframe.Show()
165     app.MainLoop()