I am trapping mouse move event. My requirement is to select all nodes which are traversed on mouse drag. I am able to trap mouse move and is geteting appropriate position values. But if I try to get the child node at the mouse move position, this does not return a valid pointer.
Below is the code snippet.
/*************************************************************************
handle mouse move
*************************************************************************/
void DateButton::onMouseMove(MouseEventArgs& e)
{
static int num;
// ButtonBase::onMouseMove(e);
Window::onMouseMove(e);
Window* sheet = System::getSingleton().getGUISheet();
#ifdef DEBUG
this == sheet->getChildAtPosition(e.position);
// logIntValue("DateButton::onMouseMove from onMouseMove begin - date value if ", this->getDate());
#endif
// convert mouse position to something local
Point localMousePos(screenToWindow(e.position));
if (getMetricsMode() == Relative)
{
localMousePos = relativeToAbsolute(localMousePos);
}
#ifdef DEBUG
this == sheet->getChildAtPosition(e.position);
//logIntValue("DateButton::onMouseMove after localMousePos - date value if ", this->getDate());
#endif
if (d_dragMoving)
{
if (sheet != NULL)
{
if (this == sheet->getChildAtPosition(e.position))
{
// logIntValue("DateButton::onMouseMove befor MouseMoveOverDate() XXXXXXX- date value if ", this->getDate());
// MouseMoveOverDate();
}
}
// WindowEventArgs args(this);
// fireEvent(EventDateMouseMove, e);
}
else if (d_segmentPushed && !d_dragMoving)
{
//initDragMoving();
d_dragMoving = true;
logMsg("entering initDragMoving");
}
e.handled = true;
}
/*************************************************************************
handle mouse button down.
*************************************************************************/
void DateButton::onMouseButtonDown(MouseEventArgs& e)
{
#ifdef DEBUG
// logMsg("DateButton::onMouseButtonDown");
#endif
// base class processing
ButtonBase::onMouseButtonDown(e);
// select
if (e.button == LeftButton)
{
Window* sheet = System::getSingleton().getGUISheet();
if (sheet != NULL)
{
if (this == sheet->getChildAtPosition(e.position))
{
#ifdef DEBUG
logIntValue("DateButton::onMouseButtonDown bef onselected() , date is ", this->getDate());
#endif
d_syskeys = e.sysKeys;
// onSelected();
}
}
}
// drag start
if (e.button == LeftButton)
{
// ensure all inputs come to us for now
if (captureInput())
{
// get position of mouse as co-ordinates local to this window.
Point localPos(screenToWindow(e.position));
if (getMetricsMode() == Relative)
{
localPos = relativeToAbsolute(localPos);
}
// store drag point for possible sizing or moving operation.
d_dragPoint = localPos;
d_segmentPushed = true;
}
}
e.handled = true;
}
I am able to get proper nodes on for the start node and for the end node and not for inbetween nodes.
Pl. let me know how to get the child instance which are being traversed on drag.
Pl help me out and I am stuck up.
regards
krithiga
Mouse move - position track uanble get the child node on mou
Moderators: CEGUI MVP, CEGUI Team
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Mouse move - position track uanble get the child node on
I have no idea what these 'nodes' are since they're specific to your app. All I can say is that there's nothing in that code which detects a child window (so if nodes are attached child windows this is likely to be the issue).
CE.
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: Mouse move - position track uanble get the child node on
The line
this == sheet->getChildAtPosition(e.position)) is retrieving the child window.
But this does not point to a valid child window
Regarding node they are date buittons in a month pane.
Pl help me out
regards
krithiga
this == sheet->getChildAtPosition(e.position)) is retrieving the child window.
But this does not point to a valid child window
Regarding node they are date buittons in a month pane.
Pl help me out
regards
krithiga
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: Mouse move - position track uanble get the child node on
the getChildAtPosition API is used extensively throughout the system and definately works in all circumstances.
Your code there is retrieving nothing, it's just seeing if the returned window is 'this' window.
CE.
Your code there is retrieving nothing, it's just seeing if the returned window is 'this' window.
CE.
Return to “Modifications / Integrations / Customisations”
Who is online
Users browsing this forum: No registered users and 3 guests