[ wxwindows-Bugs-1882056 ] wxRichTextCtrl forgets DefaultStyle
SourceForge.net
noreply at sourceforge.net
Tue Feb 26 04:56:26 PST 2008
Bugs item #1882056, was opened at 2008-01-29 20:36
Message generated for change (Comment added) made by juliansmart
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1882056&group_id=9863
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: RichTextCtrl
Group: Must fix
>Status: Closed
>Resolution: Invalid
Priority: 5
Private: No
Submitted By: Tyushkov Nikolay (softvoile)
Assigned to: Julian Smart (juliansmart)
Summary: wxRichTextCtrl forgets DefaultStyle
Initial Comment:
Create wxRichTextCtrl and add the following code to set red colour as default for text
wxTextAttr t=m_richTextCtrl.GetDefaultStyle();
m_richTextCtrl.SetTextColour(wxColour(255,0,0));
m_richTextCtrl.SetDefaultStyle(t);
Run program. Now all text that you write or paste should be red, am I correct?
Write some text, set cursor to the first position in the editor, press Enter, press Up Arrow to return to the first postion. Try to write text - it will be black, but should be red.
----------------------------------------------------------------------
>Comment By: Julian Smart (juliansmart)
Date: 2008-02-26 12:56
Message:
Logged In: YES
user_id=59495
Originator: NO
When writing a bunch of text programmatically you can rely on the default
style being kept, but when editing, the default style is taken partly from
the style at the cursor and partly the current selections in the UI (e.g.
bold). So this can't be relied on to be permanent. It would probably be
better to set the basic style (SetBasicStyle) if you want a permanent style
for the buffer. Or you could perhaps force it in idle time.
Julian
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1882056&group_id=9863
More information about the wx-dev
mailing list