Shoutbox

[Resolved!] Rich Edit Scrolling text (horizontal) - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: [Resolved!] Rich Edit Scrolling text (horizontal) (/showthread.php?tid=75577)

[Resolved!] Rich Edit Scrolling text (horizontal) by Flash on 06-24-2007 at 05:19 AM

ok i need little help for my code

the code work, but the text not ajusted, someone can help me for that code turn perfect pls :P

code:
function Scroll_Text(p,w,c,cc,ccc) {
    if (PlusWnd5) {
        var le = w.GetControlText(c).length+5
        if (p == 1) {
            if (cc == null) cc = -1;
            if (ccc == null) ccc = 0;
            if (cc > 0) {
                ScrollPos(w,c,ccc*2,0)
            }
            if (cc == 1) {
                if (ccc > le) cc = -2, ccc = 0;
                else ccc = ccc +2;
            }
            else if (cc == 2) {
                if (ccc < 0) cc = -1, ccc = 0;
                else ccc = ccc -2;
            }
            else if (cc == -1) {
                if (ccc >= 74) cc = 1, ccc = 0;
                else ccc = ccc+2;
            }
            else if (cc == -2) {
                if (ccc >= 74) cc = 2, ccc = le;
                else ccc = ccc+2;
            }   
        }
        //Debug.Trace('Ah ben: ' +le+ ' ' +cc+ ' ' +ccc)
        //if (!TimerExist('Scroll_text'))
        if (le >= 30 && Update_InProg != 1) new Timer(function(){Scroll_Text(1,w,c,cc,ccc);},250,'Scroll_text',1);
        else new Timer('Cancel','Scroll_text'), ScrollPos(w,c,0,0);
    }
    else new Timer('Cancel','Scroll_text');
}


code:
function ScrollPos(w,c,x,y) {
    var POINT = Interop.Allocate(8);
    POINT.WriteDWord(0,/* x */ x);
    POINT.WriteDWord(4,/* y */ y);
    var h = w.SendControlMessage(c,/* EM_SETSCROLLPOS */ 0x4DE, 0, POINT.DataPtr)
}

i got the lenght of text but setscrollpos not set chars but pixel :|

i think i need to got the number total of pixel for the text
RE: [Help] Rich Edit Scrolling text by markee on 06-24-2007 at 06:37 AM

quote:
Originally posted by Flash
code:
new Timer(function(){Scroll_Text(1,w,c,cc,ccc);},250,'Scroll_text',1);

How is this meant to work? I think you mean MsgPlus.AddTimer(timerId,milliseconds); and putting the function in the Event that is called....
RE: [Help] Rich Edit Scrolling text by Flash on 06-24-2007 at 12:25 PM

no its my code for all timer :P
now my timer code is that
new Timer(function(){Code;},TIME,ID,REPEATALLTIME);

so that work perfect!