Hi all,
I've been working on a control for run-time configuration of wxStyledTextCtrl style values. So far just about everything has been working (it's a long way from finished (it still uses styleIDs as names, instead of user-friendly names), but it seems to _work_). I have, however, encountered a problem (or three).
The basic design is that I have a data model of styles (the style.py module), and these styles are applied to a visualisation wxStyledTextCtrl whenever I want to update the values in the editing control (the primary application would just apply them at startup and when exiting from the configuration dialogue). This works fine for foreground and background colours, bold, italic, and underline. When a value changes, I reset the wxStyledTextCtrl's style set, then apply all of the style-sets, then re-colour the text.
The big problem comes with font face specification. I'm using a wxFontEnumerator to get the list of faces (see FontChoice in styleeditor.py). When I set the style's font face attribute, however, the face doesn't change in the window (the face-name _is_ included in the style-configuration string, it just doesn't seem to change anything in the wxStyledTextCtrl).
So, I'm wondering, is there a trick I'm missing?
Second problem:
For some reason, setting font sizes is very tricky. Individual styles don't seem to like having font sizes larger than the "normal" for the control (when the moon is in certain phases and aquarius is in ascendence), and often I wind up with the entire control taking line-sizes that are the maximum of the current styles.
Third problem:
The eolfilled parameter seems to have no effect. I was under the impression it would make e.g. unclosed strings show up as including the end of the line. Is there a different effect intended?
You can get the two modules (which require wxPython 2.3.2.1 and a Python that includes xml.dom.minidom, as it uses the colourselect control and mini-dom for parsing) at:
http://members.rogers.com/mcfletch/programming/fontproblem.tar.gz
Any thoughts would be appreciated,
Mike
···
--
_______________________________________
Mike C. Fletcher
http://members.rogers.com/mcfletch/