private void panel_Control_MouseClick(object sender, MouseEventArgs e) { ClsDatMotion clMotion = ClsSystem.GetSelectMotion(); if (clMotion == null) { return; } //以下、アイテム選択処理 int inLineNo = this.GetLineNoFromPositionY(e.Y); ClsSystem.SetSelectFromLineNo(inLineNo); ClsDatElem clElem = ClsSystem.GetElemFromLineNo(inLineNo); if (clElem != null) { if (inLineNo == clElem.mLineNo) { //Click Eye if (0 <= e.X && e.X < 17) { clElem.isDisplay = !clElem.isDisplay; } //Click Parent if (17 <= e.X && e.X < 34) { if (clElem.mElem != null) { clElem.isParent = !clElem.isParent; } } //Click Locked if (34 <= e.X && e.X < 51) { clElem.isLocked = !clElem.isLocked; } //Attribute Open if (51 <= e.X && e.X < 68) { clElem.isOpen = !clElem.isOpen; clMotion.RefreshLineNo(); //行番号とタブを割り振る処理 } } } //以下、コントロール更新処理 this.RefreshControl(); this.panel_Control.Refresh(); this.panel_Time.Refresh(); this.mFormMain.Refresh(); }
/// <summary> /// 現在選択中のエレメントを取得する /// オプションを選択中の場合は、その親のエレメントを取得する /// </summary> /// <returns>現在選択中のエレメント</returns> public static ClsDatElem GetElemFromSelectLineNo() { int inLineNo = ClsSystem.GetSelectLineNo(); if (inLineNo < 0) { return(null); } ClsDatElem clElem = ClsSystem.GetElemFromLineNo(inLineNo); return(clElem); }
private void panel_Control_MouseDoubleClick(object sender, MouseEventArgs e) { ClsDatMotion clMotion = ClsSystem.GetSelectMotion(); if (clMotion == null) { return; } //Item選択 int inLineNo = this.GetLineNoFromPositionY(e.Y); //以下、エレメント選択処理 ClsSystem.SetSelectFromLineNo(inLineNo); //Item最大数を確認 ClsDatElem clElem = ClsSystem.GetElemFromLineNo(inLineNo); if (clElem != null) { if (e.X > 69) { //以下、テキストボックス削除処理 this.RemoveTextBoxName(); //以下、テキストボックス生成処理 this.mTextBox = new TextBox(); this.mTextBox.Location = new System.Drawing.Point(69, inLineNo * FormControl.CELL_HEIGHT - 1); this.mTextBox.Font = new System.Drawing.Font("MS ゴシック", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128))); this.mTextBox.MaxLength = ClsDatElem.MAX_NAME; this.mTextBox.Text = clElem.GetName(); this.mTextBox.Name = "textBox_Name"; this.mTextBox.Size = new System.Drawing.Size(80, 19); this.mTextBox.Tag = inLineNo; this.mTextBox.TabIndex = 0; this.mTextBox.Leave += new System.EventHandler(this.textBox_Name_Leave); this.mTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox_Name_KeyDown); this.panel_Control.Controls.Add(this.mTextBox); this.mTextBox.Focus(); } } //以下、コントロール更新処理 this.RefreshControl(); this.panel_Control.Refresh(); this.panel_Time.Refresh(); this.mFormMain.Refresh(); }
private void RemoveTextBoxName() { if (this.mTextBox == null) { return; } ClsDatMotion clMotion = ClsSystem.GetSelectMotion(); if (clMotion == null) { return; } //以下、名前設定処理 int inLineNo = (int)this.mTextBox.Tag; ClsDatElem clElem = ClsSystem.GetElemFromLineNo(inLineNo); if (clElem != null) { string clName = this.mTextBox.Text; if (!string.IsNullOrEmpty(clName)) { clElem.SetName(clName); } } //以下、テキストボックス削除処理 this.panel_Control.Controls.Remove(this.mTextBox); this.mTextBox = null; //以下、コントロール更新処理 this.panel_Control.Refresh(); this.panel_Time.Refresh(); this.mFormMain.Refresh(); }