*GridCtrl: GetCtrl expects relative row index on default now

git-svn-id: svn://ultimatepp.org/upp/trunk@2553 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
unodgs 2010-07-20 19:23:43 +00:00
parent 792cb5908c
commit e719330072
2 changed files with 17 additions and 17 deletions

View file

@ -1962,7 +1962,7 @@ void GridCtrl::SyncPopup()
bool valid_pos = c >= 0 && r >= 0;
Ctrl* ctrl = valid_pos ? GetCtrl(r, c, true, false, false) : NULL;
Ctrl* ctrl = valid_pos ? GetCtrl(r, c, true, false, false, false) : NULL;
bool close = popup.IsOpen();
@ -2421,10 +2421,10 @@ void GridCtrl::DragAndDrop(Point p, PasteClip& d)
*/
}
Rect GridCtrl::GetItemRect(int r, int c, bool hgrid, bool vgrid, bool relw, bool relh)
Rect GridCtrl::GetItemRect(int r, int c, bool hgrid, bool vgrid, bool hrel, bool vrel)
{
int dx = sbx + (relw ? fixed_width : 0);
int dy = sby + (relh ? fixed_height : 0);
int dx = sbx + (hrel ? fixed_width : 0);
int dy = sby + (vrel ? fixed_height : 0);
int idx = hitems[c].id;
int idy = vitems[r].id;
@ -4379,7 +4379,7 @@ bool GridCtrl::GetCtrlsData(bool samerow, bool doall, bool updates)
for(int i = fixed_cols; i < total_cols; ++i)
{
int idx = hitems[i].id;
Ctrl * ctrl = GetCtrl(rowidx, i, true, false);
Ctrl * ctrl = GetCtrl(rowidx, i, true, false, false);
if(ctrl && !ctrl->Accept())
{
focused_ctrl = ctrl;
@ -4530,7 +4530,7 @@ void GridCtrl::UpdateCtrls(int opt /*= UC_CHECK_VIS | UC_SHOW | UC_CURSOR | UC_F
bool gofirst = opt & UC_GOFIRST && select_row && !ctrls && !draw_focus;
if(opt & UC_MOUSE)
gofirst = gofirst && !GetCtrl(cp, false, false);
gofirst = gofirst && !GetCtrl(cp, false, false, false);
for(int i = 1; i < total_cols; i++)
{
@ -6153,15 +6153,15 @@ bool GridCtrl::GoRight(bool scroll, bool ctrlmode) { return Go0(GO_RIGHT, scroll
bool GridCtrl::GoPageUp(bool scroll) { return Go0(GO_PAGEUP, scroll); }
bool GridCtrl::GoPageDn(bool scroll) { return Go0(GO_PAGEDN, scroll); }
Ctrl * GridCtrl::GetCtrl(const Point &p, bool check_visibility, bool relative, bool check_edits)
Ctrl * GridCtrl::GetCtrl(const Point &p, bool check_visibility, bool hrel, bool vrel, bool check_edits)
{
return GetCtrl(p.y, p.x, check_visibility, relative, check_edits);
return GetCtrl(p.y, p.x, check_visibility, hrel, vrel, check_edits);
}
Ctrl * GridCtrl::GetCtrl(int r, int c, bool check_visibility, bool relative, bool check_edits)
Ctrl * GridCtrl::GetCtrl(int r, int c, bool check_visibility, bool hrel, bool vrel, bool check_edits)
{
int idx = relative ? fixed_cols + c : hitems[c].id;
int idy = vitems[r].id;
int idx = hrel ? fixed_cols + c : hitems[c].id;
int idy = vrel ? fixed_rows + r : vitems[r].id;
Ctrl * ctrl = items[idy][idx].ctrl;
if(check_edits && !ctrl)
ctrl = edits[idx].ctrl;
@ -6172,17 +6172,17 @@ Ctrl * GridCtrl::GetCtrl(int r, int c, bool check_visibility, bool relative, boo
Ctrl * GridCtrl::GetCtrl(int r, int c)
{
return GetCtrl(r, c, true, true);
return GetCtrl(r, c, true, true, true);
}
Ctrl * GridCtrl::GetCtrl(int c)
{
return GetCtrl(curpos.y, c, true, true);
return GetCtrl(curpos.y, c, true, true, false);
}
bool GridCtrl::IsCtrl(Point &p)
{
return GetCtrl(p, true);
return GetCtrl(p, true, false, false);
}
void GridCtrl::GoTo(int r, bool setcursor, bool scroll)

View file

@ -1628,7 +1628,7 @@ class GridCtrl : public Ctrl
void DrawLine(bool iniLine, bool delLine);
Rect GetItemRect(int r, int c, bool hgrid = false, bool vgrid = false, bool relw = false, bool relh = false);
Rect GetItemRect(int r, int c, bool hgrid = false, bool vgrid = false, bool hrel = false, bool vrel = false);
bool Match(const WString &f, const WString &s, int &fs, int &fe);
int ShowMatchedRows(const WString &f);
@ -1685,8 +1685,8 @@ class GridCtrl : public Ctrl
void Nothing();
void Init();
Ctrl * GetCtrl(int x, int y, bool check_visibility, bool relative = false, bool check_edits = true);
Ctrl * GetCtrl(const Point &p, bool check_visibility, bool relative = false, bool check_edits = true);
Ctrl * GetCtrl(int x, int y, bool check_visibility, bool hrel = false, bool vrel = false, bool check_edits = true);
Ctrl * GetCtrl(const Point &p, bool check_visibility, bool hrel = false, bool vrel = false, bool check_edits = true);
bool IsCtrl(Point &p);
GridClipboard GetClipboard();