diff --git a/Binxelview.csproj b/Binxelview.csproj index 9d6e411..a285899 100644 --- a/Binxelview.csproj +++ b/Binxelview.csproj @@ -63,6 +63,12 @@ BinaryChunkExportForm.cs + + Form + + + ViewForm.cs + @@ -71,6 +77,9 @@ BinaryChunkExportForm.cs + + ViewForm.cs + ResXFileCodeGenerator Resources.Designer.cs diff --git a/BinxelviewForm.Designer.cs b/BinxelviewForm.Designer.cs index f908333..51e8051 100644 --- a/BinxelviewForm.Designer.cs +++ b/BinxelviewForm.Designer.cs @@ -50,7 +50,7 @@ private void InitializeComponent() this.horizontalLayoutOptionsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.optionsMenuSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.gridOptionsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.snapScrollToNextStrideOptionsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.snapScrollOptionsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.optionsMenuSeparator3 = new System.Windows.Forms.ToolStripSeparator(); this.twiddleZOptionsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.twiddleNOptionsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); @@ -130,6 +130,7 @@ private void InitializeComponent() this.pixelsToPaletteContextItem = new System.Windows.Forms.ToolStripMenuItem(); this.pixelScroll = new System.Windows.Forms.VScrollBar(); this.toolTip = new System.Windows.Forms.ToolTip(this.components); + this.splitViewOptionsMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.menuStripMain.SuspendLayout(); this.tableTop.SuspendLayout(); this.groupPacking.SuspendLayout(); @@ -269,7 +270,8 @@ private void InitializeComponent() this.horizontalLayoutOptionsMenuItem, this.optionsMenuSeparator2, this.gridOptionsMenuItem, - this.snapScrollToNextStrideOptionsMenuItem, + this.snapScrollOptionsMenuItem, + this.splitViewOptionsMenuItem, this.optionsMenuSeparator3, this.twiddleZOptionsMenuItem, this.twiddleNOptionsMenuItem, @@ -334,14 +336,14 @@ private void InitializeComponent() this.gridOptionsMenuItem.Text = "&Grid Padding"; this.gridOptionsMenuItem.Click += new System.EventHandler(this.gridOptionsMenuItem_Click); // - // snapScrollToNextStrideOptionsMenuItem + // snapScrollOptionsMenuItem // - this.snapScrollToNextStrideOptionsMenuItem.Checked = true; - this.snapScrollToNextStrideOptionsMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; - this.snapScrollToNextStrideOptionsMenuItem.Name = "snapScrollToNextStrideOptionsMenuItem"; - this.snapScrollToNextStrideOptionsMenuItem.Size = new System.Drawing.Size(203, 22); - this.snapScrollToNextStrideOptionsMenuItem.Text = "Sna&p scroll to next stride"; - this.snapScrollToNextStrideOptionsMenuItem.Click += new System.EventHandler(this.snapScrollToNextStrideOptionsMenuItem_Click); + this.snapScrollOptionsMenuItem.Checked = true; + this.snapScrollOptionsMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; + this.snapScrollOptionsMenuItem.Name = "snapScrollOptionsMenuItem"; + this.snapScrollOptionsMenuItem.Size = new System.Drawing.Size(203, 22); + this.snapScrollOptionsMenuItem.Text = "Sna&p scroll to next stride"; + this.snapScrollOptionsMenuItem.Click += new System.EventHandler(this.snapScrollOptionsMenuItem_Click); // // optionsMenuSeparator3 // @@ -1377,6 +1379,13 @@ private void InitializeComponent() this.pixelScroll.TabStop = true; this.pixelScroll.Scroll += new System.Windows.Forms.ScrollEventHandler(this.pixelScroll_Scroll); // + // splitViewOptionsMenuItem + // + this.splitViewOptionsMenuItem.Name = "splitViewOptionsMenuItem"; + this.splitViewOptionsMenuItem.Size = new System.Drawing.Size(203, 22); + this.splitViewOptionsMenuItem.Text = "Pixel &Window"; + this.splitViewOptionsMenuItem.Click += new System.EventHandler(this.splitViewOptionsMenuItem_Click); + // // BinxelviewForm // this.AllowDrop = true; @@ -1391,6 +1400,7 @@ private void InitializeComponent() this.Text = "Binxelview"; this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.BinxelviewForm_FormClosed); this.Load += new System.EventHandler(this.BinxelviewForm_Load); + this.Shown += new System.EventHandler(this.BinxelviewForm_Shown); this.DragDrop += new System.Windows.Forms.DragEventHandler(this.BinxelviewForm_DragDrop); this.DragEnter += new System.Windows.Forms.DragEventHandler(this.BinxelviewForm_DragEnter); this.menuStripMain.ResumeLayout(false); @@ -1515,7 +1525,7 @@ private void InitializeComponent() private System.Windows.Forms.Button buttonZoom; private System.Windows.Forms.Button buttonZero; private System.Windows.Forms.ToolStripSeparator optionsMenuSeparator2; - private System.Windows.Forms.ToolStripMenuItem snapScrollToNextStrideOptionsMenuItem; + private System.Windows.Forms.ToolStripMenuItem snapScrollOptionsMenuItem; private System.Windows.Forms.ToolStripMenuItem verticalLayoutOptionsMenuItem; private System.Windows.Forms.ToolStripMenuItem horizontalLayoutOptionsMenuItem; private System.Windows.Forms.ToolStripMenuItem twiddleZOptionsMenuItem; @@ -1537,6 +1547,7 @@ private void InitializeComponent() private System.Windows.Forms.ToolStripSeparator optionsMenuSeparator1; private System.Windows.Forms.ToolStripMenuItem saveOnExitOptionsMenuItem; private System.Windows.Forms.ToolStripMenuItem saveCurrentOptionsMenuItem; + private System.Windows.Forms.ToolStripMenuItem splitViewOptionsMenuItem; } } diff --git a/BinxelviewForm.cs b/BinxelviewForm.cs index 2d81514..17c905b 100644 --- a/BinxelviewForm.cs +++ b/BinxelviewForm.cs @@ -7,6 +7,7 @@ using System.Windows.Forms; using static System.Windows.Forms.VisualStyles.VisualStyleElement.ProgressBar; using System.Xml.Linq; +using Binxelview.Dialogs; namespace Binxelview { @@ -54,6 +55,9 @@ enum PaletteMode Preset preset; List presets; + ViewForm split_view_form; + PictureBox view_box; + VScrollBar view_scroll; DirectoryInfo dir_cwd, dir_exe, dir_loc; string ini_exe, ini_loc; Bitmap palette_bmp = new Bitmap(PALETTE_DIM, PALETTE_DIM); @@ -69,6 +73,8 @@ enum PaletteMode bool disable_pixel_redraw = false; // used to temporarily block redraws during repeated updates Font posfont_regular, posfont_bold; Random random = new Random(); + int main_w, main_h; // used to restore size during split_view switch + int fixed_w, fixed_h; // settings int zoom; @@ -78,6 +84,7 @@ enum PaletteMode bool decimal_position; bool snap_scroll; bool horizontal_layout; + bool split_view; int twiddle; // Twiddle probably belongs in preset, but its use is very rare, and I didn't want it to take up panel space. // If something more important needs a PRESET_VERSION 3, we should add it then to the preset. // We could maybe place rare options like this into an "advanced" menu on the menu bar, @@ -331,6 +338,7 @@ void defaultOption() decimal_position = false; snap_scroll = true; horizontal_layout = false; + split_view = false; twiddle = 0; palette_path = ""; preset_dir = ""; @@ -470,6 +478,14 @@ string parseOption(string optline, string base_path, bool ini_file) snap_scroll = (v != 0); return ""; } + if (opt == "SPLITVIEW") + { + int v; + if (!int.TryParse(val,out v)) return "Could not parse integer for splitview: "+val; + if (v != 0 && v != 1) return "Splitview value must be 0 or 1: "+val; + split_view = (v != 0); + return ""; + } if (opt == "HORIZONTAL") { int v; @@ -562,6 +578,7 @@ string saveIni(string path) sw.WriteLine(string.Format("grid={0}",hidegrid ? 0 : 1)); sw.WriteLine(string.Format("hexpos={0}",decimal_position ? 0 : 1)); sw.WriteLine(string.Format("snapscroll={0}",snap_scroll ? 1 : 0)); + sw.WriteLine(string.Format("splitview={0}",split_view ? 1 : 0)); sw.WriteLine(string.Format("horizontal={0}",horizontal_layout ? 1 : 0)); sw.WriteLine(string.Format("twiddle={0}",twiddle)); sw.WriteLine("# end"); @@ -1097,8 +1114,8 @@ void autoPalette() // regenerate automatic palettes void scrollRange() { - if (pixelScroll.Value > data.Length) pixelScroll.Value = data.Length; - pixelScroll.Maximum = data.Length; + if (view_scroll.Value > data.Length) view_scroll.Value = data.Length; + view_scroll.Maximum = data.Length; next_increment_byte = preset.next_stride_byte * ((preset.height == 1) ? 16 : 1); next_increment_bit = preset.next_stride_bit * ((preset.height == 1) ? 16 : 1); @@ -1106,12 +1123,12 @@ void scrollRange() next_increment_byte += nb; next_increment_bit -= nb * 8; - pixelScroll.LargeChange = (next_increment_byte >= 0) ? next_increment_byte : -next_increment_byte; + view_scroll.LargeChange = (next_increment_byte >= 0) ? next_increment_byte : -next_increment_byte; - pixelScroll.SmallChange = 1; + view_scroll.SmallChange = 1; if (snap_scroll) { - pixelScroll.SmallChange = pixelScroll.LargeChange; + view_scroll.SmallChange = view_scroll.LargeChange; } } @@ -1122,9 +1139,9 @@ void updatePos(bool update_scroll = true) numericPosBit.Value = pos_bit; if (update_scroll) { - pixelScroll.Value = - ((int)pos_byte < pixelScroll.Minimum) ? pixelScroll.Minimum : - ((int)pos_byte > pixelScroll.Maximum) ? pixelScroll.Maximum : + view_scroll.Value = + ((int)pos_byte < view_scroll.Minimum) ? view_scroll.Minimum : + ((int)pos_byte > view_scroll.Maximum) ? view_scroll.Maximum : (int)pos_byte; } } @@ -1187,6 +1204,7 @@ bool openFile(string path) data_path = path; data_file = Path.GetFileName(path); this.Text = APPNAME + " (" + data_file + ")"; + split_view_form.Text = "Pixel (" + data_file + ")"; redrawPixels(); return true; } @@ -1440,8 +1458,8 @@ void redrawPixels() { if (disable_pixel_redraw) return; - int w = pixelBox.Width - 2; - int h = pixelBox.Height - 2; + int w = view_box.Width - 2; + int h = view_box.Height - 2; if (w < 1 || h < 1) return; if (pixel_bmp == null || @@ -1479,7 +1497,7 @@ void redrawPixels() renderGrid((pos_byte * 8) + pos_bit, gx, gy, padx, pady, sx, sy, true); renderGridColorToBitmap(pixel_bmp, zoom); - pixelBox.Image = pixel_bmp; + view_box.Image = pixel_bmp; } void redrawPreset() @@ -1587,7 +1605,8 @@ void redrawOptions() // make sure the UI state matches current options decimalPositionOptionsMenuItem.Checked = decimal_position; hexadecimalPositionOptionsMenuItem.Checked = !decimal_position; numericPosByte.Font = decimal_position ? posfont_regular : posfont_bold; - snapScrollToNextStrideOptionsMenuItem.Checked = snap_scroll; + snapScrollOptionsMenuItem.Checked = snap_scroll; + splitViewOptionsMenuItem.Checked = split_view; if (palette_mode != PaletteMode.PALETTE_CUSTOM) comboBoxPalette.SelectedIndex = (int)palette_mode - 1; verticalLayoutOptionsMenuItem.Checked = !horizontal_layout; @@ -1596,6 +1615,39 @@ void redrawOptions() // make sure the UI state matches current options twiddleNOptionsMenuItem.Checked = twiddle == 2; bgBox.BackColor = background; saveOnExitOptionsMenuItem.Checked = save_ini; + if (!split_view) + { + view_box = pixelBox; + view_scroll = pixelScroll; + if (split_view_form.Visible) + { + split_view_form.Hide(); + this.SetBounds(this.Left,this.Top,main_w,main_h); + pixelBox.Show(); // do this after SetBounds because it causes a pixelBox_Resize + pixelScroll.Show(); + scrollRange(); + } + } + else + { + view_box = split_view_form.getPixelBox(); + view_scroll = split_view_form.getPixelScroll(); + if (!split_view_form.Visible) + { + split_view_form.Show(); + this.SetBounds(this.Left,this.Top,fixed_w,fixed_h); + pixelBox.Hide(); + pixelScroll.Hide(); + scrollRange(); + } + } + } + + public void splitviewClose() + { + split_view = false; + redrawOptions(); + redrawPixels(); } // @@ -1701,9 +1753,10 @@ void presetMenu_Select(object sender, EventArgs e) // clicking on a generated pr int old_bpp = preset.bpp; preset = presets[index].copy(); if (old_bpp != preset.bpp && palette_mode != PaletteMode.PALETTE_RANDOM) autoPalette(); + scrollRange(); redrawPalette(); redrawPreset(); - scrollRange(); + redrawPixels(); } private void decimalPositionOptionsMenuItem_Click(object sender, EventArgs e) @@ -1741,13 +1794,20 @@ private void gridOptionsMenuItem_Click(object sender, EventArgs e) redrawPixels(); } - private void snapScrollToNextStrideOptionsMenuItem_Click(object sender, EventArgs e) + private void snapScrollOptionsMenuItem_Click(object sender, EventArgs e) { snap_scroll = !snap_scroll; redrawOptions(); scrollRange(); } + private void splitViewOptionsMenuItem_Click(object sender, EventArgs e) + { + split_view = !split_view; + redrawOptions(); + redrawPixels(); + } + private void twiddleZOptionsMenuItem_Click(object sender, EventArgs e) { if (twiddle == 1) twiddle = 0; @@ -2068,9 +2128,10 @@ private void buttonLoadPreset_Click(object sender, EventArgs e) int old_bpp = preset.bpp; preset = p; if (old_bpp != preset.bpp && palette_mode != PaletteMode.PALETTE_RANDOM) autoPalette(); + scrollRange(); redrawPalette(); redrawPreset(); - scrollRange(); + redrawPixels(); } else { @@ -2287,12 +2348,17 @@ private void buttonSavePal_Click(object sender, EventArgs e) // Pixel Panel (Design Linked) // - private void pixelBox_Resize(object sender, EventArgs e) + public void pixelBox_Resize(object sender, EventArgs e) { + if (!split_view) // remember window size in case split_view changes + { + main_w = this.Width; + main_h = this.Height; + } redrawPixels(); } - private void pixelBox_MouseMove(object sender, MouseEventArgs e) + public void pixelBox_MouseMove(object sender, MouseEventArgs e) { // clear selection selected_tile = -1; @@ -2370,7 +2436,7 @@ private void pixelBox_MouseMove(object sender, MouseEventArgs e) labelInfoPixel.Text = String.Format("{0:D}+{1:D1} = {2:D}\n{0:X8}+{1:D1} = {2:X}", (int)(pos>>3), (int)(pos&7), p); } - private void pixelScroll_Scroll(object sender, ScrollEventArgs e) + public void pixelScroll_Scroll(object sender, ScrollEventArgs e) { if (snap_scroll) { @@ -2499,7 +2565,7 @@ private void pixelsToPaletteContextItem_Click(object sender, EventArgs e) // Main Form // - protected override bool ProcessCmdKey(ref Message msg, Keys keyData) + public bool handleHotkeys(ref Message msg, Keys keyData) { // global hotkeys switch (keyData) @@ -2511,8 +2577,15 @@ protected override bool ProcessCmdKey(ref Message msg, Keys keyData) reloadFileMenuItem_Click(this, null); return true; default: - return base.ProcessCmdKey(ref msg, keyData); + return false; } + + } + + protected override bool ProcessCmdKey(ref Message msg, Keys keyData) + { + if (handleHotkeys(ref msg,keyData)) return true; + return base.ProcessCmdKey(ref msg, keyData); } private void BinxelviewForm_DragDrop(object sender, DragEventArgs e) @@ -2543,11 +2616,18 @@ private void BinxelviewForm_Load(object sender, EventArgs e) disable_pixel_redraw = true; // additional form setup + view_box = pixelBox; + view_scroll = pixelScroll; + split_view_form = new ViewForm(this,pixelBox.ContextMenuStrip); posfont_regular = new Font(numericPosByte.Font, FontStyle.Regular); posfont_bold = new Font(numericPosByte.Font, FontStyle.Bold); comboBoxPalette.SelectedIndex = (int)PaletteMode.PALETTE_RGB - 1; numericZoom.Minimum = 1; numericZoom.Maximum = ZOOM_MAX; + fixed_w = this.Width; // default width is fixed width + fixed_h = this.Height - (pixelScroll.Height + 0); // fixed height should cut off pixel view entirely + main_w = this.Width; + main_h = this.Height; // set default options defaultOption(); @@ -2590,6 +2670,11 @@ private void BinxelviewForm_Load(object sender, EventArgs e) } if (arg_err.Length > 0) MessageBox.Show("Command line error:\n" + arg_err, APPNAME); + // Setup is finished, will complete during BinxelviewForm_Shown. + } + + private void BinxelviewForm_Shown(object sender, EventArgs e) + { autoPalette(); scrollRange(); redrawOptions(); diff --git a/Dialogs/BinaryChunkExportForm.Designer.cs b/Dialogs/BinaryChunkExportForm.Designer.cs index e9c3f8d..b3fb63c 100644 --- a/Dialogs/BinaryChunkExportForm.Designer.cs +++ b/Dialogs/BinaryChunkExportForm.Designer.cs @@ -28,6 +28,7 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BinaryChunkExportForm)); this.startLabel = new System.Windows.Forms.Label(); this.startNumericUpDown = new System.Windows.Forms.NumericUpDown(); this.lengthNumericUpDown = new System.Windows.Forms.NumericUpDown(); @@ -117,6 +118,7 @@ private void InitializeComponent() this.Controls.Add(this.startNumericUpDown); this.Controls.Add(this.startLabel); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "BinaryChunkExportForm"; diff --git a/Dialogs/BinaryChunkExportForm.resx b/Dialogs/BinaryChunkExportForm.resx index e85714f..e171e17 100644 --- a/Dialogs/BinaryChunkExportForm.resx +++ b/Dialogs/BinaryChunkExportForm.resx @@ -120,4 +120,33 @@ 17, 17 + + + + AAABAAEAEBAAAAAAAABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAgMCAAAAAAAAAAAAAAAAAAQFAwIA + AAAAAAAAAAAAAAAABQUDAgAAAAAAAAAAAAAAAAAFBQMCAAAAAAAAAAAAAAAAAAUGBAIAAAAAAAAAAAAA + AAAABQQEBwAAAAAAAAAAAAAAAAAFAwQBAAAAAAAAAAAAAAAAAAYDBAEAAAAAAAAAAAAAAAAABgMEAQgI + CQoAAAAAAAAAAAAGAQgICgAAAAAAAAAAAAAAAAgICgkAAAAAAAAAAAAACAgKCQkAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//AADf/wAAj/8AAIf/AADD/wAA4f8EBvD/AwL4fwAA/DsAAP4Z + AAD/AAAA/4MAAP/DAAD+BwYE//8FA///AAA= + + \ No newline at end of file diff --git a/Dialogs/ViewForm.Designer.cs b/Dialogs/ViewForm.Designer.cs new file mode 100644 index 0000000..3467297 --- /dev/null +++ b/Dialogs/ViewForm.Designer.cs @@ -0,0 +1,106 @@ +namespace Binxelview.Dialogs +{ + partial class ViewForm + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ViewForm)); + this.tableBase = new System.Windows.Forms.TableLayoutPanel(); + this.pixelBox = new System.Windows.Forms.PictureBox(); + this.pixelScroll = new System.Windows.Forms.VScrollBar(); + this.tableBase.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pixelBox)).BeginInit(); + this.SuspendLayout(); + // + // tableBase + // + this.tableBase.AutoSize = true; + this.tableBase.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; + this.tableBase.ColumnCount = 2; + this.tableBase.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableBase.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 24F)); + this.tableBase.Controls.Add(this.pixelBox, 0, 0); + this.tableBase.Controls.Add(this.pixelScroll, 1, 0); + this.tableBase.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableBase.Location = new System.Drawing.Point(0, 0); + this.tableBase.Name = "tableBase"; + this.tableBase.RowCount = 1; + this.tableBase.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); + this.tableBase.Size = new System.Drawing.Size(542, 518); + this.tableBase.TabIndex = 1; + // + // pixelBox + // + this.pixelBox.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.pixelBox.Dock = System.Windows.Forms.DockStyle.Fill; + this.pixelBox.Location = new System.Drawing.Point(3, 3); + this.pixelBox.Name = "pixelBox"; + this.pixelBox.Size = new System.Drawing.Size(512, 512); + this.pixelBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pixelBox.TabIndex = 1; + this.pixelBox.TabStop = false; + this.pixelBox.MouseMove += new System.Windows.Forms.MouseEventHandler(this.pixelBox_MouseMove); + this.pixelBox.Resize += new System.EventHandler(this.pixelBox_Resize); + // + // pixelScroll + // + this.pixelScroll.Dock = System.Windows.Forms.DockStyle.Fill; + this.pixelScroll.LargeChange = 1; + this.pixelScroll.Location = new System.Drawing.Point(518, 0); + this.pixelScroll.Maximum = 0; + this.pixelScroll.Name = "pixelScroll"; + this.pixelScroll.Size = new System.Drawing.Size(24, 518); + this.pixelScroll.TabIndex = 1; + this.pixelScroll.TabStop = true; + this.pixelScroll.Scroll += new System.Windows.Forms.ScrollEventHandler(this.pixelScroll_Scroll); + // + // ViewForm + // + this.AllowDrop = true; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(542, 518); + this.Controls.Add(this.tableBase); + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.Name = "ViewForm"; + this.Text = "Pixels"; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ViewForm_FormClosing); + this.tableBase.ResumeLayout(false); + this.tableBase.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pixelBox)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.TableLayoutPanel tableBase; + private System.Windows.Forms.PictureBox pixelBox; + private System.Windows.Forms.VScrollBar pixelScroll; + } +} \ No newline at end of file diff --git a/Dialogs/ViewForm.cs b/Dialogs/ViewForm.cs new file mode 100644 index 0000000..06a0b8f --- /dev/null +++ b/Dialogs/ViewForm.cs @@ -0,0 +1,61 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; + +namespace Binxelview.Dialogs +{ + public partial class ViewForm : Form + { + BinxelviewForm binxelview_form; + + public ViewForm(BinxelviewForm parent_form, ContextMenuStrip context_strip) + { + InitializeComponent(); + binxelview_form = parent_form; + pixelBox.ContextMenuStrip = context_strip; + } + + private void pixelBox_MouseMove(object sender, MouseEventArgs e) + { + binxelview_form.pixelBox_MouseMove(sender, e); + } + + private void pixelBox_Resize(object sender, EventArgs e) + { + binxelview_form.pixelBox_Resize(sender, e); + } + + private void ViewForm_FormClosing(object sender, FormClosingEventArgs e) + { + // cancel the close, let the parent hide this window instead + e.Cancel = true; + binxelview_form.splitviewClose(); + } + + public PictureBox getPixelBox() + { + return pixelBox; + } + + public VScrollBar getPixelScroll() + { + return pixelScroll; + } + + private void pixelScroll_Scroll(object sender, ScrollEventArgs e) + { + binxelview_form.pixelScroll_Scroll(sender, e); + } + + protected override bool ProcessCmdKey(ref Message msg, Keys keyData) + { + if (binxelview_form.handleHotkeys(ref msg,keyData)) return true; + return base.ProcessCmdKey(ref msg, keyData); + } + } +} diff --git a/Dialogs/ViewForm.resx b/Dialogs/ViewForm.resx new file mode 100644 index 0000000..d0d78dc --- /dev/null +++ b/Dialogs/ViewForm.resx @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + AAABAAEAEBAAAAAAAABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAB1EAAA7ZwAAdq0AAFOEAACFvwAAcacAAEBtADAwMABoaGgAUFBQAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAgMCAAAAAAAAAAAAAAAAAAQFAwIA + AAAAAAAAAAAAAAAABQUDAgAAAAAAAAAAAAAAAAAFBQMCAAAAAAAAAAAAAAAAAAUGBAIAAAAAAAAAAAAA + AAAABQQEBwAAAAAAAAAAAAAAAAAFAwQBAAAAAAAAAAAAAAAAAAYDBAEAAAAAAAAAAAAAAAAABgMEAQgI + CQoAAAAAAAAAAAAGAQgICgAAAAAAAAAAAAAAAAgICgkAAAAAAAAAAAAACAgKCQkAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//AADf/wAAj/8AAIf/AADD/wAA4f8EBvD/AwL4fwAA/DsAAP4Z + AAD/AAAA/4MAAP/DAAD+BwYE//8FA///AAA= + + + \ No newline at end of file diff --git a/readme.txt b/readme.txt index 41bcd7b..1a380c7 100644 --- a/readme.txt +++ b/readme.txt @@ -226,6 +226,9 @@ For an INI file, paths can be either absolute or relative to the INI file's dire -snapscroll=1 Set the "Snap scroll to next stride" option (1 on, 0 off). + -splitview=1 + Set the "Pixel Window" option to create a separate viewing window (1 on, 0 off). + -horizontal=1 Set the layout option (1 horizontal, 0 vertical). @@ -294,6 +297,7 @@ Changes - Microsoft RIFF palette support. - Option persistence, INI file save and load. - Removed default preset, as persistent options will remember your last preset instead. +- Pixel window option for second viewing window. 1.5.0.0 (2020-07-31) - Twiddle option for inspecting textures stored with morton ordering of pixels.