To get a list of files containing code samples, you need to search by <pre> tag.
1. Replace the <pre> tag with:
Code: Select all
<br /><a href="javascript:ClipBoard(pb);"><IMG title="Copy to Clipboard" style="margin: -16px 0px 0px 0px;" src="../copy.gif" border="0" align="right"></a>
<PRE class="codebox" id="pb">
Code: Select all
<textarea ID="holdtext" STYLE="display:none;"></textarea><SCRIPT LANGUAGE="JavaScript">function ClipBoard(NumBlok){holdtext.innerText = NumBlok.innerText;Copied = holdtext.createTextRange();Copied.execCommand("Copy");}</SCRIPT>
</body></html>
4. Compile the CHM help file and now it will have a copy code button without having to select the code text.
Necessary programs for searching and compiling (HTML Help Workshop)
But not everything is as perfect as we would like. Some blocks listing constants also have a <pre> tag. If there is more than one tag, then the "pb" identifier must be different, for example pb1, pb2, pb3, etc.
Code: Select all
id="pb"
ClipBoard(pb)