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.62 2000/09/19 13:11:37 per Exp $"; + constant cvs_version = "$Id: gbutton.pike,v 1.63 2000/10/17 21:01:40 per 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:279:       int left, right, top, middle, bottom; /* offsets */    int req_width;       mapping ll = ([]);       void set_image( array layers )    {    foreach( layers||({}), object l )    { -  if(!l->get_misc_value( "name" ) ) // Hm. +  if(!l->get_misc_value( "name" ) ) // Hm. Probably PSD    continue; -  +     ll[lower_case(l->get_misc_value( "name" ))] = l;    switch( lower_case(l->get_misc_value( "name" )) )    {    case "background": background = l; break;    case "frame": frame = l; break;    case "mask": mask = l; break;    }    }    };       if( args->border_image )    set_image( roxen.load_layers(args->border_image, id) );       // otherwise load default images    if ( !frame ) -  set_image( roxen.load_layers("/internal-roxen-gbutton", id) ); +  { +  catch { +  set_image(Image.XCF.decode_layers(Stdio.read_file("roxen-images/gbutton.xcf"))); +  }; +  if( !frame ) +  error("Failed to load default frame image (roxen-images/gbutton.xcf)." +  " Aborting\n"); +  }          // Translate frame image to 0,0 (left layers are most likely to the    // left of the frame image)    -  +     int x0 = frame->xoffset();    int y0 = frame->yoffset();    if( x0 || y0 )    foreach( values( ll ), object l )    {    int x = l->xoffset();    int y = l->yoffset();    l->set_offset( x-x0, y-y0 );    }