ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/Active_prgs/PrivDescriptionAssistant/trunk/PrivDescriptionAssistant_UI.py
Revision: 344
Committed: Thu Apr 25 15:50:50 2013 UTC (12 years, 11 months ago) by nino.borges
Content type: text/x-python
File size: 5758 byte(s)
Log Message:
Moved PrivDescAssistant so that its its own program and not part of chai.

File Contents

# User Rev Content
1 ninoborges 8 """
2    
3     PrivDescriptionAssistantUI
4    
5     Created by
6     Emanuel Borges
7     05.02.2011
8    
9     This program will allow Concordance users to speed up the process of creating
10     priv description sentances.
11    
12     """
13    
14     import wx
15    
16     class MyFrame(wx.Frame):
17     def __init__(self, parent, ID, title, pos=wx.DefaultPosition):
18     wx.Frame.__init__(self, parent, ID, title, pos, size =(550,580),style=wx.DEFAULT_FRAME_STYLE|wx.STAY_ON_TOP)
19     self.panel = wx.Panel(self,-1)
20    
21     documentTypeList = ['','Email','Presentation','Memorandum','Spreadsheet']
22     basisList = ['','sent to legal counsel requesting legal advice',
23     'between attorney-retained consultants',
24     'from legal counsel',
25     'from attorney-retained consultants providing advice',
26     'to attorney-retained consultants',
27     'sent to legal counsel requesting legal review and comment',
28     'sent to legal counsel for the purpose of obtaining legal advice',
29     'forwarding and discussing email providing advice from legal counsel []',
30     'referencing legal advice from legal counsel [] ',
31     'designated "Attorney Client Privileged"',
32     ]
33     regardingList = ['','regarding []']
34     adendumList = ['',
35     'for purposes of facilitating the provision of legal advice by counsel',
36     'redacted',
37     'and attached to foregoing email',]
38    
39     docType_lbl = wx.StaticText(self.panel, -1, "Document Type : ")
40     self.docType_SelectBox = wx.Choice(self.panel, -1,(100, 50), choices = documentTypeList)
41     basis_lbl = wx.StaticText(self.panel, -1, "Basis : ")
42     self.basis_SelectBox = wx.Choice(self.panel, -1,(100, 50), choices = basisList)
43     regarding_lbl = wx.StaticText(self.panel, -1, "Regarding : ")
44     self.regarding_SelectBox = wx.Choice(self.panel, -1,(100, 50), choices = regardingList)
45     adendum_lbl = wx.StaticText(self.panel, -1, "adendum : ")
46     self.adendum_SelectBox = wx.Choice(self.panel, -1,(100, 50), choices = adendumList)
47    
48     self.privSentanceTextBox = wx.TextCtrl(self.panel,-1,style=wx.TE_MULTILINE, size=(450,100))
49    
50     self.CreateBoxesSection()
51    
52     mainSizer = wx.BoxSizer(wx.VERTICAL)
53     mainSizer.Add(docType_lbl , 0, wx.ALIGN_CENTER|wx.ALL, 5)
54     mainSizer.Add(self.docType_SelectBox, 0, wx.ALIGN_CENTER|wx.ALL, 5)
55     mainSizer.Add(basis_lbl, 0, wx.ALIGN_CENTER|wx.ALL, 5)
56     mainSizer.Add(self.basis_SelectBox, 0, wx.ALIGN_CENTER|wx.ALL, 5)
57     mainSizer.Add(regarding_lbl, 0, wx.ALIGN_CENTER|wx.ALL, 5)
58     mainSizer.Add(self.regarding_SelectBox, 0, wx.ALIGN_CENTER|wx.ALL, 5)
59     mainSizer.Add(adendum_lbl, 0, wx.ALIGN_CENTER|wx.ALL, 5)
60     mainSizer.Add(self.adendum_SelectBox , 0, wx.ALIGN_CENTER|wx.ALL, 5)
61     mainSizer.Add(self.privSentanceTextBox, 0, wx.ALIGN_CENTER|wx.ALL, 20)
62     mainSizer.Add(self.buttonSizer,0, wx.ALL|wx.ALIGN_BOTTOM|wx.ALIGN_CENTER, 10)
63     self.panel.SetSizer(mainSizer)
64    
65     self.Bind(wx.EVT_CHOICE, self.RescanSentance, self.docType_SelectBox)
66     self.Bind(wx.EVT_CHOICE, self.RescanSentance, self.basis_SelectBox)
67     self.Bind(wx.EVT_CHOICE, self.RescanSentance, self.regarding_SelectBox)
68     self.Bind(wx.EVT_CHOICE, self.RescanSentance, self.adendum_SelectBox)
69     self.Bind(wx.EVT_BUTTON, self.OnProcess, self.oKButton)
70     self.Bind(wx.EVT_BUTTON, self.CloseWindow, self.cancelButton)
71    
72     def RescanSentance(self,event):
73     self.privSentanceTextBox.Clear()
74     if self.docType_SelectBox.GetStringSelection():
75     self.privSentanceTextBox.AppendText(self.docType_SelectBox.GetStringSelection() + " ")
76     if self.basis_SelectBox.GetStringSelection():
77     self.privSentanceTextBox.AppendText(self.basis_SelectBox.GetStringSelection() + " ")
78     if self.regarding_SelectBox.GetStringSelection():
79     self.privSentanceTextBox.AppendText(self.regarding_SelectBox.GetStringSelection() + " ")
80     if self.adendum_SelectBox.GetStringSelection():
81     self.privSentanceTextBox.AppendText(self.adendum_SelectBox.GetStringSelection() + ".")
82    
83     def CreateBoxesSection(self):
84     self.oKButton = wx.Button(self.panel, wx.ID_OK)
85     self.oKButton.SetDefault()
86     self.oKButton.SetSize(self.oKButton.GetBestSize())
87     self.cancelButton = wx.Button(self.panel, wx.ID_CANCEL)
88     self.cancelButton.SetSize(self.cancelButton.GetBestSize())
89     self.buttonSizer = wx.BoxSizer(wx.HORIZONTAL)
90     self.buttonSizer.Add(self.oKButton,0,wx.ALL,10)
91     self.buttonSizer.Add(self.cancelButton,0,wx.ALL,10)
92    
93     def CloseWindow(self, event):
94     self.Close(True)
95    
96     def OnProcess(self, event):
97     print self.privSentanceTextBox.GetValue()
98     cb_DataObj = wx.TextDataObject(self.privSentanceTextBox.GetValue())
99     if wx.TheClipboard.Open():
100     wx.TheClipboard.SetData(cb_DataObj)
101     wx.TheClipboard.Close()
102     self.privSentanceTextBox.Clear()
103     self.docType_SelectBox.SetSelection(0)
104     self.basis_SelectBox.SetSelection(0)
105     self.regarding_SelectBox.SetSelection(0)
106     self.adendum_SelectBox.SetSelection(0)
107    
108     class MyApp(wx.App):
109     def OnInit(self):
110     self.frame = MyFrame(None, -1, "Priv Description Assistant BETA v.01")
111     self.frame.Show(True)
112     self.SetTopWindow(self.frame)
113     return True
114    
115    
116     if __name__ == '__main__':
117     app = MyApp(0)
118     app.MainLoop()