Skip to content

A liveCode script widget that allows placeholder/hint text (optionally animated) and password field function

License

Notifications You must be signed in to change notification settings

stam66/placeholderField

Repository files navigation

placeholderField widget

Current version: 1.0.0 Special thanks to @BerndN for adding the polish by fixing issues with animation and traversalOn.

PlaceholderField is a script widget that provides a text field that includes a placeholder text as user prompty that disappears on entering text and reappears of field is empty. Optionally include a subtle animation when showing/hiding placeholder text. Includes password functionality to obscure text with bullet points and a new control is made visible to show/hide password text.
Script widgets were introduced in LiveCode version 10 DP5 and this requires this version or higher. Screenshot 2023-12-19 at 10 35 33

All properties are settable in the widget's Property Inspector. Documentation should appear in the Dictionary once loaded.

Properties

  • placeholderText: the placeholder/hint text to show (default = "Placeholder text")
  • textContent: the text the field contains, used when passwordField = true
  • normalTextColor: textColor for user-entered text (default = 66,66,66)
  • normalTextStyle: textStyle for user-entered text (default = "Plain")
  • textScaleFactor: scales text relative to field height - default = 0.4 (40% of the field's Height)
  • placeholderTextColor: placeholder text's textColor (defualt = 170,170,170)
  • placeholderTextStyle: placeholder text's textStyle (default = "Italic")
  • passwordField: setting this to true obscures text with bullet ponts (default = false)
  • obscureText: shows/hides text if passwordField = true (defuault = true)
  • bulletDelay: slight delay from 0 to 500 ms in typed letter changing to bullet,like on iOS (default 150 ms)
  • animatedPlaceholder: animates placeholder showing or hiding with moving in or out from the right (default = false)
  • animationDuration: duration of animation of placeholder (default = 250 ms)
  • widgetBorderWidth: the borderWidth of the text field (default = 2)
  • widgetBorderColor: the borderColor of the text field (default = 66,66,66)
  • widgetBackroundColor: the backgroundColor of the text field (default = 255,255,255)
  • widgetTraversalOn: the traversalOn of the widget (default = true)

About

A liveCode script widget that allows placeholder/hint text (optionally animated) and password field function

Resources

License

Stars

Watchers

Forks

Packages

No packages published