#!/usr/bin/env python
# -*- coding: utf-8 -*-
# generated by wxGlade 0.6.3 on Wed Jun 30 23:06:46 2010

import wx
from pieberry_validators import *
from pieberry_config import *
# begin wxGlade: extracode
# end wxGlade



class pieBibEditDialog(wx.Dialog):
    def __init__(self, *args, **kwds):
        # begin wxGlade: pieBibEditDialog.__init__
        kwds["style"] = wx.DEFAULT_DIALOG_STYLE
        wx.Dialog.__init__(self, *args, **kwds)
        self.panel_4 = wx.Panel(self, -1)
        self.panelx = wx.Panel(self, -1, style=wx.NO_BORDER|wx.TAB_TRAVERSAL)
        self.label_a = wx.StaticText(self.panelx, -1, "BibTeX key")
        self.keyCtrl = wx.TextCtrl(self.panelx, -1, "", validator=pieBibtexValidator())
        self.keyAutoCb = wx.CheckBox(self.panelx, -1, label="Auto-generate")
        self.label_3 = wx.StaticText(self.panelx, -1, "Author:", style=wx.EXPAND)
        self.authorIsCorporateCb = wx.CheckBox(self.panelx, -1, label="Author is corporate entity", style=wx.CHK_3STATE|wx.CHK_ALLOW_3RD_STATE_FOR_USER)
        self.authorCtrl = wx.TextCtrl(self.panelx, -1, "", style=wx.TE_PROCESS_ENTER, validator=pieBibtexValidator())
        self.authorSwapButton = wx.BitmapButton(self.panelx, -1, wx.ArtProvider.GetBitmap(wx.ART_GO_BACK, wx.ART_TOOLBAR, (16, 16)))
        self.authorAltCtrl = wx.TextCtrl(self.panelx, -1, "", style=wx.TE_READONLY)

        self.label_4 = wx.StaticText(self.panelx, -1, "Title:")
        self.titleCtrl = wx.TextCtrl(self.panelx, -1, "", style=wx.TE_PROCESS_ENTER|wx.EXPAND, validator=pieBibtexValidator())
        self.titleSwapButton = wx.BitmapButton(self.panelx, -1, wx.ArtProvider.GetBitmap(wx.ART_GO_BACK, wx.ART_TOOLBAR, (16, 16)))
        self.titleAltCtrl = wx.TextCtrl(self.panelx, -1, "", style=wx.TE_READONLY)


        self.label_5 = wx.StaticText(self.panelx, -1, "Date of publication:")
        self.datePicker = wx.DatePickerCtrl(self.panelx, -1)
        self.label_6 = wx.StaticText(self.panelx, -1, "How published:")
        self.howpublishedCtrl = wx.TextCtrl(self.panelx, -1, "", style=wx.TE_PROCESS_ENTER, validator=pieBibtexValidator())
        self.label_7 = wx.StaticText(self.panelx, -1, "Note:")
        self.noteCtrl = wx.TextCtrl(self.panelx, -1, "", style=wx.TE_MULTILINE, validator=pieBibtexValidator())
        self.label_8 = wx.StaticText(self.panelx, -1, "Annotation:")
        self.annoteCtrl = wx.TextCtrl(self.panelx, -1, "", style=wx.TE_MULTILINE, validator=pieBibtexValidator())
        self.btCancel = wx.Button(self.panel_4, wx.ID_CANCEL, "Cancel")
        self.btOk = wx.Button(self.panel_4, -1, "Ok")


        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_BUTTON, self.onCancel, self.btCancel)
        self.Bind(wx.EVT_BUTTON, self.onOk, self.btOk)
        # end wxGlade

    def __set_properties(self):
        # begin wxGlade: pieBibEditDialog.__set_properties
        self.SetTitle("Edit Bibliography Entry")
        self.SetSize((547, 558))
        self.panel_4.SetMinSize((55, 35))
        # end wxGlade

    def __do_layout(self):
        # begin wxGlade: pieBibEditDialog.__do_layout
        sizer_7 = wx.BoxSizer(wx.VERTICAL)
        sizer_8 = wx.BoxSizer(wx.HORIZONTAL)
        sizer_9 = wx.BoxSizer(wx.VERTICAL)
        sizer_A = wx.BoxSizer(wx.HORIZONTAL)
        sizer_B = wx.BoxSizer(wx.HORIZONTAL)
        sizer_C = wx.BoxSizer(wx.HORIZONTAL)
        sizer_D = wx.BoxSizer(wx.HORIZONTAL)
        sizer_A.Add(self.label_a, 0, wx.ALL, 3)
        sizer_A.Add(self.keyCtrl, 1, wx.ALL|wx.EXPAND, 3)
        sizer_A.Add(self.keyAutoCb, 1, wx.ALL, 3)
        sizer_9.Add(sizer_A, 0, wx.EXPAND)
        sizer_9.Add(wx.StaticLine(self.panelx, style=wx.LI_HORIZONTAL|wx.EXPAND))
        sizer_D.Add(self.label_3, 1, wx.ALL, 3)
        sizer_D.Add(self.authorIsCorporateCb, 0, wx.ALL, 3)
        sizer_9.Add(sizer_D, 0, wx.EXPAND)
        sizer_B.Add(self.authorCtrl, 1, wx.ALL|wx.EXPAND, 3)
        sizer_B.Add(self.authorSwapButton, 0, wx.ALL, 3)
        sizer_B.Add(self.authorAltCtrl, 1, wx.ALL|wx.EXPAND, 3)
        sizer_9.Add(sizer_B, 0, wx.EXPAND)
        sizer_9.Add(self.label_4, 0, wx.ALL, 3)
        sizer_C.Add(self.titleCtrl, 1, wx.ALL|wx.EXPAND, 3)
        sizer_C.Add(self.titleSwapButton, 0, wx.ALL, 3)
        sizer_C.Add(self.titleAltCtrl, 1, wx.ALL|wx.EXPAND, 3)
        sizer_9.Add(sizer_C, 0, wx.EXPAND)
        sizer_9.Add(self.label_5, 0, wx.ALL, 3)
        sizer_9.Add(self.datePicker, 0, wx.ALL, 3)
        sizer_9.Add(self.label_6, 0, wx.ALL, 3)
        sizer_9.Add(self.howpublishedCtrl, 0, wx.ALL|wx.EXPAND, 3)
        sizer_9.Add(self.label_7, 0, 0, 0)
        sizer_9.Add(self.noteCtrl, 1, wx.ALL|wx.EXPAND, 3)
        sizer_9.Add(self.label_8, 0, 0, 0)
        sizer_9.Add(self.annoteCtrl, 1, wx.ALL|wx.EXPAND, 3)
        self.panelx.SetSizer(sizer_9)
        sizer_7.Add(self.panelx, 6, wx.ALL|wx.EXPAND, 3)
        sizer_8.Add((20, 20), 3, wx.EXPAND, 0)
        sizer_8.Add(self.btCancel, 0, wx.ALL, 3)
        sizer_8.Add(self.btOk, 0, wx.ALL, 3)
        self.panel_4.SetSizer(sizer_8)
        sizer_7.Add(self.panel_4, 0, wx.EXPAND, 0)
        self.SetSizer(sizer_7)
        self.Layout()
        # end wxGlade

    def onCancel(self, event): # wxGlade: pieBibEditDialog.<event_handler>
        print "Event handler `onCancel' not implemented!"
        event.Skip()

    def onOk(self, event): # wxGlade: pieBibEditDialog.<event_handler>
        print "Event handler `onOk' not implemented!"
        event.Skip()

# end of class pieBibEditDialog


class pieConfigDialog(wx.Dialog):
    def __init__(self, *args, **kwds):
        # begin wxGlade: pieConfigDialog.__init__
        kwds["style"] = wx.DEFAULT_DIALOG_STYLE
        wx.Dialog.__init__(self, *args, **kwds)
        self.panel_2 = wx.Panel(self, -1)
        self.panel_1 = wx.Panel(self, -1)
        self.label_1 = wx.StaticText(self.panel_1, -1, "Root directory for library:")
        self.workDirCtrl = wx.TextCtrl(self.panel_1, -1, "", style=wx.TE_READONLY)
        self.workDirBt = wx.Button(self.panel_1, -1, "Select")
        self.label_2 = wx.StaticText(self.panel_1, -1, "Principal bibliography file:")
        self.mainBibCtrl = wx.TextCtrl(self.panel_1, -1, "", style=wx.TE_READONLY)
        self.mainBibBt = wx.Button(self.panel_1, -1, "Select")
        self.tsvBibCb = wx.CheckBox(self.panel_1, -1, label='Also export to tab-separated-values spreadsheet')
        self.defaultEntryTypeChoice = wx.Choice(self.panel_1, -1, choices=ENTRY_TYPE_CHOICES.values())
        self.okBt = wx.Button(self.panel_2, -1, "Ok")
        self.cancelBt = wx.Button(self.panel_2, wx.ID_CANCEL, "Cancel")

        self.__set_properties()
        self.__do_layout()

        self.Bind(wx.EVT_BUTTON, self.onSelectRoot, self.workDirBt)
        self.Bind(wx.EVT_BUTTON, self.onSelectBib, self.mainBibBt)
        self.Bind(wx.EVT_BUTTON, self.onOk, self.okBt)
        self.Bind(wx.EVT_BUTTON, self.onCancel, self.cancelBt)
        # end wxGlade

    def __set_properties(self):
        # begin wxGlade: pieConfigDialog.__set_properties
        self.SetTitle("PieBerry Settings")
        self.panel_2.SetMinSize((532, 34))
        # end wxGlade

    def __do_layout(self):
        # begin wxGlade: pieConfigDialog.__do_layout
        sizer_2 = wx.BoxSizer(wx.VERTICAL)
        sizer_3 = wx.BoxSizer(wx.HORIZONTAL)
        sizer_4 = wx.BoxSizer(wx.VERTICAL)
        sizer_6 = wx.BoxSizer(wx.HORIZONTAL)
        sizer_5 = wx.BoxSizer(wx.HORIZONTAL)
        sizer_4.Add(self.label_1, 0, wx.ALL, 5)
        sizer_5.Add(self.workDirCtrl, 2, wx.ALL, 5)
        sizer_5.Add(self.workDirBt, 0, wx.ALL, 5)
        sizer_4.Add(sizer_5, 1, wx.EXPAND, 0)
        sizer_4.Add(self.label_2, 0, wx.ALL, 5)
        sizer_6.Add(self.mainBibCtrl, 2, wx.ALL, 5)
        sizer_6.Add(self.mainBibBt, 0, wx.ALL, 5)
        sizer_4.Add(sizer_6, 1, wx.EXPAND, 0)
        sizer_4.Add(self.tsvBibCb, 0, wx.EXPAND|wx.ALL, 5)
        sizer_a = wx.BoxSizer(wx.HORIZONTAL)
        sizer_a.Add(wx.StaticText(self.panel_1, -1, 'Default BibTex style:'), 1, wx.EXPAND|wx.ALL, 5)
        sizer_a.Add(self.defaultEntryTypeChoice, 0, wx.ALL, 5)
        sizer_4.Add(sizer_a, 1, wx.EXPAND, 0)
        self.panel_1.SetSizer(sizer_4)
        sizer_2.Add(self.panel_1, 5, wx.EXPAND, 0)
        sizer_3.Add((20, 20), 3, 0, 0)
        sizer_3.Add(self.okBt, 0, wx.ALL, 3)
        sizer_3.Add(self.cancelBt, 0, wx.ALL, 3)
        sizer_3.Add((5, 5), 0, 0, 0)
        self.panel_2.SetSizer(sizer_3)
        sizer_2.Add(self.panel_2, 0, wx.EXPAND, 0)
        self.SetSizer(sizer_2)
        sizer_2.Fit(self)
        self.Layout()
        # end wxGlade

    def onSelectRoot(self, event): # wxGlade: pieConfigDialog.<event_handler>
        print "Event handler `onSelectRoot' not implemented"
        event.Skip()

    def onSelectBib(self, event): # wxGlade: pieConfigDialog.<event_handler>
        print "Event handler `onSelectBib' not implemented"
        event.Skip()

    def onOk(self, event): # wxGlade: pieConfigDialog.<event_handler>
        print "Event handler `onOk' not implemented"
        event.Skip()

    def onCancel(self, event): # wxGlade: pieConfigDialog.<event_handler>
        print "Event handler `onCancel' not implemented"
        event.Skip()

# end of class pieConfigDialog


if __name__ == "__main__":
    app = wx.PySimpleApp(0)
    wx.InitAllImageHandlers()
    dialog_1 = pieConfigDialog(None, -1, "")
    app.SetTopWindow(dialog_1)
    dialog_1.Show()
    app.MainLoop()
