fork download
  1. #!/usr/bin/env python3
  2. # -*- coding: UTF-8 -*-
  3. #
  4. # generated by wxGlade 1.0.4 on Sat Jun 24 02:03:15 2023
  5. #
  6.  
  7. import wx
  8.  
  9. # begin wxGlade: dependencies
  10. # end wxGlade
  11.  
  12. # begin wxGlade: extracode
  13. # end wxGlade
  14.  
  15.  
  16. class MyFrame(wx.Frame):
  17. def __init__(self, *args, **kwds):
  18. # begin wxGlade: MyFrame.__init__
  19. kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_FRAME_STYLE
  20. wx.Frame.__init__(self, *args, **kwds)
  21. self.SetSize((400, 300))
  22. self.SetTitle("PDF Converter")
  23.  
  24. self.panel_1 = wx.Panel(self, wx.ID_ANY)
  25.  
  26. sizer_1 = wx.BoxSizer(wx.VERTICAL)
  27.  
  28. label_1 = wx.StaticText(self.panel_1, wx.ID_ANY, u"PDFに変換するファイルを選択してください。")
  29. sizer_1.Add(label_1, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
  30.  
  31. self.text_ctrl_1 = wx.TextCtrl(self.panel_1, wx.ID_ANY, "")
  32. sizer_1.Add(self.text_ctrl_1, 0, wx.EXPAND, 0)
  33.  
  34. self.button_1 = wx.Button(self.panel_1, wx.ID_ANY, u"ファイルを選択")
  35. sizer_1.Add(self.button_1, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
  36.  
  37. label_2 = wx.StaticText(self.panel_1, wx.ID_ANY, u"サイズを選んでください。")
  38. sizer_1.Add(label_2, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
  39.  
  40. self.combo_box_1 = wx.ComboBox(self.panel_1, wx.ID_ANY, choices=["50%", "70%", "85%", "100%", "125%", "150%", "175%", "200%"], style=wx.CB_DROPDOWN)
  41. self.combo_box_1.SetSelection(3)
  42. sizer_1.Add(self.combo_box_1, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
  43.  
  44. label_3 = wx.StaticText(self.panel_1, wx.ID_ANY, u"出力ファイル名")
  45. sizer_1.Add(label_3, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
  46.  
  47. self.text_ctrl_2 = wx.TextCtrl(self.panel_1, wx.ID_ANY, "out")
  48. sizer_1.Add(self.text_ctrl_2, 0, wx.EXPAND, 0)
  49.  
  50. self.button_2 = wx.Button(self.panel_1, wx.ID_ANY, u"変換")
  51. sizer_1.Add(self.button_2, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)
  52.  
  53. self.panel_1.SetSizer(sizer_1)
  54.  
  55. self.Layout()
  56.  
  57. self.Bind(wx.EVT_BUTTON, self.chooseFile, self.button_1)
  58. self.Bind(wx.EVT_BUTTON, self.convert, self.button_2)
  59. # end wxGlade
  60.  
  61. def chooseFile(self, event): # wxGlade: MyFrame.<event_handler>
  62. print("Event handler 'chooseFile' not implemented!")
  63. event.Skip()
  64.  
  65. def convert(self, event): # wxGlade: MyFrame.<event_handler>
  66. print("Event handler 'convert' not implemented!")
  67. event.Skip()
  68.  
  69. # end of class MyFrame
  70.  
  71. class MyDialog(wx.Dialog):
  72. def __init__(self, *args, **kwds):
  73. # begin wxGlade: MyDialog.__init__
  74. kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_DIALOG_STYLE
  75. wx.Dialog.__init__(self, *args, **kwds)
  76. self.SetTitle("Open")
  77. self.Layout()
  78. # end wxGlade
  79.  
  80. # end of class MyDialog
  81.  
  82. class MyApp(wx.App):
  83. def OnInit(self):
  84. self.frame = MyFrame(None, wx.ID_ANY, "")
  85. self.SetTopWindow(self.frame)
  86. self.frame.Show()
  87. return True
  88.  
  89. # end of class MyApp
  90.  
  91. if __name__ == "__main__":
  92. App = MyApp(0)
  93. App.MainLoop()
  94.  
Runtime error #stdin #stdout #stderr 0.15s 25708KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 7, in <module>
ModuleNotFoundError: No module named 'wx'