[Wgui-cvs] wgui/src wg_dropdown.cpp,1.24,1.25 wg_editbox.cpp,1.89,1.90 wg_listbox.cpp,1.43,1.44 wg_m
Status: Beta
Brought to you by:
greenwire
|
From: Rob W. <gre...@us...> - 2004-07-15 18:26:42
|
Update of /cvsroot/wgui/wgui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25778/src Modified Files: wg_dropdown.cpp wg_editbox.cpp wg_listbox.cpp wg_menu.cpp wg_textbox.cpp wg_window.cpp Log Message: Draw architecture changes. Index: wg_menu.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_menu.cpp,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** wg_menu.cpp 8 Jul 2004 21:42:51 -0000 1.50 --- wg_menu.cpp 15 Jul 2004 18:26:15 -0000 1.51 *************** *** 432,436 **** m_bVisible = true; CView* pView = GetView(); ! if (!dynamic_cast<CPopupMenu*>(m_pParentWindow) && pView) { pView->SetFloatingWindow(this); --- 432,436 ---- m_bVisible = true; CView* pView = GetView(); ! if (pView && !dynamic_cast<CPopupMenu*>(m_pParentWindow)) { pView->SetFloatingWindow(this); Index: wg_editbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_editbox.cpp,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** wg_editbox.cpp 30 Jun 2004 22:31:01 -0000 1.89 --- wg_editbox.cpp 15 Jul 2004 18:26:14 -0000 1.90 *************** *** 29,32 **** --- 29,33 ---- #include "wg_timer.h" #include "wg_error.h" + #include "wg_view.h" #include "wutil_debug.h" #include "std_ex.h" *************** *** 345,349 **** //Else if it's outside the control and the I Beam cursor is set, set it // back to a normal cursor. ! if (m_ClientRect.HitTest(WindowPoint) == CRect::RELPOS_INSIDE && !m_bLastMouseMoveInside) { m_bLastMouseMoveInside = true; --- 346,358 ---- //Else if it's outside the control and the I Beam cursor is set, set it // 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; *************** *** 351,355 **** CApplication::Instance()->SetMouseCursor(&IBeamHandle); } ! else if (m_ClientRect.HitTest(WindowPoint) != CRect::RELPOS_INSIDE && m_bLastMouseMoveInside) { m_bLastMouseMoveInside= false; --- 360,365 ---- CApplication::Instance()->SetMouseCursor(&IBeamHandle); } ! else if ((m_ClientRect.HitTest(WindowPoint) != CRect::RELPOS_INSIDE || ! eFloatingWindowHit == CRect::RELPOS_INSIDE) && m_bLastMouseMoveInside) { m_bLastMouseMoveInside= false; Index: wg_dropdown.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_dropdown.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** wg_dropdown.cpp 7 Jul 2004 21:03:55 -0000 1.24 --- wg_dropdown.cpp 15 Jul 2004 18:26:14 -0000 1.25 *************** *** 45,49 **** } - // We create the listbox with the root window (probably a CView object) as it's parent, so that it gets the OnMouseButtonDown/Up properly m_pListBox = new CListBox(CRect(0, m_WindowRect.Height(), m_WindowRect.Width(), m_WindowRect.Height() + iItemHeight * 5 + 1), this, true, iItemHeight, pFontEngine); --- 45,48 ---- *************** *** 63,68 **** CDropDown::~CDropDown(void) { ! // The listbox is parented by the root window, so we need to delete it by hand ! // delete m_pListBox; } --- 62,73 ---- CDropDown::~CDropDown(void) { ! ! } ! ! ! void CDropDown::SetListboxHeight(int iItemCount) ! { ! m_pListBox->SetWindowRect( ! CRect(0, m_WindowRect.Height(), m_WindowRect.Width(), m_WindowRect.Height() + m_pListBox->GetItemHeight() * iItemCount + 1)); } *************** *** 181,186 **** pView->SetFloatingWindow(m_pListBox); } - // This makes sure the ListBox is at the top of the order so it gets first shot at the OnMouseButtonDown/Up - // m_pListBox->SetNewParent(m_pListBox->GetAncestor(PARENT)); m_pListBox->SetVisible(true); } --- 186,189 ---- Index: wg_window.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_window.cpp,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** wg_window.cpp 6 Jul 2004 16:32:25 -0000 1.49 --- wg_window.cpp 15 Jul 2004 18:26:15 -0000 1.50 *************** *** 162,166 **** } } ! CMessageServer::Instance().QueueMessage(new CMessage(CMessage::APP_PAINT, GetAncestor(PARENT), this)); } } --- 162,166 ---- } } ! CMessageServer::Instance().QueueMessage(new CMessage(CMessage::APP_PAINT, 0, this)); } } Index: wg_listbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_listbox.cpp,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** wg_listbox.cpp 7 Jul 2004 21:03:55 -0000 1.43 --- wg_listbox.cpp 15 Jul 2004 18:26:15 -0000 1.44 *************** *** 162,167 **** { CWindow::SetWindowRect(WindowRect); ! m_ClientRect = CRect(1, 1, m_WindowRect.Width() - 12, m_WindowRect.Height() - 1); ! m_pVScrollbar->SetWindowRect(CRect(m_ClientRect.Right() + 1, 0, m_ClientRect.Right() + 12, m_WindowRect.Height())); } --- 162,170 ---- { CWindow::SetWindowRect(WindowRect); ! m_ClientRect = CRect(2, 2, m_WindowRect.Width() - 16, m_WindowRect.Height() - 4); ! CRect ScrollbarRect(m_WindowRect.SizeRect()); ! ScrollbarRect.Grow(-1); ! m_pVScrollbar->SetWindowRect( ! CRect(ScrollbarRect.Right() - 12, ScrollbarRect.Top(), ScrollbarRect.Right(), ScrollbarRect.Bottom()) - CPoint(2, 2) /* client adjustment */); } *************** *** 219,226 **** bool bResult = false; if (! CWindow::OnMouseButtonUp(Point, Button) && m_bVisible && (Button == CMouseMessage::LEFT) && ! (m_ClientRect.HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { ! if (m_iFocusedItem == stdex::safe_static_cast<int>((Point.YPos() - m_ClientRect.Top()) / m_iItemHeight + m_pVScrollbar->GetValue())) { if (m_bSingleSelection) --- 222,230 ---- bool bResult = false; + CPoint WindowPoint(ViewToWindow(Point)); if (! CWindow::OnMouseButtonUp(Point, Button) && m_bVisible && (Button == CMouseMessage::LEFT) && ! (m_ClientRect.HitTest(WindowPoint) == CRect::RELPOS_INSIDE)) { ! if (m_iFocusedItem == stdex::safe_static_cast<int>((WindowPoint.YPos() - m_ClientRect.Top()) / m_iItemHeight + m_pVScrollbar->GetValue())) { if (m_bSingleSelection) Index: wg_textbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_textbox.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** wg_textbox.cpp 6 Jul 2004 05:30:38 -0000 1.23 --- wg_textbox.cpp 15 Jul 2004 18:26:15 -0000 1.24 *************** *** 27,30 **** --- 27,31 ---- #include "wg_message_server.h" #include "wg_application.h" + #include "wg_view.h" #include "wg_error.h" #include "wutil_debug.h" *************** *** 401,405 **** //Else if it's outside the control and the I Beam cursor is set, set it // back to a normal cursor. ! if (m_ClientRect.HitTest(WindowPoint) == CRect::RELPOS_INSIDE && !m_bLastMouseMoveInside) { m_bLastMouseMoveInside = true; --- 402,414 ---- //Else if it's outside the control and the I Beam cursor is set, set it // 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; *************** *** 407,411 **** CApplication::Instance()->SetMouseCursor(&IBeamHandle); } ! else if (m_ClientRect.HitTest(WindowPoint) != CRect::RELPOS_INSIDE && m_bLastMouseMoveInside) { m_bLastMouseMoveInside= false; --- 416,421 ---- CApplication::Instance()->SetMouseCursor(&IBeamHandle); } ! else if ((m_ClientRect.HitTest(WindowPoint) != CRect::RELPOS_INSIDE || ! eFloatingWindowHit == CRect::RELPOS_INSIDE) && m_bLastMouseMoveInside) { m_bLastMouseMoveInside= false; |