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; hidden = n == 0;
n = Ctrl::VertLayoutZoom(n);
if(!hidden) if(!hidden)
{ {
if(n < min) { n = min; ismin = true; } if(n < min) { n = min; ismin = true; }

View file

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

View file

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