Roxen.git
/
server
/
modules
/
graphics
/
gbutton.pike
version
»
Context lines:
10
20
40
80
file
none
3
Roxen.git/server/modules/graphics/gbutton.pike:18:
// 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.
22
2000/02/08 22:
40
:
56
per Exp $";
+
constant cvs_version = "$Id: gbutton.pike,v 1.
23
2000/02/08 22:
54
:
10
per Exp $";
constant thread_safe = 1; #include <module.h> inherit "module"; inherit "roxenlib"; roxen.ImageCache button_cache;
Roxen.git/server/modules/graphics/gbutton.pike:286:
txt_x = req_width - right - t_width; break; case "right": icn_x = req_width - right - i_width; txt_x = icn_x - i_spc - t_width; break; } break; }
-
right
= frame
->
xsize
()
-right
;
-
frame
=
stretch_layer
( frame,
left
,
right,
req_width
);
-
if (
mask
!=
frame
)
-
mask =
stretch_layer
(
mask,
left, right, req_width
);
+
if(
args->extra_frame_layers )
+
{
+
array l
=
({
frame
}
);
+
foreach
(
args->extra_
frame
_layers/"
,
"
,
string
q
)
+
l += ({ ll[q] })
;
+
l-=({ 0 });
+
if
(
sizeof
(
l
)
)
+
mask =
Image.lay
(
l
);
+
}
-
if( args->extra_layers )
+
if( args->extra_
mask_
layers )
{ array l = ({ });
-
+
if( mask )
+
l = ({ mask });
+
foreach( args->extra_mask_layers/",", string q )
+
l += ({ ll[q] });
+
l-=({ 0 });
+
if( sizeof( l ) )
+
mask = Image.lay( l );
+
}
+
+
if( args->extra_background_layers )
+
{
+
array l = ({ });
if( background ) l = ({ background });
-
foreach( args->extra_layers/",", string q )
+
foreach( args->extra_
background_
layers/",", string q )
l += ({ ll[q] }); l-=({ 0 });
-
+
if( sizeof( l ) )
background = Image.lay( l ); }
-
+
right = frame->xsize()-right;
+
frame = stretch_layer( frame, left, right, req_width );
+
if (mask != frame)
+
mask = stretch_layer( mask, left, right, req_width );
+
if( background ) { if( !background->alpha() ) background->set_image( background->image(), Image.Image( background->xsize(), background->ysize(), ({255,255,255}) ) ); if( args->dim ) background->set_image(background->image(), background->alpha() * 0.3 );
Roxen.git/server/modules/graphics/gbutton.pike:367:
} // Draw text if (args->dim) for (int i = 0; i < 3; i++) args->txt[i] = (args->txt[i] + args->bg[i]) / 2; if(text_img) button->paste_alpha_color(text_img, args->txt, txt_x, top);
+
if( args->extra_layers )
+
{
+
array l = ({ });
+
foreach( args->extra_layers/",", string q )
+
l += ({ ll[q] });
+
l-=({ 0 });
+
if( sizeof( l ) )
+
{
+
object q = Image.lay( l );
+
q = stretch_layer( q, left, right, req_width );
+
button->paste_mask( q->image(), q->alpha() );
+
}
+
}
+
+
return ([ "img":button, "alpha":mask->alpha()->threshold( 40 ), ]); } mapping find_internal(string f, RequestID id) { return button_cache->http_file_answer(f, id);
Roxen.git/server/modules/graphics/gbutton.pike:409:
"al" : args->align || "left", // Text alignment "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 "font": (args->font||id->misc->defines->font|| roxen->query("default_font")), "border_image":fi, "extra_layers":args["extra-layers"],
+
"extra_background_layers":args["extra-background-layers"],
+
"extra_mask_layers":args["extra-mask-layers"],
+
"extra_frame_layers":args["extra-frame-layers"],
]); // array hsv = Image.Color( @new_args->bg )->hsv( ); // hsv[-1] = min( hsv[-1]+70, 255 ); // new_args->bob = (array)Image.Color.hsv( @hsv ); // hsv[-1] = max( hsv[-1]-140, 0 ); // new_args->bo = (array)Image.Color.hsv( @hsv ); // if(args->bordercolor) // new_args->bo=parse_color(args->bordercolor); // Border color