A wyrd to generate rectangular buttons using the GD library.
<BASENAME::GDButton name="pushme" src="/img/pushbutton.gif" />
GDButton produces a rectangular button with given text using the GD library. It can produce either image input or img tags, as requested.
GDButton uses it's membership in the Apache::Wyrd::Site::Widget class to track changes and decide when the output file should be regenerated. Note: GDButton internally draws itself at 5x the regular size and scales down in order to make a more aesthetically pleasing final result.
File attribute. Must be absolute, relative, or root-dir-relative. Will seek through those options to find a writeable location and set the HTML attribute of the same to reflect the location of the output file. This file must end in either .png or .gif. The format of the output file will be determined by this file extension.
What file to use as a base image for this button. It is located in the same way the src file is. The file can be a GIF or PNG file (it will need to have the right file extension of .gif or .png, case insensitive). The template file is copied to memory and then written to the file area indicated by the src attribute.
(required w/o template) in pixels.
(required w/o template) background and foreground color, in six-digit hex form (#RRGGBB).
Font size, in pixels.
Path to the font file. Either absolute, relative, or root-dir-relative. It must be a TrueType font file, and your version of GD must support TrueType fonts.
Margin between text and edge of button, in pixels. Margin represents an overall number, and is the default for the others. Specific top, right, bottom, and left margins can be defined separately, falling back to the margin value.
Regular image attributes. Passed to the HTML untouched.
Turn off antialiasing for the button.
Reserves the _format_output and _generate_output methods.
Barry King <email@example.com>
General-purpose HTML-embeddable perl object
Copyright 2002-2007 Wyrdwright, Inc. and licensed under the GNU GPL.
See LICENSE under the documentation for