I want a button get the mouse focus when get into a new Window
Fun:activate() is not working
Is there other that I can use it like:getfocus()
Thank you!
How can a Button get focus
Moderators: CEGUI MVP, CEGUI Team
Re: How can a Button get focus
No One?
Re: How can a Button get focus
Typically the 'focus' has absolutely nothing to do with the mouse. The mouse can move the focus, but they are not the same thing; the keyboard, typically, can also move the 'focus', but again the 'focus' is a separate entity. So what, exactly, do you mean when you say "mouse focus"??
Do you mean that you want to automatically move the mouse over the button when the window opens? If so, just re-position the mouse yourself. You can use Window::getPixelRect() to get the pixel position of the button, and then just set the mouse position based on that.
p.s. this is a Beginner question...this does not belong in the Advanced help forum.
Do you mean that you want to automatically move the mouse over the button when the window opens? If so, just re-position the mouse yourself. You can use Window::getPixelRect() to get the pixel position of the button, and then just set the mouse position based on that.
p.s. this is a Beginner question...this does not belong in the Advanced help forum.
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!
Re: How can a Button get focus
Thankyou my question is that the image Button has four state (NormalImage HoverImage PushedImage DisabledImage). what I want is when getinto
a FrameWindow, the Button in this FrameWindow show PushedImage but no NormalImage that was What I said "get mouse focus"
and How can I re-position the mouse I Can not find the true function
Thanks
a FrameWindow, the Button in this FrameWindow show PushedImage but no NormalImage that was What I said "get mouse focus"
and How can I re-position the mouse I Can not find the true function
Thanks
- scriptkid
- Home away from home
- Posts: 1178
- Joined: Wed Jan 12, 2005 12:06
- Location: The Hague, The Netherlands
- Contact:
Re: How can a Button get focus
FeiYun wrote:How can I re-position the mouse I Can not find the true function.
You could use the System::injectMousePosition() method: http://www.cegui.org.uk/api_reference/c ... 41d9f080c4
Cegui will manage showing the corresponding state imagery.
However as soon as you move the mouse for real, i think that the button jumps back to the normal state again. What you could do is trick the user by putting the hower image on the normal 'slot':
Code: Select all
myButton->setProperty("NormalImage", "set:mySet image:buttonHover");
So that, when the mouse moves for real, the normal state looks hovered. You should however find the best place in your code when to undo this trick and set the correct image name again.
HTH.
Check out my released snake game using Cegui!
Re: How can a Button get focus
Thank you
what I want is when a new FrameWindow is opened by user, user can look at that a button is been choosed
so the button shows pushedimage
So I try to change the normalimage and then Let Button looks like being choosed, then at right place change back again.
I will use method until I find the better.
what I want is when a new FrameWindow is opened by user, user can look at that a button is been choosed
so the button shows pushedimage
So I try to change the normalimage and then Let Button looks like being choosed, then at right place change back again.
I will use method until I find the better.
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 9 guests