fork download
  1. <?xml version="1.0"?>
  2. <!-- generated by wxGlade 1.0.4 on Tue Apr 25 15:07:09 2023 -->
  3.  
  4. <application class="SimpleDatabase" encoding="UTF-8" for_version="3.0" header_extension=".h" indent_amount="4" indent_symbol="space" is_template="0" language="python" mark_blocks="1" name="SimpleDatabase" option="0" overwrite="1" path="./wxglade_out.py" source_extension=".cpp" top_window="View" use_gettext="0" use_new_namespace="1">
  5. <object class="View" name="View" base="EditFrame">
  6. <extracode>from pubsub import pub\nfrom simple_database import Env, install_package, interp\nimport sys\n\nclass Controller(object):\n def __init__(self):\n pub.subscribe(self.read, "Controller")\n self.table = {"OnNewFile": "new_file",\n "OnOpen": "open_file",\n "OnSaveFile": "save_file",\n "OnSaveFileAs": "save_file_as",\n "OnQuit": "quit",\n "OnAddCD": "insert_value",\n "Delete": "delete"}\n def read(self, x, env):\n pub.sendMessage("Model.eval",\n x = [self.table[x[0]]] + x[1:],\n env = env)\n\nclass Model(object):\n def __init__(self):\n pub.subscribe(self.eval, "Model")\n def eval(self, x, env):\n pub.sendMessage("View.SetProperties", env = interp(x, env))\n\n</extracode>
  7. <extracode_pre>self.env = Env(install_package())</extracode_pre>
  8. <extracode_post>pub.subscribe(self.SetProperties, 'View')</extracode_post>
  9. <size>400, 300</size>
  10. <title>Simple Database</title>
  11. <style>wxDEFAULT_FRAME_STYLE</style>
  12. <menubar>1</menubar>
  13. <object class="wxMenuBar" name="frame_menubar" base="EditMenuBar">
  14. <menus>
  15. <menu label="ファイル" name="">
  16. <item>
  17. <label>新規作成 Ctrl+N</label>
  18. <handler>lambda event: OnNewFile(self)</handler>
  19. </item>
  20. <item>
  21. <label>開く... Ctrl+O</label>
  22. <handler>lambda event: OnOpen(self)</handler>
  23. </item>
  24. <item>
  25. <label>保存 Ctrl+S</label>
  26. <handler>lambda event: pub.sendMessage('Controller.read', x = ['OnSaveFile'], env = self.env)</handler>
  27. </item>
  28. <item>
  29. <label>名前を付けて保存... Shift+Ctrl+S</label>
  30. <handler>lambda event: OnSaveAs(self)</handler>
  31. </item>
  32. <item>
  33. <label>Quit Ctrl+Q</label>
  34. <handler>lambda event: pub.sendMessage('Controller.read', x = ['OnQuit'], env = self.env)</handler>
  35. </item>
  36. </menu>
  37. </menus>
  38. </object>
  39. <object class="wxBoxSizer" name="sizer_1" base="EditBoxSizer">
  40. <orient>wxVERTICAL</orient>
  41. <object class="sizeritem">
  42. <option>0</option>
  43. <border>0</border>
  44. <object class="wxButton" name="AddCD" base="EditButton">
  45. <events>
  46. <handler event="EVT_BUTTON">lambda event: AddCDDialog(self).ShowModal()</handler>
  47. </events>
  48. <label>AddCD</label>
  49. </object>
  50. </object>
  51. <object class="sizeritem">
  52. <option>1</option>
  53. <border>0</border>
  54. <flag>wxEXPAND</flag>
  55. <object class="wxListCtrl" name="list_ctrl_1" base="EditListCtrl">
  56. <events>
  57. <handler event="EVT_LIST_ITEM_RIGHT_CLICK">rclick</handler>
  58. </events>
  59. <style>wxLC_REPORT|wxLC_HRULES|wxLC_VRULES</style>
  60. <columns>
  61. <column size="-1">タイトル</column>
  62. <column size="-1">アーティスト</column>
  63. <column size="-1">レーティング</column>
  64. <column size="-1">リップ</column>
  65. </columns>
  66. <rows_number>10</rows_number>
  67. </object>
  68. </object>
  69. </object>
  70. </object>
  71. <object class="AddCDDialog" name="AddCDDialog" base="EditDialog">
  72. <extracode_pre>self.env = args[0].env</extracode_pre>
  73. <title>Add CD</title>
  74. <style>wxDEFAULT_DIALOG_STYLE</style>
  75. <affirmative>button_OK</affirmative>
  76. <escape>button_CANCEL</escape>
  77. <object class="wxBoxSizer" name="sizer_1" base="EditBoxSizer">
  78. <orient>wxVERTICAL</orient>
  79. <object class="sizeritem">
  80. <option>1</option>
  81. <border>0</border>
  82. <flag>wxEXPAND</flag>
  83. <object class="wxGridSizer" name="grid_sizer_1" base="EditGridSizer">
  84. <rows>4</rows>
  85. <cols>2</cols>
  86. <vgap>0</vgap>
  87. <hgap>0</hgap>
  88. <object class="sizeritem">
  89. <option>0</option>
  90. <border>0</border>
  91. <flag>wxALIGN_CENTER</flag>
  92. <object class="wxStaticText" name="Title" base="EditStaticText">
  93. <label>タイトル</label>
  94. </object>
  95. </object>
  96. <object class="sizeritem">
  97. <option>0</option>
  98. <border>0</border>
  99. <flag>wxALIGN_CENTER</flag>
  100. <object class="wxTextCtrl" name="text_ctrl_1" base="EditTextCtrl">
  101. </object>
  102. </object>
  103. <object class="sizeritem">
  104. <option>0</option>
  105. <border>0</border>
  106. <flag>wxALIGN_CENTER</flag>
  107. <object class="wxStaticText" name="Artist" base="EditStaticText">
  108. <label>アーティスト</label>
  109. </object>
  110. </object>
  111. <object class="sizeritem">
  112. <option>0</option>
  113. <border>0</border>
  114. <flag>wxALIGN_CENTER</flag>
  115. <object class="wxTextCtrl" name="text_ctrl_2" base="EditTextCtrl">
  116. </object>
  117. </object>
  118. <object class="sizeritem">
  119. <option>0</option>
  120. <border>0</border>
  121. <flag>wxALIGN_CENTER</flag>
  122. <object class="wxStaticText" name="Rating" base="EditStaticText">
  123. <label>レーティング</label>
  124. </object>
  125. </object>
  126. <object class="sizeritem">
  127. <option>0</option>
  128. <border>0</border>
  129. <flag>wxALIGN_CENTER</flag>
  130. <object class="wxTextCtrl" name="text_ctrl_3" base="EditTextCtrl">
  131. </object>
  132. </object>
  133. <object class="sizeritem">
  134. <option>0</option>
  135. <border>0</border>
  136. <flag>wxALIGN_CENTER</flag>
  137. <object class="wxStaticText" name="Ripped" base="EditStaticText">
  138. <label>リップ</label>
  139. </object>
  140. </object>
  141. <object class="sizeritem">
  142. <option>0</option>
  143. <border>0</border>
  144. <flag>wxALIGN_CENTER</flag>
  145. <object class="wxTextCtrl" name="text_ctrl_4" base="EditTextCtrl">
  146. </object>
  147. </object>
  148. </object>
  149. </object>
  150. <object class="sizeritem">
  151. <option>0</option>
  152. <border>4</border>
  153. <flag>wxALL|wxALIGN_RIGHT</flag>
  154. <object class="wxStdDialogButtonSizer" name="sizer_2" base="EditStdDialogButtonSizer">
  155. <orient>wxHORIZONTAL</orient>
  156. <object class="sizeritem">
  157. <option>0</option>
  158. <border>0</border>
  159. <object class="wxButton" name="button_OK" base="EditButton">
  160. <events>
  161. <handler event="EVT_BUTTON">lambda event: self.OnAddCD()</handler>
  162. </events>
  163. <label>OK</label>
  164. <default>1</default>
  165. <stockitem>OK</stockitem>
  166. </object>
  167. </object>
  168. <object class="sizeritem">
  169. <option>0</option>
  170. <border>0</border>
  171. <object class="wxButton" name="button_CANCEL" base="EditButton">
  172. <events>
  173. <handler event="EVT_BUTTON">lambda event: self.Destroy()</handler>
  174. </events>
  175. <label>Cancel</label>
  176. <stockitem>CANCEL</stockitem>
  177. </object>
  178. </object>
  179. </object>
  180. </object>
  181. </object>
  182. </object>
  183. <object class="NewFile" name="NewFile" base="EditDialog">
  184. <extracode>def OnNewFile(self):\n with NewFile(self) as fileDialog:\n if fileDialog.ShowModal() == wx.ID_CANCEL:\n return\n pub.sendMessage("Controller.read",\n x = ["OnNewFile", fileDialog.GetPath()],\n env = self.env)</extracode>
  185. <extracode_pre>self.env = args[0].env</extracode_pre>
  186. <title>新規作成</title>
  187. <style>wxDEFAULT_DIALOG_STYLE</style>
  188. </object>
  189. <object class="OpenFile" name="OpenFile" base="EditDialog">
  190. <extracode>def OnOpen(self):\n with OpenFile(self) as fileDialog:\n if fileDialog.ShowModal() == wx.ID_CANCEL:\n return\n pub.sendMessage("Controller.read",\n x = ["OnOpen", fileDialog.GetPath()],\n env = self.env)</extracode>
  191. <extracode_pre>self.env = args[0].env</extracode_pre>
  192. <title>開く...</title>
  193. <style>wxDEFAULT_DIALOG_STYLE</style>
  194. </object>
  195. <object class="SaveFileAs" name="SaveFileAs" base="EditDialog">
  196. <extracode>def OnSaveFileAs(self):\n with SaveFileAs(self) as fileDialog:\n if fileDialog.ShowModal() == wx.ID_CANCEL:\n return\n pub.sendMessage("Controller.read",\n x = ["OnSaveFileAs", fileDialog.GetPath()],\n env = self.env)</extracode>
  197. <extracode_pre>self.env = args[0].env</extracode_pre>
  198. <title>名前を付けて保存...</title>
  199. <style>wxDEFAULT_DIALOG_STYLE</style>
  200. </object>
  201. </application>
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty