|
|
|
@ -39,29 +39,34 @@ namespace HexEditor.View
@@ -39,29 +39,34 @@ namespace HexEditor.View
|
|
|
|
|
|
|
|
|
|
void Init(object sender, EventArgs e) |
|
|
|
|
{ |
|
|
|
|
if (loaded) |
|
|
|
|
return; |
|
|
|
|
loaded = true; |
|
|
|
|
|
|
|
|
|
tbSizeToFit.Text = StringParser.Parse(tbSizeToFit.Text); |
|
|
|
|
|
|
|
|
|
ToolStripControlHost bytesPerLine = new ToolStripControlHost(tSTBCharsPerLine); |
|
|
|
|
this.toolStrip1.Items.Insert(1, bytesPerLine); |
|
|
|
|
|
|
|
|
|
ToolStripControlHost viewMode = new ToolStripControlHost(tCBViewMode); |
|
|
|
|
this.toolStrip1.Items.Insert(3, viewMode); |
|
|
|
|
|
|
|
|
|
hexEditControl.BytesPerLine = Settings.BytesPerLine; |
|
|
|
|
tSTBCharsPerLine.Text = hexEditControl.BytesPerLine.ToString(); |
|
|
|
|
this.hexEditControl.ContextMenuStrip = MenuService.CreateContextMenu(this.hexEditControl, "/AddIns/HexEditor/Editor/ContextMenu"); |
|
|
|
|
tCBViewMode.SelectedIndex = 0; |
|
|
|
|
|
|
|
|
|
tCBViewMode.SelectedItem = Settings.ViewMode.ToString(); |
|
|
|
|
hexEditControl.ViewMode = Settings.ViewMode; |
|
|
|
|
tbSizeToFit.Checked = hexEditControl.FitToWindowWidth = Settings.FitToWidth; |
|
|
|
|
tSTBCharsPerLine.Enabled = !Settings.FitToWidth; |
|
|
|
|
|
|
|
|
|
hexEditControl.Invalidate(); |
|
|
|
|
try { |
|
|
|
|
hexEditControl.Initializing = true; |
|
|
|
|
if (loaded) |
|
|
|
|
return; |
|
|
|
|
loaded = true; |
|
|
|
|
|
|
|
|
|
tbSizeToFit.Text = StringParser.Parse(tbSizeToFit.Text); |
|
|
|
|
|
|
|
|
|
ToolStripControlHost bytesPerLine = new ToolStripControlHost(tSTBCharsPerLine); |
|
|
|
|
this.toolStrip1.Items.Insert(1, bytesPerLine); |
|
|
|
|
|
|
|
|
|
ToolStripControlHost viewMode = new ToolStripControlHost(tCBViewMode); |
|
|
|
|
this.toolStrip1.Items.Insert(3, viewMode); |
|
|
|
|
|
|
|
|
|
hexEditControl.BytesPerLine = Settings.BytesPerLine; |
|
|
|
|
tSTBCharsPerLine.Text = hexEditControl.BytesPerLine.ToString(); |
|
|
|
|
this.hexEditControl.ContextMenuStrip = MenuService.CreateContextMenu(this.hexEditControl, "/AddIns/HexEditor/Editor/ContextMenu"); |
|
|
|
|
tCBViewMode.SelectedIndex = 0; |
|
|
|
|
|
|
|
|
|
tCBViewMode.SelectedItem = Settings.ViewMode.ToString(); |
|
|
|
|
hexEditControl.ViewMode = Settings.ViewMode; |
|
|
|
|
tbSizeToFit.Checked = hexEditControl.FitToWindowWidth = Settings.FitToWidth; |
|
|
|
|
tSTBCharsPerLine.Enabled = !Settings.FitToWidth; |
|
|
|
|
|
|
|
|
|
hexEditControl.Invalidate(); |
|
|
|
|
} finally { |
|
|
|
|
hexEditControl.Initializing = false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void TbSizeToFitClick(object sender, EventArgs e) |
|
|
|
|