Exemplo n.º 1
0
 private void ShowcomboBoxModePicker(object sender, EventArgs e)
 {
     waterMarkText.EndEditing(true);
     comboBoxModePicker.Hidden = false;
     comboBoxDoneButton.Hidden = false;
     sizePicker.Hidden         = true;
     textColorPicker.Hidden    = true;
     backColorPicker.Hidden    = true;
 }
Exemplo n.º 2
0
 void ShowsuggestionModePicker(object sender, EventArgs e)
 {
     minimumText.EndEditing(true);
     maximumText.EndEditing(true);
     popUpDelayText.EndEditing(true);
     suggestionDoneButton.Hidden   = false;
     suggestionModePicker.Hidden   = false;
     autoCompleteModePicker.Hidden = true;
 }
Exemplo n.º 3
0
 void ShowPicker1(object sender, EventArgs e)
 {
     text1.EndEditing(true);
     text2.EndEditing(true);
     text3.EndEditing(true);
     doneButton.Hidden = false;
     picker1.Hidden    = false;
     picker2.Hidden    = true;
 }
Exemplo n.º 4
0
 void ShowviewModePicker(object sender, EventArgs e)
 {
     offsetTextfield.EndEditing(true);
     scaleOffsetTextfield.EndEditing(true);
     rotationAngleTextfield.EndEditing(true);
     viewDoneButton.Hidden = false;
     viewModePicker.Hidden = false;
 }
Exemplo n.º 5
0
 void ShowsuggestionModePicker(object sender, EventArgs e)
 {
     minimumText.EndEditing(true);
     maximumText.EndEditing(true);
     popUpDelayText.EndEditing(true);
     suggestionDoneButton.Hidden       = false;
     autoCompleteModeDoneButton.Hidden = true;
     suggestionModePicker.Hidden       = false;
     autoCompleteModePicker.Hidden     = true;
     popUpDelayText.Hidden             = true;
     popupDelayLabel.Hidden            = true;
     autoCompleteModeLabel.Hidden      = true;
     maxDropDownHeightLabel.Hidden     = true;
     maximumText.Hidden             = true;
     minimumText.Hidden             = true;
     minPrefixCharacterLabel.Hidden = true;
     autoCompleteButton.Hidden      = true;
     suggestionModeLabel.Hidden     = true;
     suggestionButton.Hidden        = true;
 }
Exemplo n.º 6
0
        public void Unfocus()
        {
            if (_useTextView)
            {
                _textView.EndEditing(true);
                _textView.ResignFirstResponder();
                _textView.Opaque = false;

                _textView.BackgroundColor = new UIColor(1, 1, 1, 0);
                _textView.TextColor       = new UIColor(1, 1, 1, 0);

                _textView.Frame = new System.Drawing.RectangleF(-10, -10, 5, 5);

                _textView.Ended -= HandleEnded;
            }
            else
            {
                _textField.EndEditing(true);
                _textField.ResignFirstResponder();
                _textField.Opaque = false;

                _textField.BackgroundColor = new UIColor(1, 1, 1, 0);
                _textField.TextColor       = new UIColor(1, 1, 1, 0);

                _textField.Frame = new System.Drawing.RectangleF(-10, -10, 5, 5);

                _textField.EditingChanged -= HandleEditingChanged;
                _textField.EditingDidEnd  -= HandleEditingDidEnd;

                _textField.ShouldReturn = delegate
                {
                    return(false);
                };
            }

            CurrentFocus = null;
            DelayedActionInvoker.Instance.AddAction(0.2f, (v) => AppMain.Current.ReleaseFocus(this));

            AppMain.Redraw(true);
            AppMain.RedrawNextFrame();
        }
Exemplo n.º 7
0
        nfloat CreateNumberField(string descriptionLabel, nfloat yFrame, nfloat sizeFrame, object conteudo, int maxCaracteres, int minCaracteres)
        {
            var conteudoString = (string)conteudo;

            if (minCaracteres > 0)
            {
                yFrame = LabelField(descriptionLabel + " *", yFrame);
            }
            else
            {
                yFrame = LabelField(descriptionLabel, yFrame);
            }
            var textField = new UITextView(new CGRect(10, yFrame, scrollViewContent.Bounds.Size.Width - 20, sizeFrame))
            {
                KeyboardType  = UIKeyboardType.NumbersAndPunctuation,
                ReturnKeyType = UIReturnKeyType.Next
            };

            if (!string.IsNullOrEmpty(conteudoString))
            {
                textField.Text = conteudoString;
            }

            textField.ShouldChangeText += (textView, range, text) =>
            {
                if (text.Equals("\n"))
                {
                    textField.EndEditing(true);
                    return(false);
                }

                if (text.Equals(""))
                {
                    return(true);
                }

                if (text.Equals(","))
                {
                    text += "0";
                }
                if (text.Equals(".") || !double.TryParse(textView.Text + text, out double auxValor))
                {
                    return(false);
                }
                if (maxCaracteres > 0)
                {
                    var newLength = (textField.Text.Length - range.Length) + text.Length;
                    return(newLength <= maxCaracteres);
                }
                return(true);
            };

            CGPoint point;

            if (yFrame - 20 < 0)
            {
                point = new CGPoint(0, 0);
            }
            else
            {
                point = new CGPoint(0, yFrame - 20);
            }
            textField.ShouldBeginEditing = (textView) =>
            {
                scrollViewContent.SetContentOffset(point, true);
                return(true);
            };


            textField.Tag                 = 2;
            textField.BackgroundColor     = UIColor.GroupTableViewBackgroundColor;
            textField.Layer.CornerRadius  = 5.0f;
            textField.Layer.MasksToBounds = true;
            textField.LayoutMargins       = new UIEdgeInsets(0, 20, 0, 20);

            scrollViewContent.Add(textField);
            return(yFrame + sizeFrame);
        }