home *** CD-ROM | disk | FTP | other *** search
-
-
- #####################################################################
- #####################################################################
- ## ##
- ## TOC ENTRY CREATION ##
- ## ##
- #####################################################################
- #####################################################################
-
- dwScript Tables__ShowCurrentTocLine {
- if {[dwGet ActiveQuery] == ""} {
- dwSet TocLineHitCount ""
- } else {
- dwSet TocLineHitCount [dwGetTocItemHitCount]
- if {$TocLineHitCount <= 0} {dwSet TocLineHitCount ""}
- }
-
- ## width of indent from one TOC item level to the next
- ## if there's a query, this also holds the hit count
- if {[dwGet ActiveQuery] == ""} {
- dwSet IndentWidth 15
- } else {
- dwSet IndentWidth 35
- }
-
- ## width of expand/collapse arrow
- dwSet ArrowWidth 10
-
- ## width of TOC item text
- dwSet TextWidth 800
-
- ## width of TOC line
- ## this allows for 6 TOC levels
- ## 6 * IndentWidth w/Hit Counts = 210 + ArrowWidth + TextWidth = 1020
- dwSet LineWidth 1020
-
- set state [dwGetTocItemState]
- if {$state == "expandable"} {
- dwCall Tables__ExpandableTocLine
- } elseif {$state == "expanded"} {
- dwCall Tables__ExpandedTocLine
- } elseif {$state == "elided"} {
- if {$TocLineHitCount != 0} {
- dwCall Tables__ElidedTocLine
- }
- } else {
- dwCall Tables__NonExpandableTocLine
- }
- }
-
- dwScript Tables__ExpandedTocLine {
- if {[dwGet State__Tables] == 1} {
- if {[dwGet TocLineIsHilited] == 1} {
- dwSet TocTextAttrBefore "<TABLE cellspacing=0 cellpadding=0 border=0><TR><TD bgcolor=#C0D8FF NOWRAP><B>"
- dwSet TocTextAttrAfter "</B></TABLE>"
- } else {
- dwSet TocTextAttrBefore ""
- dwSet TocTextAttrAfter ""
- }
- dwProcessTemplate Tables__ExpandedTocLineTableRow
- } else {
- set icondir [dwGetParam IconDir]
- set hits "<FONT COLOR=#FF0000><B>[dwGet TocLineHitCount]</B></FONT>"
- set tocLine ""
- set loop [expr 2 * [dwGetTocItemLevel]]
- while {$loop > 0} {
- set tocLine "$tocLine<IMG SRC=\"${icondir}spacer.gif\" ALT=\" \">"
- incr loop -1
- }
- set tocLine "$tocLine<A HREF=\"[dwGet TocIconUrl]\">[dwGetParam graphic_image_srcmap collapse]</A>"
- set tocLine "$tocLine<IMG SRC=\"${icondir}spacer.gif\" ALT=\" \">"
- set tocLine "$tocLine<A HREF=\"[dwGet TocLineUrl]\">[dwGetTocItemTitle] </A> $hits<BR>\n"
- dwSend $tocLine
- }
- }
-
- dwTemplate Tables__ExpandedTocLineTableRow {
- <TABLE CELLPADDING=0 BORDER=0 WIDTH=$[dwGet LineWidth]>
- <TR><NOBR>
- <TD ALIGN=RIGHT VALIGN=TOP WIDTH=$[expr [dwGetTocItemLevel] * [dwGet IndentWidth]]>
- <FONT COLOR=#FF0000><B>$[dwGet TocLineHitCount]</B></FONT>
- </TD>
- <TD ALIGN=CENTER VALIGN=BASELINE WIDTH=$[dwGet ArrowWidth]>
- <A HREF="$[dwGet TocIconUrl]"$[dwGet TocIconTarget]>$[dwGetParam graphic_image_srcmap collapse]</A>
- </TD>
- <TD ALIGN=LEFT VALIGN=TOP WIDTH=$[dwGet TextWidth] NOWRAP>
- $[dwGet TocTextAttrBefore]<A HREF="$[dwGet TocLineUrl]"$[dwGet ScrollAnchor]$[dwGet TocLineTarget]>$[dwGetTocItemTitle]</A>$[dwGet TocTextAttrAfter]
- </TD>
- </NOBR></TR>
- </TABLE>
- }
-
- dwScript Tables__ExpandableTocLine {
- if {[dwGet State__Tables] == 1} {
- if {[dwGet TocLineIsHilited] == 1} {
- dwSet TocTextAttrBefore "<TABLE cellspacing=0 cellpadding=0 border=0><TR><TD bgcolor=#C0D8FF NOWRAP><B>"
- dwSet TocTextAttrAfter "</B></TABLE>"
- } else {
- dwSet TocTextAttrBefore ""
- dwSet TocTextAttrAfter ""
- }
- dwProcessTemplate Tables__ExpandableTocLineTableRow
- } else {
- set icondir [dwGetParam IconDir]
- set hits "<FONT COLOR=#FF0000><B>[dwGet TocLineHitCount]</B></FONT>"
- set tocLine ""
- set loop [expr 2 * [dwGetTocItemLevel]]
- while {$loop > 0} {
- set tocLine "$tocLine<IMG SRC=\"${icondir}spacer.gif\" ALT=\" \">"
- incr loop -1
- }
- set tocLine "$tocLine<A HREF=\"[dwGet TocIconExpUrl]\">[dwGetParam graphic_image_srcmap expand]</A>"
- set tocLine "$tocLine<IMG SRC=\"${icondir}spacer.gif\" ALT=\" \">"
- set tocLine "$tocLine<A HREF=\"[dwGet TocLineUrl]\">[dwGetTocItemTitle] </A> $hits<BR>\n"
- dwSend $tocLine
- }
- }
-
- dwTemplate Tables__ExpandableTocLineTableRow {
- <TABLE CELLPADDING=0 BORDER=0 WIDTH=$[dwGet LineWidth]>
- <TR><NOBR>
- <TD ALIGN=RIGHT VALIGN=TOP WIDTH=$[expr [dwGetTocItemLevel] * [dwGet IndentWidth]]>
- <FONT COLOR=#FF0000><B>$[dwGet TocLineHitCount]</B></FONT>
- </TD>
- <TD ALIGN=CENTER VALIGN=BASELINE WIDTH=$[dwGet ArrowWidth]>
- <A HREF="$[dwGet TocIconExpUrl]"$[dwGet TocIconTarget]>$[dwGetParam graphic_image_srcmap expand]</A>
- </TD>
- <TD ALIGN=LEFT VALIGN=TOP WIDTH=$[dwGet TextWidth] NOWRAP>
- $[dwGet TocTextAttrBefore]<A HREF="$[dwGet TocLineUrl]"$[dwGet ScrollAnchor]$[dwGet TocLineTarget]>$[dwGetTocItemTitle]</A>$[dwGet TocTextAttrAfter]
- </TD>
- </NOBR></TR>
- </TABLE>
- }
-
-
- dwScript Tables__ElidedTocLine {
- set hits ""
- if {[dwGet TocLineHitCount] > 0} {
- set hits "<FONT COLOR=#FF0000><B>$TocLineHitCount</B></FONT>"
- }
- if {[dwGet State__Tables] == 1} {
- dwProcessTemplate Tables__ElidedTocLineTableRow
- } else {
- set icondir [dwGetParam IconDir]
- set tocLine ""
- set loop [expr 2 * [dwGetTocItemLevel]]
- while {$loop > 0} {
- set tocLine "$tocLine<IMG SRC=\"${icondir}spacer.gif\" ALT=\" \">"
- incr loop -1
- }
- set tocLine "$tocLine<A HREF=\"[dwGet TocIconUrl]\">[dwGetParam graphic_image_srcmap expand]</A>"
- set tocLine "$tocLine<IMG SRC=\"${icondir}spacer.gif\" ALT=\" \">"
- set tocLine "$tocLine<A HREF=\"[dwGet TocIconUrl]\">. . .</A> $hits<BR>\n"
- dwSend $tocLine
- }
- }
-
- dwTemplate Tables__ElidedTocLineTableRow {
- <TABLE CELLPADDING=0 BORDER=0 WIDTH=$[dwGet LineWidth]>
- <TR><NOBR>
- <TD ALIGN=RIGHT VALIGN=TOP WIDTH=$[expr [dwGetTocItemLevel] * [dwGet IndentWidth]]>
- $[dwGet hits]
- </TD>
- <TD ALIGN=CENTER VALIGN=BASELINE WIDTH=$[dwGet ArrowWidth]>
- </TD>
- <TD ALIGN=LEFT VALIGN=TOP WIDTH=$[dwGet TextWidth]>
- <A HREF="$[dwGet TocIconUrl]"$[dwGet ScrollAnchor]$[dwGet TocIconTarget]>. . .</A>
- </TD>
- </NOBR></TR>
- </TABLE>
- }
-
- dwScript Tables__NonExpandableTocLine {
- if {[dwGet State__Tables] == 1} {
- if {[dwGet TocLineIsHilited] == 1} {
- dwSet TocTextAttrBefore "<TABLE cellspacing=0 cellpadding=0 border=0><TR><TD bgcolor=#C0D8FF NOWRAP><B>"
- dwSet TocTextAttrAfter "</B></TABLE>"
- } else {
- dwSet TocTextAttrBefore ""
- dwSet TocTextAttrAfter ""
- }
- dwProcessTemplate Tables__NonExpandableTocLineTableRow
- } else {
- set icondir [dwGetParam IconDir]
- set hits "<FONT COLOR=#FF0000><B>[dwGet TocLineHitCount]</B></FONT>"
- set tocLine ""
- set loop [expr 2 * [dwGetTocItemLevel]]
- while {$loop > 0} {
- set tocLine "$tocLine<IMG SRC=\"${icondir}spacer.gif\" ALT=\" \">"
- incr loop -1
- }
- set loop 3
- while {$loop > 0} {
- set tocLine "$tocLine<IMG SRC=\"${icondir}spacer.gif\" ALT=\" \">"
- incr loop -1
- }
- set tocLine "$tocLine<A HREF=\"[dwGet TocLineUrl]\">[dwGetTocItemTitle] </A> $hits<BR>\n"
- dwSend $tocLine
- }
- }
-
- dwTemplate Tables__NonExpandableTocLineTableRow {
- <TABLE CELLPADDING=0 BORDER=0 WIDTH=$[dwGet LineWidth]>
- <TR><NOBR>
- <TD ALIGN=RIGHT VALIGN=TOP WIDTH=$[expr [dwGetTocItemLevel] * [dwGet IndentWidth]]>
- <FONT COLOR=#FF0000><B>$[dwGet TocLineHitCount]</B></FONT>
- </TD>
- <TD WIDTH=$[dwGet ArrowWidth]>
- </TD>
- <TD ALIGHT=RIGHT VALIGN=TOP WIDTH=$[dwGet TextWidth] NOWRAP>
- $[dwGet TocTextAttrBefore]<A HREF="$[dwGet TocLineUrl]"$[dwGet ScrollAnchor]$[dwGet TocLineTarget]>$[dwGetTocItemTitle]</A>$[dwGet TocTextAttrAfter]
- </TD>
- </NOBR></TR>
- </TABLE>
- }
-
-