static public void MeDelete(Control.ControlCollection cons, WizComboBox cmb) { if (cons.Count <= 0) { return; } cons.Remove(cmb); cmb.Dispose(); }
private void CmbRace_VisibleChanged(object sender, EventArgs e) { WizComboBox w = (WizComboBox)sender; if (w.SelectedIndex >= 0) { WIZRACE r = (WIZRACE)w.SelectedIndex; if (m_Race != r) { m_Race = r; SetInfo(); this.Invalidate(); } } WizComboBox.MeDelete(this.Parent.Controls, w); }
private void CmbClass_VisibleChanged(object sender, EventArgs e) { WizComboBox w = (WizComboBox)sender; if (w.SelectedIndex >= 0) { WIZCLASS r = (WIZCLASS)w.SelectedIndex; if (m_Class != r) { m_Class = r; SetInfo(); this.Invalidate(); } } WizComboBox.MeDelete(this.Parent.Controls, w); }
// ************************************************************************* protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown(e); if (e.X < m_CaptionWidth) { return; } if (m_state == null) { return; } if (IsEdit == false) { return; } WizComboBox cmb = new WizComboBox(); int ox = cmb.OffsetPoint.X; int oy = cmb.OffsetPoint.Y; cmb.Name = "A"; cmb.Location = new Point(this.Left + m_CaptionWidth - ox, this.Top - oy); cmb.Size = new Size(130, this.Height * 3); for (int i = 0; i < m_statusStrE.Length; i++) { if (m_IsJapan) { cmb.Add(m_statusStrJ[i]); } else { cmb.Add(m_statusStrE[i]); } } cmb.SelectedIndex = (int)m_state.CharStatus; cmb.IsListMode = true; cmb.VisibleChanged += Cmb_VisibleChanged; this.Parent.Controls.Add(cmb); cmb.BringToFront(); cmb.Visible = true; }
private void Cmb_VisibleChanged(object sender, EventArgs e) { if (m_state == null) { return; } WizComboBox w = (WizComboBox)sender; if (w.SelectedIndex >= 0) { WIZSTATUS o = m_state.CharStatus; WIZSTATUS r = (WIZSTATUS)w.SelectedIndex; if (o != r) { m_state.CharStatus = r; this.Invalidate(); } } WizComboBox.MeDelete(this.Parent.Controls, w); }
// ****************************************************************** protected override void OnMouseDown(MouseEventArgs e) { base.OnMouseDown(e); int x = e.X; if (x < m_AlgWidth) { if (IsEditAlg) { WizComboBox cmb = new WizComboBox(); int ox = cmb.OffsetPoint.X; int oy = cmb.OffsetPoint.Y; cmb.Name = "A"; cmb.Location = new Point(this.Left - ox, this.Top - oy); cmb.Size = new Size(100, this.Height * 3); for (int i = 0; i < WizData.AlgStr.Length; i++) { cmb.Add(WizData.AlgString((WIZALG)i)); } cmb.SelectedIndex = (int)m_Alg; cmb.IsListMode = true; cmb.VisibleChanged += CmbAlg_VisibleChanged; this.Parent.Controls.Add(cmb); cmb.BringToFront(); cmb.Visible = true; } } else if (x < (m_AlgWidth + m_ClassWidth)) { if (IsEditClass) { WizComboBox cmb = new WizComboBox(); int ox = cmb.OffsetPoint.X; int oy = cmb.OffsetPoint.Y; cmb.Name = "A"; cmb.Location = new Point(this.Left - ox + m_AlgWidth, this.Top - oy); cmb.Size = new Size(55, this.Height * 3); for (int i = 0; i < WizData.ClassStr.Length; i++) { cmb.Add(WizData.ClassString((WIZCLASS)i)); } cmb.SelectedIndex = (int)m_Class; cmb.IsListMode = true; cmb.VisibleChanged += CmbClass_VisibleChanged; this.Parent.Controls.Add(cmb); cmb.BringToFront(); cmb.Visible = true; } } else if (x < (m_AlgWidth + m_ClassWidth + m_RaceWidth)) { if (IsEditRace) { WizComboBox cmb = new WizComboBox(); int ox = cmb.OffsetPoint.X; int oy = cmb.OffsetPoint.Y; cmb.Name = "A"; cmb.Location = new Point(this.Left - ox + m_AlgWidth + m_ClassWidth, this.Top - oy); cmb.Size = new Size(70, this.Height * 5); for (int i = 0; i < WizData.RaceStr.Length; i++) { cmb.Add(WizData.RaceString((WIZRACE)i)); } cmb.SelectedIndex = (int)m_Race; cmb.IsListMode = true; cmb.VisibleChanged += CmbRace_VisibleChanged; this.Parent.Controls.Add(cmb); cmb.BringToFront(); cmb.Visible = true; } } }