void CMArray2DTable::HandleKeyPress ( const int key, const JXKeyModifiers& modifiers ) { if (key == kJReturnKey) { JPoint cell; if (!IsEditing() && (GetTableSelection()).GetSingleSelectedCell(&cell)) { BeginEditing(cell); } else { EndEditing(); } } else if (!IsEditing() && HandleSelectionKeyPress(key, modifiers)) { // work has been done } else { JXStringTable::HandleKeyPress(key, modifiers); } }
void CBCommandTable::HandleKeyPress ( const int key, const JXKeyModifiers& modifiers ) { JBoolean cleared = kJFalse; if (key == kJDeleteKey || key == kJForwardDeleteKey) { JTableSelection& s = GetTableSelection(); JPoint cell; if (s.GetSingleSelectedCell(&cell)) { CBCommandManager::CmdInfo info = itsCmdList->GetElement(cell.y); if (cell.x == kMenuTextColumn) { info.menuText->Clear(); cleared = kJTrue; } else if (cell.x == kMenuShortcutColumn) { info.menuShortcut->Clear(); cleared = kJTrue; } else if (cell.x == kScriptNameColumn) { info.name->Clear(); cleared = kJTrue; } } } if (cleared) { Refresh(); } else if (IsEditing()) { JXEditTable::HandleKeyPress(key, modifiers); } else { HandleSelectionKeyPress(key, modifiers); } }
void SVNListBase::HandleKeyPress ( const int key, const JXKeyModifiers& modifiers ) { JTableSelection& s = GetTableSelection(); const JBoolean hadSelection = s.HasSelection(); itsSavedSelection->CleanOut(); if (key == kJReturnKey) { OpenSelectedItems(); } // space->clear is handled by JXStringList else if (key == kJUpArrow || key == kJDownArrow) { ClearIncrementalSearchBuffer(); if (!hadSelection && key == kJUpArrow && GetRowCount() > 0) { SelectSingleCell(JPoint(1, GetRowCount())); } else { HandleSelectionKeyPress(key, modifiers); } } else { JXStringList::HandleKeyPress(key, modifiers); } }
void CBSymbolTable::HandleKeyPress ( const int key, const JXKeyModifiers& modifiers ) { JPoint topSelCell; JTableSelection& s = GetTableSelection(); const JBoolean hadSelection = s.GetFirstSelectedCell(&topSelCell); if (key == ' ') { ClearSelection(); } else if (key == kJReturnKey) { DisplaySelectedSymbols(); if (modifiers.meta() && modifiers.control()) { (GetWindow())->Close(); return; } } else if (key == kJUpArrow || key == kJDownArrow) { itsKeyBuffer.Clear(); if (!hadSelection && key == kJUpArrow && GetRowCount() > 0) { SelectSingleEntry(GetRowCount()); } else { HandleSelectionKeyPress(key, modifiers); } } else if ((key == 'c' || key == 'C') && modifiers.meta() && !modifiers.shift()) { CopySelectedSymbolNames(); } else if (JXIsPrint(key) && !modifiers.control() && !modifiers.meta()) { itsKeyBuffer.AppendCharacter(key); JIndex index; if (itsSymbolList->ClosestMatch(itsKeyBuffer, *itsVisibleList, &index)) { JString saveBuffer = itsKeyBuffer; SelectSingleEntry(index); itsKeyBuffer = saveBuffer; } } else { JXTable::HandleKeyPress(key, modifiers); } }