added GetVisibleCount, activated WhenPasteCell

git-svn-id: svn://ultimatepp.org/upp/trunk@384 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
unodgs 2008-08-29 13:23:14 +00:00
parent 6abd307765
commit 6a6ae049ed
3 changed files with 16 additions and 5 deletions

View file

@ -60,6 +60,8 @@ GridCtrl::ItemRect& GridCtrl::ItemRect::Size(int n)
{
hidden = n == 0;
n = Ctrl::VertLayoutZoom(n);
if(!hidden)
{
if(n < min) { n = min; ismin = true; }

View file

@ -813,10 +813,9 @@ void GridCtrl::Paste(int mode)
if(fixed_paste && new_row)
break;
String& s = cells[j];
// WhenPasteCell(i, j, s);
Set0(lr, lc, s, true);
Value v(cells[j]);
WhenPasteCell(i, j, v);
Set0(lr, lc, v, true);
}
if(i == lines.GetCount() - 1 && j == cells.GetCount() - 1)
@ -4945,7 +4944,7 @@ bool GridCtrl::Key(dword key, int)
}
return false;
case K_CTRL_W:
//WriteClipboardText(GetColumnWidths());
WriteClipboardText(GetColumnWidths());
return true;
default:
if(searching && !ctrls && Search(key))
@ -5909,6 +5908,15 @@ int GridCtrl::GetCount() const { return total_rows - fixed_rows; }
int GridCtrl::GetFixedCount() const { return fixed_rows; }
int GridCtrl::GetTotalCount() const { return total_rows; }
int GridCtrl::GetVisibleCount() const
{
int cnt = 0;
for(int i = fixed_rows; i < total_rows; i++)
if(!vitems[i].hidden)
++cnt;
return cnt;
}
GridCtrl& GridCtrl::SetColsMin(int size)
{
for(int i = 1; i < total_cols; i++)

View file

@ -1368,6 +1368,7 @@ class GridCtrl : public Ctrl
int GetCount() const;
int GetRowCount() const { return GetCount(); }
int GetVisibleCount() const;
int GetFixedCount() const;
int GetTotalCount() const;