Example #1
0
        /// <summary>
        /// Invoked when the user selects a widget
        /// in the dialog such as a button or a text box.
        /// </summary>
        /// <param name="widget">Which one triggered?</param>
        public void OnButtonActuated(Widget widget)
        {
            String value = widget.Value;

            if (String.IsNullOrEmpty(value))
            {
                return;
            }

            Invoke(new MethodInvoker(delegate()
            {
                switch (value)
                {
                case "valButtonFinished":
                    finish();
                    break;

                case "valButtonCancel":
                    cancel();
                    break;

                case "valCheckWritten":
                    _mode = Abbreviation.AbbreviationMode.Write;
                    radioSetAbbreviationMode(pbTypeWritten.Name, true);
                    break;

                case "valCheckSpoken":
                    _mode = Abbreviation.AbbreviationMode.Speak;
                    radioSetAbbreviationMode(pbTypeSpoken.Name, true);
                    break;
                }
            }));
        }
Example #2
0
        /// <summary>
        /// Initializes the state of all the widgets in the
        /// dialog box.
        /// </summary>
        private void initWidgetSettings()
        {
            var rootWidget = _dialogCommon.GetRootWidget();

            _mode = InputAbbreviation.Mode;
            (rootWidget.Finder.FindChild(pbTypeSpoken.Name) as CheckBoxWidget).SetState(_mode == Abbreviation.AbbreviationMode.Speak || _mode == Abbreviation.AbbreviationMode.None);
            (rootWidget.Finder.FindChild(pbTypeWritten.Name) as CheckBoxWidget).SetState(_mode == Abbreviation.AbbreviationMode.Write);

            Windows.SetText(tbAbbreviation, InputAbbreviation.Mnemonic);
            tbAbbreviation.Select(tbAbbreviation.Text.Length, 0);
            Windows.SetText(tbExpansion, Regex.Replace(InputAbbreviation.Expansion, "\n", "\r\n"));
            tbExpansion.Select(tbExpansion.Text.Length, 0);
        }
Example #3
0
        /// <summary>
        /// Converts enum mode to string
        /// </summary>
        /// <param name="mode">mode to convert</param>
        /// <returns>string representation</returns>
        private String modeToString(Abbreviation.AbbreviationMode mode)
        {
            String retVal = String.Empty;

            switch (mode)
            {
            case Abbreviation.AbbreviationMode.None:
                retVal = R.GetString("None");
                break;

            case Abbreviation.AbbreviationMode.Speak:
                retVal = R.GetString("Speak");
                break;

            case Abbreviation.AbbreviationMode.Write:
                retVal = R.GetString("Write");
                break;
            }

            return(retVal);
        }
Example #4
0
        /// <summary>
        /// Initializes the state of all the widgets in the
        /// dialog box.
        /// </summary>
        private void initWidgetSettings()
        {
            var rootWidget = _dialogCommon.GetRootWidget();

            _mode = InputAbbreviation.Mode;
            (rootWidget.Finder.FindChild(pbTypeSpoken.Name) as CheckBoxWidget).SetState(_mode == Abbreviation.AbbreviationMode.Speak || _mode == Abbreviation.AbbreviationMode.None);
            (rootWidget.Finder.FindChild(pbTypeWritten.Name) as CheckBoxWidget).SetState(_mode == Abbreviation.AbbreviationMode.Write);

            Windows.SetText(tbAbbreviation, InputAbbreviation.Mnemonic);
            tbAbbreviation.Select(tbAbbreviation.Text.Length, 0);
            Windows.SetText(tbExpansion, Regex.Replace(InputAbbreviation.Expansion, "\n", "\r\n"));
            tbExpansion.Select(tbExpansion.Text.Length, 0);
        }
Example #5
0
        /// <summary>
        /// Invoked when the user selects a widget
        /// in the dialog such as a button or a text box.
        /// </summary>
        /// <param name="widget">Which one triggered?</param>
        public void OnButtonActuated(Widget widget)
        {
            String value = widget.Value;

            if (String.IsNullOrEmpty(value))
            {
                return;
            }

            Invoke(new MethodInvoker(delegate()
            {
                switch (value)
                {
                    case "valButtonFinished":
                        finish();
                        break;

                    case "valButtonCancel":
                        cancel();
                        break;

                    case "valCheckWritten":
                        _mode = Abbreviation.AbbreviationMode.Write;
                        radioSetAbbreviationMode(pbTypeWritten.Name, true);
                        break;

                    case "valCheckSpoken":
                        _mode = Abbreviation.AbbreviationMode.Speak;
                        radioSetAbbreviationMode(pbTypeSpoken.Name, true);
                        break;
                }
            }));
        }