ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/ns_dev/Python/NinoCode/Active_prgs/MCP/Trunk/AddEditCaseNameDialog.py
Revision: 496
Committed: Fri Dec 20 15:52:59 2013 UTC (12 years, 3 months ago) by nino.borges
Content type: text/x-python
File size: 2283 byte(s)
Log Message:
Moved the main mcp code to the trunk, for easier versioning.

File Contents

# User Rev Content
1 nino.borges 343 """
2    
3     AddEditCaseNameDialog
4    
5     Created by
6     Emanuel Borges
7     04.08.2013
8    
9     This dialog will allow you to edit or to add case name and client matter info.
10    
11     """
12    
13     import wx, NinoGenTools
14    
15     class AddEditCaseNameDialog(wx.Dialog):
16    
17     def __init__(self, parent,CLM=False,caseName=False):
18     self.CLM = CLM
19     self.caseName = caseName
20     self.parent = parent
21     wx.Dialog.__init__(self, parent, -1, "Add/Edit Case Name", style = wx.DEFAULT_DIALOG_STYLE, size = (330,180))
22     caseNameLabel = wx.StaticText(self, -1, "Case Name: ")
23     self.caseNameTextBox = wx.TextCtrl(self, -1, caseName.split("_(")[0], wx.DefaultPosition, (90,-1))
24     clientMatterLabel = wx.StaticText(self, -1, "Client Matter: ")
25     clientHyphenLabel = wx.StaticText(self, -1, " - ")
26     self.clientNumberTextBox = wx.TextCtrl(self, -1, CLM.split(".")[0], wx.DefaultPosition, (52,-1))
27     self.matterNumberTextBox = wx.TextCtrl(self, -1, CLM.split(".")[1], wx.DefaultPosition, (40,-1))
28    
29     requiredSectionSizer = wx.GridBagSizer(10,2)
30     requiredSectionSizer.Add(caseNameLabel,pos = (0,0))
31     requiredSectionSizer.Add(self.caseNameTextBox,pos = (0,1),span=(1,4), flag = wx.EXPAND)
32     requiredSectionSizer.Add(clientMatterLabel,pos = (1,0))
33     requiredSectionSizer.Add(self.clientNumberTextBox,pos = (1,1))
34     requiredSectionSizer.Add(clientHyphenLabel, pos=(1,2))
35     requiredSectionSizer.Add(self.matterNumberTextBox,pos = (1,3))
36     mainSizer = wx.BoxSizer(wx.VERTICAL)
37     mainSizer.Add(requiredSectionSizer,0, wx.ALL, 20)
38    
39     oKButton = wx.Button(self, wx.ID_OK)
40     oKButton.SetDefault()
41     cancelButton = wx.Button(self, wx.ID_CANCEL)
42     buttonSizer = wx.BoxSizer(wx.HORIZONTAL)
43     buttonSizer.Add(oKButton,0,wx.ALL,5)
44     buttonSizer.Add(cancelButton,0,wx.ALL,5)
45     mainSizer.Add(buttonSizer,0, wx.ALL|wx.ALIGN_BOTTOM|wx.ALIGN_CENTER, 10)
46    
47     self.SetSizer(mainSizer)
48    
49     def GetValues(self):
50     caseName = self.caseNameTextBox.GetValue()
51     clientNumb = self.clientNumberTextBox.GetValue()
52     matterNumb = self.matterNumberTextBox.GetValue()
53     return caseName, clientNumb,matterNumb