예제 #1
0
        /// <summary>
        /// Raises the <see cref="E:System.Windows.Forms.ComboBox.DrawItem"/> event.
        /// </summary>
        /// <param name="e">A <see cref="T:System.Windows.Forms.DrawItemEventArgs"/> that contains the event data. </param>
        protected override void OnDrawItem(DrawItemEventArgs e)
        {
            // Get the dialog to draw
            NPCChatDialogBase dialog = null;

            if (e.Index >= 0 && e.Index < Items.Count)
            {
                dialog = Items[e.Index] as NPCChatDialogBase;
            }

            // If invalid, use the default drawing
            if (dialog == null)
            {
                base.OnDrawItem(e);
                return;
            }

            e.DrawBackground();
            e.Graphics.DrawString(string.Format("{0}: {1}", dialog.ID, dialog.Title), e.Font, new SolidBrush(e.ForeColor),
                                  e.Bounds);
            e.DrawFocusRectangle();

            // TODO: Fix the display for the selected item; do not let the text be edited
        }
예제 #2
0
 public void EndDialog()
 {
     IsVisible = false;
     _dialog = null;
 }
예제 #3
0
        public void StartDialog(NPCChatDialogBase dialog)
        {
            if (dialog == null)
            {
                Debug.Fail("Dialog is null.");
                return;
            }

            _dialog = dialog;
            SetFocus();
        }