From 7d17505cfe653cf32ccb2829823a7ef90dc3dc19 Mon Sep 17 00:00:00 2001 From: cxl Date: Sun, 22 Nov 2015 07:54:23 +0000 Subject: [PATCH] ide: Fixed initial sync in HexView #1339 git-svn-id: svn://ultimatepp.org/upp/trunk@9202 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/HexView/HexView.cpp | 13 ++++++++++--- uppsrc/HexView/HexView.h | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/uppsrc/HexView/HexView.cpp b/uppsrc/HexView/HexView.cpp index 5eae2f991..eedb323d1 100644 --- a/uppsrc/HexView/HexView.cpp +++ b/uppsrc/HexView/HexView.cpp @@ -233,6 +233,8 @@ void HexView::SetTotal(int64 _total) total = _total; Layout(); SetSb(); + Refresh(); + RefreshInfo(); } void HexView::SetSc(int64 address) @@ -252,6 +254,13 @@ void HexView::Scroll() Refresh(); } +void HexView::RefreshInfo() +{ + info.SetPos(cursor, IsLongMode()); + for(int i = 0; i < 80; i++) + info.Set(i, Byte(cursor + i)); +} + void HexView::SetCursor(int64 _cursor) { cursor = _cursor; @@ -273,9 +282,7 @@ void HexView::SetCursor(int64 _cursor) sc = 0; SetSb(); Refresh(); - info.SetPos(cursor, IsLongMode()); - for(int i = 0; i < 80; i++) - info.Set(i, Byte(cursor + i)); + RefreshInfo(); } void HexView::LeftDown(Point p, dword) diff --git a/uppsrc/HexView/HexView.h b/uppsrc/HexView/HexView.h index 7d7e70d51..b5e62af8b 100644 --- a/uppsrc/HexView/HexView.h +++ b/uppsrc/HexView/HexView.h @@ -59,6 +59,7 @@ private: void SetColumns(int x); void SetInfo(int m); void Goto(); + void RefreshInfo(); public: virtual int Byte(int64 adr);