public ChangeLogDialog(TerminalConnection current) { // // Windows フォーム デザイナ サポートに必要です。 // InitializeComponent(); this._logTypeLabel.Text = GApp.Strings.GetString("Form.ChangeLog._logTypeLabel"); this._fileNameLabel.Text = GApp.Strings.GetString("Form.ChangeLog._fileNameLabel"); this._cancelButton.Text = GApp.Strings.GetString("Common.Cancel"); this._okButton.Text = GApp.Strings.GetString("Common.OK"); this.Text = GApp.Strings.GetString("Form.ChangeLog.Text"); // // _connection = current; _logTypeBox.SelectedIndex = _logTypeBox.FindStringExact(EnumDescAttributeT.For(typeof(LogType)).GetDescription(_connection.LogType)); if (_connection.LogType != LogType.None) { _fileNameBox.Items.Add(_connection.LogPath); _fileNameBox.SelectedIndex = 0; } foreach (string p in GApp.ConnectionHistory.LogPaths) { _fileNameBox.Items.Add(p); } AdjustUI(); }
private void AdjustUI() { bool e = ((LogType)EnumDescAttributeT.For(typeof(LogType)).FromDescription(_logTypeBox.Text, LogType.None) != LogType.None); _fileNameBox.Enabled = e; _selectlogButton.Enabled = e; }
public EditRenderProfile(RenderProfile prof) { // // Windows フォーム デザイナ サポートに必要です。 // InitializeComponent(); _imageStyleBox.Items.AddRange(EnumDescAttributeT.For(typeof(ImageStyle)).DescriptionCollection()); this._bgColorLabel.Text = GApp.Strings.GetString("Form.EditRenderProfile._bgColorLabel"); this._textColorLabel.Text = GApp.Strings.GetString("Form.EditRenderProfile._textColorLabel"); this._fontSelectButton.Text = GApp.Strings.GetString("Form.EditRenderProfile._fontSelectButton"); this._fontLabel.Text = GApp.Strings.GetString("Form.EditRenderProfile._fontLabel"); this._backgroundImageLabel.Text = GApp.Strings.GetString("Form.EditRenderProfile._backgroungImageLabel"); this._imageStyleLabel.Text = GApp.Strings.GetString("Form.EditRenderProfile._imageStyleLabel"); this._cancelButton.Text = GApp.Strings.GetString("Common.Cancel"); this._okButton.Text = GApp.Strings.GetString("Common.OK"); this._fontSample.Text = GApp.Strings.GetString("Common.FontSample"); this._editColorEscapeSequence.Text = GApp.Strings.GetString("Form.EditRenderProfile._editEscapeSequenceColorBox"); this.Text = GApp.Strings.GetString("Form.EditRenderProfile.Text"); // // TODO: InitializeComponent 呼び出しの後に、コンストラクタ コードを追加してください。 // _profile = new RenderProfile(prof == null? GEnv.DefaultRenderProfile : prof); InitUI(); }
public LineFeedStyleDialog(TerminalConnection con) { // // Windows フォーム デザイナ サポートに必要です。 // InitializeComponent(); // // this._cancelButton.Text = GApp.Strings.GetString("Common.Cancel"); this._okButton.Text = GApp.Strings.GetString("Common.OK"); this._lineFeedLabel.Text = GApp.Strings.GetString("Form.LineFeedStyleDialog._lineFeedLabel"); this.Text = GApp.Strings.GetString("Form.LineFeedStyleDialog.Text"); this._lineFeedBox.Items.AddRange(EnumDescAttributeT.For(typeof(LineFeedRule)).DescriptionCollection()); this._lineFeedBox.SelectedIndex = (int)con.Param.LineFeedRule; }
private void OnOK(object sender, EventArgs args) { this.DialogResult = DialogResult.None; LogType t = (LogType)EnumDescAttributeT.For(typeof(LogType)).FromDescription(_logTypeBox.Text, LogType.None); string path = null; bool append = false; if (t != LogType.None) { path = _fileNameBox.Text; LogFileCheckResult r = GCUtil.CheckLogFileName(path, this); if (r == LogFileCheckResult.Cancel || r == LogFileCheckResult.Error) { return; } append = (r == LogFileCheckResult.Append); } _connection.ResetLog(t, path, append); this.DialogResult = DialogResult.OK; }
/// <summary> /// デザイナ サポートに必要なメソッドです。このメソッドの内容を /// コード エディタで変更しないでください。 /// 消えちゃ困るコードの避難場所 /// this._logTypeBox.Items.AddRange(EnumDescAttributeT.For(typeof(LogType)).DescriptionCollection()); /// </summary> private void InitializeComponent() { this._logTypeBox = new ComboBox(); this._logTypeLabel = new System.Windows.Forms.Label(); this._fileNameBox = new ComboBox(); this._fileNameLabel = new System.Windows.Forms.Label(); this._selectlogButton = new Button(); this._cancelButton = new System.Windows.Forms.Button(); this._okButton = new System.Windows.Forms.Button(); this.SuspendLayout(); // // _logTypeBox // this._logTypeBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this._logTypeBox.Location = new System.Drawing.Point(104, 8); this._logTypeBox.Name = "_logTypeBox"; this._logTypeBox.Size = new System.Drawing.Size(96, 20); this._logTypeBox.TabIndex = 1; this._logTypeBox.SelectedIndexChanged += new System.EventHandler(this.OnLogTypeChanged); this._logTypeBox.Items.AddRange(EnumDescAttributeT.For(typeof(LogType)).DescriptionCollection()); // // _logTypeLabel // this._logTypeLabel.ImeMode = System.Windows.Forms.ImeMode.NoControl; this._logTypeLabel.Location = new System.Drawing.Point(5, 8); this._logTypeLabel.Name = "_logTypeLabel"; this._logTypeLabel.RightToLeft = System.Windows.Forms.RightToLeft.No; this._logTypeLabel.Size = new System.Drawing.Size(80, 16); this._logTypeLabel.TabIndex = 0; this._logTypeLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // _fileNameBox // this._fileNameBox.Location = new System.Drawing.Point(104, 32); this._fileNameBox.Name = "_fileNameBox"; this._fileNameBox.Size = new System.Drawing.Size(160, 20); this._fileNameBox.TabIndex = 3; // // _fileNameLabel // this._fileNameLabel.ImeMode = System.Windows.Forms.ImeMode.NoControl; this._fileNameLabel.Location = new System.Drawing.Point(5, 32); this._fileNameLabel.Name = "_fileNameLabel"; this._fileNameLabel.RightToLeft = System.Windows.Forms.RightToLeft.No; this._fileNameLabel.Size = new System.Drawing.Size(88, 16); this._fileNameLabel.TabIndex = 2; this._fileNameLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // _selectlogButton // this._selectlogButton.FlatStyle = System.Windows.Forms.FlatStyle.System; this._selectlogButton.ImageIndex = 0; this._selectlogButton.ImeMode = System.Windows.Forms.ImeMode.NoControl; this._selectlogButton.Location = new System.Drawing.Point(269, 32); this._selectlogButton.Name = "_selectlogButton"; this._selectlogButton.RightToLeft = System.Windows.Forms.RightToLeft.No; this._selectlogButton.Size = new System.Drawing.Size(19, 19); this._selectlogButton.TabIndex = 4; this._selectlogButton.Text = "..."; this._selectlogButton.Click += new System.EventHandler(this.OnSelectLogFile); // // _cancelButton // this._cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel; this._cancelButton.ImageIndex = 0; this._cancelButton.FlatStyle = FlatStyle.System; this._cancelButton.ImeMode = System.Windows.Forms.ImeMode.NoControl; this._cancelButton.Location = new System.Drawing.Point(216, 56); this._cancelButton.Name = "_cancelButton"; this._cancelButton.RightToLeft = System.Windows.Forms.RightToLeft.No; this._cancelButton.Size = new System.Drawing.Size(72, 25); this._cancelButton.TabIndex = 6; // // _okButton // this._okButton.DialogResult = System.Windows.Forms.DialogResult.OK; this._okButton.ImageIndex = 0; this._okButton.FlatStyle = FlatStyle.System; this._okButton.ImeMode = System.Windows.Forms.ImeMode.NoControl; this._okButton.Location = new System.Drawing.Point(128, 56); this._okButton.Name = "_okButton"; this._okButton.RightToLeft = System.Windows.Forms.RightToLeft.No; this._okButton.Size = new System.Drawing.Size(72, 25); this._okButton.TabIndex = 5; this._okButton.Click += new System.EventHandler(this.OnOK); // // ChangeLogDialog // this.AcceptButton = this._okButton; this.AutoScaleBaseSize = new System.Drawing.Size(5, 12); this.CancelButton = this._cancelButton; this.ClientSize = new System.Drawing.Size(292, 85); this.Controls.AddRange(new System.Windows.Forms.Control[] { this._cancelButton, this._okButton, this._logTypeBox, this._logTypeLabel, this._fileNameBox, this._fileNameLabel, this._selectlogButton }); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "ChangeLogDialog"; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.ResumeLayout(false); }