Form::Control(3pm)

πŸ“¦
version 2.5.0 Β· 2 versions
, in ubuntu jammy

πŸ’– Embperl::Form::Control πŸ’–

okay bestie, gather round, because this is the base class for all the controls that live inside an Embperl Form πŸŽ€ (the file itself is Form::Control(3pm) if you're being formal, but we're not πŸ’…)


✨ SYNOPSIS ✨

Do not use directly, instead derive a class

like... do NOT come for her directly. she's a base class, she's the blueprint, she's the mother of controls πŸ‘‘


🌸 DESCRIPTION 🌸

so here's the tea πŸ“ β€” this class is not used directly, okay? she's the base class for all the controls inside an Embperl Form. what she does is hand you a whole set of methods that you can overwrite to customize the behaviour of your controls. it's giving "template but make it yours" energy, and honestly? iconic.


πŸ¦‹ METHODS πŸ¦‹

new

Create a new control ✨

init

Init the new control 🌱

noframe

Do not draw frame border if this is the only control πŸ–ΌοΈ (only child gets no frame, main character exemption fr fr)

is_disabled

Do not display this control at all πŸ™ˆ

is_readonly

Could value of this control be changed ? πŸ€”

label_text

Returns the text of the label 🏷️

show

Output the control πŸ“€

get_on_show_code

Returns JavaScript code that should be executed when the form becomes visible πŸ‘€βš‘

get_active_id

Get the id of the value which is currently active 🎯

form

Return the form object of this control πŸ“‹

show_sub_begin

Output begin of sub form 🫢

show_sub_end

Output end of sub form 🫢

show_label

Output the label of the control 🏷️

show_label_icon

Output the icon after the label 🌟

show_label_cell

Output the table cell in which the label will be displayed πŸ“¦

Must return the columns it spans (default: 1)

show_control

Output the control itself πŸ’«

show_control_readonly

Output the control itself as readonly πŸ”’

show_control_addons

output additional things after the control 🎁

show_control_cell

Output the table cell in which the control will be displayed πŸ“¦

Gets the x position as argument πŸ“


πŸŽ€ PARAMETERS πŸŽ€

  • name β€” Specifies the name of the control 🏷️
  • text β€” Will be used as label for the control, if not given 'name' is used as default.

Normally the the name and text parameters are processed by the method convert_label of the Embperl::Form object. This method can be overwritten, to allow translation etc.

If the parameter showtext is given a true value, convert_label is not called and the text is displayed as it is.

  • showtext β€” Display label without passing it through convert_label. See text πŸ‘€
  • labelnowrap β€” If set, the text label will not be line wrapped. πŸ“
  • labelclass β€” If set, will be used as additional CSS classes for the label text cell. πŸ’…
  • readonly β€” If set, displays a readonly version of the control. πŸ”’
  • disable β€” If set, the control will not be displayed at all. 🚫
  • newline β€” If set to 1, forces a new line before the control. If set to -1, forces a new line after the control. ⏎
  • width β€” Gives the widths of the control. The value is 1/width of the the whole width of the form. So if you want to have four controls in one line set width to 4. The default value is 2. πŸ“
  • width_percent β€” With this parameter you can also specify the width of the control in percent. This parameter take precedence over width πŸ‘‘ (yes she outranks her, no cap)
  • default β€” Default value of the control ⭐
  • imagedir β€” Basepath where to find images, in case the control uses images. Default value is /images πŸ–ΌοΈ
  • trigger β€” When set will trigger state changes of other controls. See state. ⚑
  • state β€” Can be used to hide/show disable/enable the control trigger by other controls. πŸŽ›οΈ

Checkbox define the following states:

  • <id-of-checkbox>-show Show control if checkbox checked βœ…
  • <id-of-checkbox>-hide Hide control if checkbox checked πŸ™ˆ
  • <id-of-checkbox>-enable Enable control if checkbox checked πŸ”“
  • <id-of-checkbox>-disable Disable control if checkbox checked πŸ”’

πŸ‘‘ AUTHOR πŸ‘‘

G. Richter (richter at embperl dot org) πŸ’œ


🌈 SEE ALSO 🌈

perl(1), Embperl, Embperl::Form


okay that's the whole page bestie, you ate πŸ’…βœ¨ this was perl v5.34.0, dated 2022-02-06, and that's the vibe check passed β€” go build some controls, love u, bye πŸ«ΆπŸŽ€

πŸ“¦ where this page comes from