public CodeViewTab(ArmAssembly.ArmFileInfo progInfo, ApplicationJimulator jm) { JM = jm; _PI = progInfo; string fileName = progInfo.FileName; InitializeComponent(); this.SuspendLayout(); this.Location = new System.Drawing.Point(4, 22); this.Name = fileName; this.Size = new System.Drawing.Size(464, 312); this.TabIndex = 0; this.Text = Path.GetFileName(fileName); _codeViewList = new CodeViewList(this); _codeViewList.DrawItem += this.drawItem; _codeViewList.VisibleChanged += this.createLines; this.Controls.Add(_codeViewList); this.fileSystemWatcher1.Path = Path.GetDirectoryName(fileName); this.fileSystemWatcher1.Filter = Path.GetFileName(fileName); //_fileChanged = false; this.ResumeLayout(false); _drawParameters = new DrawParameters(_codeViewList.CreateGraphics(), _codeViewList.Font); }
private void computeMaxWidth() { createLines(); Graphics g = _codeViewList.CreateGraphics(); int maxWidth = -1; foreach (CodeViewLine cvl in _codeViewList.Items) { int width = cvl.CalculateWidth(g); if (width > maxWidth) { maxWidth = width; } } _codeViewList.HorizontalExtent = maxWidth; }