- Publicity: Public Only All
widgets-procs.tcl
UI widgets for use in forms, etc.
- Location:
- packages/acs-tcl/tcl/widgets-procs.tcl
- CVS Identification:
$Id: widgets-procs.tcl,v 1.25 2024/09/11 06:15:48 gustafn Exp $
Procedures in this file
- ad_color_to_hex (public)
- ad_color_widget (public, deprecated)
- ad_color_widget_js (public, deprecated)
- ad_dateentrywidget (public, deprecated)
- ad_db_select_widget (public, deprecated)
- ad_future_years_list (public)
- ad_generic_optionlist (public)
- ad_html_colors (public, deprecated)
- ad_integer_optionlist (public)
- ad_process_color_widgets (public, deprecated)
- country_widget (public, deprecated)
- day_list (public, deprecated)
- future_years_list (public, deprecated)
- long_month_list (public, deprecated)
- month_list (public, deprecated)
- month_value_list (public, deprecated)
- us_state_widget (public, deprecated)
Detailed information
ad_color_to_hex (public)
ad_color_to_hex triplet
Converts a string of the form 0,192,255 to a string of the form #00C0FF.
- Parameters:
- triplet (required)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- ad_color_to_hex
ad_color_widget (public, deprecated)
ad_color_widget name default [ use_js ]
Deprecated. Invoking this procedure generates a warning.
Returns a color selection widget, optionally using JavaScript. Default is a string of the form '0,192,255'. DEPRECATED: HTML now has a native color widget that requires no custom implementation.
- Parameters:
- name (required)
- default (required)
- use_js (optional, defaults to
"0"
)- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
ad_color_widget_js (public, deprecated)
ad_color_widget_js
Deprecated. Invoking this procedure generates a warning.
Returns JavaScript code necessary to use color widgets. DEPRECATED: HTML now has a native color widget that requires no custom implementation.
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
ad_dateentrywidget (public, deprecated)
ad_dateentrywidget column [ value ]
Deprecated. Invoking this procedure generates a warning.
Returns form pieces for a date entry widget. A null date may be selected. DEPRECATED: better alternatives exist for date-entry widgets, which would also support localization.
- Parameters:
- column (required)
- value (optional, defaults to
"0"
)- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
ad_db_select_widget (public, deprecated)
ad_db_select_widget [ -size size ] [ -multiple multiple ] \ [ -default default ] [ -option_list option_list ] \ [ -blank_if_no_db blank_if_no_db ] \ [ -hidden_if_one_db hidden_if_one_db ] [ -bind bind ] \ statement_name sql_qry name
Deprecated. Invoking this procedure generates a warning.
given a SQL query this generates a select group. If there is only one value it returns the text and a hidden variable setting that value. The first selected column should contain the optionlist items. The second selected column should contain the optionlist values.
option_list is a list in the same format (i.e. {{str val} {str2 val2}...}) which is prepended to the list
if sql_qry is null then the list is constructed from option_list only.
if there is only one item the select is not generated and the value is passed in hidden form variable.
if -multiple is given then a multi select is returned.
if -blank_if_no_db is true, then do not return a select widget unless there are rows from the database DEPRECATED: the template system offers better ways to produce markup from a query nowadays.
- Switches:
- -size (optional, defaults to
"0"
)- -multiple (optional, defaults to
"0"
)- -default (optional)
- -option_list (optional)
- -blank_if_no_db (optional, defaults to
"0"
)- -hidden_if_one_db (optional, defaults to
"0"
)- -bind (optional)
- Parameters:
- statement_name (required)
- sql_qry (required)
- name (required)
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
ad_future_years_list (public)
ad_future_years_list [ num_year ]
Returns a list containing the next num_year years in the future.
- Parameters:
- num_year (optional, defaults to
"10"
)- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- ad_future_years_list
ad_generic_optionlist (public)
ad_generic_optionlist items values [ default ]
Use this to build select form fragments. Given a list of items and a list of values, will return the option tags with default highlighted as appropriate.
- Parameters:
- items (required)
- values (required)
- default (optional)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- ad_generic_optionlist
ad_html_colors (public, deprecated)
ad_html_colors
Deprecated. Invoking this procedure generates a warning.
Returns an array of HTML colors and names.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
ad_integer_optionlist (public)
ad_integer_optionlist start_value end_value [ default ] \ [ pad_to_two_p ]
Produces an optionlist for a range of integers from start_value to end_value. If default matches one of the options, it is selected. If pad_to_two_p is 1, the option values will be padded to 2 digits with a leading 0.
- Parameters:
- start_value (required)
- end_value (required)
- default (optional)
- pad_to_two_p (optional, defaults to
"0"
)- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- ad_integer_optionlist
ad_process_color_widgets (public, deprecated)
ad_process_color_widgets [ args... ]
Deprecated. Invoking this procedure generates a warning.
Sets variables corresponding to the color widgets named in $args. DEPRECATED: HTML now has a native color widget that requires no custom implementation.
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
country_widget (public, deprecated)
country_widget [ default ] [ select_name ] [ size_subtag ]
Deprecated. Invoking this procedure generates a warning.
Returns a country selection box. This widget depends on the ref-countries package. DEPRECATED for various reasons: doesn't comply with OpenACS naming convention, difficult to style, no good separation of Tcl and HTML, 'size_subtag' is just implemented code injection and furthermore, default value might depend on a parameter designed just for "american readers". A better alternative would be e.g. implementing this using the templating system.
- Parameters:
- default (optional)
- select_name (optional, defaults to
"country_code"
)- size_subtag (optional, defaults to
"size='4'"
)- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
day_list (public, deprecated)
day_list
Deprecated. Invoking this procedure generates a warning.
DEPRECATED: this proc does not comply with OpenACS naming convention and does not provide much value. One can e.g. use 'clock' based idioms to compute the number of days that are in a specific month.
- See Also:
- clock
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
future_years_list (public, deprecated)
future_years_list [ args... ]
Deprecated. Invoking this procedure generates a warning.
Returns a list containing the next num_year years in the future. DEPRECATED: use the version complying with naming convention
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
long_month_list (public, deprecated)
long_month_list
Deprecated. Invoking this procedure generates a warning.
Returns list of months DEPRECATED: this proc does not comply with OpenACS naming convention and is not localized. 'clock' based idioms can provide a localized list of months and/or message keys can be used.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
month_list (public, deprecated)
month_list
Deprecated. Invoking this procedure generates a warning.
Returns list of month abbreviations DEPRECATED: this proc does not comply with OpenACS naming convention and is not localized. 'clock' based idioms can provide a localized list of months and/or message keys can be used.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
month_value_list (public, deprecated)
month_value_list
Deprecated. Invoking this procedure generates a warning.
DEPRECATED: this proc does not comply with OpenACS naming convention and does not provide much value.
- See Also:
- clock
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
us_state_widget (public, deprecated)
us_state_widget [ default ] [ select_name ]
Deprecated. Invoking this procedure generates a warning.
Returns a state selection box. This widget depends on the ref-us-states package. DEPRECATED for various reasons: doesn't comply with OpenACS naming convention, difficult to style, no good separation of Tcl and HTML, 'select_name' is prone to code injection and the proc depends on an external package. A better alternative would be e.g. implementing this using the templating system.
- Parameters:
- default (optional)
- select_name (optional, defaults to
"usps_abbrev"
)- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.