|
From: <kw...@us...> - 2003-11-01 00:38:31
|
Update of /cvsroot/aedgui/aedGUI/src
In directory sc8-pr-cvs1:/tmp/cvs-serv7717/src
Modified Files:
aedWidget.cpp aedWindow.cpp
Log Message:
Solved the Dragable window problem thanks to Sam's Advice
Index: aedWidget.cpp
===================================================================
RCS file: /cvsroot/aedgui/aedGUI/src/aedWidget.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** aedWidget.cpp 29 Oct 2003 19:27:19 -0000 1.3
--- aedWidget.cpp 1 Nov 2003 00:38:28 -0000 1.4
***************
*** 580,584 ****
aedWidget::wm_lbuttondown(Uint16 x, Uint16 y)
{
! return 0;
}
--- 580,585 ----
aedWidget::wm_lbuttondown(Uint16 x, Uint16 y)
{
! m_isPressed=true;
! return 0;
}
***************
*** 586,590 ****
aedWidget::wm_lbuttonup(Uint16 x, Uint16 y)
{
! return 0;
}
--- 587,592 ----
aedWidget::wm_lbuttonup(Uint16 x, Uint16 y)
{
! m_isPressed=false;
! return 0;
}
***************
*** 689,694 ****
case SDL_MOUSEMOTION:
! child = findChildAtCoord(event->motion.x, event->motion.y,
! NO_STATIC);
last = last ? pApp->getRoot()->findWidget(last) : NULL;
--- 691,703 ----
case SDL_MOUSEMOTION:
! if(pFocused != NULL && pFocused->isEnabled() && pFocused->isPressed())
! {
! child = pFocused;
! }
! else
! {
! child = findChildAtCoord(event->motion.x, event->motion.y,
! NO_STATIC);
! }
last = last ? pApp->getRoot()->findWidget(last) : NULL;
Index: aedWindow.cpp
===================================================================
RCS file: /cvsroot/aedgui/aedGUI/src/aedWindow.cpp,v
retrieving revision 1.65
retrieving revision 1.66
diff -C2 -d -r1.65 -r1.66
*** aedWindow.cpp 29 Oct 2003 19:27:19 -0000 1.65
--- aedWindow.cpp 1 Nov 2003 00:38:28 -0000 1.66
***************
*** 5,9 ****
m_InitComplete = false;
! m_Dragging = false;
m_Moveable = false;
m_Caption = "";
--- 5,9 ----
m_InitComplete = false;
! m_isPressed = false;
m_Moveable = false;
m_Caption = "";
***************
*** 129,133 ****
if ((y > m_Pos.getY() + 5) && y < m_Pos.getY() + 45)
{
! m_Dragging = true;
dragXoffset = x-m_Pos.getX();
dragYoffset = y-m_Pos.getY();
--- 129,133 ----
if ((y > m_Pos.getY() + 5) && y < m_Pos.getY() + 45)
{
! m_isPressed = true;
dragXoffset = x-m_Pos.getX();
dragYoffset = y-m_Pos.getY();
***************
*** 139,143 ****
int aedWindow::wm_lbuttonup(Uint16 x, Uint16 y)
{
! m_Dragging = false;
return 0;
}
--- 139,143 ----
int aedWindow::wm_lbuttonup(Uint16 x, Uint16 y)
{
! m_isPressed = false;
return 0;
}
***************
*** 146,150 ****
{
// FIX ME:We can't rely on wm_mousemove for dragging.
! if (m_Dragging)
{
//setPos(getPos().getX() + dx, getPos().getY() + dy);
--- 146,150 ----
{
// FIX ME:We can't rely on wm_mousemove for dragging.
! if (m_isPressed)
{
//setPos(getPos().getX() + dx, getPos().getY() + dy);
|