示例#1
0
    def __init__(self, parent, ID):
        wx.Panel.__init__(self, parent, ID)
        Registry.add("SEARCH", self)

        # search
        searchBox = self.makeSearchBox()       
        # normal result 
        normalResultBox = self.makeNormalResultBox()
                
        # patient actions
        newBtn = wx.Button(self, wx.ID_NEW)
        self.Bind(wx.EVT_BUTTON, self.newEntry, newBtn)
        delBtn = wx.Button(self, wx.ID_DELETE)
        self.Bind(wx.EVT_BUTTON, self.deleteEntry, delBtn)
        btnBox = wx.BoxSizer(wx.HORIZONTAL)
        btnBox.Add(newBtn, 0, wx.ALIGN_CENTER|wx.ALL, 1)
        btnBox.Add(delBtn, 0, wx.ALIGN_CENTER|wx.ALL, 1)

        # panel sizer
        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(searchBox, 0, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)        
        sizer.Add(normalResultBox, 1, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        sizer.Add(btnBox, 0, wx.ALIGN_CENTER|wx.ALL, 3)
       
        self.SetSizer(sizer)
        self.SetAutoLayout(True)
        sizer.Fit(self)
        sizer.SetSizeHints(self)


        # reload last query
        self.__reloadLastQuery()
class CalendarManager:
    def __init__(self):
        self.booker = Booker('PUT YOUR CALENDAR HERE')
        #  this is the calendar_id for Room 6164
        self.registry = Registry()

    def checkInput(self, input_char):
        if self.registry.check(input_char):
            print('Acessing calendar...')
            self.booker.addEvent(self.registry.getUser(
                input_char))  # this should return the correct name
        else:
            self.registry.add(input_char)

    def main(self):
        while True:
            print('\nPress a number key (or backspace to quit)')
            input_char = msvcrt.getch().decode('ASCII')
            if input_char == '\b':  #backspace or esc
                print('Quitting...')
                break
            elif input_char == 'e':  # enter edit mode
                self.registry.edit()
            else:
                self.clear()
                self.checkInput(input_char)
            time.sleep(0.5)

    def clear(self):
        _ = system('cls')
示例#3
0
    def __init__(self, parent, ID, name="",
                 style=wx.TR_HAS_BUTTONS,
                 size=wx.DefaultSize,
                 registrykey=None):

        wx.TreeCtrl.__init__(self, parent, ID, name="", style=style, size=size)
        
        if registrykey: Registry.add(registrykey, self)
示例#4
0
    def __init__(self, parent, ID):
        wx.Panel.__init__(self, parent, ID)

        Registry.add("CLOCK", self)

        self.aclock = ac.AnalogClockWindow(self, -1, style=wx.SUNKEN_BORDER)
        self.aclock.SetTickSizes(h=5, m=2)
        
        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(self.aclock, 1, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)

        self.SetSizer(sizer)
示例#5
0
    def __init__(self, parent, ID):
        wx.Panel.__init__(self, parent, ID)

        Registry.add("CONTACT", self)
        Result.addListener(self)
        
        self.grid = ContactGrid(self, -1)
        gridBox = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Contact List"), wx.HORIZONTAL)
        gridBox.Add(self.grid, 1, wx.GROW|wx.ALIGN_CENTER|wx.ALL, 3)

        self.physicalAddress = Address(self, "HOME_PHYSICAL", Colors.HOME)
        self.postalAddress = Address(self, "HOME_POSTAL", Colors.HOME)
        self.workPhysicalAddress = Address(self, "WORK_PHYSICAL", Colors.WORK)
        self.workPostalAdress = Address(self, "WORK_POSTAL", Colors.WORK)
        
        # register the widgets for later access
        self.addWidgets = {"HOME_PHYSICAL": self.physicalAddress,
                           "HOME_POSTAL": self.postalAddress,
                           "WORK_PHYSICAL": self.workPhysicalAddress,
                           "WORK_POSTAL": self.workPostalAdress}
                                    
        agrid = wx.GridSizer(1, 2, 3, 3)
        agrid.AddMany([(self.physicalAddress, 1, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3),    
                       (self.workPhysicalAddress, 1, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3),
                       (self.postalAddress, 1, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3),
                       (self.workPostalAdress, 1, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)])

        #agrid.AddGrowableRow(0, 1)   
        #agrid.AddGrowableRow(1, 1) 
        #agrid.SetFlexibleDirection(wx.HORIZONTAL|wx.VERTICAL)

        # save
        saveBtn = wx.Button(self, wx.ID_SAVE)
        self.Bind(wx.EVT_BUTTON, self.__saveData, saveBtn)
        # new
        newBtn = wx.Button(self, wx.ID_NEW)
        self.Bind(wx.EVT_BUTTON, self.new, newBtn)
        
        btnBox = wx.BoxSizer(wx.HORIZONTAL)
        btnBox.Add(newBtn, 0, wx.ALIGN_CENTER|wx.ALL, 3)
        btnBox.Add(saveBtn, 0, wx.ALIGN_CENTER|wx.ALL, 3)
        
        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(gridBox, 1, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        sizer.Add(agrid, 1, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        sizer.Add(btnBox, 0, wx.ALIGN_CENTER|wx.ALL, 3)

        self.SetSizer(sizer)
示例#6
0
    def __init__(self, parent, ID, title):
        wx.Frame.__init__(self,
                          parent,
                          ID,
                          title,
                          wx.DefaultPosition,                          
                          #size=(500, 600),
                          style=wx.DEFAULT_FRAME_STYLE)

        Registry.add("APPFRAME", self)
        self.parent = parent
        self.splitter = wx.SplitterWindow(self, -1, 
                                          style=wx.CLIP_CHILDREN| 
                                          wx.SP_LIVE_UPDATE|
                                          wx.SP_3D)
        

        self.searchpanel = SearchPanel(self.splitter, -1)                                      
        self.dataNB = DataNoteBook(self.splitter, -1)

        self.splitter.SplitVertically(self.searchpanel, self.dataNB)                
        self.splitter.SetSashPosition(260, True)
        self.splitter.SetMinimumPaneSize(20)

        # application peripherals
        self.makeStatusBar()
        self.makeMenuBar()
        
        sizer = wx.BoxSizer(wx.HORIZONTAL)
        sizer.Add(self.searchpanel, 0, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        sizer.Add(self.dataNB, 1, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        
        self.SetSizer(sizer)
        self.SetAutoLayout(True)
        self.Fit()        

        # self.SetSize(self.GetClientSize())
        # self.SetSize((1000, 800))
        self.Maximize(True)
        
        # event handler
        self.Bind(wx.EVT_CLOSE, CLEANUP.Quit)
        wx.EVT_SIZE(self, self.OnSize)

        self.Centre(wx.BOTH)

        self.SetIcon(self.__getIcon())
示例#7
0
    def __init__(self, parent, ID):
        wx.Panel.__init__(self, parent, ID)

        Registry.add("VISITS", self)
        Result.addListener(self)
        
        self.visits = {}
        self.file_number = None
        self.selected = None
        
        # visit list
        self.visitListCtrl = wx.ListBox(self, -1, size=(100, -1))
        self.Bind(wx.EVT_LISTBOX, self.dateSelected, self.visitListCtrl)
        visitBox = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Visit List"), wx.HORIZONTAL)
        visitBox.Add(self.visitListCtrl, 0, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        
        # note
        self.note = wx.TextCtrl(self, -1, "", style=wx.TE_MULTILINE)
        # self.Bind(wx.EVT_CHAR, self.OnKeyDown, self.note)
        wx.EVT_CHAR(self.note, self.OnKeyDown)
        self.noteLabel = wx.StaticBox(self, -1, "Visit Note")
        noteBox = wx.StaticBoxSizer(self.noteLabel, wx.HORIZONTAL)
        noteBox.Add(self.note, 1, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        
        topBox = wx.BoxSizer(wx.HORIZONTAL)
        topBox.Add(visitBox, 0, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        topBox.Add(noteBox, 1, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        
        # save
        saveBtn = wx.Button(self, wx.ID_SAVE)
        self.Bind(wx.EVT_BUTTON, self.__saveData, saveBtn)
        
        newBtn = wx.Button(self, wx.ID_NEW)
        self.Bind(wx.EVT_BUTTON, self.__new, newBtn)
        
        btnBox = wx.BoxSizer(wx.HORIZONTAL)
        btnBox.Add(newBtn, 0, wx.ALIGN_CENTER|wx.ALL, 3)
        btnBox.Add(saveBtn, 0, wx.ALIGN_CENTER|wx.ALL, 3)
        
        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(topBox, 1, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        sizer.Add(btnBox, 0, wx.ALIGN_CENTER|wx.ALL, 3)

        self.SetSizer(sizer)
示例#8
0
    def __init__(self, parent, ID):
        wx.StatusBar.__init__(self, parent, ID, style=wx.GA_SMOOTH)

        TimeRegistry.add('STATUSBAR', self)
        Registry.add("STATUSBAR", self)

        self.barrange = 0
        self.barvalue = 0
        
        # hart
        hartbmp = ART['24x24hart']
        self.hartPic = wx.StaticBitmap(self,
                                       -1,
                                       hartbmp,
                                       size=(hartbmp.GetWidth(), hartbmp.GetHeight()))
        self.hartPic.Show(False)

        # the gauge
        self.gauge = wx.Gauge(self, -1, 0)
        self.gauge.SetBezelFace(3)
        self.gauge.SetShadowWidth(3)
        
        fieldlengths = [400, -1, 20, 20, 160, hartbmp.GetWidth() + 6]        
        self.SetFieldsCount(len(fieldlengths))
        self.SetStatusWidths(fieldlengths)

        self.write('Witkoppen Registry GUI Initialized ...')

        # network access flashers
        self.LOGLED = LEDWindow(self, service="LOG")
        self.WATCHLED = LEDWindow(self, service="WATCH")
        
        self.position() # position the various wigets on the bar
        
        EVT_GLOBAL_TIME(self, self.clockDisplay)
        EVT_STATUSBAR(self, self.OnBarMessage)        
        wx.EVT_SIZE(self, self.OnSize)
示例#9
0
    def __init__(self, parent, ID):
        wx.Panel.__init__(self, parent, ID)

        Registry.add("BIO", self)
        Result.addListener(self)

        modefont = wx.Font(16, wx.NORMAL , wx.BOLD, wx.NORMAL, False)
        self.modeLabel = wx.StaticText(self, -1, editstr, size=(600, -1))
        self.modeLabel.SetFont(modefont)

        # folder number
        bigfont = wx.Font(22, wx.MODERN , wx.BOLD, wx.NORMAL, False)
        self.folderNumber = wx.TextCtrl(self, -1, "", size=(130, -1))
        self.folderNumber.SetBackgroundColour(Colors.LIGHTBLUE)
        self.folderNumber.SetFont(bigfont)
        folderBox = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Folder Number"), wx.HORIZONTAL)
        folderBox.Add(self.folderNumber, 0, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        
        # name
        self.name = wx.TextCtrl(self, -1, "", size=(350, -1))
        self.name.SetFont(bigfont)
        self.name.SetBackgroundColour(Colors.PURPLE)
        nameBox = wx.StaticBoxSizer(wx.StaticBox(self, -1, "First Names"), wx.HORIZONTAL)
        nameBox.Add(self.name, 0, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)

        # surname
        self.surname = wx.TextCtrl(self, -1, "", size=(250, -1))
        self.surname.SetFont(bigfont)
        self.surname.SetBackgroundColour(Colors.PURPLE)
        surnameBox = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Surname"), wx.HORIZONTAL)
        surnameBox.Add(self.surname, 0, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)        

        # callname
        self.callname = wx.TextCtrl(self, -1, "", size=(120, -1))
        callnameBox = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Name"), wx.HORIZONTAL)
        callnameBox.Add(self.callname, 0, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)

        # add the names to the top ass well, they are written in large font
        topBox = wx.BoxSizer(wx.HORIZONTAL)
        topBox.Add(folderBox, 0, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        topBox.Add(nameBox, 0, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        topBox.Add(surnameBox, 0, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)

        # names
        # mainnameBox = wx.BoxSizer(wx.HORIZONTAL)
        # mainnameBox.Add(callnameBox, 0, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        # mainnameBox.Add(nameBox, 0, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)        
        # mainnameBox.Add(surnameBox, 0, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
                
        # birthdate
        #self.birthdate = wx.DatePickerCtrl(self, size=(120,-1),
        #                                   style=wx.DP_DROPDOWN | wx.DP_SHOWCENTURY)
        self.birthdate = wx.TextCtrl(self, -1, "", size=(120, -1))
        birthdayBox = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Birth Date"), wx.HORIZONTAL)
        birthdayBox.Add(self.birthdate, 1, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
                
        # gender
        self.gender = wx.Choice(self, -1, choices=["Male", "Female", "Undefined"], size=(120, -1))
        genderBox = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Gender"), wx.HORIZONTAL)
        genderBox.Add(self.gender, 0, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        
        # marital status
        self.marital_status = wx.Choice(self, -1, choices=["Single", "Married", "Divorced", "Widowed"], size=(120, -1))
        maritalBox = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Marital Status"), wx.HORIZONTAL)
        maritalBox.Add(self.marital_status, 0, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        
        bgBox = wx.BoxSizer(wx.HORIZONTAL)
        bgBox.Add(birthdayBox, 0, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        bgBox.Add(genderBox, 0, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        bgBox.Add(maritalBox, 0, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        
        
        # ID
        self.ID = wx.TextCtrl(self, -1, "", size=(200, -1))
        IDBox = wx.StaticBoxSizer(wx.StaticBox(self, -1, "National ID"), wx.HORIZONTAL)
        IDBox.Add(self.ID, 1, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)        
        # nationality                              
        self.nationality = wx.TextCtrl(self, -1, "")
        nationalBox = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Nationality"), wx.HORIZONTAL)
        nationalBox.Add(self.nationality, 1, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        # language                              
        self.language = wx.TextCtrl(self, -1, "", size=(200, -1))
        languageBox = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Language"), wx.HORIZONTAL)
        languageBox.Add(self.language, 1, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        # race
        self.race = wx.TextCtrl(self, -1, "", size=(200, -1))
        raceBox = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Ethnicity"), wx.HORIZONTAL)
        raceBox.Add(self.race, 1, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        # id
        allidBox = wx.BoxSizer(wx.HORIZONTAL)
        allidBox.Add(IDBox, 0, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        allidBox.Add(nationalBox, 0, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        allidBox.Add(languageBox, 0, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        allidBox.Add(raceBox, 0, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        
        
        # occupation
        self.occupation = wx.TextCtrl(self, -1, "", size=(300, -1))
        occupationBox = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Occupation"), wx.HORIZONTAL)
        occupationBox.Add(self.occupation, 1, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        
        # employer
        self.employer = wx.TextCtrl(self, -1, "", size=(300, -1))
        employerBox = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Employer"), wx.HORIZONTAL)
        employerBox.Add(self.employer, 1, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        
        workBox = wx.BoxSizer(wx.HORIZONTAL)
        workBox.Add(occupationBox, 1, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        workBox.Add(employerBox, 1, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        
        # dependants
        self.dependants = wx.TextCtrl(self, -1, "", style=wx.TE_MULTILINE)
        self.dependants.SetBackgroundColour(Colors.INFOCOL)        
        dependantBox = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Dependants, Only spouse and Children under 18"), wx.HORIZONTAL)
        dependantBox.Add(self.dependants, 1, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        
        # note
        self.note = wx.TextCtrl(self, -1, "", style=wx.TE_MULTILINE)
        self.note.SetBackgroundColour(Colors.INFOCOL)        
        noteBox = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Additional Notes"), wx.HORIZONTAL)
        noteBox.Add(self.note, 1, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)

        depnoteBox = wx.BoxSizer(wx.HORIZONTAL)
        depnoteBox.Add(dependantBox, 1, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        depnoteBox.Add(noteBox, 1, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        
        
        # synopsis
        self.synopsis = wx.TextCtrl(self, -1, "", style=wx.TE_MULTILINE)        
        synopsisBox = wx.StaticBoxSizer(wx.StaticBox(self, -1, "Synopsis"), wx.HORIZONTAL)
        synopsisBox.Add(self.synopsis, 1, wx.ALIGN_CENTER|wx.GROW|wx.ALL, 3)
        
        # save
        saveBtn = wx.Button(self, wx.ID_SAVE)
        self.Bind(wx.EVT_BUTTON, self.__saveData, saveBtn)
        
        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(self.modeLabel, 0, wx.ALIGN_LEFT|wx.ALL, 3)
        sizer.Add(topBox, 0, wx.ALIGN_LEFT|wx.ALL, 3)
        sizer.Add(callnameBox, 0, wx.ALIGN_LEFT|wx.ALL, 3)
        sizer.Add(bgBox, 0, wx.ALIGN_LEFT|wx.ALL, 3)
        sizer.Add(allidBox, 0, wx.ALIGN_LEFT|wx.ALL, 3)
        sizer.Add(workBox, 0, wx.ALIGN_LEFT|wx.ALL, 3)
        sizer.Add(depnoteBox, 2, wx.ALIGN_LEFT|wx.GROW|wx.ALL, 3)
        sizer.Add(synopsisBox, 1, wx.ALIGN_LEFT|wx.GROW|wx.ALL, 3)
        sizer.Add(saveBtn, 0, wx.ALIGN_CENTER|wx.ALL, 3)

        self.SetSizer(sizer)
        
        self.widgetList = [
                           self.folderNumber,
                           self.surname,
                           self.name,
                           self.birthdate,
                           #self.gender,
                           self.ID,
                           self.nationality,
                           self.note,
                           self.callname,
                           self.language,
                           self.occupation,
                           self.synopsis,
                           self.dependants,
                           self.race,
                           self.employer
                           ]
示例#10
0
 def __init__(self, parent, ID, name="", style=wx.TAB_TRAVERSAL, registrykey="", size=wx.DefaultSize):
     wx.Panel.__init__(self, parent, ID, name="", style=style, size=size)
     
     if registrykey: Registry.add(registrykey, self)
示例#11
0
    def __init__(self, parent, ID):
        wx.Panel.__init__(self, parent, ID)

        Registry.add("ANC", self)
        Result.addListener(self)