Two notebook wishes
patg
2: It would be great to be able to query Igor what the ruler, font, size, style, etc actually are at the insertion-point / start-of-selection, as the current ruler can have been added to by in-line commands which persist. This must already exist but is not to my knowledge extractable.
Regards,
Patrick.
I'm not sure why you want to do this but you can get some of this information using the WinRecreation function. See the Notebook Details section of the help for WinRecreation. You would then need to parse the returned text which could be tricky.
March 23, 2010 at 05:01 pm - Permalink
•notebook notebook0,fSize=16,fStyle=1,text="toad\r";
•notebook notebook0,ruler=Normal,text="newt\r";
•notebook notebook0,ruler=Normal,fSize= -1,fStyle= -1,text="newt\r";
The first 'newt' still follows the 'bold, 16pt' requests from the 'toad' line. You can explicitly turn them off as in the second 'newt' line, but this would require all of text colour, vOffset, and others to be reset each time. A few possible solutions:
- never use add-on commands. Define new rulers for every occasion and just call each as required. In-line format changes can still be used if every format change is undone at the end of the paragraph. I do use this already but is hard to program for complex formatting.
- a wish list item "format= -1" to reset all of the formats back to the named (or current) ruler.
- the original request, of a 'formatInfo' string detailing the current state
Now that I look at it again, the ability to force all formatting back to a named ruler seems best.
March 31, 2010 at 03:33 pm - Permalink
You can do most of it already. This:
sets all text formats to current ruler's defaults. It contains the assumption of what the default vOffset and textRGB are.
March 31, 2010 at 06:33 pm - Permalink
April 4, 2010 at 09:37 pm - Permalink