Roxen.git / server / modules / graphics / gbutton.pike

version» Context lines:

Roxen.git/server/modules/graphics/gbutton.pike:18:   // icon-data -- inline icon data   // align -- left|center|right text alignment   // align-icon -- left|center-before|center-after|right icon alignment   // valign-icon -- above|middle|below icon vertical 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.68 2000/12/05 00:40:28 nilsson Exp $"; + constant cvs_version = "$Id: gbutton.pike,v 1.69 2000/12/11 05:14:56 nilsson Exp $";   constant thread_safe = 1;      #include <module.h>   inherit "module";      roxen.ImageCache button_cache;      constant module_type = MODULE_TAG;   constant module_name = "GButton";   constant module_doc =
Roxen.git/server/modules/graphics/gbutton.pike:264:    o = Image.lay( ({ l, m, r }) );    o->set_mode( oo->mode() );    o->set_alpha_value( oo->alpha_value() );    return o;   }      array(Image.Layer) draw_button(mapping args, string text, object id)   {    Image.Image text_img;    mapping icon; -  object button_font = resolve_font( args->font ); +        Image.Layer background;    Image.Layer frame;    Image.Layer mask;       int left, right, top, middle, bottom; /* offsets */    int req_width;       mapping ll = ([]);   
Roxen.git/server/modules/graphics/gbutton.pike:383:    else if (args->icd)    icon = roxen.low_decode_image(args->icd);       int i_width = icon && icon->img->xsize();    int i_height = icon && icon->img->ysize();    int i_spc = i_width && sizeof(text) && 5;       // Generate text    if (sizeof(text))    { -  text_img = button_font->write(text)->scale(0, text_height ); +  Font button_font = resolve_font( args->font+" "+text_height ); +  text_img = button_font->write(text); +  if( abs(text_img->ysize() -text_height) > 2 ) +  text_img = text_img->scale(0, text_height );    if (args->cnd)    text_img = text_img->scale((int) round(text_img->xsize() * 0.8),    text_img->ysize());    }       int t_width = text_img && text_img->xsize();       // Compute text and icon placement. Only incorporate icon width/spacing if    // it's placed inline with the text.    req_width = t_width + left + right;