- This topic has 6 replies, 3 voices, and was last updated 12 years, 5 months ago by Hamilton.
-
AuthorPosts
-
June 7, 2012 at 11:57 am #35233GinoParticipant
Hi,
I'm creating a touch screen application. Is there a way to have a different display state when the mouse pointer is over the TsSpeedButton and when the TsSpeedButton is down?
Now, these two states do the same “Active” state. But this is quite confusing because when you stop pressing the button, the button still seems active.
Thanks in advance,
Gino
June 7, 2012 at 12:26 pm #48481ivanov34ParticipantIt is probably necessary to transfer focus to other object
Code:procedure TForm1.sSpeedButton1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
XXX.SetFocus;
end;June 7, 2012 at 12:32 pm #48482GinoParticipant'ivanov34' wrote:It is probably necessary to transfer focus to other object
Code:procedure TForm1.sSpeedButton1MouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
XXX.SetFocus;
end;No, a sSpeedButton can not get the focus. The problem is that the mouse is still over the button and the buttons still shows the active state.
June 8, 2012 at 2:12 am #43845HamiltonParticipantHi Gino,
What skin are you using? I tested TsSpeedButtons with several skins and the down and mouseover drawing were different and distinct for all of them. For the web2 skin for instance, the mouseover effect turns the button orange and the down state draws the button as a darker shade of blue than the normal state. Once the button is down if you do the mouseover again the button remains drawn in the down state (there is no indicator that the mouse is over the button) but I think this is the expected behaviour. I wonder if the problem you're describing is that the button remains in a down state after you've stopped clicking on it? – if that is the case it's not a skin issue, its a behaviour caused by the way the button is setup and you'll either want to set the button group to 0 so it doesn't have a down state or manually control the down state. Let me know if I've misunderstood your problem.
Regards,
Hamilton
June 8, 2012 at 8:06 am #43846GinoParticipant'Hamilton' wrote:What skin are you using?
I'm using “Office 2007 Black”. I checked the “WEB2” skin and there is a difference between the mouse over state and the down state. Although, it doesn't work out for me to get the “Office 2007 Black” OK.
'Hamilton' wrote:I wonder if the problem you're describing is that the button remains in a down state after you've stopped clicking on it? – if that is the case it's not a skin issue, its a behaviour caused by the way the button is setup and you'll either want to set the button group to 0 so it doesn't have a down state or manually control the down state. Let me know if I've misunderstood your problem.
No, the button is not in the down state anymore. The group index of the speedbutton is 0. I suppose it is something with the skin setup that I have overlooked.
June 11, 2012 at 2:41 am #48485HamiltonParticipantHi Gino,
If you have a GroupIndex of 0 I would expect that you wouldn't see the down state at all and that the button would return to the default original state as soon as you clicked it? If you have a couple of buttons with a GroupIndex of 1 then I can see the problem that you describe with the Office 2007 Black skin however – the down state and the mouseover state are way too similar. If you look very closely then you'll notice that the down state draws the button orange with a brown(ish) border on the left and top sides, but the mouseover has a white(ish) line in those places instead. You should be able to use the skin editor to change the way one of those effects is drawn but it would be much better if the skin itself was fixed.
Serge – can you change the Office 2007 Black skin to have more variance between the mouseover and down states on TsSpeedButton?
EDIT – Realized you can see the down state while the mouse remains clicked. Doesn't affect other details of my post.
Regards,
Hamilton
June 11, 2012 at 4:15 am #48486HamiltonParticipantFor a quick fix – if you change the SkinData.SkinSection to BUTTON then you may get the effect you want. I tested this with Office 2007 Black and it looks OK but try some of the other sections if it doesn't suit your taste. Good luck!
-
AuthorPosts
- You must be logged in to reply to this topic.