Update of /cvsroot/wgui/wgui/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29916/src
Modified Files:
wg_editbox.cpp wg_textbox.cpp wg_tooltip.cpp wg_window.cpp
Log Message:
Tooltips and cursor changes now check the floating window and any children.
Index: wg_window.cpp
===================================================================
RCS file: /cvsroot/wgui/wgui/src/wg_window.cpp,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -d -r1.51 -r1.52
*** wg_window.cpp 16 Jul 2004 16:41:36 -0000 1.51
--- wg_window.cpp 19 Jul 2004 21:49:58 -0000 1.52
***************
*** 240,243 ****
--- 240,254 ----
+ bool CWindow::HitTest(const CPoint& Point) const
+ {
+ bool bHit = m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE;
+ for (std::list<CWindow*>::const_iterator iter = m_ChildWindows.begin(); !bHit && iter != m_ChildWindows.end(); ++iter)
+ {
+ bHit = (*iter)->HitTest(Point);
+ }
+ return bHit;
+ }
+
+
void CWindow::Draw(void) const
{
Index: wg_editbox.cpp
===================================================================
RCS file: /cvsroot/wgui/wgui/src/wg_editbox.cpp,v
retrieving revision 1.91
retrieving revision 1.92
diff -C2 -d -r1.91 -r1.92
*** wg_editbox.cpp 16 Jul 2004 16:41:36 -0000 1.91
--- wg_editbox.cpp 19 Jul 2004 21:49:56 -0000 1.92
***************
*** 347,358 ****
// back to a normal cursor.
CView* pView = GetView();
! int eFloatingWindowHit = CRect::RELPOS_INVALID;
! if (pView && pView->GetFloatingWindow())
! {
! eFloatingWindowHit = pView->GetFloatingWindow()->GetWindowRect().SizeRect().HitTest(
! pView->GetFloatingWindow()->ViewToWindow(pMouseMessage->Point));
! }
! if (m_ClientRect.HitTest(WindowPoint) == CRect::RELPOS_INSIDE &&
! eFloatingWindowHit != CRect::RELPOS_INSIDE && !m_bLastMouseMoveInside)
{
m_bLastMouseMoveInside = true;
--- 347,352 ----
// back to a normal cursor.
CView* pView = GetView();
! bool bHitFloating = pView && pView->GetFloatingWindow() && pView->GetFloatingWindow()->HitTest(pMouseMessage->Point);
! if (m_ClientRect.HitTest(WindowPoint) == CRect::RELPOS_INSIDE && !bHitFloating && !m_bLastMouseMoveInside)
{
m_bLastMouseMoveInside = true;
***************
*** 360,365 ****
CApplication::Instance()->SetMouseCursor(&IBeamHandle);
}
! else if ((m_ClientRect.HitTest(WindowPoint) != CRect::RELPOS_INSIDE ||
! eFloatingWindowHit == CRect::RELPOS_INSIDE) && m_bLastMouseMoveInside)
{
m_bLastMouseMoveInside= false;
--- 354,358 ----
CApplication::Instance()->SetMouseCursor(&IBeamHandle);
}
! else if ((m_ClientRect.HitTest(WindowPoint) != CRect::RELPOS_INSIDE || bHitFloating) && m_bLastMouseMoveInside)
{
m_bLastMouseMoveInside= false;
Index: wg_textbox.cpp
===================================================================
RCS file: /cvsroot/wgui/wgui/src/wg_textbox.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** wg_textbox.cpp 16 Jul 2004 16:41:36 -0000 1.25
--- wg_textbox.cpp 19 Jul 2004 21:49:58 -0000 1.26
***************
*** 403,414 ****
// back to a normal cursor.
CView* pView = GetView();
! int eFloatingWindowHit = CRect::RELPOS_INVALID;
! if (pView && pView->GetFloatingWindow())
! {
! eFloatingWindowHit = pView->GetFloatingWindow()->GetWindowRect().SizeRect().HitTest(
! pView->GetFloatingWindow()->ViewToWindow(pMouseMessage->Point));
! }
! if (m_ClientRect.HitTest(WindowPoint) == CRect::RELPOS_INSIDE &&
! eFloatingWindowHit != CRect::RELPOS_INSIDE && !m_bLastMouseMoveInside)
{
m_bLastMouseMoveInside = true;
--- 403,408 ----
// back to a normal cursor.
CView* pView = GetView();
! bool bHitFloating = pView && pView->GetFloatingWindow() && pView->GetFloatingWindow()->HitTest(pMouseMessage->Point);
! if (m_ClientRect.HitTest(WindowPoint) == CRect::RELPOS_INSIDE && !bHitFloating && !m_bLastMouseMoveInside)
{
m_bLastMouseMoveInside = true;
***************
*** 416,421 ****
CApplication::Instance()->SetMouseCursor(&IBeamHandle);
}
! else if ((m_ClientRect.HitTest(WindowPoint) != CRect::RELPOS_INSIDE ||
! eFloatingWindowHit == CRect::RELPOS_INSIDE) && m_bLastMouseMoveInside)
{
m_bLastMouseMoveInside= false;
--- 410,414 ----
CApplication::Instance()->SetMouseCursor(&IBeamHandle);
}
! else if ((m_ClientRect.HitTest(WindowPoint) != CRect::RELPOS_INSIDE || bHitFloating) && m_bLastMouseMoveInside)
{
m_bLastMouseMoveInside= false;
Index: wg_tooltip.cpp
===================================================================
RCS file: /cvsroot/wgui/wgui/src/wg_tooltip.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** wg_tooltip.cpp 19 Jul 2004 21:15:57 -0000 1.25
--- wg_tooltip.cpp 19 Jul 2004 21:49:58 -0000 1.26
***************
*** 147,159 ****
}
CView* pView = GetView();
! int eFloatingWindowHit = CRect::RELPOS_INVALID;
! if (pView && pView->GetFloatingWindow())
! {
! eFloatingWindowHit = pView->GetFloatingWindow()->GetWindowRect().SizeRect().HitTest(
! pView->GetFloatingWindow()->ViewToWindow(pMouseMessage->Point));
! }
if (m_pParentWindow->GetWindowRect().SizeRect().HitTest(
! m_pParentWindow->ViewToWindow(m_LastMousePosition)) == CRect::RELPOS_INSIDE
! && eFloatingWindowHit != CRect::RELPOS_INSIDE)
{
m_pTimer->StartTimer(1000);
--- 147,154 ----
}
CView* pView = GetView();
! bool bHitFloating = pView && pView->GetFloatingWindow() && pView->GetFloatingWindow()->HitTest(pMouseMessage->Point) &&
! pView->GetFloatingWindow() != m_pParentWindow;
if (m_pParentWindow->GetWindowRect().SizeRect().HitTest(
! m_pParentWindow->ViewToWindow(m_LastMousePosition)) == CRect::RELPOS_INSIDE && !bHitFloating)
{
m_pTimer->StartTimer(1000);
|