[Solved]slider in list box

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

K0h4n
Just popping in
Just popping in
Posts: 14
Joined: Sun Apr 06, 2008 15:21

[Solved]slider in list box

Postby K0h4n » Sat Jul 19, 2008 04:43

few days ago i'm asking about the mouse enter a window in this thread:
http://www.cegui.org.uk/phpBB2/viewtopic.php?t=3412
i'm creating chat window using listbox and editbox
each window (main window, listbox and editbox) i subscribe the same event to achieve the transparent once the cursor leaves the window
the problem appear once the text reach bottom and the slider appear
if i put my cursor on the slider, the main window will be transparent again (same effect once the cursor leaves the window)

i try this code:

Code: Select all

Listbox* chatLog = static_cast<Listbox*> (wmgr->getWindow((utf8*)"InGame/ChatWindow/ChatLog"));
Window *bar = static_cast<Window*> (chatLog->getVertScrollbar());
chatLog->setShowHorzScrollbar(false);
chatLog->setShowVertScrollbar(true);


and subscribe this event:

Code: Select all

bar->subscribeEvent(Window::EventMouseEnters,
          Event::Subscriber(&MainFrameListener::handle_InGameRoomChat_Mouse_Enters, this));
bar->subscribeEvent(Window::EventMouseLeaves,
          Event::Subscriber(&MainFrameListener::handle_InGameRoomChat_Mouse_Leaves, this));


but its not solve the problem

is there any way to make the window as one group
and subscribe an event to the group and affect all the window?
or maybe there is a parent child system so when the cursor enter the parents area some event is triggered

any help is appreciated
Last edited by K0h4n on Sat Jul 19, 2008 19:05, edited 1 time in total.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Sat Jul 19, 2008 16:20

I did not consider this in the other thread, and I'm not certain about a good clean solution either.

Unfortunately, I don't think there is a way to group windows in such a way that the events would be 'common' to the group.

You had the right kind of idea with subscribing to the same event on the scrollbar, the only solution I can think of at the moment is to subscribe the handler to the component parts of the scrollbar also; the increase button, the decrease button, and the thumb. Yes, that's a horrible solution, but at the moment, nothing else comes to mind.

I think this is a definite issue, and is something that should be addressed somehow.

CE.

K0h4n
Just popping in
Just popping in
Posts: 14
Joined: Sun Apr 06, 2008 15:21

Postby K0h4n » Sat Jul 19, 2008 19:03

wow
i'm glad i can solve it now

is it possible to program using function getXPosition, getYPosition, getWidth, getHeight in window class to solve this matter?
i think once the cursor inside or outside the the range of the main window, then the transparent event will be triggered
i cant figure it out how to do it
but i think it is possible

anyway thank you eddie

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Postby CrazyEddie » Sun Jul 20, 2008 09:32

You could use the Window::isHit member to discover whether the mouse is within the main window; you pass in a CEGUI::Vector2 containing the mouse position in screen pixels and it will return true if the mouse falls within the window's area (the window must not be disabled for it to work).

HTH

CE.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 9 guests