Ejemplo n.º 1
0
    def addDataGroup(self, event):
        #Pobieranie i deklaracji wartosci
        result = []
        gname = self.m_comboBox1.GetValue()
        gnote = self.m_textCtrl2.GetValue()

        #Usuwanie wszystkich powiazanych autorów z grupa
        guser = cDatabase.editUserGroup(self.session, gname)

        #Tworzenie listy nowych autorow dodanych do grupy
        guser = cDatabase.getUserName(self.session)
        t = cDatabase.getUserNameID(self.session)
        for i in range(len(guser)):
            if self.m_checkList3.IsChecked(i):
                tmp = guser[i].split(' ')
                id = t[guser[i]]
                l = (id, gname)
                result.append(l)

        #Sprawdzanie czy wszystkie wymagane pola maja wartości
        if gname != '' and len(result) != 0:
            cDatabase.addGroup(self.session, result, gnote)
        else:
            wx.MessageBox(
                u'Nie podana nazwy grupy \nlub nie wybrano \
            autorów.', u'Bład', wx.OK | wx.ICON_INFORMATION)

        #Wyczyszczenie kontrolek
        self.clearData()

        self.m_staticText1.SetLabel(u'Dodawanie Grupy')
        self.m_button5.Hide()
        self.m_button3.Hide()
        self.m_button1.Show()
Ejemplo n.º 2
0
    def deletePerson(self, event):
        #Pobiera Imie i Nazwisko użytkownika, wraz z jego ID
        t = self.m_choice1.GetStringSelection()
        a = cDatabase.getUserNameID(self.session)
        self.tmp = a[t]

        #Usuwanie użytkownika
        cDatabase.delUserDialog(self.session, self.tmp)

        #Aktualizacja kontrolki z imionami i nazwiskami autorów
        m_choice1Choices = cDatabase.getUserName(self.session)
        self.m_choice1.Clear()
        self.m_choice1.AppendItems(m_choice1Choices)
        #        self.m_choice1.SetSelection( 0 )

        self.clear()

        self.m_staticText1.SetLabel(u'Dodawanie Autora')
        #        self.st1 = u'Dodaj Autora'
        self.m_button1.Hide()
        self.m_button7.Hide()
        self.m_button2.Show()

        wx.MessageBox(u'Pomyślnie usunięto wybranego \
        Autora!', u'Sukces', wx.OK | wx.ICON_INFORMATION)
Ejemplo n.º 3
0
 def addDataGroup(self,  event):
     #Pobieranie i deklaracji wartosci
     result = []
     gname = self.m_comboBox1.GetValue()
     gnote = self.m_textCtrl2.GetValue()
     
     #Usuwanie wszystkich powiazanych autorów z grupa
     guser = cDatabase.editUserGroup(self.session, gname)
     
     #Tworzenie listy nowych autorow dodanych do grupy
     guser = cDatabase.getUserName(self.session)
     t = cDatabase.getUserNameID(self.session)
     for i in range(len(guser)):
         if self.m_checkList3.IsChecked(i):
             tmp = guser[i].split(' ')
             id = t[guser[i]]
             l = (id,  gname)
             result.append(l)
     
     #Sprawdzanie czy wszystkie wymagane pola maja wartości
     if gname != '' and len(result) != 0:
         cDatabase.addGroup(self.session, result, gnote)
     else:
         wx.MessageBox(u'Nie podana nazwy grupy \nlub nie wybrano \
         autorów.', u'Bład', wx.OK | wx.ICON_INFORMATION)
     
     #Wyczyszczenie kontrolek
     self.clearData()
     
     self.m_staticText1.SetLabel(u'Dodawanie Grupy')
     self.m_button5.Hide()
     self.m_button3.Hide()
     self.m_button1.Show()
Ejemplo n.º 4
0
    def deletePerson(self, event):
        #Pobiera Imie i Nazwisko użytkownika, wraz z jego ID
        t = self.m_choice1.GetStringSelection()
        a = cDatabase.getUserNameID(self.session)
        self.tmp = a[t]
        
        #Usuwanie użytkownika
        cDatabase.delUserDialog(self.session, self.tmp)
        
        #Aktualizacja kontrolki z imionami i nazwiskami autorów
        m_choice1Choices = cDatabase.getUserName(self.session)
        self.m_choice1.Clear()
        self.m_choice1.AppendItems(m_choice1Choices)
#        self.m_choice1.SetSelection( 0 )
        
        self.clear()
        
        self.m_staticText1.SetLabel(u'Dodawanie Autora')
#        self.st1 = u'Dodaj Autora'
        self.m_button1.Hide()
        self.m_button7.Hide()
        self.m_button2.Show()
        
        wx.MessageBox(u'Pomyślnie usunięto wybranego \
        Autora!', u'Sukces', wx.OK | wx.ICON_INFORMATION)
Ejemplo n.º 5
0
 def checkDataGroup(self, event):
     #Czyszczenie wszystkich zaznaczeń
     alluser = cDatabase.getUserName(self.session)
     for i in range(len(alluser)):
         self.m_checkList3.Check(i,  False)
     
     #Zaznaczanie autorów dla wybranej grupy
     gname = self.m_comboBox1.GetValue()
     guser = cDatabase.getCheckedUser(self.session, gname)
     t = cDatabase.getUserNameID(self.session)
     d = t.values()
     d.sort()
     p = {}
     for i in range(len(d)):
         x = {d[i]:i}
         p.update(x)
     
     for i in range(len(guser)):
         y = p[guser[i]]
         self.m_checkList3.Check(y)
     
     n = cDatabase.getGroup(self.session, gname)
     self.m_textCtrl2.SetValue(n)
     
     self.m_staticText1.SetLabel(u'Edytowanie Grupy')
     self.m_button5.Show()
     self.m_button3.Show()
     self.m_button1.Hide()
Ejemplo n.º 6
0
    def editPersonID(self, event):
        #Pobieranie wartosci z kontrolek
        tx1 = self.m_comboBox1.GetValue()
        tx2 = self.m_comboBox2.GetValue()
        tx3 = self.m_comboBox3.GetValue()
        tx4 = self.m_textCtrl3.GetValue()
        tx5 = self.m_textCtrl4.GetValue()
        tx6 = self.m_textCtrl41.GetValue()
        tx7 = self.m_textCtrl2.GetValue()
        
        t = (tx1, tx2, tx3, tx4, tx5, tx6, tx7)
        
        #Sprawdzanie czy wymagane wartości nie sa puste
        if tx1 == '' or tx4 == '' or tx5 == '' or tx6 == '':
            wx.MessageBox(u'Wszystkie wartości musz być \
            uzupełnione!', u'Bład!\
            ', wx.OK | wx.ICON_INFORMATION)
            return
        else:
            cDatabase.editUserDialog(self.session, t, self.tmp)
            wx.MessageBox(u'Dane zostały zaktualizowane!\
            ', u'Sukces', wx.OK | wx.ICON_INFORMATION)
        
        #Aktualizacja listy autorów
        m_choice1Choices = cDatabase.getUserName(self.session)
        self.m_choice1.Clear()
        self.m_choice1.AppendItems(m_choice1Choices)
#        self.m_choice1.SetSelection( 0 )
        
        self.clear()
        self.m_staticText1.SetLabel(u'Dodawanie Autora')
#        self.st1 = u'Dodaj Autora'
        self.m_button1.Hide()
        self.m_button7.Hide()
        self.m_button2.Show()
Ejemplo n.º 7
0
    def checkDataGroup(self, event):
        #Czyszczenie wszystkich zaznaczeń
        alluser = cDatabase.getUserName(self.session)
        for i in range(len(alluser)):
            self.m_checkList3.Check(i, False)

        #Zaznaczanie autorów dla wybranej grupy
        gname = self.m_comboBox1.GetValue()
        guser = cDatabase.getCheckedUser(self.session, gname)
        t = cDatabase.getUserNameID(self.session)
        d = t.values()
        d.sort()
        p = {}
        for i in range(len(d)):
            x = {d[i]: i}
            p.update(x)

        for i in range(len(guser)):
            y = p[guser[i]]
            self.m_checkList3.Check(y)

        n = cDatabase.getGroup(self.session, gname)
        self.m_textCtrl2.SetValue(n)

        self.m_staticText1.SetLabel(u'Edytowanie Grupy')
        self.m_button5.Show()
        self.m_button3.Show()
        self.m_button1.Hide()
Ejemplo n.º 8
0
    def getCheckUser(self):
        result = []
        guser = cDatabase.getUserName(self.session)
        t = cDatabase.getUserNameID(self.session)

        for i in range(len(guser)):
            if self.m_checkList3.IsChecked(i):
                id = t[guser[i]]
                result.append(id)
        return result
Ejemplo n.º 9
0
    def getCheckUser(self):
        result = []
        guser = cDatabase.getUserName(self.session)
        t = cDatabase.getUserNameID(self.session)

        for i in range(len(guser)):
            if self.m_checkList3.IsChecked(i):
                id = t[guser[i]]
                result.append(id)
        return result
Ejemplo n.º 10
0
 def clearData(self):
     #Czyszczenie kontrolkki z nazwami grup
     guser = cDatabase.getUserName(self.session)
     m_comboBox1Choices = cDatabase.getGroupName(self.session)
     self.m_comboBox1.Clear()
     self.m_comboBox1.AppendItems(m_comboBox1Choices)
     
     #Czyszczenie zaznaczonych autorow
     self.m_comboBox1.SetValue('')
     self.m_textCtrl2.SetValue('')
     for i in range(len(guser)):
         self.m_checkList3.Check(i,  False)
Ejemplo n.º 11
0
    def clearData(self):
        #Czyszczenie kontrolkki z nazwami grup
        guser = cDatabase.getUserName(self.session)
        m_comboBox1Choices = cDatabase.getGroupName(self.session)
        self.m_comboBox1.Clear()
        self.m_comboBox1.AppendItems(m_comboBox1Choices)

        #Czyszczenie zaznaczonych autorow
        self.m_comboBox1.SetValue('')
        self.m_textCtrl2.SetValue('')
        for i in range(len(guser)):
            self.m_checkList3.Check(i, False)
Ejemplo n.º 12
0
    def cancel(self, event):
        self.m_staticText1.SetLabel(u'Dodawanie Autora')
        #        self.st1 = u'Dodaj Autora'
        #Aktualizacja kontrolki z imionami i nazwiskami autorów
        m_choice1Choices = cDatabase.getUserName(self.session)
        self.m_choice1.Clear()
        self.m_choice1.AppendItems(m_choice1Choices)
        #        self.m_choice1.SetSelection( 0 )

        self.clear()

        self.m_button1.Hide()
        self.m_button7.Hide()
        self.m_button2.Show()

        self.Destroy()
Ejemplo n.º 13
0
    def cancel(self, event):
        self.m_staticText1.SetLabel(u'Dodawanie Autora')
#        self.st1 = u'Dodaj Autora'
        #Aktualizacja kontrolki z imionami i nazwiskami autorów
        m_choice1Choices = cDatabase.getUserName(self.session)
        self.m_choice1.Clear()
        self.m_choice1.AppendItems(m_choice1Choices)
#        self.m_choice1.SetSelection( 0 )

        self.clear()
        
        self.m_button1.Hide()
        self.m_button7.Hide()
        self.m_button2.Show()
        
        self.Destroy()
Ejemplo n.º 14
0
    def getUserData(self, event):
        AllDict = {}
        UserDict = {}
        ColDict = {}
        FacDict = {}
        InsDict = {}

        dbCollege = self.m_comboBox1.GetValue()
        dbFaculty = self.m_comboBox2.GetValue()
        dbInstitut = self.m_comboBox3.GetValue()
        dbName = self.m_textCtrl3.GetValue()
        dbSurname = self.m_textCtrl4.GetValue()
        dbFilter = self.m_textCtrl41.GetValue()
        dbNote = self.m_textCtrl2.GetValue()

        if dbCollege == '' or dbName == '' or dbSurname == '' or dbFilter == '':
            wx.MessageBox(u'Wszystkie pola są wymagane', u'Błąd',
                          wx.OK | wx.ICON_INFORMATION)
        else:
            ColDict['name'] = dbCollege
            FacDict['name'] = dbFaculty
            InsDict['name'] = dbInstitut
            UserDict['name'] = dbName
            UserDict['surname'] = dbSurname
            UserDict['filtr'] = dbFilter
            UserDict['note'] = dbNote
            AllDict = {
                'college': ColDict,
                'faculty': FacDict,
                'institute': InsDict,
                'person': UserDict
            }
            cDatabase.addUser(self.session, AllDict)
            wx.MessageBox(u'Poprawnie dodano Autora!', u'Sukces',
                          wx.OK | wx.ICON_INFORMATION)

    #Aktualizacja kontrolki z imionami i nazwiskami autorów
        m_choice1Choices = cDatabase.getUserName(self.session)
        self.m_choice1.Clear()
        self.m_choice1.AppendItems(m_choice1Choices)

        self.clear()

        self.m_button1.Hide()
        self.m_button7.Hide()
        self.m_button2.Show()
Ejemplo n.º 15
0
    def getUserData(self, event):
        AllDict = {}
        UserDict = {}
        ColDict = {}
        FacDict = {}
        InsDict = {}
        
        dbCollege = self.m_comboBox1.GetValue()
        dbFaculty = self.m_comboBox2.GetValue()
        dbInstitut = self.m_comboBox3.GetValue()
        dbName = self.m_textCtrl3.GetValue()
        dbSurname = self.m_textCtrl4.GetValue()
        dbFilter = self.m_textCtrl41.GetValue()
        dbNote = self.m_textCtrl2.GetValue()
        
        if dbCollege == '' or dbName == '' or dbSurname == '' or dbFilter == '':
            wx.MessageBox(u'Wszystkie pola są wymagane', u'Błąd', wx.OK | wx.ICON_INFORMATION)
        else:
            ColDict['name'] = dbCollege
            FacDict['name'] = dbFaculty
            InsDict['name'] = dbInstitut
            UserDict['name'] = dbName
            UserDict['surname'] = dbSurname
            UserDict['filtr'] = dbFilter
            UserDict['note'] = dbNote
            AllDict = {'college':ColDict,'faculty':FacDict,'institute':InsDict,'person':UserDict}
            cDatabase.addUser(self.session,AllDict)
            wx.MessageBox(u'Poprawnie dodano Autora!', u'Sukces', wx.OK | wx.ICON_INFORMATION)
        
       #Aktualizacja kontrolki z imionami i nazwiskami autorów
        m_choice1Choices = cDatabase.getUserName(self.session)
        self.m_choice1.Clear()
        self.m_choice1.AppendItems(m_choice1Choices)

        self.clear()
        
        self.m_button1.Hide()
        self.m_button7.Hide()
        self.m_button2.Show()
Ejemplo n.º 16
0
    def editPersonID(self, event):
        #Pobieranie wartosci z kontrolek
        tx1 = self.m_comboBox1.GetValue()
        tx2 = self.m_comboBox2.GetValue()
        tx3 = self.m_comboBox3.GetValue()
        tx4 = self.m_textCtrl3.GetValue()
        tx5 = self.m_textCtrl4.GetValue()
        tx6 = self.m_textCtrl41.GetValue()
        tx7 = self.m_textCtrl2.GetValue()

        t = (tx1, tx2, tx3, tx4, tx5, tx6, tx7)

        #Sprawdzanie czy wymagane wartości nie sa puste
        if tx1 == '' or tx4 == '' or tx5 == '' or tx6 == '':
            wx.MessageBox(
                u'Wszystkie wartości musz być \
            uzupełnione!', u'Bład!\
            ', wx.OK | wx.ICON_INFORMATION)
            return
        else:
            cDatabase.editUserDialog(self.session, t, self.tmp)
            wx.MessageBox(u'Dane zostały zaktualizowane!\
            ', u'Sukces', wx.OK | wx.ICON_INFORMATION)

        #Aktualizacja listy autorów
        m_choice1Choices = cDatabase.getUserName(self.session)
        self.m_choice1.Clear()
        self.m_choice1.AppendItems(m_choice1Choices)
        #        self.m_choice1.SetSelection( 0 )

        self.clear()
        self.m_staticText1.SetLabel(u'Dodawanie Autora')
        #        self.st1 = u'Dodaj Autora'
        self.m_button1.Hide()
        self.m_button7.Hide()
        self.m_button2.Show()
Ejemplo n.º 17
0
 def updateAutorName(self):
     self.ch4Choices = cDatabase.getUserName(self.session)
     self.ch4.Clear()
     self.ch4.AppendItems(self.ch4Choices)
     self.ch4.SetSelection( 0 )
Ejemplo n.º 18
0
    def __init__(self, parent):
        wx.Panel.__init__(self, parent=parent)
        
        self.control = sControler()
        self.handlerweb = webbrowser.get()
        
        if not os.path.exists('schdatabase.db'):
            cDatabase.createDatabase()
            self.session = cDatabase.connectDatabase()
            cDatabase.addEmptyString(self.session)
        
        self.session = cDatabase.connectDatabase()
        
        self.m_panel1 = wx.Panel( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TAB_TRAVERSAL )
        bSizer21 = wx.BoxSizer( wx.HORIZONTAL )
        
        bSizer22 = wx.BoxSizer( wx.HORIZONTAL )
        
        bSizer3 = wx.BoxSizer( wx.VERTICAL )
        
        bSizer5 = wx.BoxSizer( wx.VERTICAL )
        
        sbSizer1 = wx.StaticBoxSizer( wx.StaticBox( self.m_panel1, wx.ID_ANY, u"Wyszukiwarka Google Scholar" ), wx.VERTICAL )
        
        bSizer7 = wx.BoxSizer( wx.HORIZONTAL )
        
        self.m_staticText1 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Wszystkie słowa:", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText1.Wrap( -1 )
        bSizer7.Add( self.m_staticText1, 1, wx.TOP|wx.BOTTOM|wx.LEFT, 5 )
        
        self.ctrl1 = wx.TextCtrl( self.m_panel1, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 200,-1 ), 0 )
        bSizer7.Add( self.ctrl1, 0, wx.ALIGN_CENTER_VERTICAL|wx.EXPAND|wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 )
        
        sbSizer1.Add( bSizer7, 0, wx.EXPAND, 5 )
        
        bSizer8 = wx.BoxSizer( wx.HORIZONTAL )
        
        self.m_staticText2 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Wyrażenie:", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText2.Wrap( -1 )
        bSizer8.Add( self.m_staticText2, 1, wx.TOP|wx.BOTTOM|wx.LEFT, 5 )
        
        self.ctrl2 = wx.TextCtrl( self.m_panel1, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 200,-1 ), 0 )
        bSizer8.Add( self.ctrl2, 0, wx.EXPAND|wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 )
        
        sbSizer1.Add( bSizer8, 0, wx.EXPAND, 5 )
        
        bSizer9 = wx.BoxSizer( wx.HORIZONTAL )
        
        self.m_staticText3 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Jedno ze słów:", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText3.Wrap( -1 )
        bSizer9.Add( self.m_staticText3, 1, wx.TOP|wx.BOTTOM|wx.LEFT, 5 )
        
        self.ctrl3 = wx.TextCtrl( self.m_panel1, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 200,-1 ), 0 )
        bSizer9.Add( self.ctrl3, 0, wx.EXPAND|wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 )
        
        sbSizer1.Add( bSizer9, 0, wx.EXPAND, 5 )
        
        bSizer10 = wx.BoxSizer( wx.HORIZONTAL )
        
        self.m_staticText4 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Bez słów:", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText4.Wrap( -1 )
        bSizer10.Add( self.m_staticText4, 1, wx.TOP|wx.BOTTOM|wx.LEFT, 5 )
        
        self.ctrl4 = wx.TextCtrl( self.m_panel1, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 200,-1 ), 0 )
        bSizer10.Add( self.ctrl4, 0, wx.EXPAND|wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 )
        
        sbSizer1.Add( bSizer10, 0, wx.EXPAND, 5 )
        
        bSizer11 = wx.BoxSizer( wx.HORIZONTAL )
        
        self.m_staticText5 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Autor:", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText5.Wrap( -1 )
        bSizer11.Add( self.m_staticText5, 1, wx.ALL, 5 )
        
        self.ctrl5 = wx.TextCtrl( self.m_panel1, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 200,-1 ), 0 )
        bSizer11.Add( self.ctrl5, 0, wx.EXPAND|wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 )
        
        sbSizer1.Add( bSizer11, 0, wx.EXPAND, 5 )
        
        bSizer12 = wx.BoxSizer( wx.HORIZONTAL )
        
        self.m_staticText6 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Dziedzina:", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText6.Wrap( -1 )
        bSizer12.Add( self.m_staticText6, 1, wx.ALL, 5 )
        
        self.ctrl6 = wx.TextCtrl( self.m_panel1, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 200,-1 ), 0 )
        bSizer12.Add( self.ctrl6, 0, wx.EXPAND|wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 )
        
        sbSizer1.Add( bSizer12, 0, wx.EXPAND, 5 )
        
        bSizer13 = wx.BoxSizer( wx.HORIZONTAL )
        
        self.m_staticText7 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Rok od:", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText7.Wrap( -1 )
        bSizer13.Add( self.m_staticText7, 1, wx.ALL, 5 )
        
        self.ctrl7 = wx.TextCtrl( self.m_panel1, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 41,-1 ), 0 )
        bSizer13.Add( self.ctrl7, 0, wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 )
        
        self.m_staticText8 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"do", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText8.Wrap( -1 )
        bSizer13.Add( self.m_staticText8, 0, wx.ALL, 5 )
        
        self.ctrl8 = wx.TextCtrl( self.m_panel1, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 41,-1 ), 0 )
        bSizer13.Add( self.ctrl8, 0, wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 )
        
        self.but1 = wx.Button( self.m_panel1, wx.ID_ANY, u"Pobierz", wx.DefaultPosition, wx.DefaultSize, 0 )
        bSizer13.Add( self.but1, 0, wx.ALIGN_RIGHT|wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 )
        
        sbSizer1.Add( bSizer13, 0, wx.EXPAND, 5 )
        
        bSizer14 = wx.BoxSizer( wx.VERTICAL )
        
        sbSizer1.Add( bSizer14, 1, wx.EXPAND, 5 )
        
        bSizer5.Add( sbSizer1, 0, wx.ALL|wx.EXPAND, 5 )
        
        bSizer3.Add( bSizer5, 1, wx.EXPAND, 5 )
        
        bSizer6 = wx.BoxSizer( wx.VERTICAL )
        
        sbSizer2 = wx.StaticBoxSizer( wx.StaticBox( self.m_panel1, wx.ID_ANY, u"Wyszukiwanie Grupowe" ), wx.VERTICAL )
        
        bSizer15 = wx.BoxSizer( wx.VERTICAL )
        
        self.m_staticText9 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Wyszukiwanie dla wcześniej zdefiniowanej grupy autorów", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText9.Wrap( -1 )
        bSizer15.Add( self.m_staticText9, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 )
        
        sbSizer2.Add( bSizer15, 0, wx.EXPAND, 5 )
        
        bSizer16 = wx.BoxSizer( wx.HORIZONTAL )
        
        self.m_staticText10 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Grupa:", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText10.Wrap( -1 )
        bSizer16.Add( self.m_staticText10, 1, wx.TOP|wx.BOTTOM|wx.LEFT, 5 )
        
        ch1Choices = cDatabase.getGroupName(self.session)
        self.ch1 = wx.Choice( self.m_panel1, wx.ID_ANY, wx.DefaultPosition, wx.Size( 200,-1 ), ch1Choices, 0 )
        self.ch1.SetSelection( 0 )
        bSizer16.Add( self.ch1, 0, wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 )
        
        sbSizer2.Add( bSizer16, 0, wx.EXPAND, 5 )
        
        bSizer17 = wx.BoxSizer( wx.HORIZONTAL )
        
        self.m_staticText11 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Ogranicz do roku:", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText11.Wrap( -1 )
        bSizer17.Add( self.m_staticText11, 0, wx.TOP|wx.BOTTOM|wx.LEFT, 5 )
        
        self.m_textCtrl12 = wx.TextCtrl( self.m_panel1, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 65,-1 ), 0 )
        bSizer17.Add( self.m_textCtrl12, 1, wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 )
        
        self.but7 = wx.Button( self.m_panel1, wx.ID_ANY, u"Pobierz", wx.DefaultPosition, wx.DefaultSize, 0 )
        bSizer17.Add( self.but7, 0, wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 )
        
        sbSizer2.Add( bSizer17, 0, wx.EXPAND, 5 )
        
        bSizer6.Add( sbSizer2, 1, wx.ALL|wx.EXPAND, 5 )
        
        sbSizer3 = wx.StaticBoxSizer( wx.StaticBox( self.m_panel1, wx.ID_ANY, u"Filtracja" ), wx.VERTICAL )
        
        bSizer18 = wx.BoxSizer( wx.VERTICAL )
        
        self.m_staticText12 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Filtrację danych można przeprowadzić po ściągnieciu danych", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText12.Wrap( -1 )
        bSizer18.Add( self.m_staticText12, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 )
        
        sbSizer3.Add( bSizer18, 0, wx.EXPAND, 5 )
        
        bSizer19 = wx.BoxSizer( wx.HORIZONTAL )
        
        self.m_staticText13 = wx.StaticText( self.m_panel1, wx.ID_ANY, u"Imię i Nazwisko:", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText13.Wrap( -1 )
        bSizer19.Add( self.m_staticText13, 1, wx.TOP|wx.BOTTOM|wx.LEFT, 5 )
        
        self.ch4Choices = cDatabase.getUserName(self.session)
        self.ch4 = wx.Choice( self.m_panel1, wx.ID_ANY, wx.DefaultPosition, wx.Size( 200,-1 ), self.ch4Choices, 0 )
        self.ch4.SetSelection( 0 )
        bSizer19.Add( self.ch4, 0, wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 )
        
        sbSizer3.Add( bSizer19, 0, wx.EXPAND, 5 )
        
        bSizer20 = wx.BoxSizer( wx.VERTICAL )
        
        self.but2 = wx.Button( self.m_panel1, wx.ID_ANY, u"Filtruj", wx.DefaultPosition, wx.DefaultSize, 0 )

        bSizer20.Add( self.but2, 0, wx.ALIGN_RIGHT|wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 )
        
        sbSizer3.Add( bSizer20, 0, wx.EXPAND, 5 )
        
        bSizer6.Add( sbSizer3, 1, wx.EXPAND|wx.ALL, 5 )
        
        bSizer3.Add( bSizer6, 1, wx.EXPAND, 5 )
        
        bSizer22.Add( bSizer3, 0, wx.EXPAND, 5 )
        
        bSizer4 = wx.BoxSizer( wx.VERTICAL )
        
        self.dataList = TestListCtrl(self.m_panel1, wx.ID_ANY, wx.DefaultPosition, wx.Size( 685,-1 ), style=wx.LC_REPORT|wx.BORDER_SUNKEN)
        self.dataList.InsertColumn(0, u'ID', format=wx.LIST_FORMAT_CENTER, width=23)
        self.dataList.InsertColumn(1, u'Cytowań', format=wx.LIST_FORMAT_RIGHT, width=60)
        self.dataList.InsertColumn(2, u'Tytuł', format=wx.LIST_FORMAT_LEFT, width=260)
        self.dataList.InsertColumn(3, u'Autor', format=wx.LIST_FORMAT_LEFT, width=160)
        self.dataList.InsertColumn(4, u'Rok', format=wx.LIST_FORMAT_RIGHT, width=50)
        self.dataList.InsertColumn(5, u'Źródło', format=wx.LIST_FORMAT_LEFT, width=110)
        bSizer4.Add( self.dataList, 1, wx.ALL|wx.EXPAND, 5 )
        
        bSizer22.Add( bSizer4, 1, wx.EXPAND, 5 )
        
        bSizer21.Add( bSizer22, 1, wx.EXPAND, 5 )
        
        self.m_panel1.SetSizer( bSizer21 )
        self.m_panel1.Layout()
        bSizer21.Fit( self.m_panel1 )
        
        ########################################################################
        ##  Bind
        ########################################################################
        
        self.but1.Bind(wx.EVT_BUTTON, self.GetData)
        self.dataList.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.RightClickCb)
        self.dataList.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.selectOne)
        self.but2.Bind(wx.EVT_BUTTON, self.GetChoice)
        self.but7.Bind(wx.EVT_BUTTON, self.settmp)

        
        ########################################################################
        ##  Metody sch.controler.py
        ########################################################################
        
        self.menu_title_by_id = {1:'Zaznacz',2:'Odznacz',3:'Zaznacz wszystko',4:'Odznacz wszystko'}
        self.raport = []
Ejemplo n.º 19
0
    def __init__(self):
        wx.Dialog.__init__(self,
                           None,
                           id=wx.ID_ANY,
                           title=u"Zarządzanie Autorami",
                           pos=wx.DefaultPosition,
                           size=wx.Size(350, 330),
                           style=wx.DEFAULT_DIALOG_STYLE)

        self.session = cDatabase.connectDatabase()

        ico = wx.Icon('icon/autor.ico', wx.BITMAP_TYPE_ICO)
        self.SetIcon(ico)

        self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize)

        bSizer1 = wx.BoxSizer(wx.VERTICAL)

        bSizer2 = wx.BoxSizer(wx.VERTICAL)

        #        self.st1 =
        self.m_staticText1 = wx.StaticText(
            self, wx.ID_ANY, u"Dodawanie Autora", wx.DefaultPosition,
            wx.DefaultSize, wx.ALIGN_CENTRE | wx.ST_NO_AUTORESIZE)
        self.m_staticText1.Wrap(-1)
        bSizer2.Add(self.m_staticText1, 0, wx.EXPAND | wx.ALL, 5)

        bSizer1.Add(bSizer2, 0, wx.EXPAND, 5)

        bSizer3 = wx.BoxSizer(wx.VERTICAL)

        bSizer9 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText2 = wx.StaticText(self, wx.ID_ANY, u"Edytuj Autora:",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        self.m_staticText2.Wrap(-1)
        bSizer9.Add(self.m_staticText2, 1, wx.ALL, 5)

        self.m_choice1Choices = cDatabase.getUserName(self.session)
        self.m_choice1 = wx.Choice(self, wx.ID_ANY, wx.DefaultPosition,
                                   wx.Size(220, -1), self.m_choice1Choices, 0)
        #        self.m_choice1.SetSelection( 0 )
        bSizer9.Add(self.m_choice1, 0, wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer3.Add(bSizer9, 1, wx.EXPAND, 5)

        #        bSizer111 = wx.BoxSizer( wx.VERTICAL )
        #
        #        self.m_button6 = wx.Button( self, wx.ID_ANY, u"Wybierz", wx.DefaultPosition, wx.DefaultSize, 0 )
        #        bSizer111.Add( self.m_button6, 0, wx.ALIGN_RIGHT|wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 )
        #
        #
        #        bSizer3.Add( bSizer111, 1, wx.EXPAND, 5 )

        bSizer1.Add(bSizer3, 0, wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL, 5)

        bSizer13 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText6 = wx.StaticText(self, wx.ID_ANY, u"Afiliacja:",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        self.m_staticText6.Wrap(-1)
        bSizer13.Add(self.m_staticText6, 1, wx.ALL, 5)

        m_comboBox1Choices = cDatabase.getCollegeName(self.session)
        self.m_comboBox1 = wx.ComboBox(self, wx.ID_ANY,
                                       wx.EmptyString, wx.DefaultPosition,
                                       wx.Size(220, -1), m_comboBox1Choices, 0)
        bSizer13.Add(self.m_comboBox1, 0, wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer1.Add(bSizer13, 0, wx.EXPAND, 5)

        bSizer16 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText7 = wx.StaticText(self, wx.ID_ANY, u"Wydział/Dział:",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        self.m_staticText7.Wrap(-1)
        bSizer16.Add(self.m_staticText7, 1, wx.ALL, 5)

        m_comboBox2Choices = cDatabase.getFacultyName(self.session)
        self.m_comboBox2 = wx.ComboBox(self, wx.ID_ANY,
                                       wx.EmptyString, wx.DefaultPosition,
                                       wx.Size(220, -1), m_comboBox2Choices, 0)
        bSizer16.Add(self.m_comboBox2, 0, wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer1.Add(bSizer16, 0, wx.EXPAND, 5)

        bSizer17 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText8 = wx.StaticText(self, wx.ID_ANY,
                                           u"Instytut/Stanowisko:",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        self.m_staticText8.Wrap(-1)
        bSizer17.Add(self.m_staticText8, 1, wx.ALL, 5)

        m_comboBox3Choices = cDatabase.getInstituteName(self.session)
        self.m_comboBox3 = wx.ComboBox(self, wx.ID_ANY,
                                       wx.EmptyString, wx.DefaultPosition,
                                       wx.Size(220, -1), m_comboBox3Choices, 0)
        bSizer17.Add(self.m_comboBox3, 0, wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer1.Add(bSizer17, 0, wx.EXPAND, 5)

        bSizer4 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText3 = wx.StaticText(self, wx.ID_ANY, u"Imię:",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        self.m_staticText3.Wrap(-1)
        bSizer4.Add(self.m_staticText3, 1, wx.ALL, 5)

        self.m_textCtrl3 = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString,
                                       wx.DefaultPosition, wx.Size(220, -1), 0)
        bSizer4.Add(self.m_textCtrl3, 0, wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer1.Add(bSizer4, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.EXPAND, 5)

        bSizer5 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText4 = wx.StaticText(self, wx.ID_ANY, u"Nazwisko:",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        self.m_staticText4.Wrap(-1)
        bSizer5.Add(self.m_staticText4, 1, wx.ALL, 5)

        self.m_textCtrl4 = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString,
                                       wx.DefaultPosition, wx.Size(220, -1), 0)
        bSizer5.Add(self.m_textCtrl4, 0, wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer1.Add(bSizer5, 0, wx.EXPAND, 5)

        bSizer12 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText5 = wx.StaticText(self, wx.ID_ANY, u"Filtr:",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        self.m_staticText5.Wrap(-1)
        bSizer12.Add(self.m_staticText5, 1, wx.ALL, 5)

        self.m_textCtrl41 = wx.TextCtrl(self, wx.ID_ANY,
                                        wx.EmptyString, wx.DefaultPosition,
                                        wx.Size(220, -1), 0)
        self.m_textCtrl41.SetToolTipString(
            u"Format filtru: A Wójcik, A Wojcik, A WOJCIK")
        bSizer12.Add(self.m_textCtrl41, 0, wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer1.Add(bSizer12, 0, wx.EXPAND, 5)

        bSizer55 = wx.BoxSizer(wx.HORIZONTAL)

        #        self.m_staticText55 = wx.StaticText( self, wx.ID_ANY, u"Notatki:", wx.DefaultPosition, wx.DefaultSize, 0 )
        #        self.m_staticText55.Wrap( -1 )
        #        bSizer55.Add( self.m_staticText55, 1, wx.ALL, 5 )

        self.m_textCtrl2 = wx.TextCtrl(self, wx.ID_ANY,
                                       wx.EmptyString, wx.DefaultPosition,
                                       wx.Size(-1, 50), wx.TE_MULTILINE)
        self.m_textCtrl2.SetToolTipString(u"Notatki do autora")
        bSizer55.Add(self.m_textCtrl2, 1, wx.ALL | wx.EXPAND, 5)

        bSizer1.Add(bSizer55, 0, wx.EXPAND, 5)

        bSizer11 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_button2 = wx.Button(self, wx.ID_ANY, u"Dodaj",
                                   wx.DefaultPosition, wx.DefaultSize, 0)
        bSizer11.Add(self.m_button2, 0, wx.EXPAND | wx.ALL, 5)

        self.m_button1 = wx.Button(self, wx.ID_ANY, u"Zatwierdź",
                                   wx.DefaultPosition, wx.DefaultSize, 0)
        bSizer11.Add(self.m_button1, 0, wx.EXPAND | wx.ALL, 5)

        self.m_button7 = wx.Button(self, wx.ID_ANY, u"Usuń",
                                   wx.DefaultPosition, wx.DefaultSize, 0)
        bSizer11.Add(self.m_button7, 0, wx.RIGHT | wx.ALL, 5)

        self.m_button4 = wx.Button(self, wx.ID_ANY, u"Anuluj",
                                   wx.DefaultPosition, wx.DefaultSize, 0)
        bSizer11.Add(self.m_button4, 0, wx.RIGHT | wx.ALL, 5)

        bSizer1.Add(bSizer11, 0, wx.ALIGN_RIGHT, 5)

        self.SetSizer(bSizer1)
        self.Layout()

        self.Centre(wx.BOTH)

        self.m_button1.Hide()
        self.m_button7.Hide()

        ###################################################
        ## Bind
        ###################################################

        #        self.m_button6.Bind(wx.EVT_BUTTON, self.getPersonID)
        self.m_button1.Bind(wx.EVT_BUTTON, self.editPersonID)
        self.m_button2.Bind(wx.EVT_BUTTON, self.getUserData)
        self.m_button4.Bind(wx.EVT_BUTTON, self.cancel)
        self.m_button7.Bind(wx.EVT_BUTTON, self.deletePerson)
        self.m_choice1.Bind(wx.EVT_CHOICE, self.getPersonID)
Ejemplo n.º 20
0
    def __init__( self ):
        wx.Dialog.__init__ ( self, None, id = wx.ID_ANY, title = u"Zarządzanie Autorami", pos = wx.DefaultPosition, size = wx.Size( 350,330 ), style = wx.DEFAULT_DIALOG_STYLE )
        
        self.session = cDatabase.connectDatabase()
        
        ico = wx.Icon('icon/autor.ico', wx.BITMAP_TYPE_ICO)
        self.SetIcon(ico)
        
        self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
        
        bSizer1 = wx.BoxSizer( wx.VERTICAL )
        
        bSizer2 = wx.BoxSizer( wx.VERTICAL )
        
#        self.st1 =
        self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Dodawanie Autora", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_CENTRE|wx.ST_NO_AUTORESIZE )
        self.m_staticText1.Wrap( -1 )
        bSizer2.Add( self.m_staticText1, 0, wx.EXPAND|wx.ALL, 5 )
        
        
        bSizer1.Add( bSizer2, 0, wx.EXPAND, 5 )
        
        bSizer3 = wx.BoxSizer( wx.VERTICAL )
        
        bSizer9 = wx.BoxSizer( wx.HORIZONTAL )
        
        self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, u"Edytuj Autora:", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText2.Wrap( -1 )
        bSizer9.Add( self.m_staticText2, 1, wx.ALL, 5 )
        
        self.m_choice1Choices = cDatabase.getUserName(self.session)
        self.m_choice1 = wx.Choice( self, wx.ID_ANY, wx.DefaultPosition, wx.Size( 220,-1 ), self.m_choice1Choices, 0 )
#        self.m_choice1.SetSelection( 0 )
        bSizer9.Add( self.m_choice1, 0, wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 )
        
        
        bSizer3.Add( bSizer9, 1, wx.EXPAND, 5 )
        
#        bSizer111 = wx.BoxSizer( wx.VERTICAL )
#        
#        self.m_button6 = wx.Button( self, wx.ID_ANY, u"Wybierz", wx.DefaultPosition, wx.DefaultSize, 0 )
#        bSizer111.Add( self.m_button6, 0, wx.ALIGN_RIGHT|wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 )
#        
#        
#        bSizer3.Add( bSizer111, 1, wx.EXPAND, 5 )
        
        
        bSizer1.Add( bSizer3, 0, wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL, 5 )
        
        bSizer13 = wx.BoxSizer( wx.HORIZONTAL )
        
        self.m_staticText6 = wx.StaticText( self, wx.ID_ANY, u"Afiliacja:", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText6.Wrap( -1 )
        bSizer13.Add( self.m_staticText6, 1, wx.ALL, 5 )
        
        m_comboBox1Choices = cDatabase.getCollegeName(self.session)
        self.m_comboBox1 = wx.ComboBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 220,-1 ), m_comboBox1Choices, 0 )
        bSizer13.Add( self.m_comboBox1, 0, wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 )
        
        
        bSizer1.Add( bSizer13, 0, wx.EXPAND, 5 )
        
        bSizer16 = wx.BoxSizer( wx.HORIZONTAL )
        
        self.m_staticText7 = wx.StaticText( self, wx.ID_ANY, u"Wydział/Dział:", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText7.Wrap( -1 )
        bSizer16.Add( self.m_staticText7, 1, wx.ALL, 5 )
        
        m_comboBox2Choices = cDatabase.getFacultyName(self.session)
        self.m_comboBox2 = wx.ComboBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 220,-1 ), m_comboBox2Choices, 0 )
        bSizer16.Add( self.m_comboBox2, 0, wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 )
        
        
        bSizer1.Add( bSizer16, 0, wx.EXPAND, 5 )
        
        bSizer17 = wx.BoxSizer( wx.HORIZONTAL )
        
        self.m_staticText8 = wx.StaticText( self, wx.ID_ANY, u"Instytut/Stanowisko:", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText8.Wrap( -1 )
        bSizer17.Add( self.m_staticText8, 1, wx.ALL, 5 )
        
        m_comboBox3Choices = cDatabase.getInstituteName(self.session)
        self.m_comboBox3 = wx.ComboBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 220,-1 ), m_comboBox3Choices, 0 )
        bSizer17.Add( self.m_comboBox3, 0, wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 )
        
        
        bSizer1.Add( bSizer17, 0, wx.EXPAND, 5 )
        
        bSizer4 = wx.BoxSizer( wx.HORIZONTAL )
        
        self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, u"Imię:", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText3.Wrap( -1 )
        bSizer4.Add( self.m_staticText3, 1, wx.ALL, 5 )
        
        self.m_textCtrl3 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 220,-1 ), 0 )
        bSizer4.Add( self.m_textCtrl3, 0, wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 )
        
        
        bSizer1.Add( bSizer4, 0, wx.ALIGN_CENTER_HORIZONTAL|wx.EXPAND, 5 )
        
        bSizer5 = wx.BoxSizer( wx.HORIZONTAL )
        
        self.m_staticText4 = wx.StaticText( self, wx.ID_ANY, u"Nazwisko:", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText4.Wrap( -1 )
        bSizer5.Add( self.m_staticText4, 1, wx.ALL, 5 )
        
        self.m_textCtrl4 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 220,-1 ), 0 )
        bSizer5.Add( self.m_textCtrl4, 0, wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 )
        
        
        bSizer1.Add( bSizer5, 0, wx.EXPAND, 5 )
        
        bSizer12 = wx.BoxSizer( wx.HORIZONTAL )
        
        self.m_staticText5 = wx.StaticText( self, wx.ID_ANY, u"Filtr:", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText5.Wrap( -1 )
        bSizer12.Add( self.m_staticText5, 1, wx.ALL, 5 )
        
        self.m_textCtrl41 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( 220,-1 ), 0 )
        self.m_textCtrl41.SetToolTipString( u"Format filtru: A Wójcik, A Wojcik, A WOJCIK" )
        bSizer12.Add( self.m_textCtrl41, 0, wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 )
        
        
        bSizer1.Add( bSizer12, 0, wx.EXPAND, 5 )
        
        bSizer55 = wx.BoxSizer( wx.HORIZONTAL )
        
#        self.m_staticText55 = wx.StaticText( self, wx.ID_ANY, u"Notatki:", wx.DefaultPosition, wx.DefaultSize, 0 )
#        self.m_staticText55.Wrap( -1 )
#        bSizer55.Add( self.m_staticText55, 1, wx.ALL, 5 )
        
        self.m_textCtrl2 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( -1,50 ), wx.TE_MULTILINE )
        self.m_textCtrl2.SetToolTipString( u"Notatki do autora" )
        bSizer55.Add( self.m_textCtrl2, 1, wx.ALL|wx.EXPAND, 5  )
        
        
        bSizer1.Add( bSizer55, 0, wx.EXPAND, 5 )
        
        bSizer11 = wx.BoxSizer( wx.HORIZONTAL )
        
        self.m_button2 = wx.Button( self, wx.ID_ANY, u"Dodaj", wx.DefaultPosition, wx.DefaultSize, 0 )
        bSizer11.Add( self.m_button2, 0, wx.EXPAND|wx.ALL, 5 )
        
        self.m_button1 = wx.Button( self, wx.ID_ANY, u"Zatwierdź", wx.DefaultPosition, wx.DefaultSize, 0 )
        bSizer11.Add( self.m_button1, 0, wx.EXPAND|wx.ALL, 5 )
        
        self.m_button7 = wx.Button( self, wx.ID_ANY, u"Usuń", wx.DefaultPosition, wx.DefaultSize, 0 )
        bSizer11.Add( self.m_button7, 0, wx.RIGHT|wx.ALL, 5 )
        
        self.m_button4 = wx.Button( self, wx.ID_ANY, u"Anuluj", wx.DefaultPosition, wx.DefaultSize, 0 )
        bSizer11.Add( self.m_button4, 0, wx.RIGHT|wx.ALL, 5 )
        
        
        bSizer1.Add( bSizer11, 0, wx.ALIGN_RIGHT, 5 )
        
        
        self.SetSizer( bSizer1 )
        self.Layout()
        
        self.Centre( wx.BOTH )
        
        self.m_button1.Hide()
        self.m_button7.Hide()
        
###################################################
## Bind
###################################################
        
#        self.m_button6.Bind(wx.EVT_BUTTON, self.getPersonID)
        self.m_button1.Bind(wx.EVT_BUTTON, self.editPersonID)
        self.m_button2.Bind(wx.EVT_BUTTON, self.getUserData)
        self.m_button4.Bind(wx.EVT_BUTTON, self.cancel)
        self.m_button7.Bind(wx.EVT_BUTTON, self.deletePerson)
        self.m_choice1.Bind(wx.EVT_CHOICE,  self.getPersonID)
Ejemplo n.º 21
0
    def __init__( self ):
        wx.Dialog.__init__ ( self, None, id = wx.ID_ANY, title = u"Zarządzanie Grupami", pos = wx.DefaultPosition, size = wx.Size( 330,330 ), style = wx.DEFAULT_DIALOG_STYLE )
        
        self.session = cDatabase.connectDatabase()

        ico = wx.Icon('icon/grupa.ico', wx.BITMAP_TYPE_ICO)
        self.SetIcon(ico)
        
        self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
        
        bSizer1 = wx.BoxSizer( wx.VERTICAL )
        
        bSizer2 = wx.BoxSizer( wx.VERTICAL )
        
        self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Dodawanie Grupy", wx.DefaultPosition, wx.DefaultSize, wx.ALIGN_CENTRE|wx.ST_NO_AUTORESIZE )
        self.m_staticText1.Wrap( -1 )
        bSizer2.Add( self.m_staticText1, 0, wx.EXPAND|wx.ALL, 5 )        
        
        
        bSizer1.Add( bSizer2, 0, wx.EXPAND, 5 )
        
        bSizer3 = wx.BoxSizer( wx.HORIZONTAL )
        
        self.m_staticText2 = wx.StaticText( self, wx.ID_ANY, u"Grupa:", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText2.Wrap( -1 )
        bSizer3.Add( self.m_staticText2, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
        
        m_comboBox1Choices = cDatabase.getGroupName(self.session)
        self.m_comboBox1 = wx.ComboBox( self, wx.ID_ANY, u"", wx.DefaultPosition, wx.Size( 230,-1 ), m_comboBox1Choices, 0 )
        bSizer3.Add( self.m_comboBox1, 0, wx.ALL, 5 )
        
        
        bSizer1.Add( bSizer3, 0, wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL, 5 )
        
        bSizer10 = wx.BoxSizer( wx.HORIZONTAL )
        
        self.m_staticText9 = wx.StaticText( self, wx.ID_ANY, u"Autorzy:", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText9.Wrap( -1 )
        bSizer10.Add( self.m_staticText9, 1, wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 )
        
        m_checkList3Choices = cDatabase.getUserName(self.session)
        self.m_checkList3 = wx.CheckListBox( self, wx.ID_ANY, wx.DefaultPosition, wx.Size( 230,-1 ), m_checkList3Choices, 0 )
        bSizer10.Add( self.m_checkList3, 0, wx.EXPAND|wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 )
        
        
        bSizer1.Add( bSizer10, 1, wx.EXPAND, 5 )
        
        bSizer55 = wx.BoxSizer( wx.HORIZONTAL )
        
#        self.m_staticText55 = wx.StaticText( self, wx.ID_ANY, u"Notatki:", wx.DefaultPosition, wx.DefaultSize, 0 )
#        self.m_staticText55.Wrap( -1 )
#        bSizer55.Add( self.m_staticText55, 1, wx.ALL, 5 )
        
        self.m_textCtrl2 = wx.TextCtrl( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size( -1,50 ), wx.TE_MULTILINE )
        self.m_textCtrl2.SetToolTipString( u"Notatki do autora" )
        bSizer55.Add( self.m_textCtrl2, 1, wx.ALL|wx.EXPAND, 5  )
        
        
        bSizer1.Add( bSizer55, 0, wx.EXPAND, 5 )
        
        bSizer11 = wx.BoxSizer( wx.HORIZONTAL )
        
        self.m_button1 = wx.Button( self, wx.ID_ANY, u"Dodaj", wx.DefaultPosition, wx.DefaultSize, 0 )
        bSizer11.Add( self.m_button1, 0, wx.LEFT|wx.BOTTOM|wx.TOP, 5 )
        
        self.m_button5 = wx.Button( self, wx.ID_ANY, u"Zatwierdź", wx.DefaultPosition, wx.DefaultSize, 0 )
        bSizer11.Add( self.m_button5, 0, wx.LEFT|wx.BOTTOM|wx.TOP, 5 )
        
        self.m_button3 = wx.Button( self, wx.ID_ANY, u"Usuń", wx.DefaultPosition, wx.DefaultSize, 0 )
        bSizer11.Add( self.m_button3, 0, wx.LEFT|wx.BOTTOM|wx.TOP, 5 )
        
        self.m_button4 = wx.Button( self, wx.ID_ANY, u"Anuluj", wx.DefaultPosition, wx.DefaultSize, 0 )
        bSizer11.Add( self.m_button4, 0, wx.ALL, 5 )
        
        
        bSizer1.Add( bSizer11, 0, wx.ALIGN_RIGHT, 5 )
        
        
        self.SetSizer( bSizer1 )
        self.Layout()
        
        self.Centre( wx.BOTH )
        
        self.m_button5.Hide()
        self.m_button3.Hide()
        
###################################################
## Bind
###################################################
        
        self.m_button1.Bind(wx.EVT_BUTTON, self.addDataGroup)
        self.m_button5.Bind(wx.EVT_BUTTON, self.addDataGroup)
        self.m_button4.Bind(wx.EVT_BUTTON, self.cancel)
        self.m_button3.Bind(wx.EVT_BUTTON, self.deleteGroupValue)
        self.m_comboBox1.Bind(wx.EVT_COMBOBOX, self.checkDataGroup)
Ejemplo n.º 22
0
    def __init__(self):
        wx.Dialog.__init__(self,
                           None,
                           id=wx.ID_ANY,
                           title=u"Zarządzanie Publikacjami",
                           pos=wx.DefaultPosition,
                           size=wx.Size(450, 430),
                           style=wx.DEFAULT_DIALOG_STYLE)

        self.session = cDatabase.connectDatabase()
        self.listType = []
        self.getType()

        ico = wx.Icon('icon/pub.ico', wx.BITMAP_TYPE_ICO)
        self.SetIcon(ico)

        self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize)

        bSizer1 = wx.BoxSizer(wx.VERTICAL)

        bSizer28 = wx.BoxSizer(wx.VERTICAL)

        bSizer21 = wx.BoxSizer(wx.VERTICAL)

        self.m_staticText1 = wx.StaticText(
            self, wx.ID_ANY, u"Dodawanie Publikacji", wx.DefaultPosition,
            wx.DefaultSize, wx.ALIGN_CENTRE | wx.ST_NO_AUTORESIZE)
        self.m_staticText1.Wrap(-1)
        bSizer21.Add(self.m_staticText1, 0, wx.EXPAND | wx.ALL, 5)

        bSizer28.Add(bSizer21, 0, wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL, 5)

        bSizer1.Add(bSizer28, 0, wx.EXPAND, 5)

        bSizer26 = wx.BoxSizer(wx.HORIZONTAL)

        bSizer15 = wx.BoxSizer(wx.VERTICAL)

        bSizer3 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText2 = wx.StaticText(self, wx.ID_ANY, u"Tytuł:",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        self.m_staticText2.Wrap(-1)
        bSizer3.Add(self.m_staticText2, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL,
                    5)

        self.m_textCtrl2 = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString,
                                       wx.DefaultPosition, wx.Size(145, -1), 0)
        bSizer3.Add(self.m_textCtrl2, 0, wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer15.Add(bSizer3, 0, wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL, 5)

        bSizer5 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText4 = wx.StaticText(self, wx.ID_ANY, u"Autorzy:",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        self.m_staticText4.Wrap(-1)
        bSizer5.Add(self.m_staticText4, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL,
                    5)

        self.m_textCtrl4 = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString,
                                       wx.DefaultPosition, wx.Size(145, -1), 0)
        bSizer5.Add(self.m_textCtrl4, 0, wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer15.Add(bSizer5, 0, wx.EXPAND, 5)

        bSizer4 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText3 = wx.StaticText(self, wx.ID_ANY, u"Cytowania:",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        self.m_staticText3.Wrap(-1)
        bSizer4.Add(self.m_staticText3, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL,
                    5)

        self.m_textCtrl3 = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString,
                                       wx.DefaultPosition, wx.Size(145, -1), 0)
        bSizer4.Add(self.m_textCtrl3, 0, wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer15.Add(bSizer4, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.EXPAND, 5)

        bSizer6 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText5 = wx.StaticText(self, wx.ID_ANY, u"Typ:",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        self.m_staticText5.Wrap(-1)
        bSizer6.Add(self.m_staticText5, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL,
                    5)

        m_choice1Choices = self.listType
        self.m_choice1 = wx.Choice(self, wx.ID_ANY, wx.DefaultPosition,
                                   wx.Size(145, -1), m_choice1Choices, 0)
        self.m_choice1.SetSelection(0)
        bSizer6.Add(self.m_choice1, 0, wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer15.Add(bSizer6, 0, wx.EXPAND, 5)

        bSizer7 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText6 = wx.StaticText(self, wx.ID_ANY, u"Rok:",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        self.m_staticText6.Wrap(-1)
        bSizer7.Add(self.m_staticText6, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL,
                    5)

        self.m_textCtrl5 = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString,
                                       wx.DefaultPosition, wx.Size(145, -1), 0)
        bSizer7.Add(self.m_textCtrl5, 0, wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer15.Add(bSizer7, 0, wx.EXPAND, 5)

        bSizer8 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText7 = wx.StaticText(self, wx.ID_ANY, u"DOI:",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        self.m_staticText7.Wrap(-1)
        bSizer8.Add(self.m_staticText7, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL,
                    5)

        self.m_textCtrl6 = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString,
                                       wx.DefaultPosition, wx.Size(145, -1), 0)
        bSizer8.Add(self.m_textCtrl6, 0, wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer15.Add(bSizer8, 0, wx.EXPAND, 5)

        bSizer29 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText9 = wx.StaticText(self, wx.ID_ANY, u"Inny klucz:",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        self.m_staticText9.Wrap(-1)
        bSizer29.Add(self.m_staticText9, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL,
                     5)

        self.m_textCtrl7 = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString,
                                       wx.DefaultPosition, wx.Size(145, -1), 0)
        bSizer29.Add(self.m_textCtrl7, 0, wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer15.Add(bSizer29, 0, wx.EXPAND, 5)

        bSizer9 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText8 = wx.StaticText(self, wx.ID_ANY, u"Wydawca:",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        self.m_staticText8.Wrap(-1)
        bSizer9.Add(self.m_staticText8, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL,
                    5)

        m_choice2Choices = cDatabase.getJournalName(self.session)
        self.m_choice2 = wx.Choice(self, wx.ID_ANY, wx.DefaultPosition,
                                   wx.Size(145, -1), m_choice2Choices, 0)
        bSizer9.Add(self.m_choice2, 0, wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer15.Add(bSizer9, 0, wx.EXPAND, 5)

        bSizer17 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText10 = wx.StaticText(self, wx.ID_ANY, u"Źródło:",
                                            wx.DefaultPosition, wx.DefaultSize,
                                            0)
        self.m_staticText10.Wrap(-1)
        bSizer17.Add(self.m_staticText10, 1, wx.ALL, 5)

        self.m_textCtrl71 = wx.TextCtrl(self, wx.ID_ANY,
                                        wx.EmptyString, wx.DefaultPosition,
                                        wx.Size(145, -1), 0)
        bSizer17.Add(self.m_textCtrl71, 0, wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer15.Add(bSizer17, 1, wx.EXPAND, 5)

        bSizer18 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText99 = wx.StaticText(self, wx.ID_ANY, u"LMCP:",
                                            wx.DefaultPosition, wx.DefaultSize,
                                            0)
        self.m_staticText99.Wrap(-1)
        bSizer18.Add(self.m_staticText99, 1, wx.ALL, 5)

        self.m_textCtrl99 = wx.TextCtrl(self, wx.ID_ANY,
                                        wx.EmptyString, wx.DefaultPosition,
                                        wx.Size(145, -1), 0)
        self.m_textCtrl99.SetToolTipString(
            u"Ilość punktów na liście ministerialnej")
        bSizer18.Add(self.m_textCtrl99, 0, wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer15.Add(bSizer18, 1, wx.EXPAND, 5)

        bSizer19 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText98 = wx.StaticText(self, wx.ID_ANY, u"JCR:",
                                            wx.DefaultPosition, wx.DefaultSize,
                                            0)
        self.m_staticText98.Wrap(-1)
        bSizer19.Add(self.m_staticText98, 1, wx.ALL, 5)

        m_choice3Choices = ['True', 'False']
        self.m_choice3 = wx.Choice(self, wx.ID_ANY, wx.DefaultPosition,
                                   wx.Size(145, -1), m_choice3Choices, 0)
        bSizer19.Add(self.m_choice3, 0, wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer15.Add(bSizer19, 1, wx.EXPAND, 5)

        bSizer26.Add(bSizer15, 1, wx.EXPAND, 5)

        bSizer23 = wx.BoxSizer(wx.VERTICAL)

        bSizer10 = wx.BoxSizer(wx.VERTICAL)

        m_checkList3Choices = cDatabase.getUserName(self.session)
        self.m_checkList3 = wx.CheckListBox(self, wx.ID_ANY,
                                            wx.DefaultPosition,
                                            wx.Size(200, 281),
                                            m_checkList3Choices, 0)
        self.m_checkList3.SetToolTipString(u"Powiąż autorów z publikacją")

        bSizer10.Add(self.m_checkList3, 0,
                     wx.EXPAND | wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer23.Add(bSizer10, 0, wx.EXPAND, 5)

        bSizer26.Add(bSizer23, 1, wx.EXPAND, 5)

        bSizer1.Add(bSizer26, 0, wx.EXPAND, 5)

        bSizer55 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_textCtrl55 = wx.TextCtrl(self, wx.ID_ANY,
                                        wx.EmptyString, wx.DefaultPosition,
                                        wx.Size(-1, 50), wx.TE_MULTILINE)
        self.m_textCtrl55.SetToolTipString(u"Notatki do publikacji")
        bSizer55.Add(self.m_textCtrl55, 1, wx.ALL | wx.EXPAND, 5)

        bSizer1.Add(bSizer55, 0, wx.EXPAND, 5)

        bSizer11 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_button1 = wx.Button(self, wx.ID_ANY, u"Dodaj",
                                   wx.DefaultPosition, wx.DefaultSize, 0)
        bSizer11.Add(self.m_button1, 0, wx.ALL | wx.EXPAND, 5)

        self.m_button3 = wx.Button(self, wx.ID_ANY, u"Zatwierdź",
                                   wx.DefaultPosition, wx.DefaultSize, 0)
        bSizer11.Add(self.m_button3, 0, wx.ALL, 5)

        self.m_button4 = wx.Button(self, wx.ID_ANY, u"Zamknij",
                                   wx.DefaultPosition, wx.DefaultSize, 0)
        bSizer11.Add(self.m_button4, 0, wx.ALL, 5)

        self.m_staticText11 = wx.StaticText(self, wx.ID_ANY, u"",
                                            wx.DefaultPosition, wx.DefaultSize,
                                            0)
        self.m_staticText11.Wrap(-1)
        bSizer11.Add(self.m_staticText11, 1, wx.ALL, 5)

        self.m_staticText12 = wx.StaticText(self, wx.ID_ANY, u"",
                                            wx.DefaultPosition, wx.DefaultSize,
                                            0)
        self.m_staticText12.Wrap(-1)
        bSizer11.Add(self.m_staticText12, 1, wx.ALL, 5)

        bSizer1.Add(bSizer11, 0, wx.ALIGN_RIGHT, 5)

        self.SetSizer(bSizer1)
        self.Layout()

        self.Centre(wx.BOTH)

        self.m_button3.Hide()
        self.m_staticText11.Hide()
        self.m_staticText12.Hide()

        ##################################################
        ## Bind
        ###################################################

        self.m_button1.Bind(wx.EVT_BUTTON, self.addPubValue)
        self.m_button4.Bind(wx.EVT_BUTTON, self.close)
        self.m_button3.Bind(wx.EVT_BUTTON, self.editPubValue)

        ###################################################
        ## Metody
        ###################################################
        self.getType()
Ejemplo n.º 23
0
    def __init__(self):
        wx.Dialog.__init__(
            self,
            None,
            id=wx.ID_ANY,
            title=u"Zarządzanie Publikacjami",
            pos=wx.DefaultPosition,
            size=wx.Size(450, 430),
            style=wx.DEFAULT_DIALOG_STYLE,
        )

        self.session = cDatabase.connectDatabase()
        self.listType = []
        self.getType()

        ico = wx.Icon("icon/pub.ico", wx.BITMAP_TYPE_ICO)
        self.SetIcon(ico)

        self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize)

        bSizer1 = wx.BoxSizer(wx.VERTICAL)

        bSizer28 = wx.BoxSizer(wx.VERTICAL)

        bSizer21 = wx.BoxSizer(wx.VERTICAL)

        self.m_staticText1 = wx.StaticText(
            self,
            wx.ID_ANY,
            u"Dodawanie Publikacji",
            wx.DefaultPosition,
            wx.DefaultSize,
            wx.ALIGN_CENTRE | wx.ST_NO_AUTORESIZE,
        )
        self.m_staticText1.Wrap(-1)
        bSizer21.Add(self.m_staticText1, 0, wx.EXPAND | wx.ALL, 5)

        bSizer28.Add(bSizer21, 0, wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL, 5)

        bSizer1.Add(bSizer28, 0, wx.EXPAND, 5)

        bSizer26 = wx.BoxSizer(wx.HORIZONTAL)

        bSizer15 = wx.BoxSizer(wx.VERTICAL)

        bSizer3 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText2 = wx.StaticText(self, wx.ID_ANY, u"Tytuł:", wx.DefaultPosition, wx.DefaultSize, 0)
        self.m_staticText2.Wrap(-1)
        bSizer3.Add(self.m_staticText2, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)

        self.m_textCtrl2 = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size(145, -1), 0)
        bSizer3.Add(self.m_textCtrl2, 0, wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer15.Add(bSizer3, 0, wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL, 5)

        bSizer5 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText4 = wx.StaticText(self, wx.ID_ANY, u"Autorzy:", wx.DefaultPosition, wx.DefaultSize, 0)
        self.m_staticText4.Wrap(-1)
        bSizer5.Add(self.m_staticText4, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)

        self.m_textCtrl4 = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size(145, -1), 0)
        bSizer5.Add(self.m_textCtrl4, 0, wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer15.Add(bSizer5, 0, wx.EXPAND, 5)

        bSizer4 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText3 = wx.StaticText(self, wx.ID_ANY, u"Cytowania:", wx.DefaultPosition, wx.DefaultSize, 0)
        self.m_staticText3.Wrap(-1)
        bSizer4.Add(self.m_staticText3, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)

        self.m_textCtrl3 = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size(145, -1), 0)
        bSizer4.Add(self.m_textCtrl3, 0, wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer15.Add(bSizer4, 0, wx.ALIGN_CENTER_HORIZONTAL | wx.EXPAND, 5)

        bSizer6 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText5 = wx.StaticText(self, wx.ID_ANY, u"Typ:", wx.DefaultPosition, wx.DefaultSize, 0)
        self.m_staticText5.Wrap(-1)
        bSizer6.Add(self.m_staticText5, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)

        m_choice1Choices = self.listType
        self.m_choice1 = wx.Choice(self, wx.ID_ANY, wx.DefaultPosition, wx.Size(145, -1), m_choice1Choices, 0)
        self.m_choice1.SetSelection(0)
        bSizer6.Add(self.m_choice1, 0, wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer15.Add(bSizer6, 0, wx.EXPAND, 5)

        bSizer7 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText6 = wx.StaticText(self, wx.ID_ANY, u"Rok:", wx.DefaultPosition, wx.DefaultSize, 0)
        self.m_staticText6.Wrap(-1)
        bSizer7.Add(self.m_staticText6, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)

        self.m_textCtrl5 = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size(145, -1), 0)
        bSizer7.Add(self.m_textCtrl5, 0, wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer15.Add(bSizer7, 0, wx.EXPAND, 5)

        bSizer8 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText7 = wx.StaticText(self, wx.ID_ANY, u"DOI:", wx.DefaultPosition, wx.DefaultSize, 0)
        self.m_staticText7.Wrap(-1)
        bSizer8.Add(self.m_staticText7, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)

        self.m_textCtrl6 = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size(145, -1), 0)
        bSizer8.Add(self.m_textCtrl6, 0, wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer15.Add(bSizer8, 0, wx.EXPAND, 5)

        bSizer29 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText9 = wx.StaticText(self, wx.ID_ANY, u"Inny klucz:", wx.DefaultPosition, wx.DefaultSize, 0)
        self.m_staticText9.Wrap(-1)
        bSizer29.Add(self.m_staticText9, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)

        self.m_textCtrl7 = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size(145, -1), 0)
        bSizer29.Add(self.m_textCtrl7, 0, wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer15.Add(bSizer29, 0, wx.EXPAND, 5)

        bSizer9 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText8 = wx.StaticText(self, wx.ID_ANY, u"Wydawca:", wx.DefaultPosition, wx.DefaultSize, 0)
        self.m_staticText8.Wrap(-1)
        bSizer9.Add(self.m_staticText8, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL, 5)

        m_choice2Choices = cDatabase.getJournalName(self.session)
        self.m_choice2 = wx.Choice(self, wx.ID_ANY, wx.DefaultPosition, wx.Size(145, -1), m_choice2Choices, 0)
        bSizer9.Add(self.m_choice2, 0, wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer15.Add(bSizer9, 0, wx.EXPAND, 5)

        bSizer17 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText10 = wx.StaticText(self, wx.ID_ANY, u"Źródło:", wx.DefaultPosition, wx.DefaultSize, 0)
        self.m_staticText10.Wrap(-1)
        bSizer17.Add(self.m_staticText10, 1, wx.ALL, 5)

        self.m_textCtrl71 = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size(145, -1), 0)
        bSizer17.Add(self.m_textCtrl71, 0, wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer15.Add(bSizer17, 1, wx.EXPAND, 5)

        bSizer18 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText99 = wx.StaticText(self, wx.ID_ANY, u"LMCP:", wx.DefaultPosition, wx.DefaultSize, 0)
        self.m_staticText99.Wrap(-1)
        bSizer18.Add(self.m_staticText99, 1, wx.ALL, 5)

        self.m_textCtrl99 = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size(145, -1), 0)
        self.m_textCtrl99.SetToolTipString(u"Ilość punktów na liście ministerialnej")
        bSizer18.Add(self.m_textCtrl99, 0, wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer15.Add(bSizer18, 1, wx.EXPAND, 5)

        bSizer19 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText98 = wx.StaticText(self, wx.ID_ANY, u"JCR:", wx.DefaultPosition, wx.DefaultSize, 0)
        self.m_staticText98.Wrap(-1)
        bSizer19.Add(self.m_staticText98, 1, wx.ALL, 5)

        m_choice3Choices = ["True", "False"]
        self.m_choice3 = wx.Choice(self, wx.ID_ANY, wx.DefaultPosition, wx.Size(145, -1), m_choice3Choices, 0)
        bSizer19.Add(self.m_choice3, 0, wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer15.Add(bSizer19, 1, wx.EXPAND, 5)

        bSizer26.Add(bSizer15, 1, wx.EXPAND, 5)

        bSizer23 = wx.BoxSizer(wx.VERTICAL)

        bSizer10 = wx.BoxSizer(wx.VERTICAL)

        m_checkList3Choices = cDatabase.getUserName(self.session)
        self.m_checkList3 = wx.CheckListBox(
            self, wx.ID_ANY, wx.DefaultPosition, wx.Size(200, 281), m_checkList3Choices, 0
        )
        self.m_checkList3.SetToolTipString(u"Powiąż autorów z publikacją")

        bSizer10.Add(self.m_checkList3, 0, wx.EXPAND | wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer23.Add(bSizer10, 0, wx.EXPAND, 5)

        bSizer26.Add(bSizer23, 1, wx.EXPAND, 5)

        bSizer1.Add(bSizer26, 0, wx.EXPAND, 5)

        bSizer55 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_textCtrl55 = wx.TextCtrl(
            self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.Size(-1, 50), wx.TE_MULTILINE
        )
        self.m_textCtrl55.SetToolTipString(u"Notatki do publikacji")
        bSizer55.Add(self.m_textCtrl55, 1, wx.ALL | wx.EXPAND, 5)

        bSizer1.Add(bSizer55, 0, wx.EXPAND, 5)

        bSizer11 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_button1 = wx.Button(self, wx.ID_ANY, u"Dodaj", wx.DefaultPosition, wx.DefaultSize, 0)
        bSizer11.Add(self.m_button1, 0, wx.ALL | wx.EXPAND, 5)

        self.m_button3 = wx.Button(self, wx.ID_ANY, u"Zatwierdź", wx.DefaultPosition, wx.DefaultSize, 0)
        bSizer11.Add(self.m_button3, 0, wx.ALL, 5)

        self.m_button4 = wx.Button(self, wx.ID_ANY, u"Zamknij", wx.DefaultPosition, wx.DefaultSize, 0)
        bSizer11.Add(self.m_button4, 0, wx.ALL, 5)

        self.m_staticText11 = wx.StaticText(self, wx.ID_ANY, u"", wx.DefaultPosition, wx.DefaultSize, 0)
        self.m_staticText11.Wrap(-1)
        bSizer11.Add(self.m_staticText11, 1, wx.ALL, 5)

        self.m_staticText12 = wx.StaticText(self, wx.ID_ANY, u"", wx.DefaultPosition, wx.DefaultSize, 0)
        self.m_staticText12.Wrap(-1)
        bSizer11.Add(self.m_staticText12, 1, wx.ALL, 5)

        bSizer1.Add(bSizer11, 0, wx.ALIGN_RIGHT, 5)

        self.SetSizer(bSizer1)
        self.Layout()

        self.Centre(wx.BOTH)

        self.m_button3.Hide()
        self.m_staticText11.Hide()
        self.m_staticText12.Hide()

        ##################################################
        ## Bind
        ###################################################

        self.m_button1.Bind(wx.EVT_BUTTON, self.addPubValue)
        self.m_button4.Bind(wx.EVT_BUTTON, self.close)
        self.m_button3.Bind(wx.EVT_BUTTON, self.editPubValue)

        ###################################################
        ## Metody
        ###################################################
        self.getType()
Ejemplo n.º 24
0
    def __init__(self):
        wx.Dialog.__init__(self,
                           None,
                           id=wx.ID_ANY,
                           title=u"Zarządzanie Grupami",
                           pos=wx.DefaultPosition,
                           size=wx.Size(330, 330),
                           style=wx.DEFAULT_DIALOG_STYLE)

        self.session = cDatabase.connectDatabase()

        ico = wx.Icon('icon/grupa.ico', wx.BITMAP_TYPE_ICO)
        self.SetIcon(ico)

        self.SetSizeHintsSz(wx.DefaultSize, wx.DefaultSize)

        bSizer1 = wx.BoxSizer(wx.VERTICAL)

        bSizer2 = wx.BoxSizer(wx.VERTICAL)

        self.m_staticText1 = wx.StaticText(
            self, wx.ID_ANY, u"Dodawanie Grupy", wx.DefaultPosition,
            wx.DefaultSize, wx.ALIGN_CENTRE | wx.ST_NO_AUTORESIZE)
        self.m_staticText1.Wrap(-1)
        bSizer2.Add(self.m_staticText1, 0, wx.EXPAND | wx.ALL, 5)

        bSizer1.Add(bSizer2, 0, wx.EXPAND, 5)

        bSizer3 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText2 = wx.StaticText(self, wx.ID_ANY, u"Grupa:",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        self.m_staticText2.Wrap(-1)
        bSizer3.Add(self.m_staticText2, 1, wx.ALL | wx.ALIGN_CENTER_VERTICAL,
                    5)

        m_comboBox1Choices = cDatabase.getGroupName(self.session)
        self.m_comboBox1 = wx.ComboBox(self,
                                       wx.ID_ANY, u"", wx.DefaultPosition,
                                       wx.Size(230, -1), m_comboBox1Choices, 0)
        bSizer3.Add(self.m_comboBox1, 0, wx.ALL, 5)

        bSizer1.Add(bSizer3, 0, wx.EXPAND | wx.ALIGN_CENTER_HORIZONTAL, 5)

        bSizer10 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText9 = wx.StaticText(self, wx.ID_ANY, u"Autorzy:",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        self.m_staticText9.Wrap(-1)
        bSizer10.Add(self.m_staticText9, 1, wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        m_checkList3Choices = cDatabase.getUserName(self.session)
        self.m_checkList3 = wx.CheckListBox(self,
                                            wx.ID_ANY, wx.DefaultPosition,
                                            wx.Size(230, -1),
                                            m_checkList3Choices, 0)
        bSizer10.Add(self.m_checkList3, 0,
                     wx.EXPAND | wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer1.Add(bSizer10, 1, wx.EXPAND, 5)

        bSizer55 = wx.BoxSizer(wx.HORIZONTAL)

        #        self.m_staticText55 = wx.StaticText( self, wx.ID_ANY, u"Notatki:", wx.DefaultPosition, wx.DefaultSize, 0 )
        #        self.m_staticText55.Wrap( -1 )
        #        bSizer55.Add( self.m_staticText55, 1, wx.ALL, 5 )

        self.m_textCtrl2 = wx.TextCtrl(self, wx.ID_ANY,
                                       wx.EmptyString, wx.DefaultPosition,
                                       wx.Size(-1, 50), wx.TE_MULTILINE)
        self.m_textCtrl2.SetToolTipString(u"Notatki do autora")
        bSizer55.Add(self.m_textCtrl2, 1, wx.ALL | wx.EXPAND, 5)

        bSizer1.Add(bSizer55, 0, wx.EXPAND, 5)

        bSizer11 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_button1 = wx.Button(self, wx.ID_ANY, u"Dodaj",
                                   wx.DefaultPosition, wx.DefaultSize, 0)
        bSizer11.Add(self.m_button1, 0, wx.LEFT | wx.BOTTOM | wx.TOP, 5)

        self.m_button5 = wx.Button(self, wx.ID_ANY, u"Zatwierdź",
                                   wx.DefaultPosition, wx.DefaultSize, 0)
        bSizer11.Add(self.m_button5, 0, wx.LEFT | wx.BOTTOM | wx.TOP, 5)

        self.m_button3 = wx.Button(self, wx.ID_ANY, u"Usuń",
                                   wx.DefaultPosition, wx.DefaultSize, 0)
        bSizer11.Add(self.m_button3, 0, wx.LEFT | wx.BOTTOM | wx.TOP, 5)

        self.m_button4 = wx.Button(self, wx.ID_ANY, u"Anuluj",
                                   wx.DefaultPosition, wx.DefaultSize, 0)
        bSizer11.Add(self.m_button4, 0, wx.ALL, 5)

        bSizer1.Add(bSizer11, 0, wx.ALIGN_RIGHT, 5)

        self.SetSizer(bSizer1)
        self.Layout()

        self.Centre(wx.BOTH)

        self.m_button5.Hide()
        self.m_button3.Hide()

        ###################################################
        ## Bind
        ###################################################

        self.m_button1.Bind(wx.EVT_BUTTON, self.addDataGroup)
        self.m_button5.Bind(wx.EVT_BUTTON, self.addDataGroup)
        self.m_button4.Bind(wx.EVT_BUTTON, self.cancel)
        self.m_button3.Bind(wx.EVT_BUTTON, self.deleteGroupValue)
        self.m_comboBox1.Bind(wx.EVT_COMBOBOX, self.checkDataGroup)