I haven't tried this, but you could use a stylesheet with this style definition:
* {
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently supported by Chrome and Opera */
}
Load it both high (level 0) and low (ToolBook frame) by calling
pgExtFiles() twice (once on book load for the book and once for each page in your program for on page load) and you may be able to achieve the result you desire without jeopardizing normal buttonClicks on elements, etc. For objects that still require text selection you will have to set this to a value that allows it with the default behavior.
You can search the web for the user-select style and you may be able to get other ideas. I use this sparingly because in most of my work, preventing all user selects is usually not desirable. There is another style you can play around with and it is called "pointer-events". This one prevent the object(s) from responding to any mouse or touch behavior. I've used it to good advantage, but again you have to be careful or you can sabotage needed mouse interaction on object(s) that require it. PowerPac's pgStyleObject() supports setting the
pointerEvents style. I see userSelect is not supported in pgStyleObject() but it is supported by an undocumented PowerPac function called
pg_PreventSelect(obj, reset)
. In this function obj must be the return from the function
gTBo(tbName, "objRef")
. So to use this on a per object level you could use
exeJavascriptDirect():
var obj = gTBo( "your object name", "objRef" );
pg_PreventSelect( obj, false );
//Now my object cannot be selected but will still respond to buttonclicks, etc.
You could also set a class in your stylesheet which sets
user-select: none;
and just set the classname of required objects using
userProperty().
As you can see there are a lot of ways to get the results you desire. You just need to experiment a little to find the one that works best for your application. The PowerPac uses some of these methods internally when needed.