What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Help with a menu selection

Help with a menu selection
Author: Message:
J-Thread
Full Member
***

Avatar

Posts: 467
Reputation: 8
– / Male / –
Joined: Jul 2004
RE: Help with a menu selection
You're using EditText_SetCurSel in the wrong way. The function takes 2 numbers, and you are passing 2 strings. You should do:

code:
function OnEvent_MenuClicked(MenuItemId,Location,OriginWnd)
{
var currenttext = OriginWnd.EditText;
switch(MenuItemId)
{
         case "PHP":
         OriginWnd.EditText_SetCurSel (0, currenttext.length - 1);
         OriginWnd.EditText_ReplaceSel ("[ code=php] [/code ]");
         break;
    }
}

That will replace all text in the edit box with [ code=php][/code ]. To replace it with: [ code=php]oldtext[/code ] use:

code:
function OnEvent_MenuClicked(MenuItemId,Location,OriginWnd)
{
var currenttext = OriginWnd.EditText;
switch(MenuItemId)
{
         case "PHP":
         OriginWnd.EditText_SetCurSel (0, currenttext.length - 1);
         OriginWnd.EditText_ReplaceSel ("[ code=php]"+currenttext+"[/code ]");
         break;
    }
}
07-09-2006 01:59 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Help with a menu selection - by Paril on 07-09-2006 at 12:57 PM
RE: Help with a menu selection - by J-Thread on 07-09-2006 at 01:27 PM
RE: Help with a menu selection - by Paril on 07-09-2006 at 01:29 PM
RE: Help with a menu selection - by Paril on 07-09-2006 at 01:48 PM
RE: Help with a menu selection - by J-Thread on 07-09-2006 at 01:59 PM
RE: Help with a menu selection - by Paril on 07-09-2006 at 02:01 PM


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