public TextBox CreateTextBox(string name, TextBoxType type) { TextBox txtBox = new TextBox(); txtBox.Name = name; SetControlSettings(txtBox); if (type == TextBoxType.FullPathTextBox) { txtBox.IsReadOnly = false; txtBox.Width = 144; txtBox.Height = 20; return(txtBox); } if (type == TextBoxType.DirectoryNameTextBox) { txtBox.IsReadOnly = false; txtBox.Width = 100; return(txtBox); } if (type == TextBoxType.KeyTextBox) { txtBox.IsReadOnly = true; txtBox.Width = 40; return(txtBox); } return(txtBox); }
public Message(EndianBinaryReader reader, int index) { Name = $"msg_{ index }"; IsUsed = "False"; int msgBeginTest = reader.PeekReadInt32(); while (msgBeginTest > (int)TextBoxType.COSMOSPHERE_CENTER_PORTRAIT || msgBeginTest < 0) { msgBeginTest = reader.ReadInt32(); if (msgBeginTest <= (int)TextBoxType.COSMOSPHERE_CENTER_PORTRAIT && msgBeginTest >= 0) { reader.BaseStream.Position -= 4; } } mBoxType = (TextBoxType)reader.ReadInt32(); mCharacterName = (CharacterNameID)reader.ReadInt32(); mCharacterIDOrPortrait = reader.ReadInt32(); mMessageIndex = reader.ReadInt32(); mPortraitPosition = (PortraitPosition)reader.ReadInt16(); mUnknown1 = reader.ReadInt16(); mMessageLength = reader.ReadInt32(); byte[] rawMessageData = reader.ReadBytes(mMessageLength); mMessageData = MessageDataProcessor.DecodeBytes(rawMessageData).Trim(); MessageDataProcessor.PadMessageReader(reader); }
public IHtmlString TextBox(string id, TextBoxType type = TextBoxType.Texto, bool exibirMsgValidacao = true, object htmlAttributes = null) { var attributes = new RouteValueDictionary(htmlAttributes); var labelBuilder = new TagBuilder("label"); labelBuilder.AddCssClass("input"); switch (type) { case TextBoxType.Nome: var iconBuilderNome = new TagBuilder("i"); iconBuilderNome.MergeAttribute("class", "icon-prepend fa fa-user"); labelBuilder.InnerHtml += iconBuilderNome; break; case TextBoxType.Email: var iconBuilderEmail = new TagBuilder("i"); iconBuilderEmail.MergeAttribute("class", "icon-prepend fa fa-envelope-o"); labelBuilder.InnerHtml += iconBuilderEmail; break; case TextBoxType.Telefone: var iconBuilderTelefone = new TagBuilder("i"); iconBuilderTelefone.MergeAttribute("class", "icon-prepend fa fa-phone"); labelBuilder.InnerHtml += iconBuilderTelefone; break; case TextBoxType.Cep: attributes.Add("data-mask", "99.999-999"); break; case TextBoxType.Senha: var iconBuilderSenha = new TagBuilder("i"); iconBuilderSenha.MergeAttribute("class", "icon-prepend fa fa-lock"); labelBuilder.InnerHtml += iconBuilderSenha; break; } var textBoxHelper = helper.TextBox(id, helper.Value(id).ToHtmlString(), attributes); labelBuilder.InnerHtml += textBoxHelper; var tagMsgValidation = string.Empty; if (!helper.ViewData.ModelState.IsValidField(id)) { labelBuilder.AddCssClass("state-error"); if (exibirMsgValidacao) { var validationBuilder = helper.ValidationMessage(id).ToString().Replace("span", "em"); tagMsgValidation += validationBuilder.ToString(); } } var htmlRetorno = labelBuilder + tagMsgValidation; return(MvcHtmlString.Create(htmlRetorno)); }
public TextBox CreateTextBox(TextBoxType type) { TextBox txtBox = new TextBox { HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Top }; Grid.SetRow(txtBox, Index); if (type == TextBoxType.DirectoryNameTextBox) { txtBox.Name = String.Concat(DIRECTORY_NAME_TEXTBOX_NAME, Index); txtBox.IsReadOnly = false; txtBox.Width = 200; txtBox.Margin = new Thickness(105, 30, 5, 0); } if (type == TextBoxType.KeyTextBox) { txtBox.Name = String.Concat(KEY_TEXTBOX_NAME, Index); txtBox.IsReadOnly = true; txtBox.Width = 40; txtBox.Margin = new Thickness(35, 4, 0, 0); } return(txtBox); }
protected void Page_Load(object sender, EventArgs e) { this.vehicleId = Common.GetEncryptedQueryStringValue("vehicleId", 0); LabelPageTitle.Text = (this.vehicleId == 0) ? "New Vehicle" : "Edit Vehicle"; PanelError.Visible = false; Page.Form.DefaultFocus = TextBoxType.ClientID; Page.Form.DefaultButton = ButtonSaveList.UniqueID; if (!IsPostBack) { TextBoxType.Focus(); ButtonSaveEdit.Visible = true; ButtonSaveNew.Visible = true; BindVehicleOwnership(); BindVehicleInsuranceBand(); if (ViewState["vehicleId"] != null) { this.vehicleId = Convert.ToInt32(ViewState["vehicleId"].ToString()); } if (this.vehicleId != 0) { BindVehicle(); } } }
Data(TextBoxType type, double min, double max, string regEx) { BoxType = type; Min = min; Max = max; RegEx = regEx; }
public static string GetInputType(this TextBoxType type) { switch (type) { case TextBoxType.Color: return("color"); case TextBoxType.Email: return("email"); case TextBoxType.Number: return("number"); case TextBoxType.Password: return("password"); case TextBoxType.Range: return("range"); case TextBoxType.Url: return("url"); case TextBoxType.Search: return("search"); case TextBoxType.Telephone: return("tel"); case TextBoxType.Text: return("text"); default: throw new Exception(); } }
public TextBox(Vector2 pos, TelephoneBase tel, TextBoxType tbt, String text, int maxStringSize) : base(pos) { this.name = text; boxType = tbt; font = TelephoneBase.font; maxSize = maxStringSize - 1; }
public HudTextBox(TextBoxSettings boxSettings) { this.boxType = boxSettings.boxType; this.areaRelativeToScreen = boxSettings.areaRelativeToScreen; this.textArea = boxSettings.textArea; this.guiStyle = boxSettings.guiStyle; }
public void RemoveHudText(TextBoxType boxType, int ID) { HudTextBox theBox = GetHudTextOfType(boxType); if (theBox == null) { return; } theBox.RemoveText(ID); }
private bool CheckTextIfEmpty(string text, TextBoxType type) { if (text.Replace(" ", "").Length <= 0) { ShowWarningMessage($"{type.ToString()}을(를) 다시 입력해주세요. 원인 : {ErrorType.공란}", "틀렸다 닝겐"); return(false); } else { return(true); } }
/// <summary> /// Called by parent class for drawing specific variables at top. /// Parent class should automatically check for when it is dirty. /// </summary> protected override void DrawChildInspector() { boxType = (TextBoxType)EditorGUILayout.EnumPopup("Box Type", boxType); textOrder = (TextOrder)EditorGUILayout.EnumPopup("Text Order", textOrder); bool drawList_texts = true; bool drawList_sendIDsForRemoval = true; EditorHelper.DrawResizableList <string> ("Texts", ref drawList_texts, ref texts, DrawEntry_Text); EditorHelper.DrawResizableList <TriggeredBehaviour_RemoveHudText> ("Send Removal IDs", ref drawList_sendIDsForRemoval, ref sendTextIDsForRemoval, DrawEntry_SendForRemoval); }
private bool ValidateLength(TextBoxType Type, string value, int precision) { switch (Type) { case TextBoxType.Integer: return(value == null || value.Length <= MaxLength); case TextBoxType.Decimal: if (value == null) { return(true); } else if (precision == 0) { return(value.Length <= MaxLength); } else { int separatorLength = System.Globalization.NumberFormatInfo.CurrentInfo.NumberDecimalSeparator.Length; int decPointIndex = value.IndexOf(NumberFormatInfo.CurrentInfo.NumberDecimalSeparator); if (decPointIndex == -1) { decPointIndex = value.IndexOf(NumberFormatInfo.CurrentInfo.CurrencyDecimalSeparator); if (decPointIndex != -1) { separatorLength = NumberFormatInfo.CurrentInfo.CurrencyDecimalSeparator.Length; } } int fractionalLength = separatorLength + precision; if (decPointIndex == -1) { return(value.Length <= MaxLength - fractionalLength); } else if (decPointIndex == 0) { return(true); } else { return(value.Substring(0, decPointIndex).Length <= MaxLength - fractionalLength); } } default: return(true); } }
private HudTextBox GetHudTextOfType(TextBoxType boxType) { for (int i = 0; i < _hudTextBoxes.Count; i++) { if (_hudTextBoxes[i].boxType == boxType) { return(_hudTextBoxes[i]); } } return(null); }
public void ValidateEmail(string enumType, TextBox textBox) { TextBoxType textBoxType = (TextBoxType)Enum.Parse(typeof(TextBoxType), enumType.ToLower()); switch (textBoxType) { case TextBoxType.email: if (!textBox.Text.IsValidInput(Constants.Email)) { Helper.DisplayMessage("Please Enter a Valid Email"); } break; } }
private TextBox CreateTextBox(TextBoxType type) { TextBox textBox = new TextBox { Name = type == TextBoxType.SubfolderTextBox ? String.Format(DIRECTORY_NAME_TEXTBOX_NAME, Index) : String.Format(KEY_TEXTBOX_NAME, Index) }; textBox.Style = type == TextBoxType.SubfolderTextBox ? textBox.FindResource("SubfolderNameTextBoxStyle") as Style : textBox.FindResource("KeyTextBoxStyle") as Style; return(textBox); }
public TextBoxBuilder <TModel, TProperty> Type(TextBoxType type) { _type = type; if (type == TextBoxType.Readonly) { HtmlAttributes["readonly"] = ""; } else { HtmlAttributes.Remove("readonly"); } return(this); }
/// <summary> /// Constructor /// </summary> /// <param name="side">Which side of the page the portrait should be on.</param> /// <param name="sprite">Sprite to use on the box</param> /// <param name="color">Main color of the text</param> /// <param name="text">Dialogue to be spoken.</param> public AvatarBox(Side side, Sprite sprite, Color color, string text) : base(text, color, TextEffect.TYPE, "Blip_0", TEXT_SPEED) { this.Sprite = sprite; if (side == Side.LEFT) { type = TextBoxType.LEFT; } else { type = TextBoxType.RIGHT; } }
void DatePartTextBox_MouseWheel(object sender, MouseWheelEventArgs e) { DatePartTextBox t = sender as DatePartTextBox; if (t == null) { return; } TextBoxType tType = t.PartType; bool positiveIncrement = e.Delta > 0; int currentValue = -1; ChangedValue(t, tType, positiveIncrement, currentValue); }
public static AbstractTextBox GetTextBox(TextBoxType type) { switch (type) { case TextBoxType.Steel: return(new SteelTextBox()); case TextBoxType.Rubber: return(new RubberTextBox()); case TextBoxType.Wood: return(new WoodTextBox()); } return(null); }
public static bool TryGetTagName(this TextBoxType textBoxType, out string tagName) { switch (textBoxType) { case TextBoxType.Normal: tagName = "input"; return(true); case TextBoxType.MultiLine: tagName = "textarea"; return(true); default: tagName = null; return(false); } }
public VE_TextBox(TextBoxType tbType, double width, double height, string text) { InitializeComponent(); switch (tbType) { case TextBoxType.TimeTextBox: InitPropForTimeTextBox(); break; case TextBoxType.IndicatorTextBox: InitPropForIndicatorTextBox(); break; } Width = width; Height = height; Text = text; }
public static bool TryGetInputType(this TextBoxType textBoxType, out string inputType) { switch (textBoxType) { case TextBoxType.Password: inputType = "password"; return(true); case TextBoxType.Telephone: inputType = "tel"; return(true); case TextBoxType.Url: inputType = "url"; return(true); case TextBoxType.Email: inputType = "email"; return(true); case TextBoxType.Date: inputType = "date"; return(true); case TextBoxType.Time: inputType = "time"; return(true); case TextBoxType.Color: inputType = "color"; return(true); case TextBoxType.Search: inputType = "search"; return(true); case TextBoxType.Number: inputType = "number"; return(true); default: inputType = null; return(false); } }
/// <summary> /// Creates and initialises your textbox widget. After you create it and adjust its properties, /// add it to the GuiManager with Addwidget /// </summary> /// <param name="px">X position of the widget relative to the GuiManagers Surface</param> /// <param name="py">Y position of the widget relative to the GuiManagers Surface</param> /// <param name="w">Width of widget</param> /// <param name="h">Height of widget</param> /// <param name="size">Font size of input</param> /// <param name="type">Type of input</param> public GuiTextBox(int px, int py, int w, int h, int size = 12, TextBoxType type = TextBoxType.NORMAL) : base(px, py, w, h) { PosX = px; PosY = py; Width = w; Height = h; textBoxType = type; text = new Text(); text.Color = Color.Black; text.FontSize = size; TextBox = Image.CreateRectangle(Width, Height); TextBox.Color = Color.White; clickTimer = 0; RenderAfterEntity = true; OnTextChangeEvent += OnTextChange; }
void DatePartTextBox_KeyUp(object sender, KeyEventArgs e) { bool isArrowsPressed = e.Key == Key.Up || e.Key == Key.Down || e.Key == Key.Left || e.Key == Key.Right; if (isArrowsPressed) { DatePartTextBox t = sender as DatePartTextBox; if (t == null) { return; } TextBoxType tType = t.PartType; int currentValue = -1; bool positiveIncrement = e.Key == Key.Up || e.Key == Key.Right; ChangedValue(t, tType, positiveIncrement, currentValue); } }
private TextBox CreateCommonTextbox(JiraField field, TextBoxType type = TextBoxType.Common) { var txt = new TextBox(); txt.Font = new Font(Font.FontFamily, 11); txt.Width = 230; txt.Tag = new ControlTagPackage { Field = field, ID = field.Schema.CustomID }; switch (type) { case TextBoxType.Common: case TextBoxType.Number: txt.TextChanged += CommonTextBox_TextChanged; break; case TextBoxType.Label: txt.TextChanged += LabelTextBox_TextChanged; break; } txt.TabIndex = CurrentFieldCount; return(txt); }
public int AddHudText(TextBoxType boxType, string text) { HudTextBox theBox = GetHudTextOfType(boxType); //TODO: DANGEROUS HARD-CODED NUMBER //TODO: DANGEROUS HARD-CODED NUMBER if (theBox == null) { Debug.LogError("Attempted AddHudText but could not find requested HudTextBoxType: " + boxType.ToString()); //TODO: DANGEROUS HARD-CODED NUMBER return(int.MaxValue); } //TODO: DANGEROUS HARD-CODED NUMBER //TODO: DANGEROUS HARD-CODED NUMBER int ID = _nextHudTextID; _nextHudTextID++; theBox.AddText(ID, text); return(ID); }
public TextBoxControl(bool hideTag, TextBoxType textBoxType, AWPropertyAttribute attribute) { InitializeComponent(); if (hideTag) { TagLabel.Visibility = Visibility.Collapsed; } if (attribute is AWFilePathAttribute filePathAttribute) { Element.Visibility = Visibility.Collapsed; PathElement.Visibility = Visibility.Visible; VisualHelper.LeftClick(PathElement, _ => { if (DataContext is VisualTypeContext context) { context.Value = VisualHelper.SelectFile(filePathAttribute.Message, filePathAttribute.Filter, context.Value?.ToString(), filePathAttribute.OnlyFolder); } }); } else { if (attribute is AWLimitAttribute limitAttribute && limitAttribute.MaxLength > 0) { Element.MaxLength = limitAttribute.MaxLength; } if (textBoxType != TextBoxType.String) { VisualHelper.LimitInput(Element, textBoxType == TextBoxType.Double ? LimitType.Double : LimitType.Int, (attribute as AWLimitAttribute)?.AllowedStrings); } VisualHelper.ExitOnEnter(Element); } }
/// <summary> /// Creates and initialises your textbox widget. After you create it and adjust its properties, /// add it to the GuiManager with AddWidjet /// </summary> /// <param name="px">X position of the widjet relative to the GuiManagers Surface</param> /// <param name="py">Y position of the widjet relative to the GuiManagers Surface</param> /// <param name="w">Width of widjet</param> /// <param name="h">Height of widjet</param> /// <param name="size">Font size of input</param> /// <param name="type">Type of input</param> public GuiTextBox(int px, int py, int w, int h, int size = 12, TextBoxType type = TextBoxType.NORMAL) : base(px, py, w, h) { PosX = px; PosY = py; Width = w; Height = h; textBoxType = type; TextDisplay = new Text(); TextDisplay.Color = Color.Black; TextDisplay.FontSize = size; TextBox = Image.CreateRectangle(Width, Height); TextBox.Color = Color.White; TextBoxBlinker = Image.CreateRectangle(1, size, Color.Black); BlinkerAdjustment = (int)(size * 0.1f); clickTimer = 0; RenderAfterEntity = true; OnTextChangeEvent += new EventHandler(OnTextChange); }
private bool CheckTextIfValid(string text, TextBoxType type) { bool isTextValid = true; switch (type) { case TextBoxType.잔여금액: if (text.Equals("") || int.Parse(text) < 0) { ShowWarningMessage($"{type.ToString()}을(를) 다시 입력해주세요. 원인 : {ErrorType.유효하지않음}", "틀렸다 닝겐"); isTextValid = false; } break; case TextBoxType.핸드폰번호: if (text.Length > 11) { ShowWarningMessage($"{type.ToString()}을(를) 다시 입력해주세요. 원인 : {ErrorType.유효하지않음}", "틀렸다 닝겐"); isTextValid = false; } break; } return(isTextValid); }
public TextBox(string textureName, string pointerTextureName, TextBoxType category, DrawPriority priority) : base(textureName, priority) { Category = category; LoadAttributes(); Active = true; }
private TextBox CreateCommonTextbox(JiraField field, TextBoxType type = TextBoxType.Common) { var txt = new TextBox(); txt.Font = new Font(Font.FontFamily, 11); txt.Width = 230; txt.Tag = new ControlTagPackage { Field = field, ID = field.Schema.CustomID }; switch (type) { case TextBoxType.Common: case TextBoxType.Number: txt.TextChanged += CommonTextBox_TextChanged; break; case TextBoxType.Label: txt.TextChanged += LabelTextBox_TextChanged; break; } txt.TabIndex = CurrentFieldCount; return txt; }
public GameTextBoxes(string name, float x, float y, String text, String dynamic, TextBoxType type, GameObject gameObject, string panel) : base(name, text, dynamic, type, gameObject,panel) { }