Browse Source

Issue #98 - fixed missing ID on calendar widget

pull/486/head
chriskiehl 9 years ago
parent
commit
36333881f5
2 changed files with 4 additions and 3 deletions
  1. 5
      gooey/gui/widgets/calender_dialog.py
  2. 2
      gooey/gui/widgets/widget_pack.py

5
gooey/gui/widgets/calender_dialog.py

@ -11,7 +11,7 @@ class CalendarDlg(wx.Dialog):
self.SetBackgroundColour('#ffffff') self.SetBackgroundColour('#ffffff')
self.ok_button = wx.Button(self, label='Ok')
self.ok_button = wx.Button(self, wx.ID_OK, label='Ok')
self.datepicker = wx.DatePickerCtrl(self, style=wx.DP_DROPDOWN) self.datepicker = wx.DatePickerCtrl(self, style=wx.DP_DROPDOWN)
vertical_container = wx.BoxSizer(wx.VERTICAL) vertical_container = wx.BoxSizer(wx.VERTICAL)
@ -33,7 +33,7 @@ class CalendarDlg(wx.Dialog):
def OnOkButton(self, event): def OnOkButton(self, event):
self.Close() self.Close()
return wx.ID_OK
event.Skip()
def OnCancellButton(self, event): def OnCancellButton(self, event):
try: try:
@ -43,3 +43,4 @@ class CalendarDlg(wx.Dialog):
def GetPath(self): def GetPath(self):
return str(self.datepicker.GetValue()).split(' ')[0] return str(self.datepicker.GetValue()).split(' ')[0]

2
gooey/gui/widgets/widget_pack.py

@ -95,7 +95,7 @@ class BaseFileChooser(BaseChooser):
self.text_box.SetValue(result) self.text_box.SetValue(result)
def get_path(self, dlg): def get_path(self, dlg):
if isinstance(dlg, wx.DirDialog):
if isinstance(dlg, wx.DirDialog) or isinstance(dlg, CalendarDlg):
return maybe_quote(dlg.GetPath()) return maybe_quote(dlg.GetPath())
else: else:
paths = dlg.GetPaths() paths = dlg.GetPaths()

Loading…
Cancel
Save