Commit cc499edbb02193179d79e03d6837386fb68d9958

Authored by David RENE
1 parent bf3793f8

add button in Actioner_Aspect

Showing 1 changed file with 49 additions and 1 deletions   Show diff stats
calexium_lib/web/CXM_making_a_web_site.anubis
... ... @@ -918,6 +918,8 @@ public type Actioner_Target:
918 918 public type Actioner_Aspect:
919 919 link (List(Text_Option),String text, Maybe(String) name), // hypertext link
920 920 push_button (List(CoreAttrs),String text),
  921 + button (String url_off, String url_on), // rollover button
  922 + button (String url_off, String url_on, Int32 w, Int32 h), // idem with size
921 923 submit (List(CoreAttrs),String text),
922 924 immediate_selector (WebArgName name, Int32 size, List((WebArgValue,String)) choices),
923 925 immediate_selector (WebArgName name, Int32 size, List((WebArgValue,String)) choices, InitialValue selected).
... ... @@ -959,7 +961,12 @@ public define Actioner_Aspect
959 961 ) =
960 962 link([], i).
961 963  
962   -
  964 +public define Actioner_Aspect
  965 + button
  966 + (
  967 + String url_img
  968 + ) =
  969 + button(url_img,url_img).
963 970  
964 971 Actioners are explained in details below.
965 972  
... ... @@ -3090,6 +3097,8 @@ define Maybe(String)
3090 3097 {
3091 3098 link(_,_,_) then failure,
3092 3099 push_button(opts,_) then extract_id(opts),
  3100 + button(_,_) then failure,
  3101 + button(_,_,_,_) then failure,
3093 3102 submit(opts,_) then extract_id(opts),
3094 3103 immediate_selector(_,_,_) then failure,
3095 3104 immediate_selector(_,_,_,_) then failure,
... ... @@ -3138,6 +3147,32 @@ define Printable_tree
3138 3147 [s,"<input type=\"button\" value=\"",text,"\"", format_attrs(options), " onclick=\"",h,"\" />"]
3139 3148 }
3140 3149 ],
  3150 + button(url_off,url_on) then
  3151 + [ if action is
  3152 + {
  3153 + url(u) then ["<a href=\"",u],
  3154 + javascript(s,h) then [s,"<a onMouseDown=\"",h]
  3155 + },
  3156 + "\" style=\"text-decoration:none\">",
  3157 + "<img alt=\"",url_off,"\" src=\"",url_off,"\" border=0",
  3158 + " onMouseOver=\"this.src='",url_on,"'\" ",
  3159 + " onMouseOut=\"this.src='",url_off,"'\">",
  3160 + "</a>"
  3161 + ],
  3162 +
  3163 + button(url_off,url_on,w,h) then
  3164 + [ if action is
  3165 + {
  3166 + url(u) then ["<a href=\"",u],
  3167 + javascript(s,h) then [s,"<a onMouseDown=\"",h]
  3168 + },
  3169 + "\" style=\"text-decoration:none\">",
  3170 + "<img width=",w," height=",h," alt=\"",url_off,"\" src=\"",url_off,"\" border=0",
  3171 + " onMouseOver=\"this.src='",url_on,"'\" ",
  3172 + " onMouseOut=\"this.src='",url_off,"'\">",
  3173 + "</a>"
  3174 + ],
  3175 +
3141 3176 submit(options, text) then
3142 3177 [
3143 3178 if action is
... ... @@ -3192,6 +3227,19 @@ define Printable_tree
3192 3227 {
3193 3228 link(opt,text,name) then [text],
3194 3229 push_button(opt, text) then [text],
  3230 + button(url_off,url_on) then
  3231 + [
  3232 + "<img alt=\"",url_off,"\" src=\"",url_off,"\" border=0",
  3233 + " onMouseOver=\"this.src='",url_on,"'\" ",
  3234 + " onMouseOut=\"this.src='",url_off,"'\">",
  3235 + ],
  3236 +
  3237 + button(url_off,url_on,w,h) then
  3238 + [
  3239 + "<img width=",w," height=",h," alt=\"",url_off,"\" src=\"",url_off,"\" border=0",
  3240 + " onMouseOver=\"this.src='",url_on,"'\" ",
  3241 + " onMouseOut=\"this.src='",url_off,"'\">",
  3242 + ],
3195 3243 submit(opt, text) then [text],
3196 3244 immediate_selector(name,size,choices) then alert,
3197 3245 immediate_selector(name,size,choices,selected) then alert,
... ...