- 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.23.2.8 2020/07/03 07:27:29 gustafn Exp $
Procedures in this file
- ad_color_to_hex (public)
- ad_color_widget (public)
- ad_color_widget_js (public)
- ad_dateentrywidget (public)
- ad_db_select_widget (public)
- ad_future_years_list (public)
- ad_generic_optionlist (public)
- ad_html_colors (public)
- ad_integer_optionlist (public)
- ad_process_color_widgets (public)
- 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
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- ad_color_to_hex
ad_color_widget (public)
ad_color_widget name default [ use_js ]
Returns a color selection widget, optionally using JavaScript. Default is a string of the form '0,192,255'.
- Parameters:
- name
default
use_js (defaults to"0"
)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
ad_color_widget_js (public)
ad_color_widget_js
Returns JavaScript code necessary to use color widgets.
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
ad_dateentrywidget (public)
ad_dateentrywidget column [ value ]
Returns form pieces for a date entry widget. A null date may be selected.
- Parameters:
- column
value (defaults to"0"
)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
ad_db_select_widget (public)
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
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
- Switches:
- -size (defaults to
"0"
) (optional)- -multiple (defaults to
"0"
) (optional)- -default (optional)
- -option_list (optional)
- -blank_if_no_db (defaults to
"0"
) (optional)- -hidden_if_one_db (defaults to
"0"
) (optional)- -bind (optional)
- Parameters:
- statement_name
sql_qry
name
- 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 (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
values
default (optional)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
ad_html_colors (public)
ad_html_colors
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
end_value
default (optional)
pad_to_two_p (defaults to"0"
)
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
ad_process_color_widgets (public)
ad_process_color_widgets [ args... ]
Sets variables corresponding to the color widgets named in $args.
- 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 (defaults to"country_code"
)
size_subtag (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 (defaults to"usps_abbrev"
)
See Also:- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.