# -*- coding: UTF-8 -*-
#
# generated by wxGlade 1.0.1 on Fri Apr  2 13:57:56 2021
#

import wx
# begin wxGlade: dependencies
# end wxGlade

# begin wxGlade: extracode
# end wxGlade

class ConfigDialog(wx.Dialog):
    def __init__(self, *args, **kwds):
        # begin wxGlade: ConfigDialog.__init__
        kwds["style"] = kwds.get("style", 0) | wx.DEFAULT_DIALOG_STYLE
        wx.Dialog.__init__(self, *args, **kwds)
        self.SetTitle(_("dialog"))

        mainSizer = wx.FlexGridSizer(2, 1, 0, 0)

        infoSizer = wx.FlexGridSizer(7, 3, 5, 5)
        mainSizer.Add(infoSizer, 1, wx.EXPAND, 0)

        label_1 = wx.StaticText(self, wx.ID_ANY, _("Device:"))
        infoSizer.Add(label_1, 0, 0, 0)

        self.device = wx.ComboBox(self, wx.ID_ANY, choices=[], style=wx.CB_DROPDOWN)
        infoSizer.Add(self.device, 0, wx.EXPAND, 0)

        self.scanDeviceButton = wx.Button(self, wx.ID_ANY, _("Rescan"))
        infoSizer.Add(self.scanDeviceButton, 0, 0, 0)

        label_2 = wx.StaticText(self, wx.ID_ANY, _("Phase 1 FFT:"))
        infoSizer.Add(label_2, 0, 0, 0)

        self.phase1fft = wx.CheckBox(self, wx.ID_ANY, "")
        infoSizer.Add(self.phase1fft, 0, 0, 0)

        infoSizer.Add((20, 20), 0, 0, 0)

        label_3 = wx.StaticText(self, wx.ID_ANY, _("Phase 1 Freq:"))
        infoSizer.Add(label_3, 0, 0, 0)

        self.phase1freq = wx.CheckBox(self, wx.ID_ANY, "")
        infoSizer.Add(self.phase1freq, 0, 0, 0)

        infoSizer.Add((20, 20), 0, 0, 0)

        label_6 = wx.StaticText(self, wx.ID_ANY, _("Phase 1 Current:"))
        infoSizer.Add(label_6, 0, 0, 0)

        self.phase1current = wx.CheckBox(self, wx.ID_ANY, "")
        infoSizer.Add(self.phase1current, 0, 0, 0)

        infoSizer.Add((20, 20), 0, 0, 0)

        label_4 = wx.StaticText(self, wx.ID_ANY, _("Phase 2 FFT:"))
        infoSizer.Add(label_4, 0, 0, 0)

        self.phase2fft = wx.CheckBox(self, wx.ID_ANY, "")
        infoSizer.Add(self.phase2fft, 0, 0, 0)

        infoSizer.Add((20, 20), 0, 0, 0)

        label_5 = wx.StaticText(self, wx.ID_ANY, _("Phase 2 Freq:"))
        infoSizer.Add(label_5, 0, 0, 0)

        self.phase2freq = wx.CheckBox(self, wx.ID_ANY, "")
        infoSizer.Add(self.phase2freq, 0, 0, 0)

        infoSizer.Add((20, 20), 0, 0, 0)

        label_7 = wx.StaticText(self, wx.ID_ANY, _("Phase 2 Current:"))
        infoSizer.Add(label_7, 0, 0, 0)

        self.phase2current = wx.CheckBox(self, wx.ID_ANY, "")
        infoSizer.Add(self.phase2current, 0, 0, 0)

        infoSizer.Add((20, 20), 0, 0, 0)

        buttonSizer = wx.StdDialogButtonSizer()
        mainSizer.Add(buttonSizer, 0, wx.ALIGN_RIGHT | wx.ALL, 4)

        self.button_OK = wx.Button(self, wx.ID_OK, "")
        self.button_OK.SetDefault()
        buttonSizer.AddButton(self.button_OK)

        self.button_CANCEL = wx.Button(self, wx.ID_CANCEL, "")
        buttonSizer.AddButton(self.button_CANCEL)

        buttonSizer.Realize()

        infoSizer.AddGrowableCol(1)

        mainSizer.AddGrowableRow(0)
        mainSizer.AddGrowableCol(0)
        self.SetSizer(mainSizer)
        mainSizer.Fit(self)

        self.SetAffirmativeId(self.button_OK.GetId())
        self.SetEscapeId(self.button_CANCEL.GetId())

        self.Layout()

        self.Bind(wx.EVT_BUTTON, self.OnRescanButton, self.scanDeviceButton)
        # end wxGlade

    def LoadDialog(self, data):
        for item in data:
            try:
                control = getattr(self, item)
                control.SetValue(data[item])
            except Exception as e:
                print("LoadDialog: %s:%s %s" % (item, data[item], str(e)))

        self.Update()

    def OnRescanButton(self, event):  # wxGlade: ConfigDialog.<event_handler>
        print("Event handler 'OnRescanButton' not implemented!")
        event.Skip()
# end of class ConfigDialog
