OSDN Git Service

add alchemy simulator
[amulettoolsmh4/main.git] / view / memodialogview.py
1 # -*- coding: utf-8 -*-
2
3 # メモ入力用ダイアログ
4 # 2013/12/20 written by kei9
5 import wx
6 from wx import xrc
7
8 import constnumbers
9 import singleton
10
11 class MemoDialogView(object):
12     u""" メモ入力用ダイアログ """
13     __metaclass__ = singleton.Singleton
14     def __init__(self, filename):
15         self.res = wx.xrc.XmlResource(filename)
16         self._init_dialog()
17
18     def _init_dialog(self):
19         # load controls
20         self.dialog = self.res.LoadDialog(None, "MemoDialog")
21         self.text = xrc.XRCCTRL(self.dialog, "TextCtrlMemo")
22         self.button = xrc.XRCCTRL(self.dialog, "wxID_OK")
23
24         self.ID_BUTTON_OK = xrc.XRCID("wxID_OK")
25         # "self.ID_BUTTON_OK" same as "wx.ID_OK"
26
27     def Show(self):
28         self.ret_code = self.dialog.Show()
29         return self.ret_code
30
31     def Hide(self):
32         self.dialog.Hide()
33
34     def ShowModal(self):
35         self.ret_code = self.dialog.ShowModal()
36         return self.ret_code
37
38     def Destroy(self):
39         self.dialog.Destroy()
40