What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » WLM Plus! Bug Reports » [Scripting Bug] RichEditControl and SetControlText

[Scripting Bug] RichEditControl and SetControlText
Author: Message:
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
O.P. [Scripting Bug] RichEditControl and SetControlText
Well quite simply, when trying to set the text of a RichEditControl with SetControlText (with Rich Text mode enabled) the text set is not "rich".

Example:
code:
PlusWnd.SetControlText("MyRichEdit", "[b]Testing[/b]");

The text is displayed as [b]Testing[/b] not as it should be Testing.
The reason I consider this a bug is that when you use SetControlText on a RichStaticControl, it works fine and the text is bold/italic/coloured/whatever.

-----
On a related note, GetControlText when used on a RichStaticControl doesnt return the formatting from the text. Although I realise this is probably just a limitation not a bug.
01-23-2007 07:15 PM
Profile PM Find Quote Report
vikke
Senior Member
****

Avatar

Posts: 900
Reputation: 28
31 / Male / Flag
Joined: May 2006
RE: [Scripting Bug] RichEditControl and SetControlText
Since I think those are just SetWindowText, and GetWindowText, they are limited like that.

And:
[ b ]Testing[ /b ] shouldn't be bold if MessengerPlus!'s hook attaches to the richedit, which I don't know. If you want to know the "bold code" in RTF (Rich Text Format) , open Word (or WordPad which is included in Windows), type a bold word, and save it as RTF, then open it in Notepad.
01-23-2007 07:41 PM
Profile E-Mail PM Find Quote Report
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
O.P. RE: [Scripting Bug] RichEditControl and SetControlText
I understand that, but I'm guessing what Plus! does is just handle the WM_SETTEXT message sent (or in this case just edit the text as it's being set using Plus!'s own function) and replaces it's own formatting codes with the ones needed for the same formatting in the RichEdit control (Hence why it works with RichStaticControl, but not RichEditControl).
01-23-2007 07:58 PM
Profile PM Find Quote Report
deAd
Scripting Contest Winner
*****

Avatar

Posts: 1060
Reputation: 28
– / Male / Flag
Joined: Jan 2006
RE: [Scripting Bug] RichEditControl and SetControlText
In rich text controls, you have to use messages to set the format, Plus! just calls the SetWindowText API. BBCode tags are not parsed in rich edit controls because Plus! has no need to anywhere in the program. The chat window edit box is not a standard rich edit control, so Plus! has no need to hook into them, as opposed to rich static controls, which Plus! uses and hooks.

Another RichEditControl bug is that when you move a window, they appear, even if their Visible attribute is set to false.
01-23-2007 09:34 PM
Profile PM Find Quote Report
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
O.P. RE: [Scripting Bug] RichEditControl and SetControlText
quote:
Originally posted by deAd
BBCode tags are not parsed in rich edit controls because Plus! has no need to anywhere in the program.

How about Script Editor? :P
01-24-2007 07:44 AM
Profile PM Find Quote Report
vikke
Senior Member
****

Avatar

Posts: 900
Reputation: 28
31 / Male / Flag
Joined: May 2006
RE: RE: [Scripting Bug] RichEditControl and SetControlText
quote:
Originally posted by deAd
In rich text controls, you have to use messages to set the format, Plus! just calls the SetWindowText API. BBCode tags are not parsed in rich edit controls because Plus! has no need to anywhere in the program. The chat window edit box is not a standard rich edit control, so Plus! has no need to hook into them, as opposed to rich static controls, which Plus! uses and hooks.

Another RichEditControl bug is that when you move a window, they appear, even if their Visible attribute is set to false.

You can have other methods as well. :)
If BB-codes doesn't work I hope Patchou includes that in next version :)
01-24-2007 03:58 PM
Profile E-Mail PM Find Quote Report
deAd
Scripting Contest Winner
*****

Avatar

Posts: 1060
Reputation: 28
– / Male / Flag
Joined: Jan 2006
RE: RE: [Scripting Bug] RichEditControl and SetControlText
quote:
Originally posted by Eljay
quote:
Originally posted by deAd
BBCode tags are not parsed in rich edit controls because Plus! has no need to anywhere in the program.

How about Script Editor? :P

That's not BBCode, it's just sending formatting messages...
01-24-2007 09:31 PM
Profile PM Find Quote Report
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
O.P. RE: [Scripting Bug] RichEditControl and SetControlText
quote:
Originally posted by deAd
That's not BBCode, it's just sending formatting messages...

Hmm I posted that when I just woke up, excuse my sleep induced stupidity.

But anyway I still don't see why it works for static and not edit, surely the messages sent would be the same for both controls? Anyway if there is a reason for it and it's not a bug, then I guess I will have to just parse BBCode myself. :sad: :P

This post was edited on 01-24-2007 at 09:44 PM by Eljay.
01-24-2007 09:44 PM
Profile PM Find Quote Report
deAd
Scripting Contest Winner
*****

Avatar

Posts: 1060
Reputation: 28
– / Male / Flag
Joined: Jan 2006
RE: RE: [Scripting Bug] RichEditControl and SetControlText
quote:
Originally posted by Eljay
quote:
Originally posted by deAd
That's not BBCode, it's just sending formatting messages...

Hmm I posted that when I just woke up, excuse my sleep induced stupidity.

But anyway I still don't see why it works for static and not edit, surely the messages sent would be the same for both controls? Anyway if there is a reason for it and it's not a bug, then I guess I will have to just parse BBCode myself. :sad: :P

It just doesn't need to parse BBCode for rich edit controls anywhere in the program, but it doesn't. For static controls it does need to :/
01-24-2007 10:00 PM
Profile PM Find Quote Report
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
O.P. RE: [Scripting Bug] RichEditControl and SetControlText
quote:
Originally posted by deAd
It just doesn't need to parse BBCode for rich edit controls anywhere in the program, but it doesn't. For static controls it does need to :/

I understand that, what I am trying to say is that me writing a bbcode parser in a script when Plus! obviously already has this functionality included (although it's only an assumption that the same code can be used for RichEdit) is just sort of reinventing the wheel.

If this can't be added easily I guess I shall just have to code my own parser when i get to RichEdit in my plan which is to get all controls fully documented and accessible for developers (because I suck at having original script ideas :P).
01-24-2007 10:11 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On