Example #1
0
 public void Show(DiskImage2 image, int track, int sectorIndex)
 {
     this.image       = image;
     this.track       = track;
     this.sectorIndex = sectorIndex;
     ShowSector();
     ShowDialog();
 }
Example #2
0
        public Map2(int maxTrack, DiskImage2 image, Control parent, Color backColor, ImageStatsTable2 statsTable)
        {
            StatsTable     = statsTable;
            MaxTrack       = maxTrack;
            ChartArea      = new ChartArea(parent);
            this.backColor = backColor;
            Image          = image;
            if (Image != null)
            {
                for (int i = 0; i < Image.Tracks.Cnt; i++)
                {
                    if (Image.Tracks[i] == null)
                    {
                        continue;
                    }
                    image.Tracks.Data[i].MapModified = true;
                }
            }
            ChartArea.Size              = new Size(MaxTrack * CellWidth, TrackHeight + headerHeight + upperBoundHeight + bottomBoundHeight);
            ChartArea.MouseDoubleClick += ChartArea_MouseDoubleClick;
            ChartArea.MouseMove        += ChartArea_MouseMove;
            ChartArea.MouseLeave       += ChartArea_MouseLeave;
            ChartArea.MouseDown        += ChartArea_MouseDown;
            ChartArea.MouseUp          += ChartArea_MouseUp;

            TrackL = new Label()
            {
                Parent = parent, Left = 0, Top = 343, Text = "Track:", AutoSize = true
            };
            TrackLV = new Label()
            {
                Parent = parent, Left = 35, Top = 343, Text = "...", AutoSize = true
            };
            SectorL = new Label()
            {
                Parent = parent, Left = 60, Top = 343, Text = "Sector:", AutoSize = true
            };
            SectorLV = new Label()
            {
                Parent = parent, Left = 98, Top = 343, Text = "...", AutoSize = true
            };
            StatusL = new Label()
            {
                Parent = parent, Left = 130, Top = 343, Text = "Status:", AutoSize = true
            };
            StatusLV = new Label()
            {
                Parent = parent, Left = 170, Top = 343, Text = "...", AutoSize = true
            };
            SectorSizeL = new Label()
            {
                Parent = parent, Left = 250, Top = 343, Text = "Size:", AutoSize = true
            };
            SectorSizeLV = new Label()
            {
                Parent = parent, Left = 280, Top = 343, Text = "...", AutoSize = true
            };
            CylL = new Label()
            {
                Parent = parent, Left = 310, Top = 343, Text = "Cyl:", AutoSize = true
            };
            CylLV = new Label()
            {
                Parent = parent, Left = 332, Top = 343, Text = "...", AutoSize = true
            };
            HeadL = new Label()
            {
                Parent = parent, Left = 355, Top = 343, Text = "Head:", AutoSize = true
            };
            HeadLV = new Label()
            {
                Parent = parent, Left = 390, Top = 343, Text = "...", AutoSize = true
            };
            UnprocessedLC = new Label()
            {
                Parent = parent, Left = 420, Top = 343, Width = 19, Height = 13, BackColor = Color.Wheat
            };
            UnprocessedLCL = new Label()
            {
                Parent = parent, Left = 445, Top = 343, Text = "Unprocessed", AutoSize = true
            };
            GoodLC = new Label()
            {
                Parent = parent, Left = 548, Top = 343, Width = 19, Height = 13, BackColor = Color.Green
            };
            GoodLCL = new Label()
            {
                Parent = parent, Left = 573, Top = 343, Text = "Good", AutoSize = true
            };
            ZeroLC = new Label()
            {
                Parent = parent, Left = 639, Top = 343, Width = 19, Height = 13, BackColor = Color.Gray
            };
            ZeroLCL = new Label()
            {
                Parent = parent, Left = 664, Top = 343, Text = "Zero", AutoSize = true
            };
            CrcErrorLC = new Label()
            {
                Parent = parent, Left = 722, Top = 343, Width = 19, Height = 13, BackColor = Color.FromArgb(175, 0, 0)
            };
            CrcErrorLCL = new Label()
            {
                Parent = parent, Left = 747, Top = 343, Text = "CRC Error", AutoSize = true
            };
            HeaderNotFoundLC = new Label()
            {
                Parent = parent, Left = 818, Top = 343, Width = 19, Height = 13, BackColor = Color.FromArgb(0, 0, 223)
            };
            HeaderNotFoundLCL = new Label()
            {
                Parent = parent, Left = 843, Top = 343, Text = "Header Not Found", AutoSize = true
            };
            ProcessingLC = new Label()
            {
                Parent = parent, Left = 960, Top = 343, Width = 19, Height = 13, BackColor = Color.Black
            };
            ProcessingLCL = new Label()
            {
                Parent = parent, Left = 985, Top = 343, Text = "Reading", AutoSize = true
            };

            contextMenu        = new ContextMenuStrip();
            contextMenuTopItem = new ToolStripMenuItem()
            {
                Enabled = false
            };
            markAsUnprocessed          = new ToolStripMenuItem();
            markSelectionAsUnprocessed = new ToolStripMenuItem();
            markSelectionAsUnscanned   = new ToolStripMenuItem();
            markAsGood          = new ToolStripMenuItem();
            markSelectionAsGood = new ToolStripMenuItem();
            viewSectorContents  = new ToolStripMenuItem();
            contextMenu.SuspendLayout();
            //
            // contextMenuStrip1
            //
            contextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[]
            {
                contextMenuTopItem,
                markAsUnprocessed,
                markSelectionAsUnprocessed,
                markSelectionAsUnscanned,
                markAsGood,
                markSelectionAsGood,
                viewSectorContents
            });
            contextMenu.Name    = "contextMenu";
            contextMenu.Size    = new System.Drawing.Size(240, 70);
            contextMenu.Closed += ContextMenu_Closed;
            //
            // markAsUnprocessed
            //
            markAsUnprocessed.Name   = "markAsUnprocessed";
            markAsUnprocessed.Size   = new System.Drawing.Size(239, 22);
            markAsUnprocessed.Text   = "Mark Sector As Unprocessed";
            markAsUnprocessed.Click += MarkAsUnprocessed_Click;
            //
            // markSelectionAsUnprocessed
            //
            markSelectionAsUnprocessed.Name   = "markSelectionAsUnprocessed";
            markSelectionAsUnprocessed.Size   = new System.Drawing.Size(239, 22);
            markSelectionAsUnprocessed.Text   = "Mark Selection As Unprocessed";
            markSelectionAsUnprocessed.Click += MarkSelectionAsUnprocessed_Click;
            //
            // markSelectionAsUnscanned
            //
            markSelectionAsUnscanned.Name   = "markSelectionAsUnscanned";
            markSelectionAsUnscanned.Size   = new System.Drawing.Size(239, 22);
            markSelectionAsUnscanned.Text   = "Mark Selection As Unscanned";
            markSelectionAsUnscanned.Click += MarkSelectionAsUnscanned_Click;
            //
            // markAsGood
            //
            markAsGood.Name   = "markAsGood";
            markAsGood.Size   = new System.Drawing.Size(239, 22);
            markAsGood.Text   = "Mark Sector As Good";
            markAsGood.Click += MarkAsGood_Click;
            //
            // markSelectionAsGood
            //
            markSelectionAsGood.Name   = "markSelectionAsGood";
            markSelectionAsGood.Size   = new System.Drawing.Size(239, 22);
            markSelectionAsGood.Text   = "Mark Selection As Good";
            markSelectionAsGood.Click += MarkSelectionAsGood_Click;
            //
            // viewSectorContents
            //
            viewSectorContents.Name   = "viewSectorContents";
            viewSectorContents.Size   = new System.Drawing.Size(239, 22);
            viewSectorContents.Text   = "View Sector Contents";
            viewSectorContents.Click += ViewSectorContents_Click;
            //\
            contextMenu.ResumeLayout(false);
        }