[Resolved!] Rich Edit Scrolling text (horizontal) |
Author: |
Message: |
Flash
Junior Member
All time Ready
Posts: 86 Reputation: 2
44 / /
Joined: Aug 2006
|
O.P. [Resolved!] Rich Edit Scrolling text (horizontal)
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
This post was edited on 06-24-2007 at 06:17 PM by Flash.
|
|
06-24-2007 05:19 AM |
|
|
markee
Veteran Member
Posts: 1622 Reputation: 50
36 / /
Joined: Jan 2006
|
RE: [Help] Rich Edit Scrolling text
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....
|
|
06-24-2007 06:37 AM |
|
|
Flash
Junior Member
All time Ready
Posts: 86 Reputation: 2
44 / /
Joined: Aug 2006
|
O.P. RE: [Help] Rich Edit Scrolling text
no its my code for all timer
now my timer code is that
new Timer(function(){Code;},TIME,ID,REPEATALLTIME);
so that work perfect!
|
|
06-24-2007 12:25 PM |
|
|
|
|