예제 #1
0
파일: wydawca.py 프로젝트: damianbaran/inz
 def deleteJournalValue(self, event):
     tx1 = self.m_comboBox1.GetValue()   #pobieranie nazwy wydawcy z kontrolki
     
     if tx1 != '':
         cDatabase.delJournalData(self.session, tx1) #wywoałnie metody usuwajcej rekord z bazy
     else:
         wx.MessageBox(u'Nie ma takiego wydawcy w bazie!', u'Błąd!', wx.OK | wx.ICON_INFORMATION) 
     
     self.m_staticText1.SetLabel(u'Dodawanie Wydawcy')
     #Po usunięciu wyświetlnie w kontrolce nowej listy wydawców
     m_comboBox1Choices = cDatabase.getJournalName(self.session)
     self.m_comboBox1.Clear()
     self.m_comboBox1.AppendItems(m_comboBox1Choices)
     self.m_comboBox1.SetSelection( 0 )
     
     self.cancel()
예제 #2
0
파일: wydawca.py 프로젝트: damianbaran/inz
    def cancel(self, event):
        #Wyczysczenie wszystkich kontrolek i aktualizacja listy wydawców
        m_comboBox1Choices = cDatabase.getJournalName(self.session)
        self.m_comboBox1.Clear()
        self.m_comboBox1.AppendItems(m_comboBox1Choices)
        #        self.m_comboBox1.SetSelection( 0 )
        self.m_textCtrl3.SetValue('')
        self.m_textCtrl4.SetValue('')
        self.m_textCtrl2.SetValue('')

        self.m_staticText1.SetLabel(u'Dodawanie Wydawcy')
        self.m_button3.Hide()
        self.m_button2.Hide()
        self.m_button1.Show()

        self.Destroy()
        """Zamyka okienko wydawcy"""
        self.Destroy()
예제 #3
0
파일: wydawca.py 프로젝트: damianbaran/inz
    def cancel(self, event):
        #Wyczysczenie wszystkich kontrolek i aktualizacja listy wydawców
        m_comboBox1Choices = cDatabase.getJournalName(self.session)
        self.m_comboBox1.Clear()
        self.m_comboBox1.AppendItems(m_comboBox1Choices)
#        self.m_comboBox1.SetSelection( 0 )
        self.m_textCtrl3.SetValue('')
        self.m_textCtrl4.SetValue('')
        self.m_textCtrl2.SetValue('')
        
        self.m_staticText1.SetLabel(u'Dodawanie Wydawcy')
        self.m_button3.Hide()
        self.m_button2.Hide()
        self.m_button1.Show()
        
        self.Destroy()
        """Zamyka okienko wydawcy"""
        self.Destroy()
예제 #4
0
파일: wydawca.py 프로젝트: damianbaran/inz
    def deleteJournalValue(self, event):
        tx1 = self.m_comboBox1.GetValue(
        )  #pobieranie nazwy wydawcy z kontrolki

        if tx1 != '':
            cDatabase.delJournalData(
                self.session, tx1)  #wywoałnie metody usuwajcej rekord z bazy
        else:
            wx.MessageBox(u'Nie ma takiego wydawcy w bazie!', u'Błąd!',
                          wx.OK | wx.ICON_INFORMATION)

        self.m_staticText1.SetLabel(u'Dodawanie Wydawcy')
        #Po usunięciu wyświetlnie w kontrolce nowej listy wydawców
        m_comboBox1Choices = cDatabase.getJournalName(self.session)
        self.m_comboBox1.Clear()
        self.m_comboBox1.AppendItems(m_comboBox1Choices)
        self.m_comboBox1.SetSelection(0)

        self.cancel()
예제 #5
0
파일: wydawca.py 프로젝트: damianbaran/inz
    def addJournalValue(self, event):
        #Pobieranie danych wydawcy z kontrolek
        tx1 = self.m_comboBox1.GetValue()
        tx2 = self.m_textCtrl3.GetValue()
        tx3 = self.m_textCtrl4.GetValue()
        tx4 = self.m_textCtrl2.GetValue()
        t = (tx1, tx2, tx3, tx4)
        
        #Sprawdzenie czy obowiazkowe wartości nie sa puste
        if tx1 != '' or tx3 != '':
            cDatabase.addJournalData(self.session, t)
        else:
            wx.MessageBox(u'Nie podano pełnej nazwy \nlub adresu.', u'Błąd', wx.OK | wx.ICON_INFORMATION)   
        
        #Wyczysczenie wszystkich kontrolek i aktualizacja listy wydawców
        m_comboBox1Choices = cDatabase.getJournalName(self.session)
        self.m_comboBox1.Clear()
        self.m_comboBox1.AppendItems(m_comboBox1Choices)
#        self.m_comboBox1.SetSelection( 0 )
        self.m_textCtrl3.SetValue('')
        self.m_textCtrl4.SetValue('')
        self.m_textCtrl2.SetValue('')
예제 #6
0
파일: wydawca.py 프로젝트: damianbaran/inz
    def addJournalValue(self, event):
        #Pobieranie danych wydawcy z kontrolek
        tx1 = self.m_comboBox1.GetValue()
        tx2 = self.m_textCtrl3.GetValue()
        tx3 = self.m_textCtrl4.GetValue()
        tx4 = self.m_textCtrl2.GetValue()
        t = (tx1, tx2, tx3, tx4)

        #Sprawdzenie czy obowiazkowe wartości nie sa puste
        if tx1 != '' or tx3 != '':
            cDatabase.addJournalData(self.session, t)
        else:
            wx.MessageBox(u'Nie podano pełnej nazwy \nlub adresu.', u'Błąd',
                          wx.OK | wx.ICON_INFORMATION)

        #Wyczysczenie wszystkich kontrolek i aktualizacja listy wydawców
        m_comboBox1Choices = cDatabase.getJournalName(self.session)
        self.m_comboBox1.Clear()
        self.m_comboBox1.AppendItems(m_comboBox1Choices)
        #        self.m_comboBox1.SetSelection( 0 )
        self.m_textCtrl3.SetValue('')
        self.m_textCtrl4.SetValue('')
        self.m_textCtrl2.SetValue('')
예제 #7
0
파일: wydawca.py 프로젝트: damianbaran/inz
    def __init__(self):
        wx.Dialog.__init__(self,
                           None,
                           id=wx.ID_ANY,
                           title=u"Zarządzanie Wydawcami",
                           pos=wx.DefaultPosition,
                           size=wx.Size(350, 230),
                           style=wx.DEFAULT_DIALOG_STYLE)

        self.session = cDatabase.connectDatabase()

        ico = wx.Icon('icon/jou.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 Wydawcy", 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"Pełna nazwa:",
                                           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.getJournalName(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)

        bSizer4 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText3 = wx.StaticText(self, wx.ID_ANY, u"Skrócona nazwa:",
                                           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(230, -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"Adres:",
                                           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(230, -1), 0)
        bSizer5.Add(self.m_textCtrl4, 0, wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer1.Add(bSizer5, 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_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_button2 = wx.Button(self, wx.ID_ANY, u"Usuń",
                                   wx.DefaultPosition, wx.DefaultSize, 0)
        bSizer11.Add(self.m_button2, 0, 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.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_button2.Hide()

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

        self.m_button1.Bind(wx.EVT_BUTTON, self.addJournalValue)
        self.m_button4.Bind(wx.EVT_BUTTON, self.cancel)
        self.m_button3.Bind(wx.EVT_BUTTON, self.editJournalValue)
        self.m_button2.Bind(wx.EVT_BUTTON, self.deleteJournalValue)
        self.m_comboBox1.Bind(wx.EVT_COMBOBOX, self.viewJournalValue)
예제 #8
0
파일: wydawca.py 프로젝트: damianbaran/inz
class JourDialog(wx.Dialog):
    ##Konstruktor
    def __init__(self):
        wx.Dialog.__init__(self,
                           None,
                           id=wx.ID_ANY,
                           title=u"Zarządzanie Wydawcami",
                           pos=wx.DefaultPosition,
                           size=wx.Size(350, 230),
                           style=wx.DEFAULT_DIALOG_STYLE)

        self.session = cDatabase.connectDatabase()

        ico = wx.Icon('icon/jou.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 Wydawcy", 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"Pełna nazwa:",
                                           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.getJournalName(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)

        bSizer4 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText3 = wx.StaticText(self, wx.ID_ANY, u"Skrócona nazwa:",
                                           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(230, -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"Adres:",
                                           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(230, -1), 0)
        bSizer5.Add(self.m_textCtrl4, 0, wx.BOTTOM | wx.RIGHT | wx.LEFT, 5)

        bSizer1.Add(bSizer5, 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_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_button2 = wx.Button(self, wx.ID_ANY, u"Usuń",
                                   wx.DefaultPosition, wx.DefaultSize, 0)
        bSizer11.Add(self.m_button2, 0, 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.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_button2.Hide()

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

        self.m_button1.Bind(wx.EVT_BUTTON, self.addJournalValue)
        self.m_button4.Bind(wx.EVT_BUTTON, self.cancel)
        self.m_button3.Bind(wx.EVT_BUTTON, self.editJournalValue)
        self.m_button2.Bind(wx.EVT_BUTTON, self.deleteJournalValue)
        self.m_comboBox1.Bind(wx.EVT_COMBOBOX, self.viewJournalValue)


###################################################
## Metody
###################################################

## Dokumentacja deleteJournalValue
# @param self Wskaźnik obiektu
# @param event Wywołanie żadania
#
# @return void
# Funkcja wysyla zadanie z usunieciem wybranego wydawcy przez uzytkownika

    def deleteJournalValue(self, event):
        tx1 = self.m_comboBox1.GetValue(
        )  #pobieranie nazwy wydawcy z kontrolki

        if tx1 != '':
            cDatabase.delJournalData(
                self.session, tx1)  #wywoałnie metody usuwajcej rekord z bazy
        else:
            wx.MessageBox(u'Nie ma takiego wydawcy w bazie!', u'Błąd!',
                          wx.OK | wx.ICON_INFORMATION)

        self.m_staticText1.SetLabel(u'Dodawanie Wydawcy')
        #Po usunięciu wyświetlnie w kontrolce nowej listy wydawców
        m_comboBox1Choices = cDatabase.getJournalName(self.session)
        self.m_comboBox1.Clear()
        self.m_comboBox1.AppendItems(m_comboBox1Choices)
        self.m_comboBox1.SetSelection(0)

        self.cancel()

    ## Dokumentacja viewJournalValue
    # @param self Wskaźnik obiektu
    # @param event Wywołanie żadania
    #
    # @return void
    # Funkcja wysyla zadanie z wyswietleniem wartosci dla wybranego wydawcy
    def viewJournalValue(self, event):
        self.tx1 = self.m_comboBox1.GetValue()

        data = cDatabase.getJournalData(self.session, self.tx1)

        self.m_textCtrl3.SetValue(data[0])
        self.m_textCtrl4.SetValue(data[1])
        self.m_textCtrl2.SetValue(data[2])

        self.m_staticText1.SetLabel(u'Edytowanie Wydawcy')
        self.m_button3.Show()
        self.m_button2.Show()
        self.m_button1.Hide()

    ## Dokumentacja addJournalValue
    # @param self Wskaźnik obiektu
    # @param event Wywołanie żadania
    #
    # @return void
    # Funkcja wysyla zadanie o dodanie nowego wydawcy do bazy danych
    def addJournalValue(self, event):
        #Pobieranie danych wydawcy z kontrolek
        tx1 = self.m_comboBox1.GetValue()
        tx2 = self.m_textCtrl3.GetValue()
        tx3 = self.m_textCtrl4.GetValue()
        tx4 = self.m_textCtrl2.GetValue()
        t = (tx1, tx2, tx3, tx4)

        #Sprawdzenie czy obowiazkowe wartości nie sa puste
        if tx1 != '' or tx3 != '':
            cDatabase.addJournalData(self.session, t)
        else:
            wx.MessageBox(u'Nie podano pełnej nazwy \nlub adresu.', u'Błąd',
                          wx.OK | wx.ICON_INFORMATION)

        #Wyczysczenie wszystkich kontrolek i aktualizacja listy wydawców
        m_comboBox1Choices = cDatabase.getJournalName(self.session)
        self.m_comboBox1.Clear()
        self.m_comboBox1.AppendItems(m_comboBox1Choices)
        #        self.m_comboBox1.SetSelection( 0 )
        self.m_textCtrl3.SetValue('')
        self.m_textCtrl4.SetValue('')
        self.m_textCtrl2.SetValue('')

    ## Dokumentacja editJournalValue
    # @param self Wskaźnik obiektu
    # @param event Wywołanie żadania
    #
    # @return void
    # Funkcja wysyla zadanie z edycja wybranego wydawcy przez uzytkownika
    def editJournalValue(self, event):
        #Pobieranie danych wydawcy z kontrolek
        tx1 = self.m_comboBox1.GetValue()
        tx2 = self.m_textCtrl3.GetValue()
        tx3 = self.m_textCtrl4.GetValue()
        tx4 = self.m_textCtrl2.GetValue()
        t = (tx1, tx2, tx3, tx4)

        jourID = cDatabase.getJournalNameID(self.session)
        id = jourID[self.tx1]
        #        print id

        #Sprawdzenie czy obowiazkowe wartości nie sa puste
        if tx1 != '' or tx3 != '':
            try:
                cDatabase.editJournalData(self.session, t, id)
                wx.MessageBox(u'Dane zaktualizowano pomyślnie!', u'Sukces!',
                              wx.OK | wx.ICON_INFORMATION)
            except Exception, e:  #Wywołanie wyjtku, który został stworzony w zapytaniu do bazy
                e

        #Wyczysczenie wszystkich kontrolek i aktualizacja listy wydawców
        m_comboBox1Choices = cDatabase.getJournalName(self.session)
        self.m_comboBox1.Clear()
        self.m_comboBox1.AppendItems(m_comboBox1Choices)
        #        self.m_comboBox1.SetSelection( 0 )
        self.m_textCtrl3.SetValue('')
        self.m_textCtrl4.SetValue('')
        self.m_textCtrl2.SetValue('')

        self.m_staticText1.SetLabel(u'Dodawanie Wydawcy')
        self.m_button3.Hide()
        self.m_button2.Hide()
        self.m_button1.Show()
예제 #9
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()
예제 #10
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()
예제 #11
0
파일: wydawca.py 프로젝트: damianbaran/inz
    def __init__( self ):
        wx.Dialog.__init__ ( self, None, id = wx.ID_ANY, title = u"Zarządzanie Wydawcami", pos = wx.DefaultPosition, size = wx.Size( 350,230 ), style = wx.DEFAULT_DIALOG_STYLE )
        
        self.session = cDatabase.connectDatabase()

        ico = wx.Icon('icon/jou.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 Wydawcy", 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"Pełna nazwa:", 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.getJournalName(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 )
        
        bSizer4 = wx.BoxSizer( wx.HORIZONTAL )
        
        self.m_staticText3 = wx.StaticText( self, wx.ID_ANY, u"Skrócona nazwa:", 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( 230,-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"Adres:", 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( 230,-1 ), 0 )
        bSizer5.Add( self.m_textCtrl4, 0, wx.BOTTOM|wx.RIGHT|wx.LEFT, 5 )
        
        
        bSizer1.Add( bSizer5, 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_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_button2 = wx.Button( self, wx.ID_ANY, u"Usuń", wx.DefaultPosition, wx.DefaultSize, 0 )
        bSizer11.Add( self.m_button2, 0, 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.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_button2.Hide()

###################################################
## Bind
###################################################
        
        self.m_button1.Bind(wx.EVT_BUTTON, self.addJournalValue)
        self.m_button4.Bind(wx.EVT_BUTTON, self.cancel)
        self.m_button3.Bind(wx.EVT_BUTTON, self.editJournalValue)
        self.m_button2.Bind(wx.EVT_BUTTON, self.deleteJournalValue)
        self.m_comboBox1.Bind(wx.EVT_COMBOBOX, self.viewJournalValue)