diff --git a/uppsrc/GridCtrl/GridCtrl.cpp b/uppsrc/GridCtrl/GridCtrl.cpp index 9e5641457..f55c75509 100644 --- a/uppsrc/GridCtrl/GridCtrl.cpp +++ b/uppsrc/GridCtrl/GridCtrl.cpp @@ -9,6 +9,8 @@ NAMESPACE_UPP #define TFILE #include +bool GridCtrl::index_as_column = false; + GridCtrl::GridCtrl() : holder(*this) { sortCol = -1; @@ -1689,6 +1691,13 @@ GridCtrl::ItemRect& GridCtrl::AddColumn(const char *name, int size, bool idx) ib.uid = coluid++; ib.index = idx; + if(index_as_column && idx) + { + size = 70; + ib.prop = size; + ib.Fixed(size); + } + ib.Size(size); if(!ib.hidden) { diff --git a/uppsrc/GridCtrl/GridCtrl.h b/uppsrc/GridCtrl/GridCtrl.h index a7e0b8d23..f4dfdb121 100644 --- a/uppsrc/GridCtrl/GridCtrl.h +++ b/uppsrc/GridCtrl/GridCtrl.h @@ -914,6 +914,8 @@ class GridCtrl : public Ctrl bool search_move_cursor:1; bool search_display:1; int find_offset; + + static bool index_as_column; /* States */ @@ -1168,6 +1170,7 @@ class GridCtrl : public Ctrl GridCtrl& SearchImmediate(bool b = true) { search_immediate = b; return *this; } GridCtrl& SearchHideRows(bool b = true) { search_hide = b; return *this; } GridCtrl& SearchDisplay(bool b = true) { search_display = b; return *this; } + static void IndexAsColumn(bool b = true) { index_as_column = b; } GridCtrl& SetToolBar(bool b = true, int align = BarCtrl::BAR_BOTTOM, int frame = 1); ToolBar& GetToolBar() { return bar; }