Date Dev Ver Change details
---------- --- ------ --------------
+2009-09-18 DP 1.10.1 Fix a potential crash in the edit grid.
2009-09-17 GL 1.12.0 Add a button to open the query tool with the query
selected in the frmStatus window.
2009-09-04 GL 1.12.0 Add an option to automatically rollback a failed
if (sqlGrid->GetTable()->IsColBoolean(sqlGrid->GetGridCursorCol()))
return;
- wxStyledTextCtrl *text = (wxStyledTextCtrl *)sqlGrid->GetCellEditor(sqlGrid->GetGridCursorRow(), sqlGrid->GetGridCursorCol())->GetControl();
- if (text->GetCurrentPos() <= text->GetTextLength())
+ if (sqlGrid->GetTable()->IsColText(sqlGrid->GetGridCursorCol()))
{
- int len = text->GetSelectedText().Length();
- if (len)
- text->SetSelection(text->GetCurrentPos(), text->GetCurrentPos() + len);
- else
- text->SetSelection(text->GetCurrentPos(), text->GetCurrentPos() + 1);
- text->Clear();
+ wxStyledTextCtrl *text = (wxStyledTextCtrl *)sqlGrid->GetCellEditor(sqlGrid->GetGridCursorRow(), sqlGrid->GetGridCursorCol())->GetControl();
+ if (text && text->GetCurrentPos() <= text->GetTextLength())
+ {
+ int len = text->GetSelectedText().Length();
+ if (len)
+ text->SetSelection(text->GetCurrentPos(), text->GetCurrentPos() + len);
+ else
+ text->SetSelection(text->GetCurrentPos(), text->GetCurrentPos() + 1);
+ text->Clear();
+ }
+ }
+ else
+ {
+ wxTextCtrl *text = (wxTextCtrl *)sqlGrid->GetCellEditor(sqlGrid->GetGridCursorRow(), sqlGrid->GetGridCursorCol())->GetControl();
+ if (text && text->GetInsertionPoint() <= text->GetLastPosition())
+ {
+ int len = text->GetStringSelection().Length();
+ if (len)
+ text->Remove(text->GetInsertionPoint(), text->GetInsertionPoint() + len);
+ else
+ text->Remove(text->GetInsertionPoint(), text->GetInsertionPoint() + 1);
+ }
}
return;
}