quote:
Originally posted by CookieRevised
Are you sure Plus! clears the text area before OnEvent_ChatWndSendMessage is called? That seems strange... since Plus! can't know if the text is going to be parsed or not.
If text is not going to be parsed, Plus! will intercept the push on the send button and fires ChatWndSendMessage event and a new line is added after the existing text. Or ... a new line is added after the existing text and Plus! fires a ChatWndSendMessage event. Either way, line is added after the text.
If text is going to be parsed, Plus! will intercept the push on the send button and fires ChatWndSendMessage event, text is replaced (and cursor should be at the end in this case) and a new line is added after the existing text. Or ... a new line is added after the existing text and Plus! fires a ChatWndSendMessage event and the existing text is replaced (doubt this is how it works). Either way, line is added after the text.
Where did I screw up? (note: didn't tested anything of this... I'm lazy atm )
it doesn't matter if plus is going to replace text or not... the thing is that unless you do explicitly, when you put text in an edit box, the cursor possition is at the begining of the text. (with "you put" i mean "a program puts"). The possition is moved when the user pushes keys and types, not when Plus sets the texts of the edit box. And that's done before executing Messenger's code of the button (which Plus always thinks it's going to send the message). That's why when Plus finishes its work, it lets Messenger execut tis code, which in this case is to insert a new line at the possition, which is the begining because Plus (unconsciously) changed it.