コード例 #1
0
        public static async void Show(String text, String caption = null, EMessageBoxButtons buttons = EMessageBoxButtons.Ok, ResultHandler handler = null)
        {
            MessageBox.handler = handler;

            MessageDialog dialog;

            if (caption != null)
            {
                dialog = new MessageDialog(text, caption);
            }
            else
            {
                dialog = new MessageDialog(text);
            }

            // Add commands and set their callbacks; both buttons use the same callback function instead of inline event handlers
            dialog.Commands.Add(new UICommand("ok", new UICommandInvokedHandler(CommandInvokedHandler)));

            if (buttons == EMessageBoxButtons.OkCancel)
            {
                dialog.Commands.Add(new UICommand("cancel", new UICommandInvokedHandler(CommandInvokedHandler)));
            }

            // Show the message dialog
            await dialog.ShowAsync();
        }
コード例 #2
0
 public MessageBox(string title, string message, EMessageBoxButtons buttons, Action <EDialogResult> callback)
 {
     WindowContent = new GUIContent(title);
     this.message  = message;
     this.buttons  = buttons;
     this.callback = callback;
 }
コード例 #3
0
        public override EDialogResult ShowMessageBox(string text, string caption, EMessageBoxButtons buttons = EMessageBoxButtons.OK)
        {
            //!!!!buttons, result

            Android.Util.Log.WriteLine(Android.Util.LogPriority.Debug, "MyApp", "MESSAGE:\r\n" + caption + ":" + text);

            return(EDialogResult.OK);
        }
コード例 #4
0
        ///////////////////////////////////////////

        public override EDialogResult ShowMessageBox(string text, string caption, EMessageBoxButtons buttons)
        {
            while (ShowCursor(1) < 0)
            {
            }

            IntPtr hwnd = IntPtr.Zero;

            if (EngineApp.ApplicationType == EngineApp.ApplicationTypeEnum.Simulation && EngineApp.CreatedInsideEngineWindow != null)
            {
                hwnd = EngineApp.CreatedInsideEngineWindow.Handle;
            }

            return((EDialogResult)MessageBox(hwnd, text, caption, (int)buttons | MB_ICONEXCLAMATION));
            //MessageBox( hwnd, text, caption, MB_OK | MB_ICONEXCLAMATION );
        }
コード例 #5
0
        public static ResultData Show(UIControl parent, string text, string caption, EMessageBoxButtons buttons)
        {
            var window = CreateWindow(parent, text, caption);

            if (window == null)
            {
                return(null);
            }

            EDialogResult[] results = null;
            switch (buttons)
            {
            case EMessageBoxButtons.OK:
                results = new EDialogResult[] { EDialogResult.OK };
                break;

            case EMessageBoxButtons.OKCancel:
                results = new EDialogResult[] { EDialogResult.OK, EDialogResult.Cancel };
                break;

            case EMessageBoxButtons.AbortRetryIgnore:
                results = new EDialogResult[] { EDialogResult.Abort, EDialogResult.Retry, EDialogResult.Ignore };
                break;

            case EMessageBoxButtons.YesNoCancel:
                results = new EDialogResult[] { EDialogResult.Yes, EDialogResult.No, EDialogResult.Cancel };
                break;

            case EMessageBoxButtons.YesNo:
                results = new EDialogResult[] { EDialogResult.Yes, EDialogResult.No };
                break;

            case EMessageBoxButtons.RetryCancel:
                results = new EDialogResult[] { EDialogResult.Retry, EDialogResult.Cancel };
                break;
            }

            var resultData = new ResultData();

            ConfigureButtons(window, results, resultData);

            //add to parent and enable
            parent.AddComponent(window);

            return(resultData);
        }
コード例 #6
0
 public override EDialogResult ShowMessageBox(string text, string caption, EMessageBoxButtons buttons)
 {
     //!!!!buttons, result
     MacAppNativeWrapper.MessageBox(text, caption);
     return(EDialogResult.OK);
 }
コード例 #7
0
 public abstract EDialogResult ShowMessageBox(string text, string caption, EMessageBoxButtons buttons = EMessageBoxButtons.OK);
コード例 #8
0
 public static EDialogResult ShowQuestion(string text, EMessageBoxButtons buttons)
 {
     return((EDialogResult)KryptonMessageBox.Show(text, EngineInfo.OriginalName, (MessageBoxButtons)buttons, MessageBoxIcon.Question));
 }
コード例 #9
0
 public MessageBox(string message, EMessageBoxButtons buttons, Action <EDialogResult> callback)
 {
     this.message  = message;
     this.buttons  = buttons;
     this.callback = callback;
 }
コード例 #10
0
 public MessageBox(string message, EMessageBoxButtons buttons)
 {
     this.message = message;
     this.buttons = buttons;
 }
コード例 #11
0
 public MessageBox(string title, string message, EMessageBoxButtons buttons)
 {
     WindowContent = new GUIContent(title);
     this.message  = message;
     this.buttons  = buttons;
 }