PlotCalendar

 view release on metacpan or  search on metacpan

PlotCalendar/Day.pm  view on Meta::CPAN

package PlotCalendar::Day;

#
#	Version 1.0 -  3/99 - Alan Jackson : ajackson at icct.net
#			 Copyright 1999 may be used and distributed under the
#			Gnu Copyleft.

#	Version 1.1 - 6/99 Major code cleanup, and testing really big and
#	really tiny images. Added documentation.

#  To do
#   Add popup for clipped text (or maybe put it in message bar)
#	Add more intelligence for clip text
#	Add all the Tk stuff 8-)
#
#

use strict;
use vars qw( $VERSION );

use Carp;

#	Note : Day_of_Week returns 1=Mon, 7=Sun

$VERSION = sprintf "%d.%02d", q$Revision: 1.1 $ =~ m#(\d+)\.(\d+)#;

sub new {
    my $proto = shift;
    my $class = ref($proto) || $proto;
    my $self  = {};


	 $self->{SIZE} = {}; # hash of dimensions, height and width
	 $self->{COLOR} = {}; # hash of global colors, 
	                      # foreground, background-main, background-optional
	                      # (fg, bgmain)
	 $self->{FONT} = {}; # hash of global font sizes, day, main, opt
	 $self->{STYLE} = {}; # hash of global text styles, day, main, opt (n,b,i,u)
	 $self->{EXPAND} = 0; # Is height allowed to expand? default = no.
	 $self->{CLIPTEXT} = 0; # Clip text if too long? default = no.
	 $self->{DIGIT} = ''; # What day *is* it, anyway?
	 $self->{DAYNAME} = ''; # What is the day called (like, "Christmas")
	 $self->{NAMEREF} = ''; # HTML reference for dayname
	 $self->{HTMLREF} = ''; # HTML reference for whole cell
	 $self->{TEXT} = []; # array of lines of text
	 $self->{TEXTCOL} = []; # array of colors for text (optional)
	 $self->{TEXTSIZE} = []; # array of sizes for text (optional)
	 $self->{TEXTSTYLE} = []; # array of styles for text (optional) (n,b,i,u)
	                          # (n)ormal, (b)old, (i)talic, (u)nderline
	 $self->{TEXTREF} = []; # array of html references to text

	 $self->{"FONT_TABLE"}={}; # Table of points to html font sizes

	 $self->{DIGIT} = shift;

	 &initialize($self);

    bless $self, $class;

	 return $self;

}

# ****************************************************************
sub getascii {
    my $self = shift;

	 my $string='';

	 # name
	 $string .= "$self->{DAYNAME}\n";



( run in 1.005 second using v1.01-cache-2.11-cpan-364913b4093 )