[ wxwindows-Bugs-1906223 ] RTC leaks formatting after an URL was
clicked
SourceForge.net
noreply at sourceforge.net
Tue Mar 4 03:05:29 PST 2008
Bugs item #1906223, was opened at 2008-03-03 13:22
Message generated for change (Comment added) made by andrej4000
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1906223&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: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Andrej Sinicyn (andrej4000)
Assigned to: Julian Smart (juliansmart)
Summary: RTC leaks formatting after an URL was clicked
Initial Comment:
I use the RTC to print chat text out.
If a line contains a URL, it is formatted accordingly.
When I just insert a new line, it is alright.
If I click on the URL and process and then insert a new line it gets formatted with the attributes of the URL (where the caret goes to when I click) including the URL attribute.
Resetting the caret via SetCaretPosition before writing a new line doesn't help. Only if I click somewhere outsite the URL in the RTC and only then print a new line it is formatted properly without those attributes.
Even if I specify a wxRichTextAttr with intended formatting, I still get the bug.
I could reproduce this bug on wxMSW and wxGTK using C++ and a friend of mine reproduced whis on wxMSW using Python.
----------------------------------------------------------------------
>Comment By: Andrej Sinicyn (andrej4000)
Date: 2008-03-04 12:05
Message:
Logged In: YES
user_id=508463
Originator: YES
I created patch #1906896 which should fix the bug and simplify
wxRichTextCtrl a little bit.
----------------------------------------------------------------------
Comment By: Andrej Sinicyn (andrej4000)
Date: 2008-03-04 10:57
Message:
Logged In: YES
user_id=508463
Originator: YES
OK, I found a workaround for this problem and the cause.
I have to re-set the caret and call SetDefaultStyleToCursorStyle().
This is a logical problem, because SetDefaultStyleToCursorStyle() is
called by wxRichTextCtrl every time I click somewhere in the text, but by
clicking on a link it doesn't mean that I want to type there, especially if
some text has to be inserted by program and not by typing of the user. As
SetDefaultStyleToCursorStyle() is set, when I type a char, but only after I
typed a char, it would be a better solution to set the default style BEFORE
I type a char and not when I click around as this is more logical and saves
a call here and there.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=109863&aid=1906223&group_id=9863
More information about the wx-dev
mailing list