Esempio n. 1
0
        def audioBox(hide=True):
            sb = wx.StaticBox(panel, label="Audio")
            boxsizer = wx.StaticBoxSizer(sb, wx.VERTICAL)
            fgs = wx.FlexGridSizer(3, 2, 5, 25)

            tc1 = wx.TextCtrl(panel)
            tc2 = wx.TextCtrl(panel)
            self._input['audio_input'] = tc1
            self._input['audio_output'] = tc2

            fgs.AddMany([(wx.StaticText(panel, label="input")),
                         (tc1, 1, wx.EXPAND),
                         (wx.StaticText(panel, label="output")),
                         (tc2, 1, wx.EXPAND)])

            fgs.AddGrowableCol(1, 1)
            boxsizer.Add(fgs, flag=wx.LEFT | wx.TOP | wx.EXPAND, border=5)

            if hide:
                map(lambda w: w.Hide(), [
                    w.GetWindow()
                    for w in fgs.GetChildren() if w.GetWindow() is not None
                ])
                sb.Hide()
            return boxsizer
Esempio n. 2
0
        def geometryBox(hide=True):
            sb = wx.StaticBox(panel, label="Geometry")
            boxsizer = wx.StaticBoxSizer(sb, wx.VERTICAL)

            hbox = wx.BoxSizer(wx.HORIZONTAL)

            tc1 = wx.TextCtrl(panel)
            tc2 = wx.TextCtrl(panel)
            tc3 = wx.TextCtrl(panel)
            tc4 = wx.TextCtrl(panel)
            self._input['x'] = tc1
            self._input['y'] = tc2
            self._input['w'] = tc3
            self._input['h'] = tc4

            hbox.Add(wx.StaticText(panel, label="X"),
                     flag=wx.TOP | wx.LEFT | wx.BOTTOM,
                     border=5)
            hbox.AddSpacer(5)
            hbox.Add(tc1, 1, flag=wx.EXPAND)
            hbox.AddSpacer(10)
            hbox.Add(wx.StaticText(panel, label="Y"),
                     flag=wx.TOP | wx.LEFT | wx.BOTTOM,
                     border=5)
            hbox.AddSpacer(5)
            hbox.Add(tc2, 1, flag=wx.EXPAND)
            hbox.AddSpacer(10)
            hbox.Add(wx.StaticText(panel, label="W"),
                     flag=wx.TOP | wx.LEFT | wx.BOTTOM,
                     border=5)
            hbox.AddSpacer(5)
            hbox.Add(tc3, 1, flag=wx.EXPAND)
            hbox.AddSpacer(10)
            hbox.Add(wx.StaticText(panel, label="H"),
                     flag=wx.TOP | wx.LEFT | wx.BOTTOM,
                     border=5)
            hbox.AddSpacer(5)
            hbox.Add(tc4, 1, flag=wx.EXPAND)

            boxsizer.Add(hbox, flag=wx.LEFT | wx.TOP | wx.EXPAND, border=5)

            hbox2 = wx.BoxSizer(wx.HORIZONTAL)
            button1 = wx.Button(panel, label="Select Area")
            hbox2.Add(button1,
                      1,
                      flag=wx.EXPAND | wx.ALL | wx.ALIGN_RIGHT,
                      border=15)
            button2 = wx.Button(panel, label="Full Screen")
            hbox2.Add(button2,
                      1,
                      flag=wx.EXPAND | wx.ALL | wx.ALIGN_RIGHT,
                      border=15)
            boxsizer.Add(hbox2, flag=wx.LEFT | wx.TOP | wx.EXPAND, border=5)

            self.Bind(wx.EVT_BUTTON, self.OnClickSelectionArea, button1)
            self.Bind(wx.EVT_BUTTON, self.OnClickFullScreen, button2)

            if hide:
                map(lambda w: w.Hide(), [
                    w.GetWindow()
                    for w in hbox.GetChildren() if w.GetWindow() is not None
                ])
                map(lambda w: w.Hide(), [
                    w.GetWindow()
                    for w in hbox2.GetChildren() if w.GetWindow() is not None
                ])
                sb.Hide()

            return boxsizer