OSDN Git Service

Merge branch 'feature/add_threshould2_table_&_seed1_table' into develop
[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 notebookamuletview import NoteBookAmuletView
16
17 class MainFrameView():
18     u""" メインのフレームクラス """
19     def __init__(self, filename):
20         self.res = wx.xrc.XmlResource(filename)
21         self._init_frame()
22
23     def _init_frame(self):
24         # load controls
25         self.frame = self.res.LoadFrame(None, "MainFrame")
26         self.note_book = xrc.XRCCTRL(self.frame, "NoteBookMain")
27
28         # menu
29         self.ID_MENU_ITEM_EXIT = xrc.XRCID("wxID_EXIT") # same as wx.ID_EXIT
30         self.ID_MENU_ITEM_ABOUT = xrc.XRCID("wxID_ABOUT") # same as wx.ID_ABOUT
31
32         # seed1 decision view
33         self.notebook_seed1_view = NoteBookSeed1View(self.frame)
34
35         # seed2 decision view
36         self.notebook_seed2_view = NoteBookSeed2View(self.frame)
37
38         # skill2 search from seed2 view
39         self.notebook_skill2_view = NoteBookSkill2View(self.frame)
40
41         # amulet view
42         self.notebook_amulet_view = NoteBookAmuletView(self.frame)
43
44         # flow view
45         self.notebook_flow_view = NoteBookFlowView(self.frame)
46
47         # setting view
48         self.notebook_setting_view = NoteBookSettingView(self.frame)
49
50     def Show(self):
51         self.frame.Show()
52
53     def Close(self):
54         self.frame.Close(True)
55
56     def DisableNoteBook(self):
57         self.note_book.Disable()
58
59     def EnableNoteBook(self):
60         self.note_book.Enable()
61
62     def OnAboutBox(self, evt):
63         u""" Show About Box """
64         info = wx.AboutDialogInfo()
65         info.Name = constnumbers.NAME
66         info.Version = constnumbers.VERSION
67         info.Copyright = constnumbers.COPYRIGHT
68         info.Description = constnumbers.DESCRIPTION
69         info.WebSite = (constnumbers.WEBSITE_LINK, constnumbers.WEBSITE_TEXT)
70         info.Developers = constnumbers.DEVELOPERS
71         info.License = constnumbers.LICENSE_TEXT
72         wx.AboutBox(info)
73
74     def GetAboutInfo(self):
75         u""" create About info """
76         info = wx.AboutDialogInfo()
77         info.Name = constnumbers.NAME
78         info.Version = constnumbers.VERSION
79         info.Copyright = constnumbers.COPYRIGHT
80         info.Description = constnumbers.DESCRIPTION
81         info.WebSite = (constnumbers.WEBSITE_LINK, constnumbers.WEBSITE_TEXT)
82         info.Developers = constnumbers.DEVELOPERS
83         info.License = constnumbers.LICENSE_TEXT
84         return info
85
86 if __name__ == "__main__":
87     app = wx.App(False)
88     mainframe = MainFrameView(u"mainframe.xrc")
89     mainframe.Show()
90     app.MainLoop()