mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-09-05 17:44:55 -06:00
GridCtrl: Added IndexAsColumn
git-svn-id: svn://ultimatepp.org/upp/trunk@6267 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
dc89745b51
commit
fa4caceee7
2 changed files with 12 additions and 0 deletions
|
|
@ -9,6 +9,8 @@ NAMESPACE_UPP
|
|||
#define TFILE <GridCtrl/GridCtrl.t>
|
||||
#include <Core/t.h>
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue