Tk-TableMatrix

 view release on metacpan or  search on metacpan

ChangeLog  view on Meta::CPAN


2002-12-06 08:08  cerney

	* Changes, Makefile.PL, TableMatrix.pm, TableMatrix/Spreadsheet.pm,
	TableMatrix/SpreadsheetHideRows.pm, pTk/Makefile.PL: Prep for next
	release.

2002-12-03 13:48  cerney

	* pTk/mTk/Tktable/tkTable.c: Fixed Error where the rowHeight method
	was getting executed like a colWidth. This was introduced in the
	update of TkTable 2.5 to 2.6

2002-12-02 09:44  tag TableMatrix_1_0

2002-12-02 09:44  cerney

	* Changes, Makefile.PL, TableMatrix.pm, TableMatrix/Spreadsheet.pm,
	TableMatrix/SpreadsheetHideRows.pm, pTk/Makefile.PL, README:
	Preparation for next release.

TableMatrix.pm  view on Meta::CPAN


sub Tk_cmd { \&Tk::tablematrix };

sub Tk::Widget::ScrlTableMatrix { shift->Scrolled('TableMatrix' => @_) }

Tk::Methods("activate", "bbox", "border", "cget", "clear", "configure",
    "curselection", "curvalue", "delete", "get", "rowHeight",
    "hidden", "icursor", "index", "insert",
    "postscript",
    "reread", "scan", "see", "selection", "set",
    "spans", "tag", "validate", "version", "window", "colWidth",
    "xview", "yview");
    
use Tk::Submethods ( 'border'   => [qw(mark dragto)],
		     'clear'    => [qw(cache sizes tags all)],
		     'delete'   => [qw(active cols rows)],
		     'insert'   => [qw(active cols rows)],
		     'scan'     => [qw(mark dragto)],
		     'selection'=> [qw(anchor clear includes set)],
		     'tag'      => [qw(cell cget col configure delete exists
				     includes names row raise lower)],

demos/basic  view on Meta::CPAN

			      -selectmode => 'extended',
			      -sparsearray => 0,
                    );

my $button = $top->Button( -text => "Exit", -command => sub{ $top->destroy});		    

# hideous Color definitions here:
$t->tagConfigure('OddRow', -bg => 'orange', -fg => 'purple');
$t->tagConfigure('OddCol', -bg => 'brown', -fg => 'pink');

$t->colWidth( -2 => 7, -1 => 7, 1=> 5, 2 => 8, 4=> 14);

$label->pack( -expand => 1, -fill => 'both');

$t->pack(-expand => 1, -fill => 'both');
$button->pack(-expand => 1, -fill => 'both');

my $variable = $t->cget( -var);



demos/buttons  view on Meta::CPAN

use Data::Dumper qw( DumperX);
my $top = MainWindow->new;

my $tab = {};
my ($rows,$cols) = (10,10); # number of rows/cols

# create the table
my $t = $top->Scrolled('TableMatrix', -rows => $rows, -cols => $cols, 
		-titlerows =>  1, -titlecols => 1 ,
		-roworigin => -1, -colorigin => -1 ,
		-colwidth => 4 ,
		-width => 8, -height => 8 ,
		-variable => $tab ,
		-flashmode => 'off',
		-cursor => 'top_left_arrow' ,
		-borderwidth => 2 ,
		-state => 'disabled'
                    );
$t->pack;

# set up tags for the various states of the buttons

demos/command  view on Meta::CPAN

					}
		);




# hideous Color definitions here:
$t->tagConfigure('OddRow', -bg => 'orange', -fg => 'purple');
$t->tagConfigure('OddCol', -bg => 'brown', -fg => 'pink');

$t->colWidth( -2 => 7, -1 => 7, 1=> 5, 2 => 8, 4=> 14);

$label->pack( -expand => 1, -fill => 'both');
$currentLabel->pack( -expand => 1, -fill => 'both');
$activeEntry->pack( -expand => 1, -fill => 'both');

$t->pack(-expand => 1, -fill => 'both');


Tk::MainLoop;

demos/debug  view on Meta::CPAN

$t->tagConfigure('s', -font => 'courier', -justify => 'center');

# $initWindow->Label(-image => $top->Photo(-file => Tk->findINC('Xcamel.gif')))->pack;


my $perltkLogo = $top->Photo(-file => Tk->findINC('Xcamel.gif'));

$t->tagConfigure('logo', -image =>  $perltkLogo, -showtext => 1);
$t->tagCell('logo', '1,2', '2,3', '4,1');
$t->tagCell('dis', '2,1', '1,-1', '3,0');
$t->colWidth(qw/ -2 8 -1 9 0 12 4 14/);


$t->set( '1,1' => "multi-line\ntext\nmight be\ninteresting" ,
	'3,2' => "more\nmulti-line\nplaying\n" ,
	'2,2' => "null\0byte" );


$i = -1;

# This is in the row span

demos/dynarows  view on Meta::CPAN

				
 
		
$t->set("0,1" => "Begin", "0,2" => 'End', "1,0"=>"*");
 
# hideous Color definitions here:
$t->tagConfigure('unset',  -fg => '#008811');
$t->tagConfigure('title',  -fg => 'red');
$t->tagRow('unset', 1);

$t->colWidth( 0 => 3);

my $label = $top->Label(-text => "Dynamic Date Validated Rows");

$label->pack( -expand => 1, -fill => 'both');

$t->pack(-expand => 1, -fill => 'both');


# Bindings:
# Make the active area move after we press return:

demos/edit_styles.pl  view on Meta::CPAN


	my $_data = {};
	my ($rows,$cols) = (12,7); # number of rows/cols

	# create the table
	my $t = $top->Scrolled
		(TableMatrix =>
		 -rows => $rows, -cols => $cols,
		 -titlerows =>  1, -titlecols => 1,
		 -width => 8, -height => 8 ,
		 -colwidth => 11,
		 -variable => $_data,
		 -cursor => 'top_left_arrow' ,
		 -borderwidth => 2 ,
		 -ipadx => 15,
		 -scrollbars => 'se',
		)->pack(qw/-expand 1 -fill both/);
	
	my $tm = $t->Subwidget('scrolled');

	$tm->{columneditstyles} = {qw(1 readonly

demos/embeddedWindows.pl  view on Meta::CPAN

$c->insert("end", "August");
$c->insert("end", "September");
$c->insert("end", "October");
$c->insert("end", "November");
$c->insert("end", "December");


$t->windowConfigure("2,2", -sticky => 'ne', -window => $c);

# Leave enough room for the windows
$t->colWidth(2,20);
$t->colWidth(3,20);

$t->pack(-expand => 1, -fill => 'both');

Tk::MainLoop;

demos/maxsize  view on Meta::CPAN

my $anchor;
foreach $anchor( qw/ n s e w nw ne sw se c /){
	$t->tagConfigure($anchor, -anchor => $anchor);
	$t->tagRow($anchor, ++$i);
	$t->set( "$i,$first",$anchor);
}
$top->fontCreate('courier', -family => 'courier', -size => 10);
$t->tagConfigure('s', -font => 'courier', -justify => 'center');


$t->colWidth( -2 => 8, -1 => 9, 0=> 12,  4=> 14);

$label->pack( -expand => 1, -fill => 'both');

$t->pack(-expand => 1, -fill => 'both');
$button->pack(-expand => 1, -fill => 'both');




Tk::MainLoop;

demos/spreadsheet  view on Meta::CPAN

$t->tagConfigure('colored', -bg => $tableColors->{$page});
$t->tagConfigure('title', -fg => 'red', -relief => 'groove');
$t->tagConfigure('blue', -bg => 'blue');
$t->tagConfigure('green', -bg => 'green');

$t->tagCell('green', '6,3','5,7','4,9');
$t->tagCell('blue', '8,8');
$t->tagRow('blue', 7);
$t->tagCol('blue', 6,8);

$t->colWidth( 0 => 3, 2 => 7);

$label->grid(				'-',		'-',		'-',		'-',	'-sticky' => 'ew');
$currentLabel->grid(		$currentLabel,	$activeEntry, 	$pageLabel, 	$pageSelect, 	'-',	'-sticky' => 'ew');
$t->grid( 				'-',		'-',		'-',		'-',	'-sticky' => 'nsew');
$top->gridColumnconfigure(1, -weight => 1);
$top->gridRowconfigure(2, -weight => 1);


Tk::MainLoop;

pTk/mTk/Tktable/tkTable.c  view on Meta::CPAN

};

static CONST char *commandNames[] = {
    "activate", "bbox", "border", "cget", "clear", "configure",
    "curselection", "curvalue", "delete", "get", "rowHeight",
    "hidden", "icursor", "index", "insert",
#ifdef POSTSCRIPT
    "postscript",
#endif
    "reread", "scan", "see", "selection", "set",
    "spans", "tag", "validate", "version", "window", "colWidth",
    "xview", "yview", (char *)NULL
};
enum command {
    CMD_ACTIVATE, CMD_BBOX, CMD_BORDER, CMD_CGET, CMD_CLEAR, CMD_CONFIGURE,
    CMD_CURSEL, CMD_CURVALUE, CMD_DELETE, CMD_GET, CMD_HEIGHT,
    CMD_HIDDEN, CMD_ICURSOR, CMD_INDEX, CMD_INSERT,
#ifdef POSTSCRIPT
    CMD_POSTSCRIPT,
#endif
    CMD_REREAD, CMD_SCAN, CMD_SEE, CMD_SELECTION, CMD_SET,

pTk/mTk/Tktable/tkTableEdit.c  view on Meta::CPAN

	    dimPtr	= &(tablePtr->rows);
	    lo		= tablePtr->colOffset
		+ ((flags & HOLD_TITLES) ? tablePtr->titleCols : 0);
	    hi		= maxcol;
	} else {
	    maxkey	= maxcol;
	    minkey	= tablePtr->colOffset;
	    minkeyoff	= tablePtr->colOffset+tablePtr->titleCols;
	    offset	= tablePtr->colOffset;
	    tagTblPtr	= tablePtr->colStyles;
	    dimTblPtr	= tablePtr->colWidths;
	    dimPtr	= &(tablePtr->cols);
	    lo		= tablePtr->rowOffset
		+ ((flags & HOLD_TITLES) ? tablePtr->titleRows : 0);
	    hi		= maxrow;
	}

	/* constrain the starting index */
	if (first > maxkey) {
	    first = maxkey;
	} else if (first < minkey) {

pTk/mTk/Tktable/tkTablePs.c  view on Meta::CPAN

				 * be marked up, measured in table units
				 * from the positioning point on the page
				 * (reflects anchor position).  Initial
				 * values needed only to stop compiler
				 * warnings. */
    Tcl_HashSearch search;
    Tcl_HashEntry *hPtr;
    CONST char * CONST *chunk;
    Tk_TextLayout textLayout = NULL;
    char *value;
    int rowHeight, total, *colWidths, iW, iH;
    TableTag *tagPtr, *colPtr, *rowPtr, *titlePtr;
    Tcl_DString postscript, buffer;

    if (objc < 2) {
	Tcl_WrongNumArgs(interp, 2, objv, "?option value ...?");
	return TCL_ERROR;
    }

    /*
     *----------------------------------------------------------------

pTk/mTk/Tktable800/tkTableEdit.c  view on Meta::CPAN

	    dimPtr	= &(tablePtr->rows);
	    lo		= tablePtr->colOffset
		+ ((flags & HOLD_TITLES) ? tablePtr->titleCols : 0);
	    hi		= maxcol;
	} else {
	    maxkey	= maxcol;
	    minkey	= tablePtr->colOffset;
	    minkeyoff	= tablePtr->colOffset+tablePtr->titleCols;
	    offset	= tablePtr->colOffset;
	    tagTblPtr	= tablePtr->colStyles;
	    dimTblPtr	= tablePtr->colWidths;
	    dimPtr	= &(tablePtr->cols);
	    lo		= tablePtr->rowOffset
		+ ((flags & HOLD_TITLES) ? tablePtr->titleRows : 0);
	    hi		= maxrow;
	}

	/* constrain the starting index */
	if (first > maxkey) {
	    first = maxkey;
	} else if (first < minkey) {

pTk/mTk/Tktable800/tkTablePs.c  view on Meta::CPAN

				 * be marked up, measured in table units
				 * from the positioning point on the page
				 * (reflects anchor position).  Initial
				 * values needed only to stop compiler
				 * warnings. */
    Tcl_HashSearch search;
    Tcl_HashEntry *hPtr;
    CONST char * CONST *chunk;
    Tk_TextLayout textLayout = NULL;
    char *value;
    int rowHeight, total, *colWidths, iW, iH;
    TableTag *tagPtr, *colPtr, *rowPtr, *titlePtr;
    Tcl_DString postscript, buffer;

    if (objc < 2) {
	Tcl_WrongNumArgs(interp, 2, objv, "?option value ...?");
	return TCL_ERROR;
    }

    /*
     *----------------------------------------------------------------

pTk/tkTableEdit.c  view on Meta::CPAN

	    dimPtr	= &(tablePtr->rows);
	    lo		= tablePtr->colOffset
		+ ((flags & HOLD_TITLES) ? tablePtr->titleCols : 0);
	    hi		= maxcol;
	} else {
	    maxkey	= maxcol;
	    minkey	= tablePtr->colOffset;
	    minkeyoff	= tablePtr->colOffset+tablePtr->titleCols;
	    offset	= tablePtr->colOffset;
	    tagTblPtr	= tablePtr->colStyles;
	    dimTblPtr	= tablePtr->colWidths;
	    dimPtr	= &(tablePtr->cols);
	    lo		= tablePtr->rowOffset
		+ ((flags & HOLD_TITLES) ? tablePtr->titleRows : 0);
	    hi		= maxrow;
	}

	/* constrain the starting index */
	if (first > maxkey) {
	    first = maxkey;
	} else if (first < minkey) {

pod/TableMatrix.pod  view on Meta::CPAN

first check to see if a tag has been defined using the B<tag col> widget 
method.  If no tag is found, it will evaluate the named procedure passing 
the column number in question as the sole argument.  The procedure is expected 
to return the name of a tag to use, or a null string. Errors occuring during 
the evaluation of the procedure, or the return of an invalid tag name 
are silently ignored.

The Current column number is passed as an argument to the col command.


=item Switch: B<-colwidth> 

=item Name: B<colWidth> 

=item Class: B<ColWidth>

Default column width, interpreted as characters 
in the default font when the number is positive, or pixels if it is negative. 
Defaults to 10.

=item Switch: B<-command> 

=item Name: B<command>

=item Class: B<Command>

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.773 second using v1.00-cache-2.02-grep-82fe00e-cpan-503542c4f10 )