Esempio n. 1
0
    def __init__(self, subject):
        """

        :param subject:         The data store that the XMLObserver will be watching
        :type subject:          DataStore.DataStore
        :return:
        """
        Observer.__init__(self, subject)
        self._pane = None
        self._text_area = None
        self._active = False
        self.construct()
        self._xml_container = XMLContainer(subject)
        self._dispatch = {
            Event.EDGE_CREATE       :   self._xml_container.add_edge_entry,
            Event.NODE_CREATE       :   self._xml_container.add_node_entry,
            Event.OBJECT_CREATE     :   self._xml_container.add_object_entry,
            Event.OBJECT_EDIT       :   self._xml_container.edit_object_entry,
            Event.NODE_EDIT         :   self._xml_container.edit_node_entry,
            Event.EDGE_EDIT         :   self._xml_container.edit_edge_entry,
            Event.EDGE_DELETE       :   self._xml_container.remove_entry,
            Event.NODE_DELETE       :   self._xml_container.remove_entry,
            Event.OBJECT_DELETE     :   self._xml_container.remove_entry,
            Event.ENVIRONMENT_EDIT  :   self._xml_container.edit_environment,
            Event.VR_EDIT           :   self._xml_container.edit_vr
        }
        self._xml_container.create_skeleton(subject)
    def __init__(self, parent, questionTool, app):
        '''
        Create ui components.
        '''
        wx.Panel.__init__(self, parent, -1)
        Observer.__init__(self)
        self.app = app
        self.parent = parent
        self.questionTool = questionTool
        self.questionList = wx.ListCtrl(self, wx.NewId(), size = wx.Size(460, 150),style=wx.LC_REPORT)
        self.questionList.InsertColumn(0, "Questions")
        self.questionList.InsertColumn(1, "Time Sent")
        self.questionList.SetColumnWidth(0, 300)
        self.questionList.SetColumnWidth(1, 150)
        
        self.currentQuestion = wx.TextCtrl(self, -1, style= wx.TE_MULTILINE)
        self.currentQuestion.Enable()
	self.currentQuestion.SetEditable(True)
        
        self.sendButton = wx.Button(self, wx.NewId(), "Send")
        self.closeButton = wx.Button(self,  wx.ID_CLOSE, "Close")
        
        self.__Layout()
        
        EVT_BUTTON(self, self.sendButton.GetId(), self.SendQuestion)
        EVT_BUTTON(self, self.closeButton.GetId(), self.Close)
Esempio n. 3
0
    def __init__(self, parent, voyagerModel, log):
        """ 
        Create ui components. 
        """
        wxFrame.__init__(self, NULL, -1, "Personal AG Recorder", size=wxSize(420, 500))
        Observer.__init__(self)

        self.log = log
        self.voyagerModel = voyagerModel
        self.intToGuid = {}

        self.SetIcon(icons.getAGIconIcon())
        self.panel = wxPanel(self, -1)
        self.stopButton = wxButton(self.panel, wxNewId(), "Stop", size=wxSize(50, 40))
        self.playButton = wxButton(self.panel, wxNewId(), "Play", size=wxSize(50, 40))
        self.recordButton = wxButton(self.panel, wxNewId(), "Record", size=wxSize(50, 40))
        self.statusField = wxTextCtrl(
            self.panel,
            wxNewId(),
            "Use the buttons to record from a venue or play a recording from the list below.",
            style=wxTE_MULTILINE | wxTE_READONLY | wxTE_RICH,
            size=wxSize(-1, 32),
        )

        # Recordings are displayed in a list. They are keyed on the
        # unique id returned from recording.GetId()
        self.recordingList = wxListCtrl(self.panel, wxNewId(), size=wxSize(150, 150), style=wxLC_REPORT)
        self.recordingList.InsertColumn(0, "Name")
        self.recordingList.InsertColumn(1, "Date")
        self.recordingList.SetColumnWidth(0, 80)
        self.recordingList.SetColumnWidth(1, 220)

        self.playButton.SetToolTipString("Play a recording")
        self.recordButton.SetToolTipString("Record from an AG venue")

        self.recordingMenu = wxMenu()
        self.recordingMenu.Append(self.RECORDING_MENU_REMOVE, "Remove", "Remove this recording.")
        self.recordingMenu.AppendSeparator()
        self.recordingMenu.Append(self.RECORDING_MENU_IMPORT, "Import", "Load recordings")
        self.recordingMenu.Append(self.RECORDING_MENU_EXPORT, "Export", "Save this recording to file")
        self.recordingMenu.AppendSeparator()
        self.recordingMenu.Append(self.RECORDING_MENU_PROPERTIES, "Properties", "View recording details.")

        self.__Layout()
        self.__SetEvents()
        self.Update()
    def __init__(self, parent, questionTool, app):
        '''
        Create ui components.
        '''
        wx.Panel.__init__(self, parent, -1)
        Observer.__init__(self)
        self.questionTool = questionTool
        self.parent = parent
        self.app = app
        self.questionList = wx.ListCtrl(self, wx.NewId(), size = wx.Size(460, 150), style=wx.LC_REPORT)
        self.questionList.InsertColumn(0, "Question")
        self.questionList.InsertColumn(1, "Sender")
        self.questionList.InsertColumn(2, "Time Sent")
        self.questionList.SetColumnWidth(0, 150)
        self.questionList.SetColumnWidth(1, 150)
        self.questionList.SetColumnWidth(2, 150)
        self.currentQuestion = wx.TextCtrl(self, -1, style= wx.TE_MULTILINE| wx.TE_READONLY)
        self.closeButton = wx.Button(self, wx.NewId(), "Close")
        self.__Layout()
        self.__PopulateQList()

        EVT_BUTTON(self, self.closeButton.GetId(), self.Close)
        EVT_LIST_ITEM_SELECTED(self, self.questionList.GetId(), self.SelectQuestion)