Texis Web Script source code for: /texis/site/demos/button.vs
Note: Click on links to view the documentation for HTML tags which are special to the Vortex compiler.
<script language=vortex>

<!-- Preserve these as "shopping cart" variables ------------------------------>

<export $on userok>
<export $label userok>
<export $r $g $b $tr $tg $tb $or $og $ob  userok>
<export $font  userok>
<export $bevel userok>
<export $textcolor  userok>
<export $align userok>
<export $width  userok>
<export $arrange  userok>
<export $n >
<uses demonav=demonav><!--simple look and feel module-->
<entryfunc=entry>                 <!-- always call this function first -->

<!-- ===================== Init for all entry points ===================== -->
<a name=entry private>
  <!-- Path to our button-making executable: -->
  <sum "%s" $SERVER_ROOT "/graphing/mkbutton"><$MkButton = $ret>
  <sum "%s" $SERVER_ROOT "/texis"><db = $ret>  <!-- set the database -->
</a>

<!--The main entry point for this script--------------------------------------->

<a name=main PUBLIC>
<if $urlfunc eq 'button'><thebutton><return></if>
<hdr>
<center>
   <table border=0>
   <tr>
   <td align=top><a href=$url><img ISMAP USEMAP=#THUNDERSTONE_MAP src=$url/thebutton.gif alt="$label"></a><br>
   <if $arrange neq "-A">
      </td><td align=top>
   </if>
   Click on a button to obtain the "ON" version
   <mkmap>
   </td>
   </td>
   </tr>
   </table>
   <qform>
</center>
<ftr>
</a>

<!--Macro for header and footer and init the variables------------------------->

<a name=hdr>
  <demolook title="Texis Button Bar Builder Example Code">
<if $fontmenu.x gt 1>
  <$fontmenu.x = ( $fontmenu.x / 200 )>
  <$fontmenu.y = ( $fontmenu.y / 35 )>
  <$font= ( (17 * $fontmenu.x ) + $fontmenu.y )>
</if>
<if ""eq $on>
    <$on=-1>
</if>
<if $label eq "">
   <$r="00"> <$g="00"> <$b="66">
   <$tr="FF"> <$tg="FF"> <$tb="00">
   <$or="FF"> <$og="FF"> <$ob="FF">
   <$font=4>
   <$bevel=3>
   <$align='c'>
   <$width=0>
   <$n=0>   
   <$label="Home Page
New Stuff
Products
Contacts
Demos
Search">
</if>
<rex "[\alnum\punct ]+" $label />
<$tags=$ret>
<rand 1 10000> <!-- This keeps the stupid browser from caching the button.gif when it shouldn't --> 
<$n=$ret> 
</a>

<a name=ftr>
<h6 align=right>Copyright © 1997 <a href=/>Thunderstone</a> - EPI, Inc. </h6>
</demolook>
</a>

<!--Display the button --------------------------------------------------------->

<a name=thebutton PUBLIC>
<strfmt "%s%s%s" $r $g $b>
<$c=$ret>
<strfmt "%s%s%s" $tr $tg $tb>
<$t=$ret>
<strfmt "%s%s%s" $or $og $ob>
<$o=$ret>
<rex "[\alnum\punct ]+" $label />
<exec BIN $MkButton $arrange -O $on -w $width -t $t -o $o -f $font -c $c -b $bevel -a $align $ret>
</exec>
<fmt "%s" $ret>
</a>

<!-- Make the Image Map  ------------------------------------------------------->

<a name=mkmap>
<strfmt "%s%s%s" $r $g $b>
<$c=$ret>
<strfmt "%s%s%s" $tr $tg $tb>
<$t=$ret>
<exec BIN $MkButton  $arrange -map -w $width -t $t -f $font -c $c -b $bevel -a $align $tags>
</exec>
<small><pre>
$ret
</pre></small>
<exec BIN $MkButton  $arrange -u $url -map -w $width -t $t -f $font -c $c -b $bevel -a $align $tags>
</exec>
<send $ret>
</a>

<!--Spew the query form-------------------------------------------------------->

<a name=qform>
<form method=post action="$url/">
<$colors  = "00" "33" "66" "99" "CC" "FF">
<!-- <$fonts   = 0 1 2 3 4 5>
     <$fontnm  = "Tiny" "Small" "Medium" "Large" "XLarge"> -->
<$bevels  = 0 1 2 3 4>
<$aligns  = l r c >
<$alignnm = "Left" "Right" "Center">
<$arr     = "-" "-A" >
<$arrnm   = "Vertically" "Horizontally" >


<table border=0>
<tr><td nowrap valign=top>
Enter your label text then click "make the button"<br>
<table border=0>
<tr>
<td nowrap valign=center align=right >
  Label:
</td>
<td>
   <textarea name=label rows=6 cols=35>$label</textarea>
</td>
</tr>
<tr>
<td nowrap align=right >
Button:
</td>
<td nowrap align=left colspan=2 >
   Red:<select name=r><options $colors $r $colors></select>
   Green:<select name=g><options $colors $g $colors></select>
   Blue:<select name=b><options $colors $b $colors></select>
</td>
</tr>
<tr>
<td nowrap align=right >
Text OFF:
</td>
<td nowrap align=left colspan=2 >
   Red:<select name=tr><options $colors $tr $colors></select>
   Green:<select name=tg><options $colors $tg $colors></select>
   Blue:<select name=tb><options $colors $tb $colors></select>
</td>
</tr>
<tr>
<td nowrap align=right >
Text ON:
</td>
<td nowrap align=left colspan=2 >
   Red:<select name=or><options $colors $or $colors></select>
   Green:<select name=og><options $colors $og $colors></select>
   Blue:<select name=ob><options $colors $ob $colors></select>
</td>
</tr>
</table>

</td>
<td nowrap valign=bottom align=right >
<table border=0>
   <tr><td nowrap align=right >Font:</td><td><select name=font><exec BIN $MkButton -f $font -F></exec><send $ret> </select></td></tr>
   <tr><td nowrap align=right >Align:</td><td><select name=align><options $aligns $align $alignnm></select></td></tr>
   <tr><td nowrap align=right >Bevel:</td><td><select name=bevel><options $bevels $bevel $bevels></select></td></tr>
   <tr><td nowrap align=right >Width:</td><td><input name=width size=4 value="$width"></td></tr>
   <tr><td nowrap align=right >Arrange:</td><td><select name=arrange><options $arr $arrange $arrnm></select></td></tr>
   <tr><td nowrap align=right ></td><td><input type=submit value="Make the Button">
</table>
</td>
</tr>
</table>

<b>Note: Any color combination here is "Netscape-safe" and will not dither.</b>
<input type=hidden name=on value="-1">
<hr>
<b> FONTS MENU </b>
<hr>
<input type=image border=0 name=fontmenu src="https://docs.thunderstone.com/site/images/fonts.gif">
</form>
</a>


<!--That's all folks! --------------------------------------------------------->
</script>

Back to the Code Example List

The Source Viewer is also a Code Example.
Click Here to see its source.
Copyright © 1992-1999 Thunderstone Software
Copyright © 2024 Thunderstone Software LLC. All rights reserved.