ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/Active_prgs/MCP/AddDocumentProductionDialog.py
Revision: 8
Committed: Sat May 5 04:21:19 2012 UTC (13 years, 10 months ago) by ninoborges
Content type: text/x-python
File size: 3668 byte(s)
Log Message:
Initial Import

File Contents

# User Rev Content
1 ninoborges 8 """
2    
3     AddDocumentProductionDialog
4    
5     Created by
6     Emanuel Borges
7     08.03.2011
8    
9     This is the main dialog for adding document productions to the database.
10    
11     """
12    
13     import wx, NinoGenTools
14    
15     class AddDocumentProductionDialog(wx.Dialog):
16    
17     def __init__(self, parent,CLM):
18     self.CLM = CLM
19    
20     self.parent = parent
21     wx.Dialog.__init__(self, parent, -1, "Add Document Production for %s"% self.CLM, style = wx.DEFAULT_DIALOG_STYLE, size = (440,380))
22     proDate_Lbl = wx.StaticText(self, -1, "Production Date: ")
23     self.prodDate_PickerBox = wx.DatePickerCtrl(self, size=(120,-1),style = wx.DP_DROPDOWN|wx.DP_SHOWCENTURY)
24     begBates_Lbl = wx.StaticText(self, -1, "Begining Bates: ")
25     self.begBates_TextBox = wx.TextCtrl(self, size=(90,-1))
26     endBates_Lbl = wx.StaticText(self, -1, "Ending Bates: ")
27     self.endBates_TextBox = wx.TextCtrl(self, size=(90,-1))
28     prodDocCount_Lbl = wx.StaticText(self, -1, "Production Document Count: ")
29     self.prodDocCount_TextBox = wx.TextCtrl(self, size=(90,-1))
30     prodPageCount_Lbl = wx.StaticText(self, -1, "Production Page Count: ")
31     self.prodPageCount_TextBox = wx.TextCtrl(self, size=(90,-1))
32    
33     self.CreateNotesSection()
34    
35     mainSizer = wx.BoxSizer(wx.VERTICAL)
36     batesSizer = wx.BoxSizer(wx.HORIZONTAL)
37     batesSizer.Add(begBates_Lbl,0,wx.ALL,5)
38     batesSizer.Add(self.begBates_TextBox,0,wx.ALL,5)
39     batesSizer.Add(endBates_Lbl,0,wx.ALL,5)
40     batesSizer.Add(self.endBates_TextBox,0,wx.ALL,5)
41     mainSizer.Add(batesSizer,0,wx.ALL,10)
42     prodGridSizer = wx.FlexGridSizer(3, 2, 5,5)
43     prodGridSizer.Add(proDate_Lbl, 0, wx.ALIGN_RIGHT)
44     prodGridSizer.Add(self.prodDate_PickerBox, 0, wx.EXPAND)
45     prodGridSizer.Add(prodDocCount_Lbl, 0, wx.ALIGN_RIGHT)
46     prodGridSizer.Add(self.prodDocCount_TextBox , 0, wx.EXPAND)
47     prodGridSizer.Add(prodPageCount_Lbl, 0, wx.ALIGN_RIGHT)
48     prodGridSizer.Add(self.prodPageCount_TextBox, 0, wx.EXPAND)
49     mainSizer.Add(prodGridSizer,0,wx.ALL,20)
50     mainSizer.Add(self.productionNotesStaticBoxSixer,0,wx.ALL,25)
51     oKButton = wx.Button(self, wx.ID_OK)
52     oKButton.SetDefault()
53     cancelButton = wx.Button(self, wx.ID_CANCEL)
54     buttonSizer = wx.BoxSizer(wx.HORIZONTAL)
55     buttonSizer.Add(oKButton,0,wx.ALL,5)
56     buttonSizer.Add(cancelButton,0,wx.ALL,5)
57     mainSizer.Add(buttonSizer,0,wx.ALIGN_CENTER_HORIZONTAL)
58     self.SetSizer(mainSizer)
59    
60     def CreateNotesSection(self):
61     self.productionNotesTextBox = wx.TextCtrl(self, -1, "", size=(350,50), style=wx.TE_MULTILINE)
62     productionNotesStaticBox = wx.StaticBox(self, -1, "Production Notes")
63     self.productionNotesStaticBoxSixer = wx.StaticBoxSizer(productionNotesStaticBox, wx.VERTICAL)
64     self.productionNotesStaticBoxSixer.Add(self.productionNotesTextBox, 0, wx.ALL, 5)
65    
66     def GetValues(self):
67     prodDate = self.prodDate_PickerBox.GetValue()
68     year = prodDate.Year
69     month = prodDate.Month + 1
70     day = prodDate.Day
71     prodDate = "%02d/%02d/%4d" % (month, day, year)
72     #prodDate = prodDate.FormatISODate()
73     begBates = self.begBates_TextBox.GetValue()
74     endBates = self.endBates_TextBox.GetValue()
75     prodDocCount = self.prodDocCount_TextBox.GetValue()
76     prodPageCount = self.prodPageCount_TextBox.GetValue()
77     prodNotes = self.productionNotesTextBox.GetValue()
78     return prodDate, begBates, endBates, prodDocCount, prodPageCount, prodNotes
79