Roxen.git
/
server
/
modules
/
graphics
/
gbutton.pike
version
»
Context lines:
10
20
40
80
file
none
3
Roxen.git/server/modules/graphics/gbutton.pike:6:
// Usage: // // <gbutton // bgcolor -- background color inside/outside button // bordercolor -- button border color // textcolor -- button text color // href -- button URL // alt -- alternative button alt text // border -- image border
-
//
dim
--
when
set
button
is disabled
-
//
condensed
--
when
set button
text
is condensed to 80%
+
//
state
--
enabled|disabled
button
state
+
//
textstyle
--
normal|consensed
text
// icon_src -- icon reference // icon_data -- inline icon data // align -- left|center|right text alignment // align_icon -- left|center_before|center_after|right icon alignment // >Button text</gbutton> // // Alignment restriction: when text alignment is either left or right, icons // must also be aligned left or right.
-
constant cvs_version = "$Id: gbutton.pike,v 1.
4
1999/11/
15
16:
42
:
40
per
Exp $";
+
constant cvs_version = "$Id: gbutton.pike,v 1.
5
1999/11/
16
11
:
01
:
13
jonasw
Exp $";
constant thread_safe = 1; #include <module.h> inherit "module"; inherit "roxenlib"; roxen.ImageCache button_cache; object button_font = resolve_font("haru 32"); object button_border;
Roxen.git/server/modules/graphics/gbutton.pike:57:
"<tr><td><b>bordercolor</b></td><td>Button border color</td></tr>" "<tr><td><b>textcolor</b></td><td>Button text color</td></tr>" "<tr><td><b>href</b></td><td>Button URL</td></tr>" "<tr><td><b>alt</b></td><td>Alternative button alt text</td></tr>" "<tr><td><b>border</b></td><td>Image border</td></tr>"
-
"<tr><td><b>
dim
</b></td><td>Set to
dim
button</td></tr>"
+
"<tr><td><b>
state
</b></td><td>Set to
<tt>enabled</tt>
or "
+
"<tt>disabled</tt> to select
button
state
</td></tr>"
-
"<tr><td><b>
condensed
</b></td><td>Set to
condense
text
to
"
-
"
80%
</td></tr>"
+
"<tr><td><b>
textstyle
</b></td><td>Set to
<tt>normal</tt>
or
"
+
"<
tt>condensed<
/
tt> to alter text style.</
td></tr>"
"<tr><td><b>icon_src</b></td><td>Icon reference</td></tr>" "<tr><td><b>icon_data</b></td><td>Inline icon data</td></tr>" "<tr><td><b>align</b></td><td>Text alignment: " "<tt>left|center|right</tt></td></tr>" "<tr><td><b>align_icon</b></td><td>Icon alignment: " "<tt>left|center_before|center_after|right</tt></td></tr>"
Roxen.git/server/modules/graphics/gbutton.pike:254:
return button_cache->http_file_answer(f, id); } string tag_button(string tag, mapping args, string contents, RequestID id) { mapping new_args = ([ "bo" : parse_color(args->bordercolor || "#333333"), // Border color "bg" : parse_color(args->bgcolor || "#eeeeee"), // Background color "txt" : parse_color(args->textcolor || "#000000"), // Text color
-
"cnd" : args->condensed
,
// Condensed text
+
"cnd" : args->condensed
||
// Condensed text
+
(lower_case(args->textstyle || "") == "condensed"),
"wi" : (int) args->width, // Min button width "al" : args->align || "left", // Text alignment
-
"dim" : args->dim
,
// Button dimming
+
"dim" : args->dim
||
// Button dimming
+
(< "dim", "disabled" >)[lower_case(args->state || "")],
"icn" : args->icon_src && fix_relative(args->icon_src, id), // Icon URL "icd" : args->icon_data, // Inline icon data "ica" : args->align_icon || "left" // Icon alignment ]); new_args->quant = args->quant || 128; foreach(glob("*-*", indices(args)), string n) new_args[n] = args[n]; string img_src =
Roxen.git/server/modules/graphics/gbutton.pike:288:
"vspace" : args->vspace ]); if (mapping size = button_cache->metadata(new_args, id, 1)) { // Image in cache (1 above prevents generation on-the-fly, i.e. // first image will lack sizes). img_attrs->width = size->xsize; img_attrs->height = size->ysize; } // Make button clickable if not dimmed
-
if (args->href && !args->dim)
+
if (args->href && !
new_
args->dim)
return make_container("a", ([ "href" : args->href ]), make_tag("img", img_attrs)); else return make_tag("img", img_attrs); }