void wxDDGrid::ComboBoxEvent(wxGridEvent &event) { // This forces the cell to go into edit mode directly this->m_waitForSlowClick = TRUE; int row = event.GetRow(); int col = event.GetCol(); this->SetGridCursor(row, col); // Store the click co-ordinates in the editor if possible // if an editor has created a ClientData area, we presume it's // a wxPoint and we store the click co-ordinates wxGridCellEditor *pEditor = this->GetCellEditor(event.GetRow(), event.GetCol()); wxPoint *pClickPoint = (wxPoint *)pEditor->GetClientData(); if (pClickPoint) { *pClickPoint = this->ClientToScreen(event.GetPosition()); #ifndef __WINDOWS__ EnableCellEditControl(true); #endif } // hack to prevent selection from being lost when click combobox if (this->IsInSelection(event.GetRow(), event.GetCol())) { this->m_selTemp = this->m_selection; this->m_selection = NULL; } pEditor->DecRef(); }
void CListView::OnCellLeftClick(wxGridEvent& ev) { // This forces the cell to go into edit mode directly m_waitForSlowClick = TRUE; SetGridCursor(ev.GetRow(), ev.GetCol()); // Store the click co-ordinates in the editor if possible // if an editor has created a ClientData area, we presume it's // a wxPoint and we store the click co-ordinates wxGridCellEditor* pEditor = GetCellEditor(ev.GetRow(), ev.GetCol()); wxPoint* pClickPoint = (wxPoint*)pEditor->GetClientData(); if (pClickPoint) { *pClickPoint = ClientToScreen(ev.GetPosition()); #ifndef __WINDOWS__ EnableCellEditControl(true); #endif } // hack to prevent selection from being lost when click combobox if (ev.GetCol() == 0 && IsInSelection(ev.GetRow(), ev.GetCol())) { m_selTemp = m_selection; m_selection = NULL; } pEditor->DecRef(); ev.Skip(); }
void nwxGrid::OnEditCell(wxGridEvent &e) { CIncrementer x(m_nInCellChange); int nRow = e.GetRow(); int nCol = e.GetCol(); SetDoNotSave(true); SetGridCursor(nRow,nCol); EnableCellEditControl(true); }
void GLIDebugVariableGrid::OnKeyDown(wxKeyEvent &keyEvent) { //If in edit mode, allow all keys through if(IsCellEditControlEnabled()) { keyEvent.Skip(); return; } //Don't allow the enter key to switch between rows if(keyEvent.m_keyCode == WXK_RETURN) { //Toggle the expandable rows if necessary if(ToggleRowExpansion(GetGridCursorRow())) { return; } //If the cell is able to be edited, start editing if(!IsCurrentCellReadOnly()) { EnableCellEditControl(); } return; } //Delete watch values on the delete key if(keyEvent.m_keyCode == WXK_DELETE) { int currRow = GetGridCursorRow(); int currColumn = GetGridCursorCol(); //Check that the current row is in range if(currRow >= 0 && currRow < rowTypeDataArray.size() && rowTypeDataArray[currRow].type == RT_WatchValue) { //Can only delete old stored watch values, not in progress editing ones uint watchIndex = rowTypeDataArray[currRow].indexValue; if(watchIndex < watchValuesArray.size()) { //Delete the watch value from the array watchValuesArray.erase(watchValuesArray.begin() + watchIndex); //Refresh the grid RefreshGrid(); //Reset the selected cell SetCurrentCell(currRow, currColumn); return; } } } //Handle Ctrl-C to copy the contents of a cell to the clipboard if(keyEvent.m_keyCode == 'C' && keyEvent.m_controlDown) { if (wxTheClipboard->Open()) { //Add the data this is in the current cell wxTheClipboard->SetData( new wxTextDataObject(GetCellValue(GetGridCursorRow(), GetGridCursorCol())) ); wxTheClipboard->Close(); } } //Process all other keys keyEvent.Skip(); }