From 68e48205f3a28d081430efcf1470f84cece3c326 Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Mon, 24 Dec 2018 17:53:28 -0600 Subject: [PATCH] Added basic interface to audio recorder dialog --- src/wxui/dialogs/audioRecorder.py | 38 +++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/wxui/dialogs/audioRecorder.py diff --git a/src/wxui/dialogs/audioRecorder.py b/src/wxui/dialogs/audioRecorder.py new file mode 100644 index 0000000..05c3b89 --- /dev/null +++ b/src/wxui/dialogs/audioRecorder.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +import wx +import widgetUtils + +class audioRecorderDialog(widgetUtils.BaseDialog): + def __init__(self): + super(audioRecorderDialog, self).__init__(None, title=_(u"Record voice message")) + panel = wx.Panel(self) + sizer = wx.BoxSizer(wx.VERTICAL) + self.play = wx.Button(panel, -1, _(u"&Play")) + self.play.Disable() + self.pause = wx.Button(panel, -1, _(u"&Pause")) + self.pause.Disable() + self.record = wx.Button(panel, -1, _(u"&Record")) + self.record.SetFocus() + self.discard = wx.Button(panel, -1, _(u"&Discard")) + self.discard.Disable() + ok = wx.Button(panel, wx.ID_OK, _(u"&Add")) + cancel = wx.Button(panel, wx.ID_CANCEL, _(u"&Cancel")) + btnSizer = wx.BoxSizer(wx.HORIZONTAL) + btnSizer2 = wx.BoxSizer(wx.HORIZONTAL) + btnSizer.Add(self.play, 0, wx.ALL, 5) + btnSizer.Add(self.pause, 0, wx.ALL, 5) + btnSizer.Add(self.record, 0, wx.ALL, 5) + btnSizer2.Add(ok, 0, wx.ALL, 5) + btnSizer2.Add(cancel, 0, wx.ALL, 5) + sizer.Add(btnSizer, 0, wx.ALL, 5) + sizer.Add(btnSizer2, 0, wx.ALL, 5) + panel.SetSizer(sizer) + self.SetClientSize(sizer.CalcMin()) + + def enable_control(self, control): + if hasattr(self, control): + getattr(self, control).Enable() + + def disable_control(self, control): + if hasattr(self, control): + getattr(self, control).Disable() \ No newline at end of file