SRL Archive - OSR Help

Help with Tshape color change


rj

2013-06-19 19:04:14

So my script, the square colors on the Form change when ever the mouse enters the bounds
fixed

Lalaji

2013-06-20 15:27:15

Did your restorecolor procedure work?

Idk if there is a better way to tackle a lack of OnMouseExit event, but this is what I can think of. Change the changecolors procedure to this

procedure changecolors (sender:tobject, ......)
Begin
For I = 0 to high(shapes) do
Shapes[i].pen.color := 12632256;
Case sender of
Shapes[0]: Shapes[0].pen.color := 59900;
....
End;
End;

That way you restore the color of all previous tshape before changing the color of the one the mouse is on. Does that work for you?

rj

2013-06-20 15:32:22

From: Lalaji
Did your restorecolor procedure work?

Idk if there is a better way to tackle a lack of OnMouseExit event, but this is what I can think of. Change the changecolors procedure to this

procedure changecolors (sender:tobject, ......)
Begin
For I = 0 to high(shapes) do
Shapes[i].pen.color := 12632256;
Case sender of
Shapes[0]: Shapes[0].pen.color := 59900;
....
End;
End;

That way you restore the color of all previous tshape before changing the color of the one the mouse is on. Does that work for you?


OO that's a good idea, hold on a second let me try that

Kevin

2013-06-20 16:14:13

Can you do form.OnMouseOver to reset anything the moment it's not highlighting any of them as well? (I don't know if the onmouseover will work from an inner item sliding to the form or if it is considered over as it is under the inner item).

rj

2013-06-20 17:06:04

From: Kevin
Can you do form.OnMouseOver to reset anything the moment it's not highlighting any of them as well? (I don't know if the onmouseover will work from an inner item sliding to the form or if it is considered over as it is under the inner item).


I tried it but the TTab cover up the form, I also tried having P.page.onmouseover but that just made it so I had to hover over the top