def onEditorShown(self, event): # wxGlade: ParametersPanel.<event_handler> i = event.GetRow() j = event.GetCol() self._focusedText = self.grid_parameters.GetCellValue(i,j) self._selectedCells = gridutils.getSelectedCells(self.grid_parameters) event.Skip() return
def onEditorShown(self, event): # wxGlade: ParametersPanel.<event_handler> i = event.GetRow() j = event.GetCol() self._focusedText = self.grid_parameters.GetCellValue(i, j) self._selectedCells = gridutils.getSelectedCells(self.grid_parameters) event.Skip() return
def onEditorShown(self, event): # wxGlade: PhaseConstraintsPanel.<event_handler> """Capture the focused text when the grid editor is shown.""" i = event.GetRow() j = event.GetCol() self._focusedText = self.gridAtoms.GetCellValue(i,j) self._selectedCells = gridutils.getSelectedCells(self.gridAtoms) return
def onKey(self, event): """Catch key events in the panel.""" key = event.GetKeyCode() # Select All - Ctrl+A if event.ControlDown() and key == 65: rows = self.gridAtoms.GetNumberRows() cols = self.gridAtoms.GetNumberCols() self.gridAtoms.SelectBlock(0, 0, rows, cols) # context menu key elif key == wx.WXK_MENU: self.popupMenu(self.gridAtoms, event.GetPosition().x, event.GetPosition().y) # Vim-like search for atom selection elif key == 47: self.onPopupSelect(event) # Delete elif key == 127: self._selectedCells = gridutils.getSelectedCells(self.gridAtoms) self.fillCells("") self.mainFrame.needsSave() # Can't get these to work. Maybe later. ## Copy - Ctrl+C / Ctrl+Insert #if event.ControlDown() and (key == 67 or key == wx.WXK_INSERT): # if phasepanelutils.canCopySelectedCells(self): # phasepanelutils.copySelectedCells(self) ## Paste - Ctrl+V / Shift+Insert #if (event.ControlDown() and key == 86) or\ # (event.ShiftDown() and key == wx.WXK_INSERT): # if phasepanelutils.canPasteIntoCells(self): # phasepanelutils.pasteIntoCells(self) else: event.Skip() return
def onKey(self, event): """Catch key events in the panel.""" key = event.GetKeyCode() # Select All - Ctrl+A if event.ControlDown() and key == 65: rows = self.gridAtoms.GetNumberRows() cols = self.gridAtoms.GetNumberCols() self.gridAtoms.SelectBlock(0,0,rows,cols) # context menu key elif key == wx.WXK_MENU: self.popupMenu(self.gridAtoms, event.GetPosition().x, event.GetPosition().y) # Vim-like search for atom selection elif key == 47: self.onPopupSelect(event) # Delete elif key == 127: self._selectedCells = gridutils.getSelectedCells(self.gridAtoms) self.fillCells("") self.mainFrame.needsSave() # Can't get these to work. Maybe later. ## Copy - Ctrl+C / Ctrl+Insert #if event.ControlDown() and (key == 67 or key == wx.WXK_INSERT): # if phasepanelutils.canCopySelectedCells(self): # phasepanelutils.copySelectedCells(self) ## Paste - Ctrl+V / Shift+Insert #if (event.ControlDown() and key == 86) or\ # (event.ShiftDown() and key == wx.WXK_INSERT): # if phasepanelutils.canPasteIntoCells(self): # phasepanelutils.pasteIntoCells(self) else: event.Skip() return