public DumpWindow(SubViewControl tmp) : base(Gtk.WindowType.Toplevel) { SubViewCtrl = tmp; this.Build(); int maxIndex = 4; Type[] t = new Type[maxIndex]; for (int i = 0; i < maxIndex; i++) { t [i] = typeof(string); } ListStore tmpListStore = new ListStore(t); tmpListStore.AppendValues("1", "Hex", "1", "2"); tmpListStore.AppendValues("1", "Hex", "3", "4"); tmpListStore.AppendValues(ROW_TERMINATOR, ""); treeviewMain.Model = tmpListStore; ConstructAppearance(treeviewMain); buttonRequest.Clicked += new EventHandler(requestButton_Click); buttonMake.Clicked += new EventHandler(makeButton_Click); buttonCopy.Clicked += new EventHandler(copyToClipBoardButton_Click); entryVariable.KeyPressEvent += new KeyPressEventHandler(variableTextBox_KeyDown); this.ShowAll(); }
public TerminalForm(SubViewControl tmp) { subViewCtrl = tmp; InitializeComponent(); lineEndingComboBox.Items.Clear(); LineEndingItem item; item = new LineEndingItem(); item.Name = "No line ending"; item.Delimter = ""; lineEndingComboBox.Items.Add(item); item = new LineEndingItem(); item.Name = "New line"; item.Delimter = "\n"; lineEndingComboBox.Items.Add(item); item = new LineEndingItem(); item.Name = "Carriage return"; item.Delimter = "\r"; lineEndingComboBox.Items.Add(item); item = new LineEndingItem(); item.Name = "Both NL & CR"; item.Delimter = "\r\n"; lineEndingComboBox.Items.Add(item); lineEndingComboBox.SelectedIndex = 1; }
public DumpForm(SubViewControl tmp) { SubViewCtrl = tmp; InitializeComponent(); dataGridView1.Rows.Add(); // Redefined Column Name dataGridView1.Columns[0].Name = DgvRowName.Size.ToString(); dataGridView1.Columns[1].Name = DgvRowName.Type.ToString(); dataGridView1.Rows[0].Cells[(int)DgvRowName.Size].Value = "1"; dataGridView1.Rows[0].Cells[(int)DgvRowName.Type].Value = numeralSystem.HEX; }
public MainWindow() : base(Gtk.WindowType.Toplevel) { Build(); this.Title = WINDOW_TITLE; subViewControl1 = new SubViewControl(); vboxMain.Add(subViewControl1); openViewFileAction.Activated += new EventHandler(openViewFileToolStripMenuItem_Click); openMapFileAction.Activated += new EventHandler(openMapFileToolStripMenuItem_Click); saveViewFileAction.Activated += new EventHandler(saveViewFileToolStripMenuItem_Click); saveMapFileAction.Activated += new EventHandler(saveMapFileToolStripMenuItem_Click); SetupAction.Activated += new EventHandler(optionsToolStripMenuItem_Click); ExitAction.Activated += new EventHandler(exitToolStripMenuItem_Click); AboutAction.Activated += new EventHandler(aboutToolStripMenuItem_Click); }
public DumpForm(SubViewControl tmp) { subViewCtrl = tmp; InitializeComponent(); this.sizeColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.typeColumn = new System.Windows.Forms.DataGridViewComboBoxColumn(); this.dumpDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.sizeColumn, this.typeColumn }); // // sizeColumn // //this.sizeColumn.DataPropertyName = "Size"; this.sizeColumn.HeaderText = "Size"; this.sizeColumn.Name = FixedColumns.Size.ToString(); this.sizeColumn.Width = 42; // // typeColumn // //this.typeColumn.DataPropertyName = "Type"; this.typeColumn.DisplayStyle = System.Windows.Forms.DataGridViewComboBoxDisplayStyle.ComboBox; this.typeColumn.HeaderText = "Type"; this.typeColumn.Name = FixedColumns.Type.ToString(); this.typeColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.typeColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; this.typeColumn.Width = 48; dumpDataGridView.Rows.Add(); System.Data.DataTable typeTable = new System.Data.DataTable("typeTable"); typeTable.Columns.Add("Display", typeof(string)); typeTable.Rows.Add(UserType.Hex); typeTable.Rows.Add(UserType.UsD); typeTable.Rows.Add(UserType.Dec); typeTable.Rows.Add(UserType.FLT); typeTable.Rows.Add(UserType.DBL); (dumpDataGridView.Columns[(int)FixedColumns.Type] as DataGridViewComboBoxColumn).ValueType = typeof(string); (dumpDataGridView.Columns[(int)FixedColumns.Type] as DataGridViewComboBoxColumn).ValueMember = "Display"; (dumpDataGridView.Columns[(int)FixedColumns.Type] as DataGridViewComboBoxColumn).DisplayMember = "Display"; (dumpDataGridView.Columns[(int)FixedColumns.Type] as DataGridViewComboBoxColumn).DataSource = typeTable; dumpDataGridView.Rows[0].Cells[(int)FixedColumns.Size].Value = "1"; dumpDataGridView.Rows[0].Cells[(int)FixedColumns.Type].Value = UserType.Hex.ToString(); var test = new List <byte>(); test.Add(0xaa); test.Add(0x08); test.Add(0x00); test.Add(0xbb); hexboxAddress = 0; hexboxOffsetAddress = 0; mainHexBox.ByteProvider = new DynamicByteProvider(test); mainHexBox.LineInfoOffset = hexboxOffsetAddress; if ((subViewCtrl.MapList != null) && (subViewCtrl.MapList.Count > 0)) { symbolTextBox.AutoCompleteMode = AutoCompleteMode.Suggest; symbolTextBox.AutoCompleteSource = AutoCompleteSource.CustomSource; autoCompleteSourceForSymbol = new AutoCompleteStringCollection(); foreach (var factor in subViewCtrl.MapList) { autoCompleteSourceForSymbol.Add(factor.Symbol); } symbolTextBox.AutoCompleteCustomSource = autoCompleteSourceForSymbol; } }
public OptionDialog(SubViewControl tmp) { this.Build(); SubViewCtrl = tmp; SubViewControl.Components.CommMode commMode = SubViewCtrl.myComponents.CommunicationMode; if (commMode == SubViewControl.Components.CommMode.NetWork) { radiobuttonNetwork.Active = true; } else { radiobuttonSerial.Active = true; } string[] PortList = System.IO.Ports.SerialPort.GetPortNames(); ListStore comboModelPort = new ListStore(typeof(string)); comboboxCommPort.Model = comboModelPort; bool foundFlg = false; int index = 0; foreach (var PortName in PortList) { comboModelPort.AppendValues(PortName); if (PortName == SubViewCtrl.myComponents.CommPort) { comboboxCommPort.Active = index; foundFlg = true; } index++; } if ((foundFlg == false) && (PortList.Length > 0)) { comboboxCommPort.Active = PortList.Length - 1; } entryLocalIP.Text = SubViewCtrl.myComponents.NetIP; entryLocalPort.Text = SubViewCtrl.myComponents.NetPort.ToString(); BaudRateItems = new List <BaudRateItem> (); BaudRateItems.Add(new BaudRateItem("4800bps", 4800)); BaudRateItems.Add(new BaudRateItem("9600bps", 9600)); BaudRateItems.Add(new BaudRateItem("19200bps", 19200)); BaudRateItems.Add(new BaudRateItem("38400bps", 38400)); BaudRateItems.Add(new BaudRateItem("57600bps", 57600)); BaudRateItems.Add(new BaudRateItem("115200bps", 115200)); ListStore comboModel = new ListStore(typeof(string)); comboboxBaudRate.Model = comboModel; index = 0; foreach (BaudRateItem item in BaudRateItems) { comboModel.AppendValues(item.Ailias); if (item.Value == SubViewCtrl.myComponents.CommBaudRate) { comboboxBaudRate.Active = index; } index++; } entryPassword.Text = SubViewCtrl.myComponents.Password; CommProtocol.Components.RmAddr adrWidth = SubViewCtrl.myCommProtocol.myComponents.SelectByte; if (adrWidth == CommProtocol.Components.RmAddr.Byte4) { radiobuttonAddrWd4byte.Active = true; } else { radiobuttonAddrWd2byte.Active = true; } buttonOk.Clicked += new EventHandler(buttonOk_Click); buttonCancel.Clicked += new EventHandler(buttonCancel_Click); }
public MainForm(string[] args) { InitializeComponent(); this.Text = AssemblyProduct; subViewCtrl = new SubViewControl(); mainPanel.Controls.Add(subViewCtrl); subViewCtrl.Dock = DockStyle.Fill; if (IsValidRequestCommandLine(args)) { subViewCtrl.SetTargetVersionName(string.Empty); subViewCtrl.LoadViewSettingFile(new ViewSetting()); subViewCtrl.RunRemoteServerAsync(); } else { CommMainCtrl.CommunicationMode mode; if (Enum.TryParse <CommMainCtrl.CommunicationMode>(Properties.Settings.Default.CommMode, out mode)) { subViewCtrl.Config.CommMode = mode; } CommInstructions.RmAddr range; if (Enum.TryParse <CommInstructions.RmAddr>(Properties.Settings.Default.RmRange, out range)) { subViewCtrl.Config.RmRange = range; } subViewCtrl.Config.BaudRate = Properties.Settings.Default.BaudRate; subViewCtrl.Config.SerialPortName = Properties.Settings.Default.SerialPortName; System.Net.IPAddress clientAddress; if (System.Net.IPAddress.TryParse(Properties.Settings.Default.ClientAddress, out clientAddress)) { subViewCtrl.Config.ClientAddress = clientAddress; } subViewCtrl.Config.ClientPort = Properties.Settings.Default.ClientPort; System.Net.IPAddress serverAddress; if (System.Net.IPAddress.TryParse(Properties.Settings.Default.ServerAddress, out serverAddress)) { subViewCtrl.Config.ServerAddress = serverAddress; } subViewCtrl.Config.ServerPort = Properties.Settings.Default.ServerPort; if (Properties.Settings.Default.PassNumber <= UInt32.MaxValue) { subViewCtrl.Config.PassNumber = Properties.Settings.Default.PassNumber; } if (!loadViewFile(Properties.Settings.Default.PathViewFileName)) { pathViewFileName = null; DefaultViewSettings(); } else { pathViewFileName = Properties.Settings.Default.PathViewFileName; } } }
} /* class BuadRateItem */ public OptionForm(SubViewControl tmp) { SubViewCtrl = tmp; InitializeComponent(); }