Example #1
0
 public MessageBoxEvent(string title, string msg, MessageBoxStyle style, Action <MessageBoxResult> callback)
 {
     this.title    = title;
     this.msg      = msg;
     this.style    = style;
     this.callback = callback;
 }
Example #2
0
 /// <summary>
 /// Define an Asp.net MessageBox instance.
 /// </summary>
 /// <param name="text">Message Box text property.</param>
 public MessageBox(string text)
 {
     this.MessageText    = text;
     this.MessageIcons   = MessageBoxIcons.System;
     this.MessageButtons = MessageBoxButtons.Ok;
     this.MessageStyles  = MessageBoxStyle.StyleA;
 }
 private void doUndoButtonClick(MessageBoxStyle result)
 {
     if (result == MessageBoxStyle.Yes)
     {
         resetToOpeningState();
     }
 }
 private void overwriteMessageCallback(MessageBoxStyle result)
 {
     if (result == MessageBoxStyle.Yes)
     {
         doSaveAndClose();
     }
 }
Example #5
0
 private void doUndoButtonClick(MessageBoxStyle result)
 {
     if (result == MessageBoxStyle.Yes)
     {
         context.runAction(wizardView.UndoAction, ViewHost);
     }
 }
Example #6
0
    /// <summary>
    /// 设置UI风格样式
    /// </summary>
    /// <param name="style"></param>
    void SetUIButtonActiveByStyle(MessageBoxStyle style)
    {
        switch (style)
        {
        case MessageBoxStyle.OK:
            m_OKButton.gameObject.SetActive(true);
            m_CancelButton.gameObject.SetActive(false);
            m_CloseButton.gameObject.SetActive(false);
            break;

        case MessageBoxStyle.OKCancel:
            m_OKButton.gameObject.SetActive(true);
            m_CancelButton.gameObject.SetActive(true);
            m_CloseButton.gameObject.SetActive(false);
            break;

        case MessageBoxStyle.OKCancelClose:
            m_OKButton.gameObject.SetActive(true);
            m_CancelButton.gameObject.SetActive(true);
            m_CloseButton.gameObject.SetActive(true);
            break;

        case MessageBoxStyle.OKClose:
            m_OKButton.gameObject.SetActive(true);
            m_CancelButton.gameObject.SetActive(false);
            m_CloseButton.gameObject.SetActive(true);
            break;
        }
    }
 private void doMakeNormalButtonClick(MessageBoxStyle result)
 {
     if (result == MessageBoxStyle.Yes)
     {
         setToDefault();
     }
 }
Example #8
0
 private void doMakeNormalButtonClick(MessageBoxStyle style)
 {
     if (style == MessageBoxStyle.Yes)
     {
         this.setToDefault();
     }
 }
Example #9
0
        /// <summary>
        /// This function will show a message box with the given options and call callback when it is closed.
        /// </summary>
        /// <param name="message">The message to go in the box.</param>
        /// <param name="caption">The caption of the message box.</param>
        /// <param name="style">The style to use for the message box.</param>
        /// <param name="callback">The callback to call when the box is closed.</param>
        public static void show(String message, String caption, MessageBoxStyle style, MessageClosedDelegate callback)
        {
            Message box = Message.createMessageBox("MyGUIPlugin.Resources.MessageBox.MessageBox.layout", caption, message, style);

            box.MessageBoxResult += box_MessageBoxResult;
            delegates.Add(box, callback);
        }
 private void doUndoButtonClick(MessageBoxStyle style)
 {
     if (style == MessageBoxStyle.Yes)
     {
         context.runAction(wizardView.UndoAction, ViewHost);
         heightControl.getPositionFromScene();
     }
 }
Example #11
0
 public static Message createMessageBox(
     String skin,
     String caption,
     String message,
     MessageBoxStyle style)
 {
     return(createMessageBox(skin, caption, message, style, "", true, "", "", "", ""));
 }
Example #12
0
 private void doMakeNormalButtonClick(MessageBoxStyle result)
 {
     if (result == MessageBoxStyle.Yes)
     {
         TeethController.setAllOffsets(Vector3.Zero);
         TeethController.setAllRotations(Quaternion.Identity);
     }
 }
Example #13
0
 /// <summary>
 /// Define an Asp.net MessageBox instance.
 /// </summary>
 /// <param name="text">MessageBox text property.</param>
 /// <param name="title">MessageBox title property.</param>
 /// <param name="icons">MessageBox icon property.</param>
 /// <param name="buttons">MessageBox button style.</param>
 public MessageBox(string text, string title, MessageBoxIcons icons, MessageBoxButtons buttons, MessageBoxStyle styles)
 {
     this.MessageText    = text;
     this.MessageTitle   = title;
     this.MessageIcons   = icons;
     this.MessageButtons = buttons;
     this.MessageStyles  = styles;
 }
Example #14
0
 /// <summary>
 /// Define an Asp.net MessageBox instance.
 /// </summary>
 /// <param name="text">MessageBox text property.</param>
 /// <param name="title">MessageBox title property.</param>
 public MessageBoxWithHTML(string text, string title)
 {
     this.MessageText    = text;
     this.MessageTitle   = title;
     this.MessageIcons   = MessageBoxIcons.System;
     this.MessageButtons = MessageBoxButtons.Ok;
     this.MessageStyles  = MessageBoxStyle.StyleA;
 }
 private void doMakeNormalButtonClick(MessageBoxStyle style)
 {
     if (style == MessageBoxStyle.Yes)
     {
         TeethController.setAllOffsets(Vector3.Zero);
         TeethController.setAllRotations(Quaternion.Identity);
         heightControl.setToDefault();
     }
 }
 private void doUndoButtonClick(MessageBoxStyle result)
 {
     if (result == MessageBoxStyle.Yes)
     {
         allowCameraChange = false;
         resetToOpeningState();
         allowCameraChange = true;
     }
 }
 private void doMakeNormalButtonClick(MessageBoxStyle result)
 {
     if (result == MessageBoxStyle.Yes)
     {
         allowCameraChange = false;
         setToDefault();
         allowCameraChange = true;
     }
 }
Example #18
0
    public WaitForUserClick(MessageBoxStyle style,
                            string text, string title, string tips = "", string num = "")
    {
        _FrameMessage = EntryPoint.Instance.PanelMessageBox.FindChild("Frame_Message");
        if (EntryPoint.Instance.PanelHotUpdate != null)
        {
            _FrameInfo = EntryPoint.Instance.PanelHotUpdate.FindChild("Frame_Info");
        }

        _BtnYes         = _FrameMessage.FindChild("Btn_Yes").GetComponent <GButton>();
        _BtnNo          = _FrameMessage.FindChild("Btn_No").GetComponent <GButton>();
        _BtnYes.OnClick = OnClickYes;
        _BtnNo.OnClick  = OnClickNo;
        _RectBtnYes     = _BtnYes.RectTrans;
        _RectBtnNo      = _BtnNo.RectTrans;

        bool bShowTips = !string.IsNullOrEmpty(tips);
        var  msgTips   = _FrameMessage.FindChild("Lay_Content/Frame_Middle/Lab_DownloadTips").GetComponent <Text>();

        if (msgTips.gameObject.activeSelf != bShowTips)
        {
            msgTips.gameObject.SetActive(bShowTips);
        }
        if (bShowTips)
        {
            msgTips.text = tips;
        }

        var msgTitle = _FrameMessage.FindChild("Lab_MsgTitle").GetComponent <Text>();
        var msgText  = _FrameMessage.FindChild("Lay_Content/Lab_Message").GetComponent <Text>();

        msgText.text  = text;
        msgTitle.text = title;

        bool bShowNum = !string.IsNullOrEmpty(num);
        var  msgNum   = _FrameMessage.FindChild("Lay_Content/Frame_Middle/Lab_Number").GetComponent <Text>();

        if (msgNum.gameObject.activeSelf != bShowNum)
        {
            msgNum.gameObject.SetActive(bShowNum);
        }
        if (bShowNum)
        {
            msgNum.text = num;
        }

        var frameMiddle = _FrameMessage.FindChild("Lay_Content/Frame_Middle");

        if (frameMiddle.activeSelf != (bShowTips || bShowNum))
        {
            frameMiddle.SetActive(bShowTips || bShowNum);
        }

        RetCode = -1;

        OnShow(style);
    }
 private void nativeEvent(IntPtr widget, MessageBoxStyle result)
 {
     //Fill out the MessageEventArgs
     eventArgs.Result = result;
     if (boundEvent != null)
     {
         boundEvent.Invoke(message, eventArgs);
     }
 }
Example #20
0
 public static Message createMessageBox(
     String skin,
     String caption,
     String message,
     MessageBoxStyle style,
     String layer,
     bool modal)
 {
     return(createMessageBox(skin, caption, message, style, layer, modal, "", "", "", ""));
 }
Example #21
0
 private static void OnExportMessageBoxResult(
     MessageBox _sender,
     MessageBoxStyle _result)
 {
     if (_sender.mEventMessageBoxResult != null)
     {
         _sender.mEventMessageBoxResult(
             _sender,
             _result);
     }
 }
Example #22
0
 private static extern IntPtr Message_createMessageBox(
     String skin,
     [MarshalAs(UnmanagedType.LPWStr)] String caption,
     [MarshalAs(UnmanagedType.LPWStr)] String message,
     MessageBoxStyle style,
     String layer,
     bool modal,
     String button1,
     String button2,
     String button3,
     String button4);
Example #23
0
        public MessageBoxW(MessageBoxStyle messageBoxStyle, string msg)
        {
            InitializeComponent();
            Style style = StyleManager.Style;

            StyleManager.SetStyle(this, style);
            btnClose.BackColor = Color.Transparent;
            if (messageBoxStyle == MessageBoxStyle.info)
            {
                picICO.Image      = Resources.info3;
                prgMessage.Text   = "提示";
                panel1.Visible    = true;
                panel2.Visible    = false;
                this.AcceptButton = btnOk;
            }
            else if (messageBoxStyle == MessageBoxStyle.question)
            {
                picICO.Image      = Resources.question3;
                prgMessage.Text   = "询问";
                panel1.Visible    = false;
                panel2.Visible    = true;
                this.AcceptButton = btnYes;
            }
            else if (messageBoxStyle == MessageBoxStyle.error)
            {
                picICO.Image         = Resources.error3;
                prgMessage.Text      = "错误";
                prgMessage.ForeColor = Color.Red;
                panel1.Visible       = true;
                panel2.Visible       = false;
                this.AcceptButton    = btnOk;
            }

            this.labInfo.Text = msg;

            SizeF size = TextRenderer.MeasureText(msg, new Font("宋体", 9, FontStyle.Regular));

            int TempWidth = (int)size.Width;

            if (TempWidth <= 250)
            {
                return;
            }

            this.Width        = (int)size.Width;
            this.panel1.Width = TempWidth - 20;
            this.panel2.Width = TempWidth - 20;
            btnYes.Width      = TempWidth / 2 - 20;
            btnNo.Width       = TempWidth / 2 - 20;
        }
Example #24
0
 public static Message createMessageBox(
     String skin,    //regular
     String caption, //ustring
     String message, //ustring
     MessageBoxStyle style,
     String layer,   //regular
     bool modal,
     String button1, //regular
     String button2, //regular
     String button3, //regular
     String button4) //regular
 {
     return(new Message(Message_createMessageBox(skin, caption, message, style, layer, modal, button1, button2, button3, button4)));
 }
Example #25
0
        public MessageBox(string title, string message, MessageBoxStyle style = MessageBoxStyle.OkCancel)
        {
            InitializeComponent();

            switch (style)
            {
            case MessageBoxStyle.OkOnly:
                btnCancel.Visibility = Visibility.Hidden;
                break;
            }

            Title          = title;
            tbMessage.Text = message;
        }
        public ActionResult Message(MessageBoxStyle style, string message)
        {
            ViewData["alertMessage"] = message;
            ViewData["Guid"]         = Guid.NewGuid().ToString("N");
            switch (style)
            {
            case MessageBoxStyle.success: return(PartialView("_MessageSuccessPartial"));

            case MessageBoxStyle.info: return(PartialView("_MessageInfoPartial"));

            case MessageBoxStyle.warning: return(PartialView("_MessageWarningPartial"));

            default: return(PartialView("_MessageDangerPartial"));
            }
        }
        public MessageBoxW(MessageBoxStyle messageBoxStyle, string msg)
        {
            InitializeComponent();
            Style style = StyleManager.Style;
            StyleManager.SetStyle(this, style);
            btnClose.BackColor = Color.Transparent;
            if (messageBoxStyle == MessageBoxStyle.info)
            {
                picICO.Image = Resources.info3;
                prgMessage.Text = "提示";
                panel1.Visible = true;
                panel2.Visible = false;
                this.AcceptButton = btnOk;
            }
            else if (messageBoxStyle == MessageBoxStyle.question)
            {
                picICO.Image = Resources.question3;
                prgMessage.Text = "询问";
                panel1.Visible = false;
                panel2.Visible = true;
                this.AcceptButton = btnYes;
            }
            else if (messageBoxStyle == MessageBoxStyle.error)
            {
                picICO.Image =Resources.error3;
                prgMessage.Text = "错误";
                prgMessage.ForeColor = Color.Red;
                panel1.Visible = true;
                panel2.Visible = false;
                this.AcceptButton = btnOk;
            }

            this.labInfo.Text = msg;

            SizeF size = TextRenderer.MeasureText(msg, new Font("宋体", 9, FontStyle.Regular));
            
            int TempWidth = (int)size.Width;
            if (TempWidth <= 250) { return; }

            this.Width = (int)size.Width;
            this.panel1.Width = TempWidth - 20;
            this.panel2.Width = TempWidth - 20;
            btnYes.Width = TempWidth / 2 - 20;
            btnNo.Width = TempWidth / 2 - 20;
    
            
        }
        public frmMessageBox(MessageBoxStyle messageBoxStyle, string msg)
        {
            InitializeComponent();

            if (messageBoxStyle == MessageBoxStyle.info)
            {
                picICO.Image   = ResourceFont.info;
                this.Text      = "提示";
                panel1.Visible = true;
                panel2.Visible = false;
            }
            else if (messageBoxStyle == MessageBoxStyle.question)
            {
                picICO.Image   = ResourceFont.question;
                this.Text      = "询问";
                panel1.Visible = false;
                panel2.Visible = true;
            }
            else if (messageBoxStyle == MessageBoxStyle.error)
            {
                picICO.Image   = ResourceFont.error;
                this.Text      = "错误";
                panel1.Visible = true;
                panel2.Visible = false;
            }

            this.labInfo.Text = msg;

            SizeF size = TextRenderer.MeasureText(msg, new Font("宋体", 15, FontStyle.Regular));

            int TempWidth = (int)size.Width;

            if (TempWidth <= 249)
            {
                return;
            }

            this.Width        = (int)size.Width + 130;
            this.panel1.Width = TempWidth - 20;
            this.panel2.Width = TempWidth - 20;
            btnYes.Width      = TempWidth / 2 - 20;
            btnNo.Width       = TempWidth / 2 - 20;
        }
        public FrmMessageBox(string message, string title, MessageBoxStyle style)
        {
            InitializeComponent();
            this.style       = style;
            this.Text        = title;
            labinfo.Text     = message;
            labinfo.Visible  = true;
            label1.Visible   = false;
            textBox1.Visible = false;
            switch (style)
            {
            case MessageBoxStyle.error:    //报错
                ButCancel.Visible = false;
                ButOK.Location    = ButCancel.Location;
                picICO.Image      = new Bitmap(Application.StartupPath + "\\Image\\error.png");
                break;

            case MessageBoxStyle.info:    //详细信息
                ButCancel.Visible = false;
                ButOK.Location    = ButCancel.Location;
                picICO.Image      = new Bitmap(Application.StartupPath + "\\Image\\info.png");
                break;

            case MessageBoxStyle.question:    //出问题
                picICO.Image = new Bitmap(Application.StartupPath + "\\Image\\question.png");
                break;

            case MessageBoxStyle.right:    //正确
                ButCancel.Visible = false;
                ButOK.Location    = ButCancel.Location;
                picICO.Image      = new Bitmap(Application.StartupPath + "\\Image\\right.png");
                break;

            case MessageBoxStyle.mima:    //输入密码模式
                picICO.Image     = new Bitmap(Application.StartupPath + "\\Image\\question.png");
                label1.Visible   = true;
                textBox1.Visible = true;
                break;
            }
        }
        internal MessageBoxWindow(string Title, string Message, MessageBoxStyle msgboxStyle)
        {
            InitializeComponent();

            frmstyle   = msgboxStyle;
            returndata = MessageBoxResult.None;

            this.Title          = Title;
            this.messageTB.Text = Message;

            this.Closing += this_Closing;
            this.KeyDown += this_KeyDown;

            switch (msgboxStyle)
            {
            case MessageBoxStyle.OKCancel:
                BtnOK.Content     = "확인";
                BtnCancel.Content = "취소";
                break;

            case MessageBoxStyle.Yes:
                BtnOK.Content        = "예";
                BtnCancel.Visibility = Visibility.Hidden;
                break;

            case MessageBoxStyle.YesNo:
                BtnOK.Content     = "예";
                BtnCancel.Content = "아니오";
                break;

            case MessageBoxStyle.OK:
                BtnOK.Content        = "확인";
                BtnCancel.Visibility = Visibility.Hidden;
                break;
            }
        }
        private static void OnExportMessageBoxResult(
			 MessageBox _sender ,
			 MessageBoxStyle _result )
        {
            if (_sender.mEventMessageBoxResult != null)
                _sender.mEventMessageBoxResult(
                     _sender ,
                     _result );
        }
Example #32
0
 public void endMessage(MessageBoxStyle result)
 {
     Message_endMessage(widget, result);
 }
Example #33
0
 public static extern DialogBoxResult MessageBoxW([In] IntPtr hWnd,
     [In] [MarshalAs(UnmanagedType.LPWStr)] string lpText,
     [In] [MarshalAs(UnmanagedType.LPWStr)] string lpCaption,
     MessageBoxStyle uType);
Example #34
0
 public static extern DialogBoxResult MessageBoxExA([In] IntPtr hWnd,
     [In] [MarshalAs(UnmanagedType.LPStr)] string lpText,
     [In] [MarshalAs(UnmanagedType.LPStr)] string lpCaption,
     MessageBoxStyle uType, ushort wLanguageId);
Example #35
0
 /// <summary>
 /// The MessageBoxEx function creates, displays, and operates a message box. The message box contains an 
 /// application-defined message and title, plus any combination of predefined icons and push buttons. 
 /// The buttons are in the language of the system user interface. 
 /// </summary>
 /// <param name="hWnd">Handle to the owner window of the message box to be created. If this parameter is null,
 /// the message box has no owner window</param>
 /// <param name="lpText">Pointer to a null-terminated string that contains the message to be displayed.</param>
 /// <param name="lpCaption">Pointer to a null-terminated string that contains the dialog box title. If 
 /// this parameter is null, the default title Error is used.</param>
 /// <param name="uType">Specifies the contents and behavior of the dialog box. This parameter can be a combination 
 /// of flags from the following groups of flags</param>
 /// <param name="wLanguageId">Specifies the language for the text displayed in the message box button(s). Specifying
 /// a value of zero (0) indicates to display the button text in the default system language.</param>
 /// <returns>If a message box has a Cancel button, the function returns the IDCANCEL value if either 
 /// the ESC key is pressed or the Cancel button is selected. If the message box has no Cancel button,
 /// pressing ESC has no effect. 
 /// If the function fails, the return value is zero. To get extended error information, call 
 /// GetLastError. 
 /// If the function succeeds, the return value is one of memeber of DialogBoxResult</returns>
 public static DialogBoxResult MessageBoxEx([In] IntPtr hWnd, [In] string lpText, [In] string lpCaption,
     MessageBoxStyle uType, ushort wLanguageId)
 {
     return Environment.OSVersion.Platform >= PlatformID.Win32NT ? Native.MessageBoxExW(hWnd, lpText, lpCaption, uType, wLanguageId) : Native.MessageBoxExA(hWnd, lpText, lpCaption, uType, wLanguageId);
 }
        public void SetMessageButton(
			MessageBoxStyle _value )
        {
            ExportMessageBox_SetMessageButton_value( mNative ,
                 _value );
        }
 static void box_EventMessageBoxResult(MessageBox _sender, MessageBoxStyle _result)
 {
     ExampleApplication.DebugOut("EventMessageBoxResult  _result=" + _result.ToString());
 }
        public void SetMessageButton(
			MessageBoxStyle _button )
        {
            ExportMessageBox_SetMessageButton_button( mNative ,
                 _button );
        }
        public void EndMessage(
			MessageBoxStyle _result )
        {
            ExportMessageBox_EndMessage_result( mNative ,
                 _result );
        }
 /// <summary>
 /// Define an Asp.net MessageBox instance.
 /// </summary>  
 /// <param name="text">MessageBox text property.</param>
 /// <param name="title">MessageBox title property.</param>
 /// <param name="icons">MessageBox icon property.</param>
 /// <param name="buttons">MessageBox button style.</param>
 public MessageBox(string text, string title, MessageBoxIcons icons, MessageBoxButtons buttons, MessageBoxStyle styles)
 {
     this.MessageText = text;
     this.MessageTitle = title;
     this.MessageIcons = icons;
     this.MessageButtons = buttons;
     this.MessageStyles = styles;
 }
        public void SetMessageStyle(
			MessageBoxStyle _style )
        {
            ExportMessageBox_SetMessageStyle_style( mNative ,
                 _style );
        }
        public void SetMessageIcon(
			MessageBoxStyle _icon )
        {
            ExportMessageBox_SetMessageIcon_icon( mNative ,
                 _icon );
        }
 static void box_EventMessageBoxResult(MessageBox _sender, MessageBoxStyle _result)
 {
     Export.DebugOut("EventMessageBoxResult  _result=" + _result.ToString());
 }