diff --git a/uppsrc/GridCtrl/GridCtrl.cpp b/uppsrc/GridCtrl/GridCtrl.cpp index 5b7cee15d..9e5641457 100644 --- a/uppsrc/GridCtrl/GridCtrl.cpp +++ b/uppsrc/GridCtrl/GridCtrl.cpp @@ -99,7 +99,8 @@ GridCtrl::GridCtrl() : holder(*this) row_changing = true; edit_mode = GE_ROW; one_click_edit = false; - coloring_mode = 0; + goto_first_edit = true; + coloring_mode = 0; isedit = false; genr_ctrls = 0; edit_ctrls = false; @@ -6582,7 +6583,7 @@ bool GridCtrl::StartEdit() WhenStartEdit(); SetCtrlsData(); - UpdateCtrls(UC_SHOW | UC_GOFIRST | UC_CURSOR | UC_CTRLS); + UpdateCtrls(UC_SHOW | UC_CURSOR | UC_CTRLS | (goto_first_edit ? UC_GOFIRST : 0)); return true; } diff --git a/uppsrc/GridCtrl/GridCtrl.h b/uppsrc/GridCtrl/GridCtrl.h index 06b2ca095..a7e0b8d23 100644 --- a/uppsrc/GridCtrl/GridCtrl.h +++ b/uppsrc/GridCtrl/GridCtrl.h @@ -864,6 +864,7 @@ class GridCtrl : public Ctrl int resize_row_mode; int edit_mode; bool one_click_edit:1; + bool goto_first_edit:1; bool inserting:1; bool appending:1; @@ -1091,6 +1092,7 @@ class GridCtrl : public Ctrl GridCtrl& EditRow() { edit_mode = GE_ROW; return *this; } GridCtrl& EditCell() { edit_mode = GE_CELL; return *this; } GridCtrl& OneClickEdit(bool b = true) { one_click_edit = b; return *this; } + GridCtrl& GotoFirstEdit(bool b = true) { goto_first_edit = b; return *this; } GridCtrl& Absolute() { return ResizeColMode(0); } GridCtrl& Proportional() { return ResizeColMode(1); } GridCtrl& SelectRow(bool b = true) { select_row = b; return *this; }