def test_lib_agw_gradientbuttonCtor(self):

        # Initialize GradientButton 1 (with image)
        bitmap = wx.Bitmap(pngFile, wx.BITMAP_TYPE_PNG)
        btn1 = GB.GradientButton(self.frame, -1, bitmap, "GradientButton")
        # Initialize GradientButton 2 (no image)
        btn2 = GB.GradientButton(self.frame, -1, None, "Hello World!")
Пример #2
0
    def addToOdsjek(self, odsjek):
        global l_buttons
        self.Refresh()
        odsjek_button = GB.GradientButton(self,
                                          bitmap=None,
                                          pos=(120, 30),
                                          size=(150, 50),
                                          label=odsjek)
        odsjek_button.SetTopStartColour((105, 105, 105))
        odsjek_button.SetTopEndColour((105, 105, 105))
        odsjek_button.SetBottomStartColour((105, 105, 105))
        odsjek_button.SetBottomEndColour((105, 105, 105))
        odsjek_button.Disable()
        back_button = GB.GradientButton(self,
                                        bitmap=None,
                                        pos=(165, 300),
                                        label="Back")
        back_button.Bind(wx.EVT_BUTTON, self.back)
        poc_button = GB.GradientButton(self,
                                       bitmap=None,
                                       pos=(5, 5),
                                       size=(50, 30),
                                       label="Početna")
        poc_button.Bind(wx.EVT_BUTTON, self.pocetna)
        c.execute(
            "SELECT titula,name,username,status FROM DatabaseInCabinet WHERE odsjek = ?",
            (odsjek, ))
        fetched = c.fetchall()
        #ovo bi se moglo ubaciti u funkciju
        x = 0
        y = -100
        brojac = 0
        l_buttons = []
        #postavljanje profesora na odsjecima
        for i in range(len(fetched)):
            if i % 2 == 0 and i != 0:
                x = 0
            if brojac % 2 == 0:
                y += 100
            prof_info = GB.GradientButton(self,
                                          bitmap=None,
                                          pos=(13 + x, 100 + y),
                                          size=(180, 50),
                                          label=fetched[i][0] + " " +
                                          fetched[i][1],
                                          align=wx.CENTER)
            if fetched[i][3] == "A":
                prof_info.SetForegroundColour((76, 187, 23))
            elif fetched[i][3] == "P":
                prof_info.SetForegroundColour((255, 0, 0))
            else:
                prof_info.SetForegroundColour((255, 255, 0))

            l_buttons.append(prof_info)
            x += 183
            brojac += 1
        for j in range(len(l_buttons)):
            string = fetched[j][0] + " " + fetched[j][1]
            self.bindButtonsProf(l_buttons[j], string, fetched[j][2])
Пример #3
0
    def __init__(self, parent):
        super(ButtonTestPanel, self).__init__(parent)

        # Attributes
        # Make a ToggleButton
        self.toggle = wx.ToggleButton(self,
                                      label="Toggle Button")

        # Make a BitmapButton
        bmp = wx.Bitmap("./face-monkey.png",
                        wx.BITMAP_TYPE_PNG)
        self.bmpbtn = wx.BitmapButton(self, bitmap=bmp)

        # Make a few PlateButton variants
        self.pbtn1 = pbtn.PlateButton(self,
                                      label="PlateButton")
        self.pbtn2 = pbtn.PlateButton(self, 
                                      label="PlateBmp",
                                      bmp=bmp)
        style = pbtn.PB_STYLE_SQUARE
        self.pbtn3 = pbtn.PlateButton(self,
                                      label="Square Plate",
                                      bmp=bmp,
                                      style=style)
        self.pbtn4 = pbtn.PlateButton(self,
                                      label="PlateMenu")
        menu = wx.Menu()
        menu.Append(wx.NewId(), text="Hello World")
        self.pbtn4.SetMenu(menu)

        # Gradient Buttons
        self.gbtn1 = gbtn.GradientButton(self,
                                         label="GradientBtn")
        self.gbtn2 = gbtn.GradientButton(self,
                                         label="GradientBmp",
                                         bitmap=bmp)

        # Layout
        vsizer = wx.BoxSizer(wx.VERTICAL)
        vsizer.Add(self.toggle, 0, wx.ALL, 12)
        vsizer.Add(self.bmpbtn, 0, wx.ALL, 12)
        hsizer1 = wx.BoxSizer(wx.HORIZONTAL)
        hsizer1.AddMany([(self.pbtn1, 0, wx.ALL, 5),
                        (self.pbtn2, 0, wx.ALL, 5),
                        (self.pbtn3, 0, wx.ALL, 5),
                        (self.pbtn4, 0, wx.ALL, 5)])
        vsizer.Add(hsizer1, 0, wx.ALL, 12)
        hsizer2 = wx.BoxSizer(wx.HORIZONTAL)
        hsizer2.AddMany([(self.gbtn1, 0, wx.ALL, 5),
                         (self.gbtn2, 0, wx.ALL, 5)])
        vsizer.Add(hsizer2, 0, wx.ALL, 12)
        self.SetSizer(vsizer)
Пример #4
0
    def __init__(self, parent):
        super(MyPanel, self).__init__(parent)

        # attibutes
        #make a toggleButton
        self.toggle = wx.ToggleButton(self, label="Toggle Button")

        #make a bitmapButton
        bmp = wx.Bitmap('../image/play_hover.png', wx.BITMAP_TYPE_PNG)
        self.bmpbtn = wx.BitmapButton(self, bitmap=bmp)

        # make a few plateButton variants
        self.pbtn1 = pbtn.PlateButton(self, label='PlateButton')
        self.pbtn2 = pbtn.PlateButton(self, label='PlateBmp', bmp=bmp)

        style = pbtn.PB_STYLE_SQUARE
        self.pbtn3 = pbtn.PlateButton(self,
                                      label='Square Plate',
                                      bmp=bmp,
                                      style=style)
        self.pbtn4 = pbtn.PlateButton(self, label='PlateMenu')

        menu = wx.Menu()
        menu.Append(wx.NewId(), item="Hello World")
        self.pbtn4.SetMenu(menu)

        # Gradient BUttons
        self.gbtn1 = gbtn.GradientButton(self, label='GradientBtn')
        self.gbtn2 = gbtn.GradientButton(self, label='GradientBmp', bitmap=bmp)

        # layout
        vsizer = wx.BoxSizer(wx.VERTICAL)
        vsizer.Add(self.toggle, 0, wx.ALL, 5)
        vsizer.Add(self.bmpbtn, 0, wx.ALL, 5)
        hsizer1 = wx.BoxSizer(wx.HORIZONTAL)
        hsizer1.AddMany([
            (self.pbtn1, 0, wx.ALL, 5), (self.pbtn2, 0, wx.ALL, 5),
            (self.pbtn3, 0, wx.ALL, 5), (self.pbtn4, 0, wx.ALL, 5)
        ])
        vsizer.Add(hsizer1, 0, wx.ALL, 12)
        hsizer2 = wx.BoxSizer(wx.HORIZONTAL)
        hsizer2.AddMany([(self.gbtn1, 0, wx.ALL, 5),
                         (self.gbtn2, 0, wx.ALL, 5)])
        vsizer.Add(hsizer2, 0, wx.ALL, 12)

        #make some buttons
        sizer = wx.BoxSizer(wx.HORIZONTAL)
        for bid in (wx.ID_OK, wx.ID_CANCEL, wx.ID_APPLY, wx.ID_HELP):
            button = wx.Button(self, bid)
            sizer.Add(button, 0, wx.ALL, 5)
        vsizer.Add(sizer, 0, wx.ALL, 12)
        self.SetSizer(vsizer)
Пример #5
0
    def __init__(self, parent):
        wx.Dialog.__init__(self, parent, id=wx.ID_ANY, title="- ODMTools Bulk Insert -",
                              size=(400, 600))
        mainPanel = wx.Panel(self, -1)
        self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize)

        self.uploadBtn = GB.GradientButton(mainPanel, wx.ID_ANY, upload_2_32.GetBitmap(), ' Upload')
        self.templateBtn = GB.GradientButton(mainPanel, wx.ID_ANY, downloading_updates_32.GetBitmap(), ' Download')
        self.closeBtn = GB.GradientButton(mainPanel, wx.ID_ANY, close_window_32.GetBitmap(), " Close")
        self._initSizers(mainPanel)

        self.Bind(wx.EVT_BUTTON, self.onUpload, self.uploadBtn)
        self.Bind(wx.EVT_BUTTON, self.onTemplate, self.templateBtn)
        self.Bind(wx.EVT_BUTTON, self.onClose, self.closeBtn)
Пример #6
0
    def add_button(self,
                   message: str,
                   position: tuple,
                   size: tuple,
                   button_type: str = None,
                   color: str = None,
                   action: str = 'default') -> None:
        """Add Button."""
        # Button Type
        if button_type == 'gradient_button':
            btn = GB.GradientButton(self.panel,
                                    label=message,
                                    pos=position,
                                    size=size)
        elif button_type == 'aqua_button':
            btn = AB.AquaButton(self.panel,
                                label=message,
                                pos=position,
                                size=size)
        else:
            btn = buttons.GenButton(self.panel,
                                    label=message,
                                    pos=position,
                                    size=size)

            # You can really only set colors with GenButtons as the others
            #  use native widgets!
            if color:
                btn.SetBackgroundColour(color)

        # Attach Custom Actions
        self.bind_action(action, btn)

        self.buttons.append(btn)
Пример #7
0
    def addToSPanel(self, value):
        status_p = wx.StaticBox(self, -1)
        sSizer = wx.StaticBoxSizer(status_p, wx.VERTICAL)
        s1 = wx.BoxSizer(wx.HORIZONTAL)
        text_g = wx.StaticText(self,
                               -1,
                               "Odsjeci:",
                               pos=(150, 30),
                               size=(60, 20),
                               style=wx.ALIGN_CENTRE_HORIZONTAL)
        s1.Add(text_g, 0, wx.ALL | wx.CENTER, 100)
        text_g.SetBackgroundColour((192, 192, 192))
        poc_button = GB.GradientButton(self,
                                       bitmap=None,
                                       pos=(5, 5),
                                       size=(50, 30),
                                       label="Početna")
        poc_button.Bind(wx.EVT_BUTTON, self.pocetna)
        back_button = GB.GradientButton(self,
                                        bitmap=None,
                                        pos=(150, 300),
                                        label="Log out")

        x = 0
        y = -100
        brojac = 0
        l = []
        for i in range(len(odsjeci)):
            if i % 2 == 0 and i != 0:
                x = 0
            if brojac % 2 == 0:
                y += 100
            odsjek_info = GB.GradientButton(self,
                                            bitmap=None,
                                            pos=(33 + x, 100 + y),
                                            size=(150, 50),
                                            label=odsjeci[i])
            l.append(odsjek_info)
            x += 183
            brojac += 1

        for j in range(len(l)):
            self.bindButtons(l[j], odsjeci[j])
        back_button.Bind(wx.EVT_BUTTON,
                         lambda event: self.backMainS(event, value))
    def test_lib_agw_gradientbuttonMethods(self):
        # Initialize AquaButton 2 (no image)
        btn2 = GB.GradientButton(self.frame, -1, None, "Hello World!")

        bitmap = wx.Bitmap(pngFile, wx.BITMAP_TYPE_PNG)
        btn2.SetBitmapLabel(bitmap)

        btn2.SetTopStartColour(wx.Colour('grey'))
        btn2.SetBottomStartColour(wx.WHITE)
        btn2.SetPressedBottomColour(wx.BLACK)
Пример #9
0
    def InCompleteOrder(self, parent):
        ##########################未完成订单开始###############################
        incomplete_order_panel = wx.Panel(parent)
        incomplete_order_sizer = wx.BoxSizer(wx.VERTICAL)

        self.btn = GB.GradientButton(incomplete_order_panel, -1, None, u"查询订单")
        # self.payBtn = GB.GradientButton(incomplete_order_panel, -1, None, u"去12306支付", (80, 5))
        self.btn.Bind(wx.EVT_BUTTON, self.toQueryInCompleteOrder)
        # self.payBtn.Bind(wx.EVT_BUTTON, self.toGo12306Pay)

        incomplete_order_sizer.Add(self.btn, 0, wx.ALL, 5)
        # incomplete_order_sizer.Add(self.payBtn, 0, wx.ALL, 5)

        agwStyle = (ULC.ULC_HAS_VARIABLE_ROW_HEIGHT | wx.LC_REPORT
                    | wx.LC_VRULES | wx.LC_HRULES | wx.LC_SINGLE_SEL)
        self.orderlist = orderlist = ULC.UltimateListCtrl(
            incomplete_order_panel,
            wx.ID_ANY,
            size=(400, 300),
            agwStyle=agwStyle)
        self.orderlist.Bind(wx.EVT_LIST_COL_BEGIN_DRAG, self.OnColumnDrag)

        orderlist.InsertColumn(0,
                               u'序号',
                               format=ULC.ULC_FORMAT_CENTER,
                               width=50)
        orderlist.InsertColumn(1,
                               u'车次信息',
                               format=ULC.ULC_FORMAT_CENTER,
                               width=300)
        orderlist.InsertColumn(2,
                               u'席位信息',
                               format=ULC.ULC_FORMAT_CENTER,
                               width=150)
        orderlist.InsertColumn(3,
                               u'旅客信息',
                               format=ULC.ULC_FORMAT_CENTER,
                               width=150)
        orderlist.InsertColumn(4,
                               u'票款金额',
                               format=ULC.ULC_FORMAT_CENTER,
                               width=100)
        orderlist.InsertColumn(5,
                               u'车票状态',
                               format=ULC.ULC_FORMAT_CENTER,
                               width=180)

        incomplete_order_sizer.Add(self.orderlist, 0, wx.ALL | wx.EXPAND, 5)

        incomplete_order_panel.SetSizer(incomplete_order_sizer)
        incomplete_order_panel.Layout()

        self.nb.AddPage(incomplete_order_panel, u"未完成订单")
Пример #10
0
 def __init__(self, pos):
     wx.Frame.__init__(self, None, title="Kiosk Command Window", pos=pos)
     panel = wx.Panel(self)
     panel.SetBackgroundColour(wx.Color(118, 118, 56))
     vsizer = wx.BoxSizer(wx.VERTICAL)
     vsizer.Add(wx.StaticText(panel, -1, "Welcome to Foo"), 1, wx.EXPAND)
     gsizer = wx.GridSizer(0, 3, 20, 20)
     count = 6
     for idx in range(count):
         btn = gradientbtn.GradientButton(panel, -1, None, "foobar")
         #			btn.Bind(wx.EVT_BUTTON, self.OnBtnPress)
         gsizer.Add(btn, 1, wx.EXPAND)
     vsizer.Add(gsizer, 1, wx.EXPAND)
     panel.SetSizer(vsizer)
     vsizer.Layout()
     self.Bind(wx.EVT_BUTTON, self.OnPress)
Пример #11
0
    def __init__(self,parent,title):
        wx.Frame.__init__(self,parent,title=title,size=(600,-1))
        static_font = wx.Font(12, wx.SWISS, wx.NORMAL, wx.NORMAL)
        
        Size = namedtuple("Size",['x','y'])
        s = Size(100,50)

        self.fileName = None
        self.model = model
        
        b_labels = [u'open',u'run']

        TipString = [u'选择图片', u'识别数字']
        
        funcs = [self.choose_file,self.run]
        
        '''create input area'''
        self.in1 = wx.TextCtrl(self,-1,size = (2*s.x,3*s.y))
        self.out1 = wx.TextCtrl(self,-1,size = (s.x,3*s.y))

        '''create button'''
        self.sizer0 = wx.FlexGridSizer(cols=4, hgap=4, vgap=2)
        self.sizer0.Add(self.in1)
        
        buttons = []
        for i,label in enumerate(b_labels):
            b = gbtn.GradientButton(self, id = i,label = label,size = (1.5*s.x,s.y))
            buttons.append(b)
            self.sizer0.Add(b)      

        self.sizer0.Add(self.out1)

        '''set the color and size of labels and buttons'''  
        for i,button in enumerate(buttons):
            button.SetForegroundColour('red')
            button.SetFont(static_font)
            button.SetToolTipString(TipString[i])
            button.Bind(wx.EVT_BUTTON,funcs[i])

        '''layout'''
        self.SetSizer(self.sizer0)
        self.SetAutoLayout(1)
        self.sizer0.Fit(self)
        
        self.CreateStatusBar()
        self.Show(True)
Пример #12
0
    def _button_construction(self, label, size, pos):
        slash_index = label.rindex("\\")
        if slash_index != -1:
            name = label[slash_index + 1:len(label)]
            name = name[0:22]
        else:
            name = label[0:len(label) - 5]

        bmp = wx.Bitmap(os.path.join(BIT_MAP_DIR, "agt_mp3.png"),
                        wx.BITMAP_TYPE_ANY)

        button = GB.GradientButton(self.album_panel,
                                   bitmap=bmp,
                                   id=wx.ID_ANY,
                                   label=str("\n") + name,
                                   size=size,
                                   pos=pos,
                                   name=label)
        button.Bind(wx.EVT_BUTTON, self.load_song)
        return button
Пример #13
0
def createGradientButton(parent, wxId, bitmap, handler):
    """Create a new gradient button.
    
    Parameters
    ----------
    parent : gh.Panel
        The panel which contains this button.
    wxId : int
        The ID for this button.
    bitmap : wxBitmap
        The image to go on the button.
    handler : method
        The method to execute when the button is pressed.
        
    Returns
    -------
    wxGradientButton
        The newly created gradient button.
    """
    buttonSize = (bitmap.GetWidth() + 10, bitmap.GetHeight() + 10)
    button = GB.GradientButton(parent, wxId, bitmap, size=buttonSize)
    button.Bind(wx.EVT_BUTTON, handler, id=wxId)
    parent.add(button)
    return button
Пример #14
0
    def __init__(self, interface, message=u"", icone=None, couleurClaire=wx.Colour(206, 196, 190), couleurFoncee=wx.Colour(169, 156, 146),
                                        bouton_non=True, texte_non=_(u"Non"), image_non="Efface.png",
                                        bouton_oui=True, texte_oui=_(u"Oui"), image_oui="Validation.png",
                                        listeItems=[], multiSelection=True,
                                        ):
        wx.Dialog.__init__(self, interface, -1, style=wx.NO_BORDER|wx.FRAME_SHAPED|wx.STAY_ON_TOP)
        self.interface = interface
        self.message = message
        self.icone = icone
        self.multiSelection = multiSelection
        
        # Regarde si un thème existe dans l'interface
        if interface != None :
            dictTheme = interface.GetTheme() 
            if "dlg" in dictTheme :
                couleurClaire = dictTheme["dlg"]["couleurClaire"]
                couleurFoncee = dictTheme["dlg"]["couleurFoncee"]
        
        # Propriétés
        self.SetBackgroundColour(couleurClaire)
        self.SetFont(wx.Font(28, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "MS Shell Dlg 2"))
        
        # Panneau gauche
        self.panel_gauche = wx.Panel(self, -1)
        self.panel_gauche.SetBackgroundColour(couleurFoncee)
        self.panel_gauche.SetMinSize((-1, 600))
        
        # Icone
        if icone == "erreur" : bmp = wx.Bitmap(Chemins.GetStaticPath("Images/Badgeage/Erreur.png"), wx.BITMAP_TYPE_ANY)
        elif icone == "exclamation" : bmp = wx.Bitmap(Chemins.GetStaticPath("Images/Badgeage/Exclamation.png"), wx.BITMAP_TYPE_ANY)
        elif icone == "information" : bmp = wx.Bitmap(Chemins.GetStaticPath("Images/Badgeage/Information.png"), wx.BITMAP_TYPE_ANY)
        elif icone == "question" : bmp = wx.Bitmap(Chemins.GetStaticPath("Images/Badgeage/Question.png"), wx.BITMAP_TYPE_ANY)
        elif icone == "commentaire" : bmp = wx.Bitmap(Chemins.GetStaticPath("Images/Badgeage/Commentaire.png"), wx.BITMAP_TYPE_ANY)
        else : bmp = wx.NullBitmap
        self.ctrl_icone = wx.StaticBitmap(self.panel_gauche, -1, bitmap=bmp)
        
        # Panneau droite
##        message = textwrap.wrap(message, 30)
##        self.label_message = wx.StaticText(self, -1, u"\n".join(message))
        self.label_message = wx.StaticText(self, -1, message)
        self.label_message.SetMinSize((600, 200))
        
        # Boutons Toggle
        self.ctrl_choix = CTRL_Choix(self, listeItems=listeItems, multiSelection=multiSelection, couleurClaire=couleurClaire, couleurFoncee=couleurFoncee, taille=(500, -1))
        if len(listeItems) == 0 :
            self.ctrl_choix.Enable(False) 
        
        # Boutons
        self.ctrl_non = GB.GradientButton(self, -1, wx.Bitmap(Chemins.GetStaticPath("Images/Badgeage/%s" % image_non), wx.BITMAP_TYPE_ANY), u" %s " % texte_non)
        self.ctrl_non.SetTopStartColour(wx.Colour(228, 98, 79))
        self.ctrl_non.SetTopEndColour(wx.Colour(223, 70, 25))
        self.ctrl_non.SetBottomStartColour(wx.Colour(223, 70, 25))
        self.ctrl_non.SetBottomEndColour(wx.Colour(228, 98, 79))
        self.ctrl_non.SetPressedTopColour(wx.Colour(195, 76, 70))
        self.ctrl_non.SetPressedBottomColour(wx.Colour(195, 76, 70))
        self.ctrl_non.Show(bouton_non)
        
        self.ctrl_oui = GB.GradientButton(self, -1, wx.Bitmap(Chemins.GetStaticPath("Images/Badgeage/%s" % image_oui), wx.BITMAP_TYPE_ANY), u" %s " % texte_oui)
        self.ctrl_oui.SetTopStartColour(wx.Colour(159, 207, 80))
        self.ctrl_oui.SetTopEndColour(wx.Colour(131, 193, 36))
        self.ctrl_oui.SetBottomStartColour(wx.Colour(131, 193, 36))
        self.ctrl_oui.SetBottomEndColour(wx.Colour(159, 207, 80))
        self.ctrl_oui.SetPressedTopColour(wx.Colour(60, 160, 84))
        self.ctrl_oui.SetPressedBottomColour(wx.Colour(60, 160, 84))
        self.ctrl_oui.Show(bouton_oui)
        
        # Désactive la touche OUI si multiSelection activée
        if len(listeItems) > 0 and self.multiSelection == True :
            self.ctrl_oui.Enable(False)

        # Texte d'attente
        self.SetFont(wx.Font(10, wx.DEFAULT, wx.NORMAL, wx.NORMAL, 0, "MS Shell Dlg 2"))
        self.label_attente = wx.StaticText(self, -1, _(u"Veuillez patienter..."))
        self.label_attente.SetForegroundColour(couleurFoncee)
        if bouton_non == True or bouton_oui == True :
            self.label_attente.Show(False) 
            
        # Binds
        self.Bind(wx.EVT_BUTTON, self.OnBoutonNon, self.ctrl_non)
        self.Bind(wx.EVT_BUTTON, self.OnBoutonOui, self.ctrl_oui)

        # Touches de raccourcis
        if bouton_non == True or bouton_oui == True :
            self.Bind(wx.EVT_MENU, self.OnBoutonNon, id=ID_NON)
            self.Bind(wx.EVT_MENU, self.OnBoutonOui, id=ID_OUI)
            accel_tbl = wx.AcceleratorTable([
                (0, ord('N'), ID_NON),
                (0, ord('O'), ID_OUI),
                (0, 13, ID_OUI),
                (0, wx.WXK_BACK, ID_NON),
                (0, ord('A'), ID_NON),
                ])
            self.SetAcceleratorTable(accel_tbl)

        # Layout
        grid_sizer_base = wx.FlexGridSizer(rows=1, cols=2, vgap=10, hgap=10)
        
        # Panneau gauche
        grid_sizer_gauche = wx.FlexGridSizer(rows=3, cols=1, vgap=10, hgap=10)
        grid_sizer_gauche.Add(self.ctrl_icone, 0, wx.ALL, 20)
        self.panel_gauche.SetSizer(grid_sizer_gauche)
        grid_sizer_base.Add(self.panel_gauche, 1, wx.EXPAND, 0)
        
        # Panneau droit
        grid_sizer_droit = wx.FlexGridSizer(rows=4, cols=1, vgap=10, hgap=10)
        grid_sizer_droit.Add(self.label_message, 0, 0, 0)
        
        # Boutons de Choix
        grid_sizer_droit.Add(self.ctrl_choix, 1, wx.EXPAND|wx.TOP, 10)
        
        # Bouton Veuillez patienter
        grid_sizer_droit.Add(self.label_attente, 0, wx.ALIGN_RIGHT, 0)
        
        # Boutons
        grid_sizer_boutons = wx.FlexGridSizer(rows=1, cols=3, vgap=20, hgap=20)
        grid_sizer_boutons.Add((1, 1), 0, wx.EXPAND, 0)
        grid_sizer_boutons.Add(self.ctrl_non, 0, wx.ALL, 0)
        grid_sizer_boutons.Add(self.ctrl_oui, 0, wx.ALL, 0)
        grid_sizer_boutons.AddGrowableCol(0)
        grid_sizer_droit.Add(grid_sizer_boutons, 1, wx.EXPAND|wx.TOP, 20)
        
        grid_sizer_droit.AddGrowableRow(1)
        grid_sizer_droit.AddGrowableCol(0)
        grid_sizer_base.Add(grid_sizer_droit, 1, wx.EXPAND|wx.ALL, 20)
        
        self.SetSizer(grid_sizer_base)
        grid_sizer_base.Fit(self)
        grid_sizer_base.AddGrowableRow(0)
        grid_sizer_base.AddGrowableCol(1)
        self.Layout()
        self.CenterOnScreen() 
        
        # Création de la forme de la fenêtre
        size = self.GetSize()
        if 'phoenix' in wx.PlatformInfo:
            bmp = wx.Bitmap(size.x, size.y)
        else :
            bmp = wx.EmptyBitmap(size.x, size.y)
        dc = wx.BufferedDC(None, bmp)
        dc.SetBackground(wx.Brush(wx.Colour(0, 0, 0), wx.SOLID))
        dc.Clear()
        dc.SetPen(wx.Pen(wx.Colour(0, 0, 0), 1))
        dc.DrawRoundedRectangle(0, 0, size.x, size.y, 20)
        if 'phoenix' in wx.PlatformInfo:
            r = wx.Region(bmp, wx.Colour(0, 0, 0))
        else :
            r = wx.RegionFromBitmapColour(bmp, wx.Colour(0, 0, 0))
        self.reg = r
        if wx.Platform == "__WXGTK__":
            self.Bind(wx.EVT_WINDOW_CREATE, self.SetBusyShape)
        else:
            self.SetBusyShape()
        
        # Synthèse vocale
        wx.CallAfter(self.Vocal)
Пример #15
0
    def CompleteOrder(self, parent):

        complete_order_panel = wx.Panel(parent)
        complete_order_sizer = wx.BoxSizer(wx.VERTICAL)

        self.complete_order_btn = GB.GradientButton(complete_order_panel, -1,
                                                    None, u"查询订单")
        self.complete_order_btn.Bind(wx.EVT_BUTTON, self.toQueryCompleteOrder)
        complete_order_sizer.Add(self.complete_order_btn, 0, wx.ALL, 5)

        self.ch = wx.Choice(complete_order_panel,
                            -1, (80, 5),
                            choices=[u'按订票日期查询', u'按乘车日期查询'])
        self.queryType = [1, 2]
        self.ch.SetSelection(0)
        # self.ch.Bind(wx.EVT_CHOICE, self.EvtChoice)

        self.startDate = wx.DatePickerCtrl(complete_order_panel,
                                           pos=(210, 5),
                                           size=(120, -1),
                                           style=wx.DP_DROPDOWN)
        # dpc.Bind(wx.EVT_DATE_CHANGED, self.OnDateChanged)

        wx.StaticText(complete_order_panel, -1, u'-', (335, 5))
        self.endDate = wx.DatePickerCtrl(complete_order_panel,
                                         pos=(350, 5),
                                         size=(120, -1),
                                         style=wx.DP_DROPDOWN)

        agwStyle = (ULC.ULC_HAS_VARIABLE_ROW_HEIGHT | wx.LC_REPORT
                    | wx.LC_VRULES | wx.LC_HRULES | wx.LC_SINGLE_SEL)
        self.complete_orderlist = complete_orderlist = ULC.UltimateListCtrl(
            complete_order_panel,
            wx.ID_ANY,
            size=(400, 300),
            agwStyle=agwStyle)
        self.complete_orderlist.Bind(wx.EVT_LIST_COL_BEGIN_DRAG,
                                     self.OnColumnDrag)

        complete_orderlist.InsertColumn(0,
                                        u'序号',
                                        format=ULC.ULC_FORMAT_CENTER,
                                        width=50)
        complete_orderlist.InsertColumn(1,
                                        u'车次信息',
                                        format=ULC.ULC_FORMAT_CENTER,
                                        width=300)
        complete_orderlist.InsertColumn(2,
                                        u'席位信息',
                                        format=ULC.ULC_FORMAT_CENTER,
                                        width=150)
        complete_orderlist.InsertColumn(3,
                                        u'旅客信息',
                                        format=ULC.ULC_FORMAT_CENTER,
                                        width=150)
        complete_orderlist.InsertColumn(4,
                                        u'票款金额',
                                        format=ULC.ULC_FORMAT_CENTER,
                                        width=100)
        complete_orderlist.InsertColumn(5,
                                        u'车票状态',
                                        format=ULC.ULC_FORMAT_CENTER,
                                        width=180)

        complete_order_sizer.Add(self.complete_orderlist, 0,
                                 wx.ALL | wx.EXPAND, 5)

        complete_order_panel.SetSizer(complete_order_sizer)
        complete_order_panel.Layout()
        self.nb.AddPage(complete_order_panel, u"已完成订单")
Пример #16
0
    def __init__(self, *args, **kwargs):
        parent = args[0]
        self.passenger_data = kwargs['passenger_data']
        self.two_isOpenClick = kwargs['two_isOpenClick']
        self.other_isOpenClick = kwargs['other_isOpenClick']

        self.passengers_panel = wx.Panel(parent)
        passengers_sizer = wx.BoxSizer(wx.VERTICAL)

        self.btn = GB.GradientButton(self.passengers_panel, -1, None, u"增加")
        self.payBtn = GB.GradientButton(self.passengers_panel, -1, None, u"删除",
                                        (60, 5))
        self.reloadBtn = GB.GradientButton(self.passengers_panel, -1, None,
                                           u"加载联系人", (120, 5))
        self.btn.Bind(wx.EVT_BUTTON, self.addContact)
        self.payBtn.Bind(wx.EVT_BUTTON,
                         lambda evt, p_panel=self.passengers_panel: self.
                         delContact(evt, p_panel))
        self.reloadBtn.Bind(wx.EVT_BUTTON, self.operatedAfterInit)

        passengers_sizer.Add(self.btn, 0, wx.ALL, 5)
        # passengers_sizer.Add(self.payBtn, 0, wx.ALL, 5)

        agwStyle = (ULC.ULC_HAS_VARIABLE_ROW_HEIGHT | wx.LC_REPORT
                    | wx.LC_VRULES | wx.LC_HRULES | ULC.ULC_SINGLE_SEL
                    | ULC.ULC_AUTO_CHECK_CHILD)
        self.contactlist = contactlist = ULC.UltimateListCtrl(
            self.passengers_panel,
            wx.ID_ANY,
            size=(400, 300),
            agwStyle=agwStyle)
        self.contactlist.Bind(wx.EVT_LIST_COL_BEGIN_DRAG, self.OnColumnDrag)

        # orderlist.InsertColumn(0, u'序号', format=ULC.ULC_FORMAT_CENTER, width=50)
        info = ULC.UltimateListItem()
        info._mask = wx.LIST_MASK_TEXT | wx.LIST_MASK_FORMAT | ULC.ULC_MASK_CHECK
        info._format = 0
        info._kind = 1
        info._text = u"序号"
        contactlist.InsertColumnInfo(0, info)
        contactlist.SetColumnWidth(0, 80)

        contactlist.InsertColumn(1,
                                 u'姓名',
                                 format=ULC.ULC_FORMAT_CENTER,
                                 width=80)
        contactlist.InsertColumn(2,
                                 u'证件类型',
                                 format=ULC.ULC_FORMAT_CENTER,
                                 width=150)
        contactlist.InsertColumn(3,
                                 u'证件号码',
                                 format=ULC.ULC_FORMAT_CENTER,
                                 width=150)
        contactlist.InsertColumn(4,
                                 u'手机/电话',
                                 format=ULC.ULC_FORMAT_CENTER,
                                 width=150)
        contactlist.InsertColumn(5,
                                 u'旅客类型',
                                 format=ULC.ULC_FORMAT_CENTER,
                                 width=150)
        contactlist.InsertColumn(6,
                                 u'核验状态',
                                 format=ULC.ULC_FORMAT_CENTER,
                                 width=100)
        contactlist.InsertColumn(7,
                                 u'操作',
                                 format=ULC.ULC_FORMAT_CENTER,
                                 width=50)
        # contactlist.InsertColumn(8, u'', format=ULC.ULC_FORMAT_CENTER, width=0)
        # contactlist.SetColumnWidth(8, 0)

        # 初始化联系人
        self.initPassengerData(self.passenger_data)
        passengers_sizer.Add(self.contactlist, 0, wx.ALL | wx.EXPAND, 5)

        self.passengers_panel.SetSizer(passengers_sizer)
        self.passengers_panel.Layout()

        sizer = wx.BoxSizer()
        sizer.Add(self.passengers_panel, 1, wx.EXPAND)
        parent.SetSizer(sizer)
Пример #17
0
    def __init__(self, parent, path_srcShare, path_confdir, PWD, OS,
                 iconanalyzes, iconpeaklevel, btn_color, fontBtncolor):
        """
        
        """
        self.src_prst = os.path.join(path_srcShare, 'presets')  #origin/share
        self.user_prst = os.path.join(path_confdir, 'presets')  #conf/videomass
        self.PWD = PWD  #current work of videomass
        self.OS = OS
        self.parent = parent
        self.file_src = []
        self.txtcmdedited = False  # show dlg if cmdline is edited
        self.normdetails = []
        prst = sorted([
            os.path.splitext(x)[0] for x in os.listdir(self.user_prst)
            if os.path.splitext(x)[1] == '.prst'
        ])
        self.btnC = btn_color
        self.fBtnC = fontBtncolor

        wx.Panel.__init__(self, parent, -1)
        """constructor"""

        self.panel_1 = wx.Panel(self, wx.ID_ANY)
        self.list_ctrl = wx.ListCtrl(self.panel_1,
                                     wx.ID_ANY,
                                     style=wx.LC_REPORT | wx.SUNKEN_BORDER)
        nb1 = wx.Notebook(self.panel_1, wx.ID_ANY, style=0)
        nb1_p1 = wx.Panel(nb1, wx.ID_ANY)
        lab_prfl = wx.StaticText(nb1_p1, wx.ID_ANY,
                                 _("Select a preset from "
                                   "the drop down:"))
        self.cmbx_prst = wx.ComboBox(nb1_p1,
                                     wx.ID_ANY,
                                     choices=prst,
                                     size=(200, -1),
                                     style=wx.CB_DROPDOWN | wx.CB_READONLY)
        nb1_p2 = wx.Panel(nb1, wx.ID_ANY)
        labcmd_1 = wx.StaticBox(nb1_p2, wx.ID_ANY, _("First pass parameters"))
        self.txt_1cmd = wx.TextCtrl(nb1_p2,
                                    wx.ID_ANY,
                                    "",
                                    style=wx.TE_MULTILINE
                                    | wx.TE_PROCESS_ENTER)
        labcmd_2 = wx.StaticBox(nb1_p2, wx.ID_ANY, _("Second pass parameters"))
        self.txt_2cmd = wx.TextCtrl(nb1_p2,
                                    wx.ID_ANY,
                                    "",
                                    style=wx.TE_MULTILINE
                                    | wx.TE_PROCESS_ENTER)
        #--------------------------------### Audio.
        self.nb1_p3 = wx.Panel(nb1, wx.ID_ANY)
        self.rdbx_norm = wx.RadioBox(
            self.nb1_p3,
            wx.ID_ANY,
            (_("Audio Normalization")),
            choices=[
                ('Off'),
                ('PEAK'),
                ('RMS'),
                ('EBU R128'),
            ],
            majorDimension=0,
            style=wx.RA_SPECIFY_ROWS,
        )
        analyzebmp = wx.Bitmap(iconanalyzes, wx.BITMAP_TYPE_ANY)
        self.btn_analyzes = GB.GradientButton(self.nb1_p3,
                                              size=(-1, 25),
                                              bitmap=analyzebmp,
                                              label=_("Volumedected"))
        self.btn_analyzes.SetBaseColours(startcolour=wx.Colour(158, 201, 232),
                                         foregroundcolour=wx.Colour(
                                             self.fBtnC))
        self.btn_analyzes.SetBottomEndColour(wx.Colour(self.btnC))
        self.btn_analyzes.SetBottomStartColour(wx.Colour(self.btnC))
        self.btn_analyzes.SetTopStartColour(wx.Colour(self.btnC))
        self.btn_analyzes.SetTopEndColour(wx.Colour(self.btnC))

        peaklevelbmp = wx.Bitmap(iconpeaklevel, wx.BITMAP_TYPE_ANY)
        self.btn_details = GB.GradientButton(self.nb1_p3,
                                             size=(-1, 25),
                                             bitmap=peaklevelbmp,
                                             label=_("Volume Statistics"))
        self.btn_details.SetBaseColours(startcolour=wx.Colour(158, 201, 232),
                                        foregroundcolour=wx.Colour(self.fBtnC))
        self.btn_details.SetBottomEndColour(wx.Colour(self.btnC))
        self.btn_details.SetBottomStartColour(wx.Colour(self.btnC))
        self.btn_details.SetTopStartColour(wx.Colour(self.btnC))
        self.btn_details.SetTopEndColour(wx.Colour(self.btnC))

        self.lab_amplitude = wx.StaticText(self.nb1_p3, wx.ID_ANY,
                                           (_("Target level:")))
        self.spin_target = FS.FloatSpin(self.nb1_p3,
                                        wx.ID_ANY,
                                        min_val=-99.0,
                                        max_val=0.0,
                                        increment=0.5,
                                        value=-1.0,
                                        agwStyle=FS.FS_LEFT,
                                        size=(-1, -1))
        self.spin_target.SetFormat("%f"), self.spin_target.SetDigits(1)

        self.lab_i = wx.StaticText(self.nb1_p3, wx.ID_ANY,
                                   (_("Set integrated loudness target:  ")))
        self.spin_i = FS.FloatSpin(self.nb1_p3,
                                   wx.ID_ANY,
                                   min_val=-70.0,
                                   max_val=-5.0,
                                   increment=0.5,
                                   value=-24.0,
                                   agwStyle=FS.FS_LEFT,
                                   size=(-1, -1))
        self.spin_i.SetFormat("%f"), self.spin_i.SetDigits(1)

        self.lab_tp = wx.StaticText(self.nb1_p3, wx.ID_ANY,
                                    (_("Set maximum true peak:")))
        self.spin_tp = FS.FloatSpin(self.nb1_p3,
                                    wx.ID_ANY,
                                    min_val=-9.0,
                                    max_val=0.0,
                                    increment=0.5,
                                    value=-2.0,
                                    agwStyle=FS.FS_LEFT,
                                    size=(-1, -1))
        self.spin_tp.SetFormat("%f"), self.spin_tp.SetDigits(1)

        self.lab_lra = wx.StaticText(self.nb1_p3, wx.ID_ANY,
                                     (_("Set loudness range target:")))
        self.spin_lra = FS.FloatSpin(self.nb1_p3,
                                     wx.ID_ANY,
                                     min_val=1.0,
                                     max_val=20.0,
                                     increment=0.5,
                                     value=7.0,
                                     agwStyle=FS.FS_LEFT,
                                     size=(-1, -1))
        self.spin_lra.SetFormat("%f"), self.spin_lra.SetDigits(1)

        #----------------------Set Properties----------------------#
        if OS == 'Darwin':
            self.txt_1cmd.SetFont(wx.Font(10, wx.MODERN, wx.NORMAL, wx.BOLD))
            self.txt_2cmd.SetFont(wx.Font(10, wx.MODERN, wx.NORMAL, wx.BOLD))
        else:
            self.txt_1cmd.SetFont(wx.Font(8, wx.MODERN, wx.NORMAL, wx.BOLD))
            self.txt_2cmd.SetFont(wx.Font(8, wx.MODERN, wx.NORMAL, wx.BOLD))

        self.txt_1cmd.SetMinSize((430, 100))
        self.txt_2cmd.SetMinSize((430, 100))
        #self.list_ctrl.SetBackgroundColour(azure)
        #------- tooltips
        self.txt_1cmd.SetToolTip(
            _('First pass parameters of the '
              'selected profile'))
        self.txt_2cmd.SetToolTip(
            _('Second pass parameters of the '
              'selected profile'))
        self.btn_analyzes.SetToolTip(
            _('Gets maximum volume and average volume '
              'data in dBFS, then calculates the offset amount for audio '
              'normalization.'))
        self.spin_target.SetToolTip(
            _('Limiter for the maximum peak level or '
              'the mean level (when switch to RMS) in dBFS. From -99.0 to '
              '+0.0; default for PEAK level is -1.0; default for RMS is '
              '-20.0'))
        self.spin_i.SetToolTip(
            _('Integrated Loudness Target in LUFS. '
              'From -70.0 to -5.0, default is -24.0'))
        self.spin_tp.SetToolTip(
            _('Maximum True Peak in dBTP. From -9.0 '
              'to +0.0, default is -2.0'))
        self.spin_lra.SetToolTip(
            _('Loudness Range Target in LUFS. '
              'From +1.0 to +20.0, default is +7.0'))
        #----------------------Build Layout----------------------#
        #siz1 = wx.BoxSizer(wx.VERTICAL)
        siz1 = wx.FlexGridSizer(1, 1, 0, 0)
        grid_siz7 = wx.GridSizer(2, 1, 0, 0)
        grd_s1 = wx.FlexGridSizer(2, 1, 0, 0)
        grd_s2 = wx.FlexGridSizer(3, 1, 0, 0)
        grd_s4 = wx.GridSizer(1, 3, 0, 0)
        grid_siz5 = wx.FlexGridSizer(2, 2, 0, 0)
        grid_siz6 = wx.FlexGridSizer(1, 7, 0, 0)
        grd_s3 = wx.GridSizer(1, 2, 0, 0)
        grd_s5 = wx.FlexGridSizer(1, 2, 0, 0)

        grd_s1.Add(self.list_ctrl, 1, wx.ALL | wx.EXPAND, 15)
        labcmd_1.Lower()
        sizlab1 = wx.StaticBoxSizer(labcmd_1, wx.VERTICAL)
        sizlab1.Add(
            self.txt_1cmd, 0, wx.ALL | wx.EXPAND
            | wx.ALIGN_CENTER_HORIZONTAL
            | wx.ALIGN_CENTER_VERTICAL, 15)
        grd_s3.Add(
            sizlab1, 0, wx.ALL | wx.EXPAND
            | wx.ALIGN_CENTER_HORIZONTAL
            | wx.ALIGN_CENTER_VERTICAL, 15)

        labcmd_2.Lower()
        sizlab2 = wx.StaticBoxSizer(labcmd_2, wx.VERTICAL)
        sizlab2.Add(
            self.txt_2cmd, 0, wx.ALL | wx.EXPAND
            | wx.ALIGN_CENTER_HORIZONTAL
            | wx.ALIGN_CENTER_VERTICAL, 15)
        grd_s3.Add(
            sizlab2, 0, wx.ALL | wx.EXPAND
            | wx.ALIGN_CENTER_HORIZONTAL
            | wx.ALIGN_CENTER_VERTICAL, 15)
        grid_siz7.Add(lab_prfl, 0,
                      wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 0)
        grid_siz7.Add(self.cmbx_prst, 0, wx.ALIGN_CENTER_HORIZONTAL, 0)

        grd_s5.Add(self.rdbx_norm, 0, wx.ALL, 5)

        grid_normctrl = wx.FlexGridSizer(5, 2, 0, 0)

        grid_normctrl.Add(self.btn_analyzes, 0, wx.ALL, 10)
        grid_normctrl.Add(self.btn_details, 0, wx.ALL, 10)
        grid_normctrl.Add(self.lab_amplitude, 0, wx.ALL, 10)
        grid_normctrl.Add(self.spin_target, 0, wx.ALL, 5)
        grid_normctrl.Add(self.lab_i, 0, wx.ALL, 10)
        grid_normctrl.Add(self.spin_i, 0, wx.ALL, 5)
        grid_normctrl.Add(self.lab_tp, 0, wx.ALL, 10)
        grid_normctrl.Add(self.spin_tp, 0, wx.ALL, 5)
        grid_normctrl.Add(self.lab_lra, 0, wx.ALL, 10)
        grid_normctrl.Add(self.spin_lra, 0, wx.ALL, 5)
        grd_s5.Add(grid_normctrl)

        grid_siz8 = wx.GridSizer(1, 1, 0, 0)
        grid_siz8.Add(grd_s5, 0,
                      wx.ALIGN_CENTER_HORIZONTAL | wx.ALIGN_CENTER_VERTICAL, 5)
        nb1_p1.SetSizer(grid_siz7)
        nb1_p2.SetSizer(grd_s3)
        self.nb1_p3.SetSizer(grid_siz8)
        nb1.AddPage(nb1_p1, (_("Preset Selection")))
        nb1.AddPage(nb1_p2, (_("Command line FFmpeg")))
        nb1.AddPage(self.nb1_p3, (_("Automations")))
        grd_s2.Add(nb1, 1, wx.EXPAND, 0)
        grd_s2.Add(grd_s4, 1, wx.EXPAND, 0)
        grd_s1.Add(grd_s2, 1, wx.ALL | wx.EXPAND, 15)
        self.panel_1.SetSizer(grd_s1)
        siz1.Add(self.panel_1, 1, wx.EXPAND, 0)
        self.SetSizer(siz1)
        siz1.AddGrowableRow(0)
        siz1.AddGrowableCol(0)
        grd_s1.AddGrowableRow(0)
        grd_s1.AddGrowableCol(0)
        grd_s2.AddGrowableRow(0)
        grd_s2.AddGrowableCol(0)
        self.Layout()

        #----------------------Binder (EVT)----------------------#
        self.Bind(wx.EVT_COMBOBOX, self.on_choice_profiles, self.cmbx_prst)
        self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.on_select, self.list_ctrl)
        self.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.parent.Run_Coding,
                  self.list_ctrl)
        self.Bind(wx.EVT_RADIOBOX, self.on_Enable_norm, self.rdbx_norm)
        self.Bind(wx.EVT_BUTTON, self.on_Analyzes, self.btn_analyzes)
        self.Bind(wx.EVT_BUTTON, self.on_Show_normlist, self.btn_details)
        self.Bind(wx.EVT_SPINCTRL, self.enter_Amplitude, self.spin_target)

        #---------------------------- defaults
        self.cmbx_prst.SetSelection(0)
        self.set_listctrl()
        self.normalization_default()
    def __init__(self):
        wx.Frame.__init__(self, None, title='aaa', size=(839, 626), name='frame', style=541072384)
        self.启动窗口 = wx.Panel(self)
        self.Centre()
        self.按钮4 = wx.Button(self.启动窗口, size=(129, 52), pos=(12, 505), label='按钮', name='button')
        self.按钮4.Bind(wx.事件_按钮_被点击, self.按钮4_按钮被单击)
        self.编辑框4 = wx.TextCtrl(self.启动窗口, size=(159, 45), pos=(155, 508), value='1234567890', name='text', style=0)
        self.编辑框4.Bind(wx.EVT_TEXT, self.编辑框4_内容被改变)
        self.按钮5 = wx.Button(self.启动窗口, size=(80, 32), pos=(21, 9), label='按钮', name='button')
        self.标签2 = wx.StaticText(self.启动窗口, size=(80, 24), pos=(118, 9), label='标签', name='staticText', style=2321)
        self.编辑框5 = wx.TextCtrl(self.启动窗口, size=(80, 22), pos=(269, 12), value='', name='text', style=0)
        self.单选框2 = wx.RadioButton(self.启动窗口, size=(80, 24), pos=(378, 22), name='radioButton', label='单选框')
        self.多选框2 = wx.CheckBox(self.启动窗口, size=(80, 24), pos=(488, 15), name='check', label='多选框', style=12288)
        self.图片框3 = wx.StaticBitmap(self.启动窗口, size=(64, 64), pos=(596, 20), name='staticBitmap', style=0)
        self.组合框2 = wx.ComboBox(self.启动窗口, value='', pos=(17, 76), name='comboBox', choices=[], style=16)
        self.组合框2.SetSize((100, 22))
        self.进度条2 = wx.Gauge(self.启动窗口, range=100, size=(120, 24), pos=(141, 73), name='gauge', style=4)
        self.进度条2.SetValue(0)
        self.滑块条2 = wx.Slider(self.启动窗口, size=(120, 22), pos=(292, 83), name='slider', minValue=1, maxValue=100,
                              value=1, style=4)
        self.滑块条2.SetTickFreq(10)
        self.滑块条2.SetPageSize(5)
        self.整数微调框2 = wx.SpinCtrl(self.启动窗口, size=(60, 24), pos=(458, 78), name='wxSpinCtrl', min=0, max=100, initial=0,
                                  style=0)
        self.整数微调框2.SetBase(10)
        self.动画框2 = wx.adv.AnimationCtrl(self.启动窗口, size=(64, 64), pos=(26, 138), name='animationctrl', style=2097152)
        self.列表框2 = wx.ListBox(self.启动窗口, size=(100, 50), pos=(137, 152), name='listBox', choices=[], style=32)
        self.选择列表框2 = wx.CheckListBox(self.启动窗口, size=(100, 50), pos=(288, 155), name='listBox', choices=[], style=0)
        self.图形按钮2 = wx.BitmapButton(self.启动窗口, size=(80, 32), pos=(416, 155), name='button')
        # self.超级链接框4 = wx.adv.HyperlinkCtrl(self.启动窗口, size=(60, 22), pos=(541, 167), name='hyperlink', label='易起玩',
        #                                    url='www.012.plus', style=1)
        self.排序列表框2 = wx.adv.EditableListBox(self.启动窗口, size=(170, 140), pos=(638, 138), name='editableListBox',
                                             label='', style=1792)
        self.排序列表框2.SetStrings([])
        self.引导按钮2 = wx.adv.CommandLinkButton(self.启动窗口, size=(110, 50), pos=(55, 260), name='button', mainLabel='标签内容',
                                              note='描述内容')
        self.日历框2 = wx.adv.CalendarCtrl(self.启动窗口, size=(246, 163), pos=(232, 271), name='CalendarCtrl', style=1)
        self.日期框2 = wx.adv.DatePickerCtrl(self.启动窗口, size=(100, 24), pos=(505, 286), name='datectrl', style=2)
        self.时间框2 = wx.adv.TimePickerCtrl(self.启动窗口, size=(70, 24), pos=(499, 340), name='timectrl')
        self.时间框2.SetTime(17, 2, 43)
        self.超级列表框2 = wx.ListCtrl(self.启动窗口, size=(100, 80), pos=(516, 391), name='listCtrl', style=8227)
        self.横向滚动条2 = wx.ScrollBar(self.启动窗口, size=(60, 20), pos=(389, 474), name='scrollBar', style=4)
        self.横向滚动条2.SetScrollbar(0, 1, 2, 1, True)
        self.纵向滚动条2 = wx.ScrollBar(self.启动窗口, size=(20, 60), pos=(463, 458), name='scrollBar', style=8)
        self.纵向滚动条2.SetScrollbar(0, 1, 2, 1, True)
        self.分组单选框2 = wx.RadioBox(self.启动窗口, size=(120, 60), pos=(52, 365), label='单选项', choices=['示例1', '示例2'],
                                  majorDimension=0, name='radioBox', style=4)
        self.颜色选择器2 = wx.ColourPickerCtrl(self.启动窗口, size=(80, 28), pos=(76, 207), colour=(0, 0, 0, 255),
                                          name='colourpicker', style=0)
        self.图文按钮2 = lib_button.ThemedGenBitmapTextButton(self.启动窗口, size=(100, 32), pos=(208, 230), bitmap=None,
                                                          label='图文按钮', name='genbutton')
        self.图文按钮L2 = lib_gb.GradientButton(self.启动窗口, size=(100, 32), pos=(359, 228), bitmap=None, label='图文按钮L',
                                            name='gradientbutton')
        self.图文按钮L2.SetForegroundColour((255, 255, 255, 255))
        self.超级链接框L2 = lib_hyperlink.HyperLinkCtrl(self.启动窗口, size=(80, 22), pos=(503, 234), name='staticText',
                                                   label='易起玩', URL='www.012.plus')
        超级链接框L2_字体 = wx.Font(9, 70, 90, 400, True, 'Microsoft YaHei UI', -1)
        self.超级链接框L2.SetFont(超级链接框L2_字体)
        self.超级链接框L2.SetForegroundColour((0, 0, 255, 255))
        self.小数微调框2 = lib_fs.FloatSpin(self.启动窗口, size=(80, -1), pos=(631, 310), name='FloatSpin', min_val=0,
                                       max_val=5.0, increment=0.1, value=1.1, agwStyle=4)
        self.小数微调框2.SetDigits(1)

        self.时钟2 = wx.时钟(self)
        self.时钟2.启动(1000)
        self.Bind(wx.EVT_TIMER, self.时钟2_周期事件, self.时钟2)
Пример #19
0
    def __init__(self, setui, fileconf, path_confdir, PWD, ffmpeg_link,
                 ffprobe_link, ffplay_link, pathicons):
        """
        NOTE: 'path_srcShare' is a current work directory of Videomass 
               program. How it can be localized depend if Videomass is 
               run as portable program or installated program.
        """

        self.videomass_icon = pathicons[0]
        self.icon_presets = pathicons[1]
        self.icon_switchvideomass = pathicons[2]
        self.icon_process = pathicons[3]
        self.icon_help = pathicons[4]
        self.icon_headphones = pathicons[5]
        self.icon_import = pathicons[6]
        barC = fileconf[14].split(',')
        barColor = wx.Colour(int(barC[0]), int(barC[1]),
                             int(barC[2]))  # toolbar panel colour
        bBtnC = fileconf[15].split(',')
        self.bBtnC = wx.Colour(int(bBtnC[0]), int(bBtnC[1]),
                               int(bBtnC[2]))  # toolbar buttons colour

        #self.helping = setui[5]# path contestual help for helping:
        self.OS = setui[0]  # ID of the operative system:
        path_srcShare = setui[1]  # share dir (are where the origin files?):

        #---------------------------#
        self.threads = fileconf[2]  #ffmpeg option, set the cpu threads
        self.cpu_used = fileconf[3]
        self.ffmpeg_log = ''  #fileconf[3]
        self.save_log = fileconf[4]
        self.path_log = fileconf[5]
        self.loglevel_type = fileconf[6]  # marks as single process
        self.loglevel_batch = ''  #fileconf[7]# marks as batch process
        self.ffmpeg_check = fileconf[7]
        self.ffprobe_check = fileconf[9]
        self.ffplay_check = fileconf[11]
        self.ffmpeg_link = ffmpeg_link
        self.ffprobe_link = ffprobe_link
        self.ffplay_link = ffplay_link
        self.iconset = fileconf[13]
        #-------------------------------#
        self.import_clicked = ''  #when clicking on item in list control self-set
        self.post_process = [
        ]  # at the end of any process put file for play/metadata
        self.file_sources = []  # list of items in list control
        self.file_destin = ''  # path name for file saved destination
        self.panelshown = ''  # gives current (previusly) panel shown
        self.time_seq = ''
        self.duration = []

        wx.Frame.__init__(self, None, -1, style=wx.DEFAULT_FRAME_STYLE)
        #----------- panel toolbar buttons
        self.btnpanel = wx.Panel(self, wx.ID_ANY, style=wx.TAB_TRAVERSAL)

        infoIbmp = wx.Bitmap(pathicons[7], wx.BITMAP_TYPE_ANY)
        previewbmp = wx.Bitmap(pathicons[8], wx.BITMAP_TYPE_ANY)
        cutbmp = wx.Bitmap(pathicons[9], wx.BITMAP_TYPE_ANY)
        saveprfbmp = wx.Bitmap(pathicons[12], wx.BITMAP_TYPE_ANY)
        newprfbmp = wx.Bitmap(pathicons[13], wx.BITMAP_TYPE_ANY)
        delprfbmp = wx.Bitmap(pathicons[14], wx.BITMAP_TYPE_ANY)
        editprfbmp = wx.Bitmap(pathicons[15], wx.BITMAP_TYPE_ANY)

        self.btn_metaI = GB.GradientButton(self.btnpanel,
                                           size=(-1, 25),
                                           bitmap=infoIbmp,
                                           label=_(u"Show Metadata"))
        self.btn_metaI.SetBaseColours(startcolour=wx.Colour(158, 201, 232),
                                      foregroundcolour=wx.Colour(28, 28, 28))
        self.btn_metaI.SetBottomEndColour(self.bBtnC)
        self.btn_metaI.SetBottomStartColour(self.bBtnC)
        self.btn_metaI.SetTopStartColour(self.bBtnC)
        self.btn_metaI.SetTopEndColour(self.bBtnC)

        self.btn_playO = GB.GradientButton(self.btnpanel,
                                           size=(-1, 25),
                                           bitmap=previewbmp,
                                           label=_(u"Preview"))
        self.btn_playO.SetBaseColours(startcolour=wx.Colour(158, 201, 232),
                                      foregroundcolour=wx.Colour(28, 28, 28))
        self.btn_playO.SetBottomEndColour(self.bBtnC)
        self.btn_playO.SetBottomStartColour(self.bBtnC)
        self.btn_playO.SetTopStartColour(self.bBtnC)
        self.btn_playO.SetTopEndColour(self.bBtnC)

        self.btn_duration = GB.GradientButton(self.btnpanel,
                                              size=(-1, 25),
                                              bitmap=cutbmp,
                                              label=_(u"Duration"))
        self.btn_duration.SetBaseColours(startcolour=wx.Colour(158, 201, 232),
                                         foregroundcolour=wx.Colour(
                                             28, 28, 28))
        self.btn_duration.SetBottomEndColour(self.bBtnC)
        self.btn_duration.SetBottomStartColour(self.bBtnC)
        self.btn_duration.SetTopStartColour(self.bBtnC)
        self.btn_duration.SetTopEndColour(self.bBtnC)

        self.btn_saveprf = GB.GradientButton(self.btnpanel,
                                             size=(-1, 25),
                                             bitmap=saveprfbmp,
                                             label=_(u"Save As Profile"))
        self.btn_saveprf.SetBaseColours(startcolour=wx.Colour(158, 201, 232),
                                        foregroundcolour=wx.Colour(28, 28, 28))
        self.btn_saveprf.SetBottomEndColour(self.bBtnC)
        self.btn_saveprf.SetBottomStartColour(self.bBtnC)
        self.btn_saveprf.SetTopStartColour(self.bBtnC)
        self.btn_saveprf.SetTopEndColour(self.bBtnC)

        self.btn_newprf = GB.GradientButton(self.btnpanel,
                                            size=(-1, 25),
                                            bitmap=newprfbmp,
                                            label=_(u"New.."))
        self.btn_newprf.SetBaseColours(startcolour=wx.Colour(158, 201, 232),
                                       foregroundcolour=wx.Colour(28, 28, 28))
        self.btn_newprf.SetBottomEndColour(self.bBtnC)
        self.btn_newprf.SetBottomStartColour(self.bBtnC)
        self.btn_newprf.SetTopStartColour(self.bBtnC)
        self.btn_newprf.SetTopEndColour(self.bBtnC)

        self.btn_delprf = GB.GradientButton(self.btnpanel,
                                            size=(-1, 25),
                                            bitmap=delprfbmp,
                                            label=_(u"Delete.."))
        self.btn_delprf.SetBaseColours(startcolour=wx.Colour(158, 201, 232),
                                       foregroundcolour=wx.Colour(28, 28, 28))
        self.btn_delprf.SetBottomEndColour(self.bBtnC)
        self.btn_delprf.SetBottomStartColour(self.bBtnC)
        self.btn_delprf.SetTopStartColour(self.bBtnC)
        self.btn_delprf.SetTopEndColour(self.bBtnC)

        self.btn_editprf = GB.GradientButton(self.btnpanel,
                                             size=(-1, 25),
                                             bitmap=editprfbmp,
                                             label=_(u"Edit.."))
        self.btn_editprf.SetBaseColours(startcolour=wx.Colour(158, 201, 232),
                                        foregroundcolour=wx.Colour(28, 28, 28))
        self.btn_editprf.SetBottomEndColour(self.bBtnC)
        self.btn_editprf.SetBottomStartColour(self.bBtnC)
        self.btn_editprf.SetTopStartColour(self.bBtnC)
        self.btn_editprf.SetTopEndColour(self.bBtnC)

        self.btnpanel.SetBackgroundColour(barColor)
        #self.btnpanel.SetBackgroundColour(wx.Colour(205, 235, 222))
        #---------- others panel instances:
        self.PrstsPanel = presets_mng_panel.PresetsPanel(
            self,
            path_srcShare,
            path_confdir,
            PWD,
            self.threads,
            self.cpu_used,
            self.loglevel_type,
            self.ffmpeg_link,
            self.OS,
        )
        self.VconvPanel = video_conv.Video_Conv(
            self,
            self.ffmpeg_link,
            self.ffplay_link,
            self.threads,
            self.cpu_used,
            self.loglevel_type,
            self.OS,
            pathicons[10],  # icon playfilters
            pathicons[11],  # icon resetfilters
            pathicons[16],  # icon resize
            pathicons[17],  # icon crop
            pathicons[18],  # icon rotate
            pathicons[19],  # icon deinterlace
            pathicons[20],  # icon ic_denoiser
            pathicons[21],  # icon analyzes
            pathicons[22],  # icon settings
        )
        self.AconvPanel = audio_conv.Audio_Conv(
            self,
            self.ffmpeg_link,
            self.threads,
            self.cpu_used,
            self.loglevel_type,
            self.ffprobe_link,
            self.OS,
            pathicons[21],  # icon analyzes
            pathicons[22],  # icon settings
        )

        self.DnD = dragNdrop.DnDPanel(self,
                                      self.ffprobe_link)  # dragNdrop panel

        self.PrstsPanel.Hide()
        self.VconvPanel.Hide()
        self.AconvPanel.Hide()
        # Layout toolbar buttons:
        self.DnDsizer = wx.BoxSizer(wx.VERTICAL)  # sizer base global
        grid_pan = wx.FlexGridSizer(1, 7, 0, 0)
        grid_pan.Add(self.btn_metaI, 0, wx.CENTER | wx.ALL, 5)
        grid_pan.Add(self.btn_playO, 0, wx.CENTER | wx.ALL, 5)
        grid_pan.Add(self.btn_duration, 0, wx.CENTER | wx.ALL, 5)
        grid_pan.Add(self.btn_saveprf, 0, wx.CENTER | wx.ALL, 5)
        grid_pan.Add(self.btn_newprf, 0, wx.CENTER | wx.ALL, 5)
        grid_pan.Add(self.btn_delprf, 0, wx.CENTER | wx.ALL, 5)
        grid_pan.Add(self.btn_editprf, 0, wx.CENTER | wx.ALL, 5)
        self.btnpanel.SetSizer(grid_pan)  # set panel
        self.DnDsizer.Add(self.btnpanel, 0, wx.EXPAND, 0)
        # Layout externals panels:
        self.DnDsizer.Add(self.DnD, 1, wx.EXPAND | wx.ALL, 0)
        self.DnDsizer.Add(self.PrstsPanel, 1, wx.EXPAND | wx.ALL, 0)
        self.DnDsizer.Add(self.VconvPanel, 1, wx.EXPAND | wx.ALL, 0)
        self.DnDsizer.Add(self.AconvPanel, 1, wx.EXPAND | wx.ALL, 0)

        #----------------------Set Properties----------------------#
        self.SetTitle("Videomass")
        self.btn_playO.Hide()
        icon = wx.EmptyIcon()
        icon.CopyFromBitmap(wx.Bitmap(self.videomass_icon, wx.BITMAP_TYPE_ANY))
        self.SetIcon(icon)
        if self.OS == 'Darwin':
            self.SetSize((920, 435))
        elif self.OS == 'Linux':
            self.SetSize((900, 530))
        elif self.OS == 'Windows':
            self.SetSize((900, 530))
        #self.Centre()
        #self.CentreOnScreen() # se lo usi, usa CentreOnScreen anziche Centre
        self.SetSizer(self.DnDsizer)
        self.Layout()

        # Tooltips:
        self.btn_duration.SetToolTipString(
            _(u'Sets a global time sequences to '
              u'apply at any media file with duration.'))
        self.btn_metaI.SetToolTipString(
            _(u"Show information about the metadata "
              u"of the selected imported file."))
        self.btn_playO.SetToolTipString(
            _(u"Preview exported files. Reproduction "
              u"exported file when finish encoding."))
        self.btn_saveprf.SetToolTipString(
            _(u"Save as profile with the current "
              u"settings of this panel."))
        self.btn_newprf.SetToolTipString(
            _(u"Create a new profile from yourself "
              u"and save it in the selected preset."))
        self.btn_delprf.SetToolTipString(_(u"Delete the selected profile."))
        self.btn_editprf.SetToolTipString(_(u"Edit the selected profile."))
        # menu bar
        self.videomass_menu_bar()
        ## tool bar main
        self.videomass_tool_bar()
        self.Setup_items_bar()
        # status bar
        self.sb = self.CreateStatusBar(1)

        #---------------------- Binding (EVT) ----------------------#
        self.DnD.ckbx_dir.Bind(wx.EVT_CHECKBOX, self.onCheckBox)
        self.DnD.btn_save.Bind(wx.EVT_BUTTON, self.onCustomSave)
        self.Bind(wx.EVT_BUTTON, self.Cut_range, self.btn_duration)
        self.Bind(wx.EVT_BUTTON, self.Saveprofile, self.btn_saveprf)
        self.Bind(wx.EVT_BUTTON, self.Newprofile, self.btn_newprf)
        self.Bind(wx.EVT_BUTTON, self.Delprofile, self.btn_delprf)
        self.Bind(wx.EVT_BUTTON, self.Editprofile, self.btn_editprf)
        self.Bind(wx.EVT_BUTTON, self.ImportInfo, self.btn_metaI)
        self.Bind(wx.EVT_BUTTON, self.ExportPlay, self.btn_playO)
        #self.Bind(wx.EVT_SHOW, self.panelShown)
        #self.DnDPanel.fileListCtrl.Bind(wx.EVT_LIST_INSERT_ITEM, self.new_isertion)
        self.Bind(wx.EVT_CLOSE, self.on_close)  # controlla la chiusura (x)
        #-----------------------------------------------------------#
        self.statusbar_msg('Drag and Drop - panel',
                           None)  #set default statusmsg
Пример #20
0
    def __init__(self, parent, ffmpeg_link, threads, ffmpeg_loglev,
                 ffprobe_link, OS, iconanalyzes, iconsettings, iconpeaklevel,
                 btn_color, fontBtncolor):

        self.parent = parent
        self.ffmpeg_link = ffmpeg_link
        self.threads = threads
        self.ffmpeg_loglevel = ffmpeg_loglev
        self.ffprobe_link = ffprobe_link
        self.OS = OS
        self.btnC = btn_color
        self.fBtnC = fontBtncolor
        #self.DIRconf = DIRconf
        self.file_sources = []
        self.file_destin = ''
        self.normdetails = []

        wx.Panel.__init__(self, parent, -1)
        """ constructor"""
        # Widgets definitions:
        self.cmbx_a = wx.ComboBox(self,
                                  wx.ID_ANY,
                                  choices=[x for x in acodecs.keys()],
                                  size=(120, -1),
                                  style=wx.CB_DROPDOWN | wx.CB_READONLY)
        self.cmbx_a.SetSelection(4)
        setbmp = wx.Bitmap(iconsettings, wx.BITMAP_TYPE_ANY)
        self.btn_param = GB.GradientButton(self,
                                           size=(-1, 25),
                                           bitmap=setbmp,
                                           label=_("Audio Options"))
        self.btn_param.SetBaseColours(startcolour=wx.Colour(158, 201, 232),
                                      foregroundcolour=wx.Colour(self.fBtnC))
        self.btn_param.SetBottomEndColour(wx.Colour(self.btnC))
        self.btn_param.SetBottomStartColour(wx.Colour(self.btnC))
        self.btn_param.SetTopStartColour(wx.Colour(self.btnC))
        self.btn_param.SetTopEndColour(wx.Colour(self.btnC))

        self.txt_options = wx.TextCtrl(self,
                                       wx.ID_ANY,
                                       size=(265, -1),
                                       style=wx.TE_READONLY)
        self.rdbx_norm = wx.RadioBox(
            self,
            wx.ID_ANY,
            (_("Audio Normalization")),
            choices=[
                ('Off'),
                ('PEAK'),
                ('RMS'),
                ('EBU R128'),
            ],
            majorDimension=0,
            style=wx.RA_SPECIFY_ROWS,
        )
        analyzebmp = wx.Bitmap(iconanalyzes, wx.BITMAP_TYPE_ANY)
        self.btn_analyzes = GB.GradientButton(self,
                                              size=(-1, 25),
                                              bitmap=analyzebmp,
                                              label=_("Volumedected"))
        self.btn_analyzes.SetBaseColours(startcolour=wx.Colour(158, 201, 232),
                                         foregroundcolour=wx.Colour(
                                             self.fBtnC))
        self.btn_analyzes.SetBottomEndColour(wx.Colour(self.btnC))
        self.btn_analyzes.SetBottomStartColour(wx.Colour(self.btnC))
        self.btn_analyzes.SetTopStartColour(wx.Colour(self.btnC))
        self.btn_analyzes.SetTopEndColour(wx.Colour(self.btnC))

        peaklevelbmp = wx.Bitmap(iconpeaklevel, wx.BITMAP_TYPE_ANY)
        self.btn_details = GB.GradientButton(self,
                                             size=(-1, 25),
                                             bitmap=peaklevelbmp,
                                             label=_("Volume Statistics"))
        self.btn_details.SetBaseColours(startcolour=wx.Colour(158, 201, 232),
                                        foregroundcolour=wx.Colour(self.fBtnC))
        self.btn_details.SetBottomEndColour(wx.Colour(self.btnC))
        self.btn_details.SetBottomStartColour(wx.Colour(self.btnC))
        self.btn_details.SetTopStartColour(wx.Colour(self.btnC))
        self.btn_details.SetTopEndColour(wx.Colour(self.btnC))

        self.lab_amplitude = wx.StaticText(self, wx.ID_ANY,
                                           (_("Target level:")))
        self.spin_target = FS.FloatSpin(self,
                                        wx.ID_ANY,
                                        min_val=-99.0,
                                        max_val=0.0,
                                        increment=0.5,
                                        value=-1.0,
                                        agwStyle=FS.FS_LEFT,
                                        size=(-1, -1))
        self.spin_target.SetFormat("%f"), self.spin_target.SetDigits(1)

        self.lab_i = wx.StaticText(self, wx.ID_ANY,
                                   (_("Set integrated loudness target:  ")))
        self.spin_i = FS.FloatSpin(self,
                                   wx.ID_ANY,
                                   min_val=-70.0,
                                   max_val=-5.0,
                                   increment=0.5,
                                   value=-24.0,
                                   agwStyle=FS.FS_LEFT,
                                   size=(-1, -1))
        self.spin_i.SetFormat("%f"), self.spin_i.SetDigits(1)

        self.lab_tp = wx.StaticText(self, wx.ID_ANY,
                                    (_("Set maximum true peak:")))
        self.spin_tp = FS.FloatSpin(self,
                                    wx.ID_ANY,
                                    min_val=-9.0,
                                    max_val=0.0,
                                    increment=0.5,
                                    value=-2.0,
                                    agwStyle=FS.FS_LEFT,
                                    size=(-1, -1))
        self.spin_tp.SetFormat("%f"), self.spin_tp.SetDigits(1)

        self.lab_lra = wx.StaticText(self, wx.ID_ANY,
                                     (_("Set loudness range target:")))
        self.spin_lra = FS.FloatSpin(self,
                                     wx.ID_ANY,
                                     min_val=1.0,
                                     max_val=20.0,
                                     increment=0.5,
                                     value=7.0,
                                     agwStyle=FS.FS_LEFT,
                                     size=(-1, -1))
        self.spin_lra.SetFormat("%f"), self.spin_lra.SetDigits(1)

        #----------------------Set Layout----------------------#
        sizer_base = wx.BoxSizer(wx.VERTICAL)
        sizer_global = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, ("")),
                                         wx.VERTICAL)
        sizer_2 = wx.BoxSizer(wx.HORIZONTAL)
        grid_sizer_3 = wx.FlexGridSizer(7, 2, 0, 0)
        grid_sizer_1 = wx.GridSizer(2, 1, 0, 0)
        grid_sizer_2 = wx.FlexGridSizer(2, 2, 0, 0)
        grid_sizer_4 = wx.FlexGridSizer(2, 4, 0, 0)
        #grid_sizer_5 = wx.FlexGridSizer(1, 3, 0, 0)
        sizer_3 = wx.StaticBoxSizer(
            wx.StaticBox(self, wx.ID_ANY, (_("Audio format selection"))),
            wx.VERTICAL)
        sizer_3.Add(self.cmbx_a, 0, wx.ALIGN_CENTER | wx.ALL, 20)
        grid_sizer_1.Add(sizer_3, 1, wx.ALL | wx.EXPAND, 5)
        grid_sizer_2.Add((0, 20), 0, wx.EXPAND | wx.TOP, 5)
        grid_sizer_2.Add((0, 20), 0, wx.EXPAND | wx.TOP, 5)
        grid_sizer_2.Add(self.btn_param, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL,
                         5)
        grid_sizer_2.Add(self.txt_options, 0,
                         wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
        grid_sizer_1.Add(grid_sizer_2, 1, 0, 0)
        sizer_2.Add(grid_sizer_1, 1, wx.ALL | wx.EXPAND, 20)
        grid_sizer_3.Add(self.rdbx_norm, 0, wx.TOP, 5)
        grid_sizer_3.Add((20, 20), 0, wx.EXPAND | wx.TOP, 5)
        grid_sizer_3.Add(self.btn_analyzes, 0, wx.TOP, 10)
        grid_sizer_3.Add((20, 20), 0, wx.EXPAND | wx.TOP, 5)
        grid_sizer_3.Add(self.btn_details, 0, wx.TOP, 10)
        grid_sizer_3.Add((20, 20), 0, wx.EXPAND | wx.TOP, 5)
        grid_sizer_3.Add(self.lab_amplitude, 0, wx.TOP, 10)
        grid_sizer_3.Add(self.spin_target, 0, wx.TOP, 5)
        grid_sizer_3.Add(self.lab_i, 0, wx.TOP, 10)
        grid_sizer_3.Add(self.spin_i, 0, wx.TOP, 5)
        grid_sizer_3.Add(self.lab_tp, 0, wx.TOP, 10)
        grid_sizer_3.Add(self.spin_tp, 0, wx.TOP, 5)
        grid_sizer_3.Add(self.lab_lra, 0, wx.TOP, 10)
        grid_sizer_3.Add(self.spin_lra, 0, wx.TOP, 5)

        sizer_2.Add(grid_sizer_3, 1, wx.ALL | wx.EXPAND, 20)
        sizer_global.Add(sizer_2, 1, wx.ALL | wx.EXPAND, 5)
        sizer_base.Add(sizer_global, 1, wx.ALL | wx.EXPAND, 5)
        self.SetSizer(sizer_base)
        # Set tooltip:
        self.btn_param.SetToolTip(
            _('Audio bit-rate, audio channel and audio '
              'rate of the selected audio codec.'))
        self.btn_analyzes.SetToolTip(
            _('Gets maximum volume and average volume '
              'data in dBFS, then calculates the offset amount for audio '
              'normalization.'))
        self.spin_target.SetToolTip(
            _('Limiter for the maximum peak level or '
              'the mean level (when switch to RMS) in dBFS. From -99.0 to '
              '+0.0; default for PEAK level is -1.0; default for RMS is '
              '-20.0'))
        self.spin_i.SetToolTip(
            _('Integrated Loudness Target in LUFS. '
              'From -70.0 to -5.0, default is -24.0'))
        self.spin_tp.SetToolTip(
            _('Maximum True Peak in dBTP. From -9.0 '
              'to +0.0, default is -2.0'))
        self.spin_lra.SetToolTip(
            _('Loudness Range Target in LUFS. '
              'From +1.0 to +20.0, default is +7.0'))

        #----------------------Binding (EVT)----------------------#
        self.cmbx_a.Bind(wx.EVT_COMBOBOX, self.audioFormats)
        self.Bind(wx.EVT_BUTTON, self.on_Param, self.btn_param)
        self.Bind(wx.EVT_RADIOBOX, self.on_Enable_norm, self.rdbx_norm)
        self.Bind(wx.EVT_BUTTON, self.on_Analyzes, self.btn_analyzes)
        self.Bind(wx.EVT_BUTTON, self.on_Show_normlist, self.btn_details)
        self.Bind(wx.EVT_SPINCTRL, self.enter_Amplitude, self.spin_target)

        # set default :
        self.normalization_default()
Пример #21
0
    def __init__(self, parent):
        wx.ScrolledWindow.__init__(self, parent=parent)
        self.SetBackgroundColour('BLACK')
        self.SetScrollbars(20, 20, 55, 40)
        self.Scroll(0, 0)

        self.Show()

        hbox = wx.BoxSizer(wx.HORIZONTAL)
        pnl1 = wx.Panel(self, -1, style=wx.SIMPLE_BORDER)

        #pnl1.Bind(wx.EVT_SCROLLWIN, self.OnScroll)
        #first = pnl1.SetScrollbar(wx.VERTICAL, 0, 6, 50);

        pnl2 = wx.Panel(self, -1, style=wx.SIMPLE_BORDER)
        pnl3 = wx.Panel(self, -1, style=wx.SIMPLE_BORDER)
        pnl4 = wx.Panel(self, -1, style=wx.SIMPLE_BORDER)

        hbox.Add(pnl1, 1, wx.EXPAND | wx.ALL, 3)
        hbox.Add(pnl2, 1, wx.EXPAND | wx.ALL, 3)
        hbox.Add(pnl3, 1, wx.EXPAND | wx.ALL, 3)
        hbox.Add(pnl4, 1, wx.EXPAND | wx.ALL, 3)

        siz = wx.GridBagSizer(4, 4)

        self.base_path = os.path.dirname(os.path.abspath(__file__))
        self.data = []

        # -----------------------------------------------
        # create the widgel.ts

        # add the data viewing control
        self.pdfOlv = ObjectListView(pnl1,
                                     style=wx.LC_REPORT | wx.SUNKEN_BORDER)

        ### USE TO MAKE LIST OF ITEM DOUBLE CLICK AND OPEN
        self.pdfOlv.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.onDoubleClick)

        ### FIRST THING TO DISPLAY IF NOTHING IS LOADED
        self.pdfOlv.SetEmptyListMsg("No PDFs Found!")
        self.updateDisplay()

        browseBtn = wx.Button(pnl1, label="Browse")
        browseBtn.Bind(wx.EVT_BUTTON, self.getPdfs)

        # -----------------------------------------------
        # layout the widgets
        mainSizer = wx.BoxSizer(wx.VERTICAL)

        mainSizer.Add(self.pdfOlv, 1, wx.ALL | wx.EXPAND, 5)
        mainSizer.Add(browseBtn, 0, wx.ALL | wx.CENTER, 5)

        self.SetSizer(mainSizer)

        # -----------------------------------------------
        # layout the widgets
        mainSizer = wx.BoxSizer(wx.VERTICAL)

        mainSizer.Add(self.pdfOlv, 1, wx.ALL | wx.EXPAND, 5)
        mainSizer.Add(browseBtn, 0, wx.ALL | wx.CENTER, 5)

        self.SetSizer(mainSizer)

        ##########################################################################################################################################
        ##   #
        #Panel 2 Button Starts Here

        siz2 = wx.GridBagSizer(4, 4)
        movbtn21 = gbtn.GradientButton(pnl2,
                                       1,
                                       label='Better',
                                       bitmap=wx.Bitmap(
                                           "ima/mov.jpg", wx.BITMAP_TYPE_JPEG))
        siz2.Add(movbtn21, (1, 1), flag=wx.LEFT | wx.RIGHT, border=5)

        movbtn31 = gbtn.GradientButton(pnl2,
                                       1,
                                       label='Drills  ',
                                       bitmap=wx.Bitmap(
                                           "ima/mov17.jpg",
                                           wx.BITMAP_TYPE_JPEG))
        siz2.Add(movbtn31, (2, 0), flag=wx.LEFT | wx.RIGHT, border=5)

        movbtn41 = gbtn.GradientButton(pnl2,
                                       1,
                                       label='Freed',
                                       bitmap=wx.Bitmap(
                                           "ima/mov23.jpg",
                                           wx.BITMAP_TYPE_JPEG))
        siz2.Add(movbtn41, (3, 0), flag=wx.LEFT | wx.RIGHT, border=5)
        movbtn51 = gbtn.GradientButton(pnl2,
                                       1,
                                       label='Billz ',
                                       bitmap=wx.Bitmap(
                                           "ima/mov6.jpg",
                                           wx.BITMAP_TYPE_JPEG))
        siz2.Add(movbtn51, (4, 0), flag=wx.LEFT | wx.RIGHT, border=5)
        movbtn61 = gbtn.GradientButton(pnl2,
                                       1,
                                       label='Drills',
                                       bitmap=wx.Bitmap(
                                           "ima/mov7.jpg",
                                           wx.BITMAP_TYPE_JPEG))
        siz2.Add(movbtn61, (5, 0), flag=wx.LEFT | wx.RIGHT, border=5)
        movbtn71 = gbtn.GradientButton(pnl2,
                                       1,
                                       label='Drills',
                                       bitmap=wx.Bitmap(
                                           "ima/mov8.jpg",
                                           wx.BITMAP_TYPE_JPEG))
        siz2.Add(movbtn71, (6, 0), flag=wx.LEFT | wx.RIGHT, border=5)
        movbtn81 = gbtn.GradientButton(pnl2,
                                       1,
                                       label='Drills',
                                       bitmap=wx.Bitmap(
                                           "ima/mov9c.jpg",
                                           wx.BITMAP_TYPE_JPEG))
        siz2.Add(movbtn81, (7, 0), flag=wx.LEFT | wx.RIGHT, border=5)

        ##########################################################################################################################################
        ##########################################################################################################################################

        #Panel 3 Button Starts Here

        siz3 = wx.GridBagSizer(4, 4)
        movbtn211 = gbtn.GradientButton(pnl3,
                                        1,
                                        label='Better',
                                        bitmap=wx.Bitmap(
                                            "ima/mov17.jpg",
                                            wx.BITMAP_TYPE_JPEG))
        siz3.Add(movbtn211, (1, 1), flag=wx.LEFT | wx.RIGHT, border=5)

        movbtn311 = gbtn.GradientButton(pnl3,
                                        1,
                                        label='Drills  ',
                                        bitmap=wx.Bitmap(
                                            "ima/mov.jpg",
                                            wx.BITMAP_TYPE_JPEG))
        siz3.Add(movbtn311, (2, 0), flag=wx.LEFT | wx.RIGHT, border=5)

        movbtn411 = gbtn.GradientButton(pnl3,
                                        1,
                                        label='Freed',
                                        bitmap=wx.Bitmap(
                                            "ima/mov6.jpg",
                                            wx.BITMAP_TYPE_JPEG))
        siz3.Add(movbtn411, (3, 0), flag=wx.LEFT | wx.RIGHT, border=5)
        movbtn511 = gbtn.GradientButton(pnl3,
                                        1,
                                        label='Billz ',
                                        bitmap=wx.Bitmap(
                                            "ima/mov23.jpg",
                                            wx.BITMAP_TYPE_JPEG))
        siz3.Add(movbtn511, (4, 0), flag=wx.LEFT | wx.RIGHT, border=5)
        movbtn611 = gbtn.GradientButton(pnl3,
                                        1,
                                        label='Drills',
                                        bitmap=wx.Bitmap(
                                            "ima/mov8.jpg",
                                            wx.BITMAP_TYPE_JPEG))
        siz3.Add(movbtn611, (5, 0), flag=wx.LEFT | wx.RIGHT, border=5)
        movbtn711 = gbtn.GradientButton(pnl3,
                                        1,
                                        label='Drills',
                                        bitmap=wx.Bitmap(
                                            "ima/mov7.jpg",
                                            wx.BITMAP_TYPE_JPEG))
        siz3.Add(movbtn711, (6, 0), flag=wx.LEFT | wx.RIGHT, border=5)
        movbtn811 = gbtn.GradientButton(pnl3,
                                        1,
                                        label='Drills',
                                        bitmap=wx.Bitmap(
                                            "ima/mov9c.jpg",
                                            wx.BITMAP_TYPE_JPEG))
        siz3.Add(movbtn811, (7, 0), flag=wx.LEFT | wx.RIGHT, border=5)

        ########################################################################################################################################

        ##########################################################################################################################################
        ##   #
        #Panel 4 Button Starts Here

        siz4 = wx.GridBagSizer(4, 4)
        movbtn2111 = gbtn.GradientButton(pnl4,
                                         1,
                                         label='Better',
                                         bitmap=wx.Bitmap(
                                             "ima/mov.jpg",
                                             wx.BITMAP_TYPE_JPEG))
        siz4.Add(movbtn2111, (1, 1), flag=wx.LEFT | wx.RIGHT, border=5)

        movbtn3111 = gbtn.GradientButton(pnl4,
                                         1,
                                         label='Drills  ',
                                         bitmap=wx.Bitmap(
                                             "ima/mov23.jpg",
                                             wx.BITMAP_TYPE_JPEG))
        siz4.Add(movbtn3111, (2, 0), flag=wx.LEFT | wx.RIGHT, border=5)

        movbtn4111 = gbtn.GradientButton(pnl4,
                                         1,
                                         label='Freed',
                                         bitmap=wx.Bitmap(
                                             "ima/mov17.jpg",
                                             wx.BITMAP_TYPE_JPEG))
        siz4.Add(movbtn4111, (3, 0), flag=wx.LEFT | wx.RIGHT, border=5)
        movbtn5111 = gbtn.GradientButton(pnl4,
                                         1,
                                         label='Billz ',
                                         bitmap=wx.Bitmap(
                                             "ima/mov8.jpg",
                                             wx.BITMAP_TYPE_JPEG))
        siz4.Add(movbtn5111, (4, 0), flag=wx.LEFT | wx.RIGHT, border=5)
        movbtn6111 = gbtn.GradientButton(pnl4,
                                         1,
                                         label='Drills',
                                         bitmap=wx.Bitmap(
                                             "ima/mov9c.jpg",
                                             wx.BITMAP_TYPE_JPEG))
        siz4.Add(movbtn6111, (5, 0), flag=wx.LEFT | wx.RIGHT, border=5)
        movbtn7111 = gbtn.GradientButton(pnl4,
                                         1,
                                         label='Drills',
                                         bitmap=wx.Bitmap(
                                             "ima/mov6.jpg",
                                             wx.BITMAP_TYPE_JPEG))
        siz4.Add(movbtn7111, (6, 0), flag=wx.LEFT | wx.RIGHT, border=5)
        movbtn8111 = gbtn.GradientButton(pnl4,
                                         1,
                                         label='Drills',
                                         bitmap=wx.Bitmap(
                                             "ima/mov7.jpg",
                                             wx.BITMAP_TYPE_JPEG))
        siz4.Add(movbtn8111, (7, 0), flag=wx.LEFT | wx.RIGHT, border=5)

        ########################################################################################################################################

        self.SetSize((400, 120))
        self.SetSizer(hbox)
        self.Centre()

        #siz.AddGrowableRow(1)
        #siz.AddGrowableCol(2)
        #pnl1.SetSizer(siz)
        pnl2.SetSizer(siz2)
        pnl3.SetSizer(siz3)
        pnl4.SetSizer(siz4)
Пример #22
0
    def __init__(self):
        super().__init__(parent=None,
                         title='InCabinet',
                         style=wx.DEFAULT_DIALOG_STYLE | wx.MINIMIZE_BOX)
        #panel = wx.Panel(self)

        sizer = wx.BoxSizer()
        self.SetSizer(sizer)

        panel = MainPanel(self)
        panel.SetBackgroundColour((211, 211, 211))
        self.panel = panel
        sizer.Add(self.panel, 1, wx.EXPAND)
        self.panel_two = MyPanel(self)
        self.panel_two.SetBackgroundColour((211, 211, 211))
        sizer.Add(self.panel_two, 1, wx.EXPAND)
        self.panel_two.Hide()
        self.panel_three = MyPanelStudent(self)
        self.panel_three.SetBackgroundColour((211, 211, 211))
        sizer.Add(self.panel_three, 1, wx.EXPAND)
        self.panel_three.Hide()
        self.panel_four = PanelOdsjek(self)
        self.panel_four.SetBackgroundColour((211, 211, 211))
        sizer.Add(self.panel_four, 1, wx.EXPAND)
        self.panel_four.Hide()
        self.panel_fifth = APanel(self)
        self.panel_fifth.SetBackgroundColour((211, 211, 211))
        sizer.Add(self.panel_fifth, 1, wx.EXPAND)
        self.panel_fifth.Hide()
        self.SetSize((400, 400))
        self.Centre()

        self.text_ctrl_usernamefield = wx.TextCtrl(panel, pos=(140, 100))
        self.text_ctrl_passwordfield = wx.TextCtrl(panel,
                                                   pos=(140, 150),
                                                   style=wx.TE_PASSWORD)
        self.text_ctrl_usernamefield.SetBackgroundColour((229, 229, 229))
        self.text_ctrl_passwordfield.SetBackgroundColour((229, 229, 229))

        my_btn_student = GB.GradientButton(panel,
                                           label='Login student',
                                           pos=(150, 200))
        my_btn_student.Bind(wx.EVT_BUTTON, self.on_press_student)

        my_btn_prof = GB.GradientButton(panel,
                                        label='Login professor',
                                        pos=(142, 250))
        my_btn_prof.Bind(wx.EVT_BUTTON, self.on_press)

        close_btn = GB.GradientButton(panel,
                                      label='Kraj',
                                      pos=(320, 320),
                                      size=(50, 30))
        close_btn.Bind(wx.EVT_BUTTON, self.close)

        username_text = wx.StaticText(panel,
                                      -1,
                                      label="Username:"******"Password:",
                                      pos=(80, 155),
                                      style=wx.ALIGN_CENTER)

        self.Show()
Пример #23
0
    def __init__(self):
        size = wx.Size(465,85)
        self.defaultstyle = wx.DEFAULT_FRAME_STYLE & ~(wx.RESIZE_BORDER | wx.MAXIMIZE_BOX| wx.SYSTEM_MENU)
        self.myFrame = wx.MiniFrame.__init__(self,None, wx.ID_ANY, "Idasen - Desk Control", wx.DefaultPosition, size, self.defaultstyle, "")
        logging.debug('MyForm:_init_: miniframe created')
        self._minToTray = False
        
        # prepare the popmenu
        self._popmenu = PopMenu(self)

        if config["always_on_top"] == 1:
            self._popmenu._aotMenu.Check(True)
            self.SetWindowStyle(self.defaultstyle | wx.STAY_ON_TOP)

        if config["minimize_to_tray"] == 1:
            self._popmenu._mttMenu.Check(True)
            self._minToTray = True
                    
              
        self.tbIcon = CustomTaskBarIcon(self)        
        
        panel = wx.Panel(self, wx.ID_ANY)            
        panel.Bind(wx.EVT_RIGHT_DOWN, self.OnRightClick)        
        
        bmp = wx.Bitmap("bt-nc.png", wx.BITMAP_TYPE_ANY)          
        btsize = wx.Size(60,46)
        self.gbBluetoothBtn = GB.GradientButton(panel, bitmap=bmp, label="", size=btsize)                        
        self.gbBluetoothBtn.Bind(wx.EVT_BUTTON, self.onBtBtnPress) 
        self.gbBluetoothBtn.Bind(wx.EVT_RIGHT_DOWN, self.OnRightClick)
        self.gbBluetoothBtn.SetToolTip(wx.ToolTip("Make sure desk is connected and paired to computer.\nPress Bluetooth button to discover desk."))                         
                                  
        self.gbHeightBtn = GB.GradientButton(panel, label="N/A")
        size = wx.Size(75,46)
        font = wx.Font(wx.FontInfo(24).FaceName("Arial").Bold())
        self.gbHeightBtn.SetFont(font)
        self.gbHeightBtn.SetInitialSize(size)
        self.gbHeightBtn.Bind(wx.EVT_RIGHT_DOWN, self.OnRightClick)
        self.gbHeightBtn.Disable()
		
        bmp = wx.Bitmap("up-nc.png", wx.BITMAP_TYPE_ANY)
        self.gbUpBtn = GB.GradientButton(panel, bitmap=bmp, label="", size=btsize)        
        self.gbUpBtn.Bind( wx.EVT_LEFT_DOWN, self.onBtnUpPress)
        self.gbUpBtn.Bind( wx.EVT_LEFT_UP, self.onBtnUpRelease)
        self.gbUpBtn.Bind(wx.EVT_RIGHT_DOWN, self.OnRightClick)
        self.gbUpBtn.Disable()
        
        bmp = wx.Bitmap("down-nc.png", wx.BITMAP_TYPE_ANY)
        self.gbDownBtn = GB.GradientButton(panel, bitmap=bmp, label="", size=btsize)
        self.gbDownBtn.Bind( wx.EVT_LEFT_DOWN, self.onBtnDownPress)
        self.gbDownBtn.Bind( wx.EVT_LEFT_UP, self.onBtnDownRelease)
        self.gbDownBtn.Bind(wx.EVT_RIGHT_DOWN, self.OnRightClick)
        self.gbDownBtn.Disable()
        
        bmp = wx.Bitmap("pos1-nc.png", wx.BITMAP_TYPE_ANY)
        self.pos1Btn = GB.GradientButton(panel, bitmap=bmp, label="", size=btsize)
        self.pos1Btn.Bind(wx.EVT_BUTTON, self.onBtn1Press)  
        self.pos1Btn.Bind(wx.EVT_RIGHT_DOWN, self.OnRightClick)
        self.pos1Btn.Disable()       

        bmp = wx.Bitmap("pos2-nc.png", wx.BITMAP_TYPE_ANY)
        self.pos2Btn = GB.GradientButton(panel, bitmap=bmp, label="", size=btsize)
        self.pos2Btn.Bind(wx.EVT_BUTTON, self.onBtn2Press)   
        self.pos2Btn.Bind(wx.EVT_RIGHT_DOWN, self.OnRightClick)
        self.pos2Btn.Disable()       

        bmp = wx.Bitmap("m-nc.png", wx.BITMAP_TYPE_ANY)
        self.gbMBtn = GB.GradientButton(panel, bitmap=bmp, label="", size=btsize)
        self.gbMBtn.Bind(wx.EVT_BUTTON, self.onBtnMemoryPress)
        self.gbMBtn.Bind(wx.EVT_RIGHT_DOWN, self.OnRightClick)
        self.gbMBtn.Disable()

        self.Bind(wx.EVT_CLOSE, self.OnClose)
        self.Bind(wx.EVT_ICONIZE, self.onMinimize)
        
        logging.debug('MyForm:_init_: all button created and bind')
        
        # Create desk instance that will be running in a separate thread        
        self.buttonUpPressed = False
        self.buttonDownPressed = False    
        self.buttonMemoryPressed = False
        
        logging.debug('MyForm:_init_: about to create DeskWorkerThread')
        self.idasen_desk = DeskWorkerThread(self) 
        logging.debug('MyForm:_init_: DeskWorkerThread created')
        # Try to connect to Idasen desk based on previous saved config
        try:            
            if self.idasen_desk.connect():            
                self.showConnectedButton()
                self.idasen_desk.start_running_loop()    
        except Exception as e:
            log("No saved config found")
            
        sizer = wx.BoxSizer(wx.HORIZONTAL)
        sizer.Add(self.gbBluetoothBtn, 0, wx.ALL, 1)
        sizer.Add(self.gbHeightBtn, 0, wx.ALL, 1)
        sizer.Add(self.gbUpBtn, 0, wx.ALL, 1)
        sizer.Add(self.gbDownBtn, 0, wx.ALL, 1)
        sizer.Add(self.pos1Btn, 0, wx.ALL, 1)
        sizer.Add(self.pos2Btn, 0, wx.ALL, 1)
        sizer.Add(self.gbMBtn, 0, wx.ALL, 1)
        
        panel.SetSizer(sizer)
Пример #24
0
    def __init__(self, parent, title):
        wx.Frame.__init__(self, parent, title=title, size=(600, -1))
        Size = namedtuple("Size", ['x', 'y'])
        s = Size(100, 50)

        self.cn_text = None
        self.en_text = None
        cwd = os.getcwd()
        self.mask_path = path.join(path.abspath(cwd), 'alice_mask.png')
        self.user_sw = STOPWORDS

        self.lt = layout_template()
        self.name = 'WordCloud draw'
        self.version = '0.2'
        self.des = '''Draw the word cloud.\n'''
        self.git_website = "https://github.com/WellenWoo/WordCloud_draw"
        self.copyright = "(C) 2018 All Right Reserved"
        """创建菜单栏"""
        filemenu = wx.Menu()
        menuExit = filemenu.Append(wx.ID_EXIT, "E&xit\tCtrl+Q",
                                   "Tenminate the program")

        confmenu = wx.Menu()
        menuSw = confmenu.Append(wx.ID_ANY, "StopWords",
                                 "Add user StopWrods dict")
        menuMask = confmenu.Append(wx.ID_ANY, "Mask", "Set mask")

        helpmenu = wx.Menu()
        menuAbout = helpmenu.Append(wx.ID_ABOUT, "&About",
                                    "Information about this program")

        menuBar = wx.MenuBar()
        menuBar.Append(filemenu, "&File")
        menuBar.Append(confmenu, "&Configure")
        menuBar.Append(helpmenu, "&Help")
        self.SetMenuBar(menuBar)
        """创建输入框"""
        self.in1 = wx.TextCtrl(self, -1, size=(2 * s.x, s.y))
        """创建按钮"""
        b1 = gbtn.GradientButton(self, -1, label="text")
        b2 = gbtn.GradientButton(self, -1, label="run")
        """设置输入框的提示信息"""
        self.in1.SetToolTipString('choose a text file')
        """界面布局"""
        self.sizer0 = rcs.RowColSizer()
        self.sizer0.Add(b1, row=1, col=1)
        self.sizer0.Add(self.in1, row=1, col=2)
        self.sizer0.Add(b2, row=1, col=3)
        """绑定回调函数"""
        self.Bind(wx.EVT_BUTTON, self.choose_cn, b1)
        self.Bind(wx.EVT_BUTTON, self.draw_cn, b2)
        '''菜单绑定函数'''
        self.Bind(wx.EVT_MENU, self.OnExit, menuExit)
        self.Bind(wx.EVT_MENU, self.OnAbout, menuAbout)

        self.Bind(wx.EVT_MENU, self.get_stopwords, menuSw)
        self.Bind(wx.EVT_MENU, self.get_mask, menuMask)

        self.SetSizer(self.sizer0)
        self.SetAutoLayout(1)
        self.sizer0.Fit(self)
        self.CreateStatusBar()
        self.Show(True)
Пример #25
0
 def ShowActivity(self, status, name, user):
     #postavljanje gumbova
     name_button = GB.GradientButton(self,
                                     bitmap=None,
                                     pos=(90, 30),
                                     size=(200, 50),
                                     label=name)
     name_button.SetTopStartColour((105, 105, 105))
     name_button.SetTopEndColour((105, 105, 105))
     name_button.SetBottomStartColour((105, 105, 105))
     name_button.SetBottomEndColour((105, 105, 105))
     name_button.Disable()
     back_button = GB.GradientButton(self,
                                     bitmap=None,
                                     pos=(165, 300),
                                     label="Back")
     back_button.Bind(wx.EVT_BUTTON, self.backP)
     poc_button = GB.GradientButton(self,
                                    bitmap=None,
                                    pos=(5, 5),
                                    size=(50, 30),
                                    label="Početna")
     poc_button.Bind(wx.EVT_BUTTON, self.pocetna)
     logout_button = GB.GradientButton(self,
                                       bitmap=None,
                                       pos=(300, 300),
                                       label="Log out")
     logout_button.Bind(wx.EVT_BUTTON,
                        lambda event: self.logout(event, user))
     activity = status[0][0]
     #postavljanje aktivnosti
     if activity == "A":
         a_button = GB.GradientButton(self,
                                      bitmap=None,
                                      pos=(90, 150),
                                      size=(200, 50),
                                      label="AKTIVAN(U KABINETU)")
         a_button.SetTopStartColour((127, 255, 0))
         a_button.SetTopEndColour((127, 255, 0))
         a_button.SetBottomStartColour((127, 255, 0))
         a_button.SetBottomEndColour((127, 255, 0))
         a_button.Disable()
     elif activity == "P":
         a_button = GB.GradientButton(self,
                                      bitmap=None,
                                      pos=(90, 150),
                                      size=(200, 50),
                                      label="NEAKTIVAN (NIJE U KABINETU)")
         a_button.SetTopStartColour((139, 0, 0))
         a_button.SetTopEndColour((139, 0, 0))
         a_button.SetBottomStartColour((139, 0, 0))
         a_button.SetBottomEndColour((139, 0, 0))
         a_button.Disable()
     else:
         a_button = GB.GradientButton(self,
                                      bitmap=None,
                                      pos=(90, 150),
                                      size=(200, 50),
                                      label="NE KORISTI APLIKACIJU")
         a_button.SetTopStartColour((255, 255, 0))
         a_button.SetTopEndColour((255, 255, 0))
         a_button.SetBottomStartColour((255, 255, 0))
         a_button.SetBottomEndColour((255, 255, 0))
         a_button.Disable()
Пример #26
0
    def __init__(self, parent):
        """Constructor"""
        wx.Panel.__init__(self, parent=parent)

        self.SetBackgroundColour('#000000')

        sizer = wx.GridBagSizer(0, 0)

        gool = '\xe5\xb1(x + 5) = y\xb2  = \xe5\x7c'
        goo = u'\u20ac'

        text3 = wx.StaticText(self, -1, gool)
        sizer.Add(text3, (3, 18), (1, 1),
                  flag=wx.TOP | wx.LEFT | wx.BOTTOM,
                  border=15)
        text3.SetFont(wx.Font(15, wx.ROMAN, wx.NORMAL, wx.BOLD))

        help3 = gbtn.GradientButton(self,
                                    1,
                                    label=" Coupon  ",
                                    bitmap=wx.Bitmap("ima/network.png",
                                                     wx.BITMAP_TYPE_PNG))
        sizer.Add(help3, (3, 6), flag=wx.LEFT | wx.RIGHT, border=5)

        help4 = gbtn.GradientButton(self,
                                    19,
                                    label="Shop File",
                                    bitmap=wx.Bitmap("ima/market.png",
                                                     wx.BITMAP_TYPE_PNG))
        sizer.Add(help4, (3, 7), flag=wx.LEFT | wx.RIGHT, border=5)

        helpi = gbtn.GradientButton(self,
                                    23,
                                    label="  Audio  ",
                                    bitmap=wx.Bitmap("ima/route.png",
                                                     wx.BITMAP_TYPE_PNG))
        sizer.Add(helpi, (3, 8), flag=wx.LEFT | wx.RIGHT, border=5)

        helpk = gbtn.GradientButton(self,
                                    label="Cloud File",
                                    bitmap=wx.Bitmap("ima/wifi.png",
                                                     wx.BITMAP_TYPE_PNG))
        sizer.Add(helpk, (3, 9), flag=wx.LEFT | wx.RIGHT, border=5)

        help5 = gbtn.GradientButton(self,
                                    121,
                                    label=" Favourite",
                                    bitmap=wx.Bitmap("ima/speedometer.png",
                                                     wx.BITMAP_TYPE_PNG))
        sizer.Add(help5, (5, 6), flag=wx.LEFT | wx.RIGHT, border=5)

        help6 = gbtn.GradientButton(self,
                                    label=" History ",
                                    bitmap=wx.Bitmap("ima/his.png",
                                                     wx.BITMAP_TYPE_PNG))
        sizer.Add(help6, (5, 7), flag=wx.LEFT | wx.RIGHT, border=5)

        help7 = gbtn.GradientButton(self,
                                    34,
                                    label="Video-s  ",
                                    bitmap=wx.Bitmap("ima/video_clip.png",
                                                     wx.BITMAP_TYPE_PNG))
        sizer.Add(help7, (5, 8), flag=wx.LEFT | wx.RIGHT, border=5)

        helpy = gbtn.GradientButton(self,
                                    9,
                                    label="Transfers ",
                                    bitmap=wx.Bitmap("ima/transfer.png",
                                                     wx.BITMAP_TYPE_PNG))
        sizer.Add(helpy, (5, 9), flag=wx.LEFT | wx.RIGHT, border=5)

        helpu = gbtn.GradientButton(self,
                                    1,
                                    label="Sign-Up",
                                    bitmap=wx.Bitmap("ima/moneyS.png",
                                                     wx.BITMAP_TYPE_PNG))

        sizer.Add(helpu, (15, 18), flag=wx.LEFT | wx.RIGHT, border=5)

        led = gizmos.LEDNumberCtrl(self, -1, (0, 0),
                                   (280, 50))  # | gizmos.LED_DRAW_FADED)

        sizer.Add(led, (15, 10), (1, 5), flag=wx.LEFT | wx.RIGHT, border=5)

        ###########################################################################
        #Bindings
        #self.Bind(wx.EVT_BUTTON, self.onSwitchPanels, id = 121)
        ###########################################################################

        self.clock = led
        self.OnTimer(None)

        self.timer = wx.Timer(self)
        self.timer.Start(1000)
        self.Bind(wx.EVT_TIMER, self.OnTimer)

        helpu.SetToolTipString('Sign-up')
        helpy.SetToolTipString('Check Transfer')
        help7.SetToolTipString('Choose Video')
        help6.SetToolTipString('Media History')
        help5.SetToolTipString('Available Songs')
        helpk.SetToolTipString('Transfer Files')
        helpi.SetToolTipString('Play Audio Files')
        help4.SetToolTipString('Media Stores')
        help3.SetToolTipString('Album')

        self.SetSizerAndFit(sizer)
        self.Centre()
        self.Show(True)
Пример #27
0
    def __init__(
        self,
        parent,
        ffmpeg_link,
        threads,
        cpu_used,
        loglevel_type,
        ffprobe_link,
        OS,
        iconanalyzes,
        iconsettings,
    ):
        # passed attributes
        self.parent = parent
        self.ffmpeg_link = ffmpeg_link
        self.threads = threads
        self.cpu_used = cpu_used
        self.loglevel_type = loglevel_type
        self.ffprobe_link = ffprobe_link
        self.OS = OS
        # others attributes:
        self.file_sources = []
        self.file_destin = ''

        wx.Panel.__init__(self, parent, -1)
        """ constructor"""
        # Widgets definitions:
        self.cmbx_a = wx.ComboBox(self,
                                  wx.ID_ANY,
                                  choices=[("WAV [.wav]"), ("AIFF [.aiff]"),
                                           ("FLAC [.flac]"), ("OGG [.ogg]"),
                                           ("MP3 [.mp3]"), ("AAC [.m4a]"),
                                           ("ALAC [.m4a]"), ("AC3 [.ac3]"),
                                           (_("Save audio from movie"))],
                                  style=wx.CB_DROPDOWN | wx.CB_READONLY)
        self.cmbx_a.SetSelection(4)
        setbmp = wx.Bitmap(iconsettings, wx.BITMAP_TYPE_ANY)
        self.btn_param = GB.GradientButton(self,
                                           size=(-1, 25),
                                           bitmap=setbmp,
                                           label=_("Audio Options"))
        self.btn_param.SetBaseColours(startcolour=wx.Colour(158, 201, 232),
                                      foregroundcolour=wx.Colour(28, 28, 28))
        self.btn_param.SetBottomEndColour(wx.Colour(205, 235, 222))
        self.btn_param.SetBottomStartColour(wx.Colour(205, 235, 222))
        self.btn_param.SetTopStartColour(wx.Colour(205, 235, 222))
        self.btn_param.SetTopEndColour(wx.Colour(205, 235, 222))

        self.txt_options = wx.TextCtrl(self,
                                       wx.ID_ANY,
                                       size=(265, -1),
                                       style=wx.TE_READONLY)
        self.ckb_onlynorm = wx.CheckBox(self, wx.ID_ANY,
                                        (_("Only Normalization")))
        self.ckb_norm = wx.CheckBox(self, wx.ID_ANY,
                                    (_("Audio Normalization")))
        analyzebmp = wx.Bitmap(iconanalyzes, wx.BITMAP_TYPE_ANY)
        self.btn_analyzes = GB.GradientButton(self,
                                              size=(-1, 25),
                                              bitmap=analyzebmp,
                                              label=_("Analyzes"))
        self.btn_analyzes.SetBaseColours(startcolour=wx.Colour(158, 201, 232),
                                         foregroundcolour=wx.Colour(
                                             165, 165, 165))
        self.btn_analyzes.SetBottomEndColour(wx.Colour(205, 235, 222))
        self.btn_analyzes.SetBottomStartColour(wx.Colour(205, 235, 222))
        self.btn_analyzes.SetTopStartColour(wx.Colour(205, 235, 222))
        self.btn_analyzes.SetTopEndColour(wx.Colour(205, 235, 222))

        self.lab_volmax = wx.StaticText(self, wx.ID_ANY, (_("Max Volume db.")))
        self.txt_volmax = wx.TextCtrl(self,
                                      wx.ID_ANY,
                                      "",
                                      style=wx.TE_READONLY)
        self.lab_volmid = wx.StaticText(self, wx.ID_ANY,
                                        (_("Average Volume db.")))
        self.txt_volmid = wx.TextCtrl(self,
                                      wx.ID_ANY,
                                      "",
                                      style=wx.TE_READONLY)
        self.lab_amplitude = wx.StaticText(self, wx.ID_ANY,
                                           (_("Max Peak Level Threshold:   ")))
        self.spin_amplitude = FS.FloatSpin(self,
                                           wx.ID_ANY,
                                           min_val=-99.0,
                                           max_val=0.0,
                                           increment=1.0,
                                           value=-1.0,
                                           agwStyle=FS.FS_LEFT)
        self.spin_amplitude.SetFormat("%f")
        self.spin_amplitude.SetDigits(1)
        #----------------------Set Properties----------------------#
        sizer_base = wx.BoxSizer(wx.VERTICAL)
        sizer_global = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, ("")),
                                         wx.VERTICAL)
        sizer_2 = wx.BoxSizer(wx.HORIZONTAL)
        grid_sizer_3 = wx.FlexGridSizer(7, 2, 0, 0)
        grid_sizer_1 = wx.GridSizer(2, 1, 0, 0)
        grid_sizer_2 = wx.FlexGridSizer(1, 2, 0, 0)
        grid_sizer_4 = wx.FlexGridSizer(2, 4, 0, 0)
        #grid_sizer_5 = wx.FlexGridSizer(1, 3, 0, 0)
        sizer_3 = wx.StaticBoxSizer(
            wx.StaticBox(self, wx.ID_ANY, (_("Audio Container Selection"))),
            wx.VERTICAL)
        sizer_3.Add(self.cmbx_a, 0, wx.ALIGN_CENTER | wx.ALL, 20)
        grid_sizer_1.Add(sizer_3, 1, wx.ALL | wx.EXPAND, 5)
        grid_sizer_2.Add(self.btn_param, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL,
                         5)
        grid_sizer_2.Add(self.txt_options, 0,
                         wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)
        #grid_sizer_4.Add(self.lab_bitdepth, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)
        #grid_sizer_4.Add(self.txt_bitdepth, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)
        #grid_sizer_4.Add(self.lab_bitrate, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)
        #grid_sizer_4.Add(self.txt_bitrate, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)
        #grid_sizer_4.Add(self.lab_channel, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)
        #grid_sizer_4.Add(self.txt_channel, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)
        #grid_sizer_2.Add(grid_sizer_4, 0, wx.TOP, 5)
        grid_sizer_1.Add(grid_sizer_2, 1, 0, 0)
        sizer_2.Add(grid_sizer_1, 1, wx.ALL | wx.EXPAND, 20)
        grid_sizer_3.Add(self.ckb_norm, 0, wx.TOP, 5)
        grid_sizer_3.Add(self.ckb_onlynorm, 0, wx.TOP, 5)
        grid_sizer_3.Add(self.btn_analyzes, 0, wx.TOP, 10)
        grid_sizer_3.Add((20, 20), 0, wx.EXPAND | wx.TOP, 5)
        grid_sizer_3.Add(self.lab_volmax, 0, wx.TOP, 10)
        grid_sizer_3.Add(self.txt_volmax, 0, wx.TOP, 5)
        grid_sizer_3.Add(self.lab_volmid, 0, wx.TOP, 10)
        grid_sizer_3.Add(self.txt_volmid, 0, wx.TOP, 5)
        grid_sizer_3.Add(self.lab_amplitude, 0, wx.TOP, 10)
        grid_sizer_3.Add(self.spin_amplitude, 0, wx.TOP, 5)
        #--------------------------------------------------------------
        grid_sizer_3.Add((0, 55), 0, wx.EXPAND | wx.TOP, 5)
        grid_sizer_3.Add((0, 55), 0, wx.EXPAND | wx.TOP, 5)
        #sizer_4 = wx.StaticBoxSizer(wx.StaticBox(self, wx.ID_ANY, (
        #"Export Preferences")), wx.VERTICAL)
        #sizer_4.Add(grid_sizer_5, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5)
        #grid_sizer_5.Add(self.ckb_test, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL,5)
        #grid_sizer_5.Add(self.label_sec, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL,5)
        #grid_sizer_5.Add(self.spin_ctrl_test, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL,5)
        #grid_sizer_3.Add(sizer_4, 0, wx.TOP|wx.BOTTOM, 20)
        #--------------------------------------------------------------
        sizer_2.Add(grid_sizer_3, 1, wx.ALL | wx.EXPAND, 20)
        sizer_global.Add(sizer_2, 1, wx.ALL | wx.EXPAND, 5)
        sizer_base.Add(sizer_global, 1, wx.ALL | wx.EXPAND, 5)
        self.SetSizer(sizer_base)
        # Set tooltip:
        self.btn_param.SetToolTip(
            _("Enable advanced settings as audio "
              "bit-rate, audio channel and audio rate "
              "of the selected audio codec."))
        self.btn_analyzes.SetToolTip(
            _("Calculate the maximum and average "
              "peak in dB values of the one audio track "
              "imported. This feature is disabled for "
              "multiple file to process."))
        self.txt_volmax.SetToolTip(_("Maximum peak scanned in dB values."))
        self.txt_volmid.SetToolTip(_("Average peak scanned in dB values."))
        self.spin_amplitude.SetToolTip(
            _("Threshold for the maximum peak "
              "level in dB values. The default setting "
              "is -1.0 dB and is good for most of the "
              "processes."))

        #----------------------Binding (EVT)----------------------#
        self.cmbx_a.Bind(wx.EVT_COMBOBOX, self.audioFormats)
        self.Bind(wx.EVT_BUTTON, self.on_Param, self.btn_param)
        self.Bind(wx.EVT_CHECKBOX, self.on_Enable_norm, self.ckb_norm)
        self.Bind(wx.EVT_CHECKBOX, self.on_OnlyNorm, self.ckb_onlynorm)
        self.Bind(wx.EVT_BUTTON, self.on_Analyzes, self.btn_analyzes)
        #self.Bind(wx.EVT_SPINCTRL, self.enter_normalize, self.spin_amplitude)

        # set default :
        self.normalization_disabled()
Пример #28
0
    def addToPanel(self, status, name, value, titula):
        string = titula + " " + name + " - " + "aktivnost" + " :"
        status_p = wx.StaticBox(self, -1, 'Name')
        sSizer = wx.StaticBoxSizer(status_p, wx.VERTICAL)
        s1 = wx.BoxSizer(wx.HORIZONTAL)
        #Može i text, static text, itd..
        ac_button = GB.GradientButton(self,
                                      bitmap=None,
                                      pos=(100, 100),
                                      size=(200, 50),
                                      label="AKTIVAN(U KABINETU)")
        ac_button.SetTopStartColour((127, 255, 0))
        ac_button.SetTopEndColour((127, 255, 0))
        ac_button.SetBottomStartColour((127, 255, 0))
        ac_button.SetBottomEndColour((127, 255, 0))
        ac_button.Disable()
        ac_button = GB.GradientButton(self,
                                      bitmap=None,
                                      pos=(40, 40),
                                      size=(300, 50),
                                      label=string)
        ac_button.SetTopStartColour((169, 169, 169))
        ac_button.SetTopEndColour((169, 169, 169))
        ac_button.SetBottomStartColour((169, 169, 169))
        ac_button.SetBottomEndColour((169, 169, 169))
        ac_button.Disable()
        poc_button = GB.GradientButton(self,
                                       bitmap=None,
                                       pos=(5, 5),
                                       size=(50, 30),
                                       label="Početna")
        poc_button.Bind(wx.EVT_BUTTON, self.pocetna)
        #text_name = wx.StaticText(self,-1,string,pos=(40,40),size=(150,50),style=wx.ALIGN_CENTRE_HORIZONTAL)
        #s1.Add(text_name,0,wx.ALL | wx.CENTER, 100)
        text_g = wx.StaticText(self,
                               -1,
                               "Grupe :",
                               pos=(50, 170),
                               size=(60, 20),
                               style=wx.ALIGN_CENTRE_HORIZONTAL)
        s1.Add(text_g, 0, wx.ALL | wx.CENTER, 100)

        back_button = GB.GradientButton(self,
                                        bitmap=None,
                                        pos=(165, 280),
                                        label="Log out")
        self.SetBackgroundColour((211, 211, 211))

        #back_button = wx.Button(self,label='Back',pos=(165, 280),size=(50,25))
        back_button.Bind(wx.EVT_BUTTON,
                         lambda event: self.backMain(event, value))

        string_for_g = ""
        for i in dic[value]:
            string_for_g += i + " "
        text_ctrl_groups = wx.TextCtrl(self,
                                       value=string_for_g,
                                       pos=(60, 200),
                                       style=wx.TE_READONLY | wx.TE_MULTILINE,
                                       name="Groups",
                                       size=(100, 40))
        s1.Add(text_ctrl_groups, 0, wx.ALL | wx.CENTER | wx.EXPAND, 100)
Пример #29
0
    def __init__(self, setui, pathicons):
        """
        NOTE: 'SRCpath' is a current work directory of Videomass 
               program. How it can be localized depend if Videomass is 
               run as portable program or installated program.
        """
        barC = setui[4][12].split(',')
        barColor = wx.Colour(int(barC[0]), int(barC[1]), int(barC[2]))
        # toolbar panel colour
        bBtnC = setui[4][13].split(',')
        self.bBtnC = wx.Colour(int(bBtnC[0]), int(bBtnC[1]), int(bBtnC[2]))
        # toolbar buttons colour
        fBtnC = setui[4][14].split(',')
        self.fBtnC = wx.Colour(int(fBtnC[0]), int(fBtnC[1]), int(fBtnC[2]))
        # Buttons Font Colour
        self.OS = setui[0]  # ID of the operative system:
        SRCpath = setui[1]  # share dir (are where the origin files?):
        self.PATHconf = setui[6]
        self.WORKdir = setui[7]
        self.DIRconf = setui[8]
        #---------------------------#
        self.threads = setui[4][2]  #ffmpeg option, set the cpu threads
        self.iconset = setui[4][11]
        self.videomass_icon = pathicons[0]
        self.icon_runconversion = pathicons[2]
        #-------------------------------#
        self.data = None  # list of items in list control
        self.file_destin = None  # path name for file saved destination
        self.time_seq = ''  # ffmpeg format time specifier with flag -ss, -t
        self.time_read = {'start seek': ['', ''], 'time': ['', '']}
        self.duration = []  # empty if not file imported
        self.topicname = None  # panel name shown

        wx.Frame.__init__(self, None, -1, style=wx.DEFAULT_FRAME_STYLE)
        #----------- panel toolbar buttons
        self.btnpanel = wx.Panel(self, wx.ID_ANY, style=wx.TAB_TRAVERSAL)

        infoIbmp = wx.Bitmap(pathicons[4], wx.BITMAP_TYPE_ANY)
        previewbmp = wx.Bitmap(pathicons[5], wx.BITMAP_TYPE_ANY)
        cutbmp = wx.Bitmap(pathicons[6], wx.BITMAP_TYPE_ANY)
        saveprfbmp = wx.Bitmap(pathicons[9], wx.BITMAP_TYPE_ANY)
        newprfbmp = wx.Bitmap(pathicons[29], wx.BITMAP_TYPE_ANY)
        delprfbmp = wx.Bitmap(pathicons[30], wx.BITMAP_TYPE_ANY)
        editprfbmp = wx.Bitmap(pathicons[31], wx.BITMAP_TYPE_ANY)

        self.btn_metaI = GB.GradientButton(self.btnpanel,
                                           size=(-1, 25),
                                           bitmap=infoIbmp,
                                           label=_("Streams Information"))
        self.btn_metaI.SetBaseColours(startcolour=wx.Colour(158, 201, 232),
                                      foregroundcolour=wx.Colour(self.fBtnC))
        self.btn_metaI.SetBottomEndColour(self.bBtnC)
        self.btn_metaI.SetBottomStartColour(self.bBtnC)
        self.btn_metaI.SetTopStartColour(self.bBtnC)
        self.btn_metaI.SetTopEndColour(self.bBtnC)

        self.btn_playO = GB.GradientButton(self.btnpanel,
                                           size=(-1, 25),
                                           bitmap=previewbmp,
                                           label=_("Preview"))
        self.btn_playO.SetBaseColours(startcolour=wx.Colour(158, 201, 232),
                                      foregroundcolour=wx.Colour(self.fBtnC))
        self.btn_playO.SetBottomEndColour(self.bBtnC)
        self.btn_playO.SetBottomStartColour(self.bBtnC)
        self.btn_playO.SetTopStartColour(self.bBtnC)
        self.btn_playO.SetTopEndColour(self.bBtnC)

        self.btn_duration = GB.GradientButton(self.btnpanel,
                                              size=(-1, 25),
                                              bitmap=cutbmp,
                                              label=_("Duration"))
        self.btn_duration.SetBaseColours(startcolour=wx.Colour(158, 201, 232),
                                         foregroundcolour=wx.Colour(
                                             self.fBtnC))
        self.btn_duration.SetBottomEndColour(self.bBtnC)
        self.btn_duration.SetBottomStartColour(self.bBtnC)
        self.btn_duration.SetTopStartColour(self.bBtnC)
        self.btn_duration.SetTopEndColour(self.bBtnC)

        self.btn_saveprf = GB.GradientButton(self.btnpanel,
                                             size=(-1, 25),
                                             bitmap=saveprfbmp,
                                             label=_("Save Configuration"))
        self.btn_saveprf.SetBaseColours(startcolour=wx.Colour(158, 201, 232),
                                        foregroundcolour=wx.Colour(self.fBtnC))
        self.btn_saveprf.SetBottomEndColour(self.bBtnC)
        self.btn_saveprf.SetBottomStartColour(self.bBtnC)
        self.btn_saveprf.SetTopStartColour(self.bBtnC)
        self.btn_saveprf.SetTopEndColour(self.bBtnC)

        self.btn_newprf = GB.GradientButton(self.btnpanel,
                                            size=(-1, 25),
                                            bitmap=newprfbmp,
                                            label=_("New.."))
        self.btn_newprf.SetBaseColours(startcolour=wx.Colour(158, 201, 232),
                                       foregroundcolour=wx.Colour(self.fBtnC))
        self.btn_newprf.SetBottomEndColour(self.bBtnC)
        self.btn_newprf.SetBottomStartColour(self.bBtnC)
        self.btn_newprf.SetTopStartColour(self.bBtnC)
        self.btn_newprf.SetTopEndColour(self.bBtnC)

        self.btn_delprf = GB.GradientButton(self.btnpanel,
                                            size=(-1, 25),
                                            bitmap=delprfbmp,
                                            label=_("Delete.."))
        self.btn_delprf.SetBaseColours(startcolour=wx.Colour(158, 201, 232),
                                       foregroundcolour=wx.Colour(self.fBtnC))
        self.btn_delprf.SetBottomEndColour(self.bBtnC)
        self.btn_delprf.SetBottomStartColour(self.bBtnC)
        self.btn_delprf.SetTopStartColour(self.bBtnC)
        self.btn_delprf.SetTopEndColour(self.bBtnC)

        self.btn_editprf = GB.GradientButton(self.btnpanel,
                                             size=(-1, 25),
                                             bitmap=editprfbmp,
                                             label=_("Edit.."))
        self.btn_editprf.SetBaseColours(startcolour=wx.Colour(158, 201, 232),
                                        foregroundcolour=wx.Colour(self.fBtnC))
        self.btn_editprf.SetBottomEndColour(self.bBtnC)
        self.btn_editprf.SetBottomStartColour(self.bBtnC)
        self.btn_editprf.SetTopStartColour(self.bBtnC)
        self.btn_editprf.SetTopEndColour(self.bBtnC)

        self.btnpanel.SetBackgroundColour(barColor)
        #---------- others panel instances:
        self.ChooseTopic = choose_topic.Choose_Topic(
            self, self.OS, pathicons[1], pathicons[3], pathicons[23],
            pathicons[24], pathicons[20], pathicons[21], pathicons[22],
            pathicons[25], pathicons[28])
        self.ChooseTopic.SetBackgroundColour(barColor)
        self.ytDownloader = downloader.Downloader(self, self.OS)
        self.VconvPanel = av_conversions.AV_Conv(
            self,
            self.OS,
            pathicons[7],  # icon playfilters
            pathicons[8],  # icon resetfilters
            pathicons[10],  # icon resize
            pathicons[11],  # icon crop
            pathicons[12],  # icon rotate
            pathicons[13],  # icon deinterlace
            pathicons[14],  # icon ic_denoiser
            pathicons[15],  # icon analyzes
            pathicons[16],  # icon settings
            pathicons[18],  # icon peaklevel
            pathicons[19],  # icon audiotrack
            self.bBtnC,
            self.fBtnC,
        )
        self.fileDnDTarget = filedrop.FileDnD(self, pathicons[26],
                                              pathicons[27])
        self.textDnDTarget = textdrop.TextDnD(self, pathicons[26],
                                              pathicons[27])
        self.ProcessPanel = Logging_Console(self)
        self.PrstsPanel = presets_manager.PrstPan(
            self,
            SRCpath,
            self.DIRconf,
            self.WORKdir,
            self.OS,
            pathicons[15],  #icon analyzes
            pathicons[18],  #icon peaklevel
            self.bBtnC,
            self.fBtnC,
        )
        # hide panels
        self.fileDnDTarget.Hide()
        self.textDnDTarget.Hide()
        self.ytDownloader.Hide()
        self.VconvPanel.Hide()
        self.ProcessPanel.Hide()
        self.PrstsPanel.Hide()
        # Layout toolbar buttons:
        self.mainSizer = wx.BoxSizer(wx.VERTICAL)  # sizer base global
        grid_pan = wx.FlexGridSizer(1, 7, 0, 0)
        grid_pan.Add(self.btn_metaI, 0, wx.CENTER | wx.ALL, 5)
        grid_pan.Add(self.btn_playO, 0, wx.CENTER | wx.ALL, 5)
        grid_pan.Add(self.btn_duration, 0, wx.CENTER | wx.ALL, 5)
        grid_pan.Add(self.btn_saveprf, 0, wx.CENTER | wx.ALL, 5)
        grid_pan.Add(self.btn_newprf, 0, wx.CENTER | wx.ALL, 5)
        grid_pan.Add(self.btn_delprf, 0, wx.CENTER | wx.ALL, 5)
        grid_pan.Add(self.btn_editprf, 0, wx.CENTER | wx.ALL, 5)
        self.btnpanel.SetSizer(grid_pan)  # set panel
        self.mainSizer.Add(self.btnpanel, 0, wx.EXPAND, 0)
        # Layout externals panels:
        self.mainSizer.Add(self.ChooseTopic, 1, wx.EXPAND | wx.ALL, 0)
        self.mainSizer.Add(self.fileDnDTarget, 1, wx.EXPAND | wx.ALL, 0)
        self.mainSizer.Add(self.textDnDTarget, 1, wx.EXPAND | wx.ALL, 0)
        self.mainSizer.Add(self.ytDownloader, 1, wx.EXPAND | wx.ALL, 0)
        self.mainSizer.Add(self.VconvPanel, 1, wx.EXPAND | wx.ALL, 0)
        self.mainSizer.Add(self.ProcessPanel, 1, wx.EXPAND | wx.ALL, 0)
        self.mainSizer.Add(self.PrstsPanel, 1, wx.EXPAND | wx.ALL, 0)
        #----------------------Set Properties----------------------#
        self.SetTitle("Videomass")
        icon = wx.Icon()
        icon.CopyFromBitmap(wx.Bitmap(self.videomass_icon, wx.BITMAP_TYPE_ANY))
        self.SetIcon(icon)
        if self.OS == 'Darwin':
            self.SetMinSize((900, 600))
        elif self.OS == 'Windows':
            self.SetMinSize((900, 600))
        else:
            self.SetMinSize((900, 600))
        self.CentreOnScreen()  # se lo usi, usa CentreOnScreen anziche Centre
        self.SetSizer(self.mainSizer)
        # Tooltips:
        self.btn_duration.SetToolTip(
            _('Specify the duration or portion of the '
              'time globally. this can affect many '
              'functions.'))
        self.btn_metaI.SetToolTip(_("Show additional media information."))
        self.btn_playO.SetToolTip(
            _("Choose a file to playback in the "
              "destination folder"))
        self.btn_saveprf.SetToolTip(_("Save the settings on presets manager"))
        self.btn_newprf.SetToolTip(
            _("Create a new profile from yourself "
              "and save it in the selected preset."))
        self.btn_delprf.SetToolTip(_("Delete the selected profile."))
        self.btn_editprf.SetToolTip(_("Edit the selected profile."))
        # menu bar
        self.videomass_menu_bar()
        ## tool bar main
        self.videomass_tool_bar()
        # status bar
        self.sb = self.CreateStatusBar(1)
        # hide toolbar and buttons bar
        self.toolbar.Hide()
        self.btnpanel.Hide()
        self.Layout()
        #---------------------- Binding (EVT) ----------------------#
        self.fileDnDTarget.btn_save.Bind(wx.EVT_BUTTON, self.onCustomSave)
        self.fileDnDTarget.btn_back.Bind(wx.EVT_BUTTON, self.on_close)
        self.textDnDTarget.btn_save.Bind(wx.EVT_BUTTON, self.onCustomSave)
        self.textDnDTarget.btn_back.Bind(wx.EVT_BUTTON, self.on_close)
        self.Bind(wx.EVT_BUTTON, self.Cut_range, self.btn_duration)
        self.Bind(wx.EVT_BUTTON, self.Saveprofile, self.btn_saveprf)
        self.Bind(wx.EVT_BUTTON, self.Newprofile, self.btn_newprf)
        self.Bind(wx.EVT_BUTTON, self.Delprofile, self.btn_delprf)
        self.Bind(wx.EVT_BUTTON, self.Editprofile, self.btn_editprf)
        self.Bind(wx.EVT_BUTTON, self.ImportInfo, self.btn_metaI)
        self.Bind(wx.EVT_BUTTON, self.ExportPlay, self.btn_playO)
        #self.Bind(wx.EVT_SHOW, self.panelShown)
        #self.fileDnDTargetPanel.fileListCtrl.Bind(wx.EVT_LIST_INSERT_ITEM, self.new_isertion)
        self.Bind(wx.EVT_CLOSE, self.on_close)  # controlla la chiusura (x)