Package Gnumed :: Package wxpython :: Package patient :: Module gmGP_Referrals
[frames] | no frames]

Source Code for Module Gnumed.wxpython.patient.gmGP_Referrals

  1  # -*- coding: utf-8 -*- 
  2  ############################################################################# 
  3  # This panel is the gui frontend to allow choice of person to 
  4  # refer to by name, company or category 
  5  # 
  6  # @copyright: author 
  7  # @license: GPL v2 or later (details at http://www.gnu.org) 
  8  ############################################################################ 
  9  __author__ = "R.Terry, I.Haywood" 
 10   
 11   
 12  import wx 
 13   
 14  from Gnumed.wxpython import gmGuiElement_HeadingCaptionPanel, gmGuiElement_DividerCaptionPanel, gmGuiElement_AlertCaptionPanel, gmEditArea, gmPlugin_Patient 
 15  from Gnumed.wxpython.gmPatientHolder import PatientHolder 
 16   
 17  ID_REFERRALDATE = wxNewId() 
 18   
 19  #============================================================== 
20 -class ReferralsPanel (wxPanel, PatientHolder):
21 - def __init__(self,parent, id):
22 PatientHolder.__init__(self) 23 24 wxPanel.__init__(self, parent, id,wxDefaultPosition,wxDefaultSize,wxRAISED_BORDER) 25 self.SetBackgroundColour(wxColor(222,222,222)) 26 # top heading 27 self.referralspanelheading = gmGuiElement_HeadingCaptionPanel.HeadingCaptionPanel(self,-1,_(" REFERRALS ")) 28 #---------------------------------- 29 # put date at top - allow backdating 30 # FIXME remove the fixed date below 31 # FIXME use gmDateTimeInput 32 # FIXME shouldn't this be part of the editarea proper ? 33 #---------------------------------- 34 szr_top = wxBoxSizer(wxHORIZONTAL) 35 self.txt_referraldate = wxTextCtrl(self,ID_REFERRALDATE,"12/06/2002",wxDefaultPosition,wxDefaultSize) 36 spacer_top = wxWindow(self, -1, wxDefaultPosition, wxDefaultSize, 0) 37 spacer_top.SetBackgroundColour(wxColor(222,222,222)) 38 szr_top.Add(spacer_top, 6, wxEXPAND) 39 szr_top.Add(self.txt_referraldate, 1, wxEXPAND|wxALL, 2) 40 szr_top.Add(10, 0, 0) 41 # create referrals specific editarea 42 self.editarea = gmEditArea.gmReferralEditArea(self, -1) 43 # add elements to the main background sizer 44 self.szr_main = wxBoxSizer(wxVERTICAL) 45 self.szr_main.Add(self.referralspanelheading, 0, wxEXPAND) 46 self.szr_main.Add(0, 5, 0) 47 self.szr_main.Add(szr_top, 0, wxEXPAND) 48 self.szr_main.Add(self.editarea, 10, wxEXPAND) 49 self.SetSizer(self.szr_main) 50 self.SetAutoLayout(True) 51 self.Show(True)
52 53 #==============================================================
54 -class gmGP_Referrals (gmPlugin_Patient.wxPatientPlugin):
55 """ 56 Plugin to encapsulate the referrals window 57 """ 58 __icons = { 59 """icon_outgoing_letter""": "x\xda]\xcd;\x0e\x830\x10\x04\xd0\x9eSXJ\xe1T+\\$r\x9dH.\xe3\x82f[\x84R\x05e\ 60 r\xff*\xbb\xb6\xf1\x87\x11B\xccc\x0c\xd7\xfd\xe7\xa6\xc5\xba\xbb\x91\xebf\ 61 \x9c\x9d\xd6\xc5\xc2l\xe6\xb1\xaf\xdb'5\x92v\xf1\xb3&u#\xfd\x85\xef;\x15\xd6\ 62 \x97\xc1\x87g\xf0\xa9G\xed\xf3\\\xbb\xc9!.\x0f\x1d\x12\x1d\xda\x90\xa8jE\xa2\ 63 \xa6m\t!\x9c\x96`\xddaX\x82\x13f-(\x96Q\x94\x0b\x02\xb1`\x04*\xb2*\xabq\x87\ 64 \x8c\x1c\x1e1-G\xcc6\x1eG\x8c\xf2Q\xb9\xf5?\xeas \x0fQ\xa4?:Rj{", 65 66 """icon_writing_pen""": 'x\xda\x8d\x901\x0b\xc3 \x10\x85\xf7\xfc\x8a\x83\x0e\x16\x02\x8ff\xa97+d\x8c\ 67 C\x96[C\xe8\xd4P\xfb\xff\xa7\x1a\xb5P/\x85\xf6!\xc2\xf7\xdd\xbbA\xcf\xdbs\ 68 \xe8f3\\)\x9dt\x99n\x99\rh%\xb7-\xeb=\x93$:Y\xb6\xder\xe6X\xf8\x92\x929\xec<\ 69 \xf2\xe8+S\xe2)>n\x19\xfa}\xe8\xd8y\xc7u\xd8\xe6?\t\xe0 \x051BK\x04@\x94\x14\ 70 \x049\xac#\xf4\x10%KQ\xc9Rle-\xb6\xb2\x16\xb5\xccE%\x01\xfa"?\xde\x8ew~\xfc\ 71 \x12^\x04\x14P\xa7' 72 } 73
74 - def name (self):
75 return 'Referrals'
76
77 - def MenuInfo (self):
78 return ('view', '&Referrals') #FIXME fix the ampersand to a logical place in relationship to other buttons
79
80 - def GetIconData(self, anIconID = None):
81 if anIconID == None: 82 return self.__icons[_("""icon_writing_pen""")] 83 else: 84 if anIconID in self.__icons: 85 return self.__icons[anIconID] 86 else: 87 return self.__icons[_("""icon_writing_pen""")]
88
89 - def GetWidget (self, parent):
90 return ReferralsPanel(parent, -1)
91 92 #============================================================== 93 if __name__ == "__main__": 94 app = wxPyWidgetTester(size = (600, 600)) 95 app.SetWidget(ReferralsPanel, -1) 96 app.MainLoop() 97 98 #============================================================== 99