From 61deef5cdf96cbfdd6ad45be49e80d597c00ca65 Mon Sep 17 00:00:00 2001
From: QuakeGod <QuakeGod@sina.com>
Date: 星期二, 24 十二月 2024 08:37:21 +0800
Subject: [PATCH] 2024-12-24

---
 MTerm2/MTerm2View.h |   44 +++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 41 insertions(+), 3 deletions(-)

diff --git a/MTerm2/MTerm2View.h b/MTerm2/MTerm2View.h
index 1e7b9df..968ad3c 100644
--- a/MTerm2/MTerm2View.h
+++ b/MTerm2/MTerm2View.h
@@ -4,7 +4,10 @@
 
 #pragma once
 
+#include <memory>
+#include <vector>
 
+#include "MTerm2Doc.h"
 class CMTerm2View : public CScrollView
 {
 protected: // 浠呬粠搴忓垪鍖栧垱寤�
@@ -13,7 +16,7 @@
 
 // 鐗规��
 public:
-	CMFCStatusBar * m_pStatusBar;
+	CStatusBar * m_pStatusBar;
 	CMTerm2Doc* GetDocument() const;
 
 	//浠庢枃妗h幏鍙栫▼搴�
@@ -63,9 +66,11 @@
 		int nProgStep;
 		int bFocused = 0;
 		int bSelected = 0;
-
 		int bEditing = 0;
 		int bModified = 0;
+
+		int bErrFocus = 0;
+
 		int bLeftLineUp = 0;
 		int bLeftLineDn = 0;
 		int nStat = 0;
@@ -83,6 +88,32 @@
 		}
 	};
 	stCell Cells[2000][16] = { 0 };
+
+	struct stProgSection
+	{
+		std::vector <CMTerm2Doc::stProg> Progs;
+		int Append(CMTerm2Doc::stProg prog)	{
+			Progs.push_back(prog);
+			return 0;
+		};
+		int Append(struct stProgSection progsec){
+			int n=(int)progsec.Progs.size();
+			for (int i = 0; i < n; i++) {
+				Progs.push_back(progsec.Progs[i]);
+			}
+			return 0;
+		};
+		int operator+=(const struct stProgSection progsec) { 
+			Append(progsec);
+			return 0; 
+		};
+
+		int Insert(CMTerm2Doc::stProg prog)	{
+			Progs.insert(Progs.begin(), prog);
+			return 0;
+		}
+	};
+
 	int m_nTotalRow=0;
 	bool m_bMonitoring = false;		//鐩戞帶涓�
 	bool m_bShowComments = true;	//鏄剧ず娉ㄩ噴
@@ -171,6 +202,11 @@
 	int DoReDraw();
 	int DrawLDSGraph(CDC* pDC);
 
+	int ScrollToCell(int nRow, int nCol);
+
+	int ScrollCellIntoView(int nRow, int nCol);
+	int isCellInView(int nRow, int nCol);
+
 // 閲嶅啓
 public:
 	virtual void OnDraw(CDC* pDC);  // 閲嶅啓浠ョ粯鍒惰瑙嗗浘
@@ -244,7 +280,9 @@
 	int TransLDSToProg();
 	afx_msg void OnInputIoComment();
 	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
-	int ScanLDSCells(int nStartLine, int nEndLine, int nPosY, int nPosX, int nLevel, CString & sProgSec, int &nSteps);
+	int ScanLDSCells(int nStartLine, int nEndLine, int nPosY, int nPosX, int nLevel, stProgSection & progsec, CString & sProgSec, int &nSteps);
+	void GetIncToView(stCell cell1);
+
 };
 
 #ifndef _DEBUG  // MultiTerminal2View.cpp 涓殑璋冭瘯鐗堟湰

--
Gitblit v1.9.1