Exemplo n.º 1
0
    def __init__( self ):
        wx.Dialog.__init__ ( self, None, id = wx.ID_ANY, title = u"Dodaj Publikację", pos = wx.DefaultPosition, size = wx.Size( 600,300 ), style = wx.DEFAULT_DIALOG_STYLE )
        
        self.session = cDatabase.connectDatabase()
        
        self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
        
        bSizer1 = wx.BoxSizer( wx.VERTICAL )
        
        bSizer13 = wx.BoxSizer( wx.VERTICAL )
        
#        self.m_listCtrl1 = wx.ListCtrl( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LC_ICON )
        self.dataList = TestListCtrl(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 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=130)
        self.dataList.InsertColumn(3, u'Autor', format=wx.LIST_FORMAT_LEFT, width=100)
        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=100)
        self.dataList.InsertColumn(6, u'DOI', format=wx.LIST_FORMAT_LEFT, width=100)
        bSizer13.Add( self.dataList, 1, wx.ALL|wx.EXPAND, 5 )
        
        bSizer4 = wx.BoxSizer( wx.VERTICAL )
        
        self.m_button1 = wx.Button( self, wx.ID_ANY, u"Dodaj", wx.DefaultPosition, wx.DefaultSize, 0 )
        bSizer4.Add( self.m_button1, 0, wx.BOTTOM|wx.RIGHT|wx.LEFT|wx.ALIGN_RIGHT, 5 )
        
        
        bSizer13.Add( bSizer4, 0, wx.EXPAND|wx.LEFT, 5 )
        
        
        bSizer1.Add( bSizer13, 1, wx.EXPAND, 5 )
        
        
        self.SetSizer( bSizer1 )
        self.Layout()
        
        self.Centre( wx.BOTH )
    
#################################################
## Bind
###################################################
        
#        self.Bind( wx.EVT_TOOL, self.openLinkCit, addall )
#        self.Bind( wx.EVT_TOOL, self.openLinkPub, addone )
#        self.Bind( wx.EVT_TOOL, self.clearData, clear )
#        self.Bind( wx.EVT_TOOL, self.mergePub, merge )
#        self.Bind( wx.EVT_TOOL, self.deletePub, delpub )
#        self.Bind( wx.EVT_TOOL, self.backListPub, backlist )
        self.m_button1.Bind(wx.EVT_BUTTON, self.addPub)

###################################################
## Metody
###################################################
        self.data = cDatabase.getCitPubData(self.session)
        self.updateRecord()
Exemplo n.º 2
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 = []
Exemplo n.º 3
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)
Exemplo n.º 4
0
    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)
Exemplo n.º 5
0
    def __init__(self):
        wx.Dialog.__init__(self,
                           None,
                           id=wx.ID_ANY,
                           title=u"Menadźer łączenia publikacji",
                           pos=wx.DefaultPosition,
                           size=wx.Size(600, 300),
                           style=wx.DEFAULT_DIALOG_STYLE)

        self.handlerweb = webbrowser.get()
        self.session = cDatabase.connectDatabase()

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

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

        bSizer1 = wx.BoxSizer(wx.VERTICAL)

        self.m_toolBar2 = wx.ToolBar(self, wx.ID_ANY, wx.DefaultPosition,
                                     wx.DefaultSize,
                                     wx.TB_HORIZONTAL | wx.TB_FLAT)
        addall = self.m_toolBar2.AddLabelTool(
            1, u"tool", wx.Bitmap(u"icon/globe.png", wx.BITMAP_TYPE_ANY),
            wx.NullBitmap, wx.ITEM_NORMAL, u"Wyświetl wszystkie cytowania",
            wx.EmptyString, None)
        addone = self.m_toolBar2.AddLabelTool(
            2, u"tool", wx.Bitmap(u"icon/browser.png", wx.BITMAP_TYPE_ANY),
            wx.NullBitmap, wx.ITEM_NORMAL, u"Wyświetl wybrana publikację",
            wx.EmptyString, None)
        clear = self.m_toolBar2.AddLabelTool(
            3, u"tool", wx.Bitmap(u"icon/clear.png",
                                  wx.BITMAP_TYPE_ANY), wx.NullBitmap,
            wx.ITEM_NORMAL, u"Czyść listę", wx.EmptyString, None)
        backlist = self.m_toolBar2.AddLabelTool(
            6, u"tool", wx.Bitmap(u"icon/back.png", wx.BITMAP_TYPE_ANY),
            wx.NullBitmap, wx.ITEM_NORMAL, u"Przywróć wybrane publikacje",
            wx.EmptyString, None)
        self.m_toolBar2.AddSeparator()

        merge = self.m_toolBar2.AddLabelTool(
            4, u"tool", wx.Bitmap(u"icon/merge.png",
                                  wx.BITMAP_TYPE_ANY), wx.NullBitmap,
            wx.ITEM_NORMAL, u"Połacz wybrane publikacje", wx.EmptyString, None)
        addpub = self.m_toolBar2.AddLabelTool(
            7, u"tool", wx.Bitmap(u"icon/addp.png",
                                  wx.BITMAP_TYPE_ANY), wx.NullBitmap,
            wx.ITEM_NORMAL, u"Dodaj publikację", wx.EmptyString, None)
        delpub = self.m_toolBar2.AddLabelTool(
            5, u"tool", wx.Bitmap(u"icon/delete.png", wx.BITMAP_TYPE_ANY),
            wx.NullBitmap, wx.ITEM_NORMAL,
            u"Usuń wybrane publikacje z bazy danych", wx.EmptyString, None)
        delpublist = self.m_toolBar2.AddLabelTool(
            8, u"tool", wx.Bitmap(u"icon/dellist.png", wx.BITMAP_TYPE_ANY),
            wx.NullBitmap, wx.ITEM_NORMAL, u"Usuń wybrane publikacje z listy",
            wx.EmptyString, None)

        self.m_toolBar2.Realize()

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

        bSizer13 = wx.BoxSizer(wx.VERTICAL)

        bSizer3 = wx.BoxSizer(wx.HORIZONTAL)

        self.m_staticText1 = wx.StaticText(self, wx.ID_ANY,
                                           u"Edytuj połączoną publikację:",
                                           wx.DefaultPosition, wx.DefaultSize,
                                           0)
        self.m_staticText1.Wrap(-1)
        bSizer3.Add(self.m_staticText1, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL,
                    5)

        self.pubcit = cDatabase.getMergePub(self.session)
        self.m_comboBox1Choices = self.pubcit.values()
        self.m_comboBox1 = wx.ComboBox(self, wx.ID_ANY, wx.EmptyString,
                                       wx.DefaultPosition, wx.DefaultSize,
                                       self.m_comboBox1Choices, 0)
        bSizer3.Add(self.m_comboBox1, 1, wx.TOP | wx.BOTTOM | wx.LEFT, 5)

        bSizer13.Add(bSizer3, 0, wx.EXPAND | wx.TOP | wx.RIGHT | wx.LEFT, 5)

        self.dataList = TestListCtrl(self,
                                     wx.ID_ANY,
                                     wx.DefaultPosition,
                                     wx.DefaultSize,
                                     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=130)
        self.dataList.InsertColumn(3,
                                   u'Autor',
                                   format=wx.LIST_FORMAT_LEFT,
                                   width=100)
        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=100)
        self.dataList.InsertColumn(6,
                                   u'DOI',
                                   format=wx.LIST_FORMAT_LEFT,
                                   width=100)
        bSizer13.Add(self.dataList, 1, wx.ALL | wx.EXPAND, 5)

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

        self.SetSizer(bSizer1)
        self.Layout()

        self.Centre(wx.BOTH)

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

        self.Bind(wx.EVT_TOOL, self.openLinkCit, addall)
        self.Bind(wx.EVT_TOOL, self.openLinkPub, addone)
        self.Bind(wx.EVT_TOOL, self.clearData, clear)
        self.Bind(wx.EVT_TOOL, self.mergePub, merge)
        self.Bind(wx.EVT_TOOL, self.deletePub, delpub)
        self.Bind(wx.EVT_TOOL, self.backListPub, backlist)
        self.Bind(wx.EVT_TOOL, self.addPub, addpub)
        self.Bind(wx.EVT_TOOL, self.delPub, delpublist)
        self.Bind(wx.EVT_CLOSE, self.close)
        self.m_comboBox1.Bind(wx.EVT_COMBOBOX, self.editPubCit)
        self.dataList.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.RightClickCb)
        self.dataList.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.selectOne)

        ###################################################
        ## Metody
        ###################################################
        self.data = []
        self.id = 0
        self.menu_title_by_id = {
            1: 'Zaznacz',
            2: 'Odznacz',
            3: 'Zaznacz wszystko',
            4: 'Odznacz wszystko'
        }

        Publisher().subscribe(self.change_data, 'change_data')
        Publisher().subscribe(self.update_data, 'update_data')
Exemplo n.º 6
0
    def __init__( self ):
        wx.Dialog.__init__ ( self, None, id = wx.ID_ANY, title = u"Menadźer łączenia publikacji", pos = wx.DefaultPosition, size = wx.Size( 600,300 ), style = wx.DEFAULT_DIALOG_STYLE )
        
        self.handlerweb = webbrowser.get()
        self.session = cDatabase.connectDatabase()
        
        ico = wx.Icon('icon/citpub.ico', wx.BITMAP_TYPE_ICO)
        self.SetIcon(ico)
        
        self.SetSizeHintsSz( wx.DefaultSize, wx.DefaultSize )
        
        bSizer1 = wx.BoxSizer( wx.VERTICAL )
        
        self.m_toolBar2 = wx.ToolBar( self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.TB_HORIZONTAL|wx.TB_FLAT  ) 
        addall = self.m_toolBar2.AddLabelTool( 1, u"tool", wx.Bitmap( u"icon/globe.png", wx.BITMAP_TYPE_ANY ), wx.NullBitmap, wx.ITEM_NORMAL, u"Wyświetl wszystkie cytowania", wx.EmptyString, None ) 
        addone = self.m_toolBar2.AddLabelTool( 2, u"tool", wx.Bitmap( u"icon/browser.png", wx.BITMAP_TYPE_ANY ), wx.NullBitmap, wx.ITEM_NORMAL, u"Wyświetl wybrana publikację", wx.EmptyString, None ) 
        clear = self.m_toolBar2.AddLabelTool( 3, u"tool", wx.Bitmap( u"icon/clear.png", wx.BITMAP_TYPE_ANY ), wx.NullBitmap, wx.ITEM_NORMAL, u"Czyść listę", wx.EmptyString, None ) 
        backlist = self.m_toolBar2.AddLabelTool( 6, u"tool", wx.Bitmap( u"icon/back.png", wx.BITMAP_TYPE_ANY ), wx.NullBitmap, wx.ITEM_NORMAL, u"Przywróć wybrane publikacje", wx.EmptyString, None ) 
        self.m_toolBar2.AddSeparator()
        
        merge = self.m_toolBar2.AddLabelTool( 4, u"tool", wx.Bitmap( u"icon/merge.png", wx.BITMAP_TYPE_ANY ), wx.NullBitmap, wx.ITEM_NORMAL, u"Połacz wybrane publikacje", wx.EmptyString, None ) 
        addpub = self.m_toolBar2.AddLabelTool( 7, u"tool", wx.Bitmap( u"icon/addp.png", wx.BITMAP_TYPE_ANY ), wx.NullBitmap, wx.ITEM_NORMAL, u"Dodaj publikację", wx.EmptyString, None ) 
        delpub = self.m_toolBar2.AddLabelTool( 5, u"tool", wx.Bitmap( u"icon/delete.png", wx.BITMAP_TYPE_ANY ), wx.NullBitmap, wx.ITEM_NORMAL, u"Usuń wybrane publikacje z bazy danych", wx.EmptyString, None ) 
        delpublist = self.m_toolBar2.AddLabelTool( 8, u"tool", wx.Bitmap( u"icon/dellist.png", wx.BITMAP_TYPE_ANY ), wx.NullBitmap, wx.ITEM_NORMAL, u"Usuń wybrane publikacje z listy", wx.EmptyString, None ) 
        
        self.m_toolBar2.Realize() 
        
        bSizer1.Add( self.m_toolBar2, 0, wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL, 5 )
        
        bSizer13 = wx.BoxSizer( wx.VERTICAL )
        
        bSizer3 = wx.BoxSizer( wx.HORIZONTAL )
        
        self.m_staticText1 = wx.StaticText( self, wx.ID_ANY, u"Edytuj połączoną publikację:", wx.DefaultPosition, wx.DefaultSize, 0 )
        self.m_staticText1.Wrap( -1 )
        bSizer3.Add( self.m_staticText1, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 )
        
        self.pubcit = cDatabase.getMergePub(self.session)
        self.m_comboBox1Choices = self.pubcit.values()
        self.m_comboBox1 = wx.ComboBox( self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, wx.DefaultSize, self.m_comboBox1Choices, 0 )
        bSizer3.Add( self.m_comboBox1, 1, wx.TOP|wx.BOTTOM|wx.LEFT, 5 )
        
        
        bSizer13.Add( bSizer3, 0, wx.EXPAND|wx.TOP|wx.RIGHT|wx.LEFT, 5 )
        
        self.dataList = TestListCtrl(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 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=130)
        self.dataList.InsertColumn(3, u'Autor', format=wx.LIST_FORMAT_LEFT, width=100)
        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=100)
        self.dataList.InsertColumn(6, u'DOI', format=wx.LIST_FORMAT_LEFT, width=100)
        bSizer13.Add( self.dataList, 1, wx.ALL|wx.EXPAND, 5 )
        
        bSizer1.Add( bSizer13, 1, wx.EXPAND, 5 )
        
        self.SetSizer( bSizer1 )
        self.Layout()
        
        self.Centre( wx.BOTH )
    
##################################################
## Bind
###################################################
        
        self.Bind( wx.EVT_TOOL, self.openLinkCit, addall )
        self.Bind( wx.EVT_TOOL, self.openLinkPub, addone )
        self.Bind( wx.EVT_TOOL, self.clearData, clear )
        self.Bind( wx.EVT_TOOL, self.mergePub, merge )
        self.Bind( wx.EVT_TOOL, self.deletePub, delpub )
        self.Bind( wx.EVT_TOOL, self.backListPub, backlist )
        self.Bind( wx.EVT_TOOL, self.addPub, addpub )
        self.Bind( wx.EVT_TOOL, self.delPub, delpublist )
        self.Bind( wx.EVT_CLOSE, self.close )
        self.m_comboBox1.Bind(wx.EVT_COMBOBOX,  self.editPubCit)
        self.dataList.Bind(wx.EVT_LIST_ITEM_RIGHT_CLICK, self.RightClickCb)
        self.dataList.Bind(wx.EVT_LIST_ITEM_ACTIVATED, self.selectOne)

###################################################
## Metody
###################################################
        self.data = []
        self.id = 0
        self.menu_title_by_id = {1:'Zaznacz',2:'Odznacz',3:'Zaznacz wszystko',4:'Odznacz wszystko'}
        
        Publisher().subscribe(self.change_data, 'change_data')
        Publisher().subscribe(self.update_data, 'update_data')
Exemplo n.º 7
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()
Exemplo n.º 8
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)
Exemplo n.º 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()
Exemplo n.º 10
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)
Exemplo n.º 11
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)
Exemplo n.º 12
0
    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)