[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sc-dev] [commit?] SCStaticText helpfile



hey,

a helpfile for SCStaticText... would someone mind to commit it, please?

have a nice day
Till



{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf230
{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fnil\fcharset77 Monaco;
\f3\fswiss\fcharset77 ArialMT;\f4\fnil\fcharset77 GadgetRegular;\f5\fnil\fcharset77 MarkerFelt-Thin;
}
{\colortbl;\red255\green255\blue255;\red0\green0\blue0;\red0\green0\blue191;\red96\green96\blue96;
\red191\green0\blue0;\red96\green96\blue96;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural

\f0\b\fs32 \cf0 SCStaticText\

\fs24 \

\f1\b0 A non-editable textfield
\f2\fs18 \
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural

\f0\b\fs24 \cf0 \
string_(string)\
	
\f1\b0 set the text.
\f0\b \
\
font_(font)\
	
\f1\b0 set the font.
\f0\b \
\
stringColor_(color)\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural

\f1\b0 \cf0 	set the color of the string.\

\f2\fs18 \

\f0\b\fs28 Examples\

\f2\b0\fs18 \cf2 \
(\
w = \cf3 SCWindow\cf2 .new.front;\
a = \cf3 SCStaticText\cf2 (w, \cf3 Rect\cf2 (10, 10, 100, 20));\
a.string = \cf4 "Rolof's Rolex"\cf2 ;\
)\
\
\cf5 // adjust bounds\cf2 \
a.bounds = \cf3 Rect\cf2 (5, 5, 100, 20)\
\
\
\cf5 ///// dynamic\cf2 \
\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
\cf0 (\cf2 \
w = \cf3 SCWindow\cf2 .new.front;\
a = \cf3 Array\cf2 .fill(20, \{\cf3 SCStaticText\cf2 (w, \cf3 Rect\cf2 (w.bounds.extent.x.rand, w.bounds.extent.y.rand, 100, 16))\
	.string_(\cf4 "Rolof's Rolex"\cf2 .scramble)\
	.stringColor_(Color.rand)\
	.font_(Font(\cf0 [\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
\cf0 		"
\f0\b\fs24 \cf6 Helvetica-Bold
\f2\b0\fs18 ",\
\cf0 		"
\f1\fs24 Helvetica
\f2\fs18 ",\
		"Monaco",\
		"
\f3 Arial
\f2 ",\
		"
\f4 Gadget
\f2 ",\
		"
\f5\fs24 MarkerFelt-Thin
\fs18 "
\f2 \
	].choose, 16\cf2 ))\
\});\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
\cf0 )\
\cf2 \
r = \{\cf3 inf\cf2 .do\{\cf3 |i|\cf2 \
	\cf3 thisThread\cf2 .randSeed_(1284);\
	a.do\{\cf3 |item|\cf2  \
		\{item.bounds = \cf3 Rect\cf2 (5+w.bounds.extent.x.rand * (cos(i*0.01)).abs, w.bounds.extent.y.rand * sin(i*0.001), 100, 20)\}.defer;\
	\};\
	0.1.wait;\
\}\}.fork\
\
r.stop\
\
}