From e8c85a99701d089d8b70cf92c6defa229ec6afcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20R=C4=99bacz?= Date: Wed, 28 Jan 2026 22:03:28 +0100 Subject: [PATCH] GridCtrl: remove depricated usage of VeiwDraw. --- uppsrc/GridCtrl/GridCtrl.cpp | 54 +++--------------------------------- uppsrc/GridCtrl/GridCtrl.h | 5 +--- 2 files changed, 5 insertions(+), 54 deletions(-) diff --git a/uppsrc/GridCtrl/GridCtrl.cpp b/uppsrc/GridCtrl/GridCtrl.cpp index 3c8686390..69007a94b 100644 --- a/uppsrc/GridCtrl/GridCtrl.cpp +++ b/uppsrc/GridCtrl/GridCtrl.cpp @@ -972,38 +972,9 @@ void GridCtrl::Nothing() { } -void GridCtrl::DrawLine(bool iniLine, bool delLine) -{ - if((resizeCol || resizeRow) && resize_paint_mode < 2) - { - int sx = resize_paint_mode == 1 ? fixed_width : 0; - int sy = resize_paint_mode == 1 ? fixed_height : 0; - ViewDraw w(this); - Size sz = GetSize(); - - Point curPnt; - static Point oldPnt = curPnt; - - if(resizeCol) - { - curPnt.x = hitems[splitCol].nRight(sbx) - 1; - if(delLine) w.DrawRect(oldPnt.x, sy, 1, sz.cy, InvertColor()); - if(iniLine) w.DrawRect(curPnt.x, sy, 1, sz.cy, InvertColor()); - } - if(resizeRow) - { - curPnt.y = vitems[splitRow].nBottom(sby) - 1; - if(delLine) w.DrawRect(sx, oldPnt.y, sz.cx, 1, InvertColor()); - if(iniLine) w.DrawRect(sx, curPnt.y, sz.cx, 1, InvertColor()); - } - - oldPnt = curPnt; - } -} - Value GridCtrl::GetItemValue(const Item& it, int id, const ItemRect& hi, const ItemRect& vi) { - Value val = hi.IsConvertion() && vi.IsConvertion() + Value val = hi.IsConvertion() && vi.IsConvertion() ? GetConvertedColumn(id, it.val) : it.val; @@ -4164,24 +4135,8 @@ Point GridCtrl::GetCtrlPos(Ctrl * ctrl) return Point(-1, -1); } -void GridCtrl::Split(int state, bool sync) +void GridCtrl::Split(GridState state) { - if(resize_paint_mode < 2) - { - if(resize_paint_mode > 0 && state != GS_DOWN) - { - if(resizeCol) RefreshTop(); - if(resizeRow) RefreshLeft(); - } - - if(state == GS_DOWN) - DrawLine(true, false); - else if(state == GS_MOVE) - DrawLine(true, true); - else - DrawLine(false, true); - } - if(state == GS_DOWN) { firstCol = firstRow = -1; @@ -4193,7 +4148,6 @@ void GridCtrl::Split(int state, bool sync) UpdateSizes(); UpdateHolder(); UpdateSb(); - Refresh(); } if((resize_paint_mode > 1 && state > GS_UP) || state == GS_UP) @@ -4202,8 +4156,8 @@ void GridCtrl::Split(int state, bool sync) UpdateCtrls(UC_CHECK_VIS | UC_SHOW); } - if(sync) - Sync(); + Refresh(); + Sync(); } bool GridCtrl::TabKey(bool enter_mode) diff --git a/uppsrc/GridCtrl/GridCtrl.h b/uppsrc/GridCtrl/GridCtrl.h index 3a67dba5f..2c342654c 100644 --- a/uppsrc/GridCtrl/GridCtrl.h +++ b/uppsrc/GridCtrl/GridCtrl.h @@ -1003,7 +1003,6 @@ class GridCtrl : public Ctrl bool valid_cursor; - /* Values */ int curSplitCol, curSplitRow; @@ -1718,7 +1717,7 @@ class GridCtrl : public Ctrl int GetFocusedCtrlIndex(); Point GetCtrlPos(Ctrl * ctrl); - void Split(int state = 0, bool sync = false); + void Split(GridState gstate); void Scroll(); bool IsTopHeader() { return fixed_rows > 0; } @@ -1726,8 +1725,6 @@ class GridCtrl : public Ctrl bool IsMouseBody(Point &p); - void DrawLine(bool iniLine, bool delLine); - 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);