Font dialog problems
-
Ok, so I want to be able to select a section of text and modify its properties. Well, the CFontDialog class only offers BOOLs for most of the options (underscore, bold, italic, etc. are either TRUE or FALSE). That doesn't allow me to have a third value to set the dialog to if, say, two different parts of the selected text had different properties. The idea would be to check all properties, and set the ones that differ to some third value. Then, on '...DoModal() == OnOK;' Check the values again to see whether they'd been changed to either TRUE or FALSE, and change the entire selection to that. If it's still the third value, then do not change the selection and leave each character just as it was for that property. So, there's the problem: There's no third state which means to keep the differences intact. And since they're BOOLs, I can't even set the underlying value to some third state to compare with the value after the user's done. My attempts: So, I tried to do a callback function to somehow try and figure out when the user has made a selection in the font dialog, then I can hopefully ONLY use the selected value(s) to modify the text, NOT the other properties that were not specified. This is still annoying, since it wouldn't show the user an acceptable third (greyed out, but still selectable, like in Word) state, but at least the functionality could be accomplished. Result: Assertion errors on my attempts at the callback function. I can't seem to make them work. So, help on the callbacks, or suggestions on showing the user this third state would be greatly appreciated. I'm not good enough to make my own font dialog, I don't think. halblonious