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