コード例 #1
0
        public static void AddAndInitializeWithControl(WindowManager wm, XNAControl control)
        {
            var dp = new DarkeningPanel(wm);

            wm.AddAndInitializeControl(dp);
            dp.AddChild(control);
        }
コード例 #2
0
        /// <summary>
        /// Creates and displays a new message box with the specified caption and description.
        /// </summary>
        /// <param name="game">The game.</param>
        /// <param name="caption">The caption/header of the message box.</param>
        /// <param name="description">The description of the message box.</param>
        public static void Show(WindowManager windowManager, string caption, string description)
        {
            var panel = new DarkeningPanel(windowManager);

            panel.Focused = true;
            windowManager.AddAndInitializeControl(panel);

            var msgBox = new XNAMessageBox(windowManager,
                                           Renderer.GetSafeString(caption, 1),
                                           Renderer.GetSafeString(description, 0),
                                           XNAMessageBoxButtons.OK);

            panel.AddChild(msgBox);
            msgBox.OKClickedAction = MsgBox_OKClicked;
            windowManager.AddAndInitializeControl(msgBox);
        }
コード例 #3
0
        /// <summary>
        /// Shows a message box with "Yes" and "No" being the user input options.
        /// </summary>
        /// <param name="windowManager">The WindowManager.</param>
        /// <param name="caption">The caption of the message box.</param>
        /// <param name="description">The description in the message box.</param>
        /// <returns>The XNAMessageBox instance that is created.</returns>
        public static XNAMessageBox ShowYesNoDialog(WindowManager windowManager, string caption, string description)
        {
            var panel = new DarkeningPanel(windowManager);

            windowManager.AddAndInitializeControl(panel);

            var msgBox = new XNAMessageBox(windowManager,
                                           Renderer.GetSafeString(caption, 1),
                                           Renderer.GetSafeString(description, 0),
                                           XNAMessageBoxButtons.YesNo);

            panel.AddChild(msgBox);
            msgBox.YesClickedAction = MsgBox_YesClicked;
            msgBox.NoClickedAction  = MsgBox_NoClicked;

            return(msgBox);
        }
コード例 #4
0
 public void Show()
 {
     DarkeningPanel.AddAndInitializeWithControl(WindowManager, this);
 }