[wx-dev] [ wxwindows-Bugs-1906223 ] RTC leaks formatting after an URL was clicked

SourceForge.net noreply at sourceforge.net
Mon May 5 03:24:16 PDT 2008


Bugs item #1906223, was opened at 2008-03-03 12:22
Message generated for change (Comment added) made by juliansmart
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: Closed
>Resolution: Rejected
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: Julian Smart (juliansmart)
Date: 2008-05-05 10:24

Message:
Logged In: YES 
user_id=59495
Originator: NO

Sorry, I discovered that the patch completely broke programmatic style
application with BeginStyle/EndStyle, so I had to revert it.

I'm not so sure this is a bug - it's intended that the formatting at the
caret should be applied when you type. If I'm in a URL and start typing,
then I expect to get URL formatting. If I move the caret outside the URL, I
then don't get URL formatting. So I don't see the problem.

----------------------------------------------------------------------

Comment By: Julian Smart (juliansmart)
Date: 2008-05-03 20:09

Message:
Logged In: YES 
user_id=59495
Originator: NO

Patch applied, many thanks.

----------------------------------------------------------------------

Comment By: Andrej Sinicyn (andrej4000)
Date: 2008-03-04 11: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 09: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