1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>1.7 MaskTools -- Simple HTML patterns.</title>
<META NAME="description" CONTENT="1.7 MaskTools -- Simple HTML patterns.">
<META NAME="keywords" CONTENT="lib">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="STYLESHEET" href="lib.css" type='text/css'>
<link rel="first" href="lib.html">
<link rel="contents" href="contents.html" title="Contents">
<LINK REL="previous" href="module-MySql.html">
<LINK REL="up" HREF="node3.html">
<LINK REL="next" HREF="node25.html">
<meta name='aesop' content='information'>
</head>
<body>
<DIV CLASS="navigation">
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td><A href="module-MySql.html"><img src="../icons/previous.gif"
border="0" height="32"
alt="Previous Page" width="32"></A></td>
<td><A HREF="node3.html"><img src="../icons/up.gif"
border="0" height="32"
alt="Up One Level" width="32"></A></td>
<td><A HREF="node25.html"><img src="../icons/next.gif"
border="0" height="32"
alt="Next Page" width="32"></A></td>
<td align="center" width="100%">CherryPy Standard Library Reference</td>
<td><A href="contents.html"><img src="../icons/contents.gif"
border="0" height="32"
alt="Contents" width="32"></A></td>
<td><img src="../icons/blank.gif"
border="0" height="32"
alt="" width="32"></td>
<td><img src="../icons/blank.gif"
border="0" height="32"
alt="" width="32"></td>
</tr></table>
<b class="navlabel">Previous:</b> <a class="sectref" href="module-MySql.html">1.6 MySql </A>
<b class="navlabel">Up:</b> <a class="sectref" HREF="node3.html">1. Module list</A>
<b class="navlabel">Next:</b> <a class="sectref" HREF="node25.html">A. History and License</A>
<br><hr>
</DIV>
<!--End of Navigation Panel-->
<H1><A NAME="SECTION003700000000000000000">
1.7 <tt class="module">MaskTools</tt> -- Simple HTML patterns.</A>
</H1>
<P>
This module is a simple module that contains a few commonly used HTML patterns. Its main purpose
is to show you that it ease very easy to create your own masks and reuse them all over your website.
<P>
<dl><dt><b><a name="l2h-44"><tt class="function">mask: x</tt></a></b>()
<dd>
Returns the code for a transparent pixel. This is very useful when you want to draw 1-pixel wide lines.
<P>
The way it is used is the following:
<div class="verbatim"><pre>
# Draw a 1px by 100px blue line
<table border=0 cellspacing=0 cellpadding=0><tr><td width=100 height=1 bgColor=blue py-eval="maskTools.x()"></td></tr></table>
</pre></div>
</dl>
<P>
<dl><dt><b><a name="l2h-45"><tt class="function">mask: displayByColumn</tt></a></b>(<var>dataList, numberOfColumns=2, columnWidth=0, gapWidth=50, tdClass=''</var>)
<dd>
This function displays a list of data on several columns.
<P>
<var>dataList</var> is a list of strings that you want to display
<P>
<var>numberOfColumns</var> is the number of columns that you want to use to display the data
<P>
<var>columnWidth</var> is used if you want to use a specific with for the columns (in pixels)
<P>
<var>gapWidth</var> is the number of pixels between each column
<P>
<var>tdClass</var> is the style sheet class to use to display the strings
<P>
Example:
<div class="verbatim"><pre>
# Display integers from 1 to 102 in 7 columns with 20 pixels between each column:
<py-eval="maskTools.displayByColumn(map(str,range(1,103)), 7, 0, 20)">
</pre></div>
</dl>
<P>
<dl><dt><b><a name="l2h-46"><tt class="function">mask: displayByLine</tt></a></b>(<var>dataList, numberOfLines=2, lineHeight=0, gapHeight=50</var>)
<dd>
This function displays a list of data on several lines.
<P>
<var>dataList</var> is a list of strings that you want to display
<P>
<var>numberOfLines</var> is the number of lines that you want to use to display the data
<P>
<var>lineHeight</var> is used if you want to use a specific height for the lines (in pixels)
<P>
<var>gapHeight</var> is the number of pixels between each line
<P>
<var>tdClass</var> is the style sheet class to use to display the strings
<P>
Example:
<div class="verbatim"><pre>
# Display integers from 1 to 102 in 7 lines with 5 pixels between each line:
<py-eval="maskTools.displayByLine(map(str,range(1,103)), 7, 0, 5)">
</pre></div>
</dl>
<P>
<dl><dt><b><a name="l2h-47"><tt class="function">mask: textInBox</tt></a></b>(<var>text, boxColor="black", insideColor="white"</var>)
<dd>
This function displays a text in a box
<P>
<var>text</var> is the text to display inside the box
<P>
<var>boxColor</var> is the color of the border of the box
<P>
<var>insideColor</var> is the color of the background of the box
<P>
Example:
<div class="verbatim"><pre>
<py-eval="maskTools.textInBox('This is some text displayed in a red box filled with yellow', boxColor='red', insideColor='yellow')">
</pre></div>
</dl>
<P>
<P>
<P>
<DIV CLASS="navigation">
<p><hr>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td><A href="module-MySql.html"><img src="../icons/previous.gif"
border="0" height="32"
alt="Previous Page" width="32"></A></td>
<td><A HREF="node3.html"><img src="../icons/up.gif"
border="0" height="32"
alt="Up One Level" width="32"></A></td>
<td><A HREF="node25.html"><img src="../icons/next.gif"
border="0" height="32"
alt="Next Page" width="32"></A></td>
<td align="center" width="100%">CherryPy Standard Library Reference</td>
<td><A href="contents.html"><img src="../icons/contents.gif"
border="0" height="32"
alt="Contents" width="32"></A></td>
<td><img src="../icons/blank.gif"
border="0" height="32"
alt="" width="32"></td>
<td><img src="../icons/blank.gif"
border="0" height="32"
alt="" width="32"></td>
</tr></table>
<b class="navlabel">Previous:</b> <a class="sectref" href="module-MySql.html">1.6 MySql </A>
<b class="navlabel">Up:</b> <a class="sectref" HREF="node3.html">1. Module list</A>
<b class="navlabel">Next:</b> <a class="sectref" HREF="node25.html">A. History and License</A>
<hr>
<span class="release-info">Release 0.10, documentation updated on 19 March 2004.</span>
</DIV>
<!--End of Navigation Panel-->
<ADDRESS>
See <i><a href="about.html">About this document...</a></i> for information on suggesting changes.
</ADDRESS>
</BODY>
</HTML>
|