ad_color_widget (public, deprecated)

 ad_color_widget name default [ use_js ]

Defined in packages/acs-tcl/tcl/widgets-procs.tcl

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):
%3 ad_generic_optionlist ad_generic_optionlist (public) ad_html_colors ad_html_colors (public, deprecated) ad_log_deprecated ad_log_deprecated (public) template::add_event_listener template::add_event_listener (public) ad_color_widget ad_color_widget ad_color_widget->ad_generic_optionlist ad_color_widget->ad_html_colors ad_color_widget->ad_log_deprecated ad_color_widget->template::add_event_listener

Testcases:
No testcase defined.
Source code:
ad_log_deprecated proc ad_color_widget
    set out {<table cellspacing="0" cellpadding="0"><tr><td>}
    append out [subst {<select name="$name.list"}]
    if { $use_js != 0 } {
        set id [clock clicks -microseconds]
        append out [subst { id="select-$id"}]
        template::add_event_listener  -id select-$id -event change  -script [subst {adUpdateColorText('$name');}]
    }
    append out ">\n"

    set items [list "custom:" "none"]
    set values [list "custom" ""]

    foreach color [ad_html_colors] {
        lappend items [lindex $color 0]
        lappend values "[lindex $color 1],[lindex $color 2],[lindex $color 3]"
    }

    append out "[ad_generic_optionlist $items $values $default]</select>\n"

    if { ![regexp {^([0-9]+),([0-9]+),([0-9]+)$} $default all c1 c2 c3] } {
        set c1 ""
        set c2 ""
        set c3 ""
    }

    foreach component { c1 c2 c3 } {
        append out [subst { <input name="$name.$component" size="3" value="[set $component]"}]
        if { $use_js } {
            append out [subst { id="input-$component-$id"}]
            template::add_event_listener  -id input-$component-$id -event change  -script [subst {adUpdateColorList('$name');}]
        }
        append out ">"
    }

    if { $use_js == 1 } {
        if { $c1 eq "" } {
            set c1 255
            set c2 255
            set c3 255
        }
        append out [subst {</td><td>&nbsp;
                           <img name="color_$name" src="/shared/1pixel.tcl?r=$c1&g=$c2&b=$c3" width="26" height="26" style="border:1">
        }]
    }
    append out "</td></tr></table>\n"
    return $out
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/acs-tcl/tcl/widgets-procs.xql

[ hide source ] | [ make this the default ]
Show another procedure: