public DisassemblerControl()
{
Width = 100;
Height = 100;
Label alphaLabel = new Label()
{
Text = "Disassembler is in pre-pre-alpha stage. Don't expect perfect results.",
Location = new Point(3,5),
Height = 20,
Width = 400,
};
Label offsetLabel = new Label()
{
Location = new Point(3, 30),
Width = 50,
Text = "Offset:",
};
offsetBox = new TextBox()
{
Width = 100,
Location = new Point(offsetLabel.Left + offsetLabel.Width + 5, offsetLabel.Top - 3),
};
Label sizeLabel = new Label()
{
Location = new Point(offsetBox.Right + 10, 30),
Width = 50,
Text = "Size:",
};
sizeBox = new TextBox()
{
Width = 100,
Location = new Point(sizeLabel.Right + 5, sizeLabel.Top - 3),
};
disassembleButton = new Button()
{
Text = "Disassemble",
Location = new Point(sizeBox.Right + 10, sizeBox.Top - 1),
};
analyseButton = new Button()
{
Text = "Analyse",
Location = new Point(disassembleButton.Right + 5, disassembleButton.Top),
};
progressBar = new ProgressBar()
{
Width = 10,
Height = 15,
Anchor = AnchorStyles.Left | AnchorStyles.Right,
Visible = false,
};
progressBar.Location = new Point(this.Width / 2 - progressBar.Width / 2, this.Height / 2 - progressBar.Height / 2);
disassemblyView = new ListView()
{
Location = new Point(0, sizeBox.Bottom + 7),
Width = this.Width,
Height = this.Height - (sizeBox.Bottom + 7),
View = View.Details,
Anchor = AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Bottom,
FullRowSelect = true,
UseCompatibleStateImageBehavior = false,
};
disassemblyView.Columns.AddRange(new ColumnHeader[] {
new ColumnHeader() { Text = "Offset", Width = 75,},
new ColumnHeader() { Text = "Bytes" , Width = 100,},
new ColumnHeader() { Text = "Disassembly", Width = 200,},
new ColumnHeader() { Text = "Comment", Width = 100},
});
disassembleButton.Click += disassembleButton_Click;
analyseButton.Click += analyseButton_Click;
this.Controls.AddRange(new Control[] {
alphaLabel,
offsetLabel,
offsetBox,
sizeLabel,
sizeBox,
disassembleButton,
analyseButton,
disassemblyView,
progressBar,
});
progressBar.BringToFront();
}