[Wgui-cvs] wgui/src wg_editbox.cpp,1.87,1.88 wg_menu.cpp,1.48,1.49 wg_scrollbar.cpp,1.35,1.36 wg_too
Status: Beta
Brought to you by:
greenwire
|
From: Rob W. <gre...@us...> - 2004-06-29 22:14:31
|
Update of /cvsroot/wgui/wgui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv538/src Modified Files: wg_editbox.cpp wg_menu.cpp wg_scrollbar.cpp wg_toolbar.cpp wg_tooltip.cpp wg_view.cpp Log Message: Draw architecture changes. Index: wg_view.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_view.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** wg_view.cpp 28 Jun 2004 23:03:35 -0000 1.37 --- wg_view.cpp 29 Jun 2004 22:14:20 -0000 1.38 *************** *** 80,85 **** if (m_pMenu) { ! m_pMenu->SetWindowRect(CRect(0, 0, m_WindowRect.Width() - 1, m_pMenu->GetWindowRect().Height())); ! m_ClientRect.SetTop(m_pMenu->GetWindowRect().Height() + 1); m_ClientRect.ClipTo(m_WindowRect); } --- 80,86 ---- if (m_pMenu) { ! int iMenuHeight = m_pMenu->GetWindowRect().Height(); ! m_pMenu->SetWindowRect(CRect(0, -iMenuHeight, m_WindowRect.Width() - 1, -1)); ! m_ClientRect.SetTop(iMenuHeight + 1); m_ClientRect.ClipTo(m_WindowRect); } Index: wg_toolbar.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_toolbar.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** wg_toolbar.cpp 25 Jun 2004 19:37:51 -0000 1.13 --- wg_toolbar.cpp 29 Jun 2004 22:14:20 -0000 1.14 *************** *** 106,110 **** void CToolBar::RepositionButtons(void) { ! int xPosition = m_WindowRect.Left() + 4; for (t_ButtonVector::iterator iter = m_vpButtons.begin(); iter != m_vpButtons.end(); ++iter) { --- 106,110 ---- void CToolBar::RepositionButtons(void) { ! int xPosition = 4; for (t_ButtonVector::iterator iter = m_vpButtons.begin(); iter != m_vpButtons.end(); ++iter) { *************** *** 114,122 **** int xStartPosition = xPosition; xPosition = xPosition + 2 + pButton->GetWindowRect().Width(); ! pButton->SetWindowRect(CRect(xStartPosition, m_WindowRect.Top() + 2, xPosition - 3, ! m_WindowRect.Top() + 1 + pButton->GetWindowRect().Height())); // Hide any buttons that extend beyond the end of the toolbar ! if (xPosition > m_WindowRect.Right()) { pButton->SetVisible(false); --- 114,121 ---- int xStartPosition = xPosition; xPosition = xPosition + 2 + pButton->GetWindowRect().Width(); ! pButton->SetWindowRect(CRect(xStartPosition, 2, xPosition - 3, pButton->GetWindowRect().Height() + 1)); // Hide any buttons that extend beyond the end of the toolbar ! if (xPosition > m_WindowRect.Width()) { pButton->SetVisible(false); Index: wg_scrollbar.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_scrollbar.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** wg_scrollbar.cpp 29 Jun 2004 18:03:40 -0000 1.35 --- wg_scrollbar.cpp 29 Jun 2004 22:14:20 -0000 1.36 *************** *** 45,64 **** { case VERTICAL: ! m_pBtnUpLeft = new CPictureButton(CRect(0, 0, WindowRect.Width() - 1, WindowRect.Width() - 1), this, CwgBitmapResourceHandle(WGRES_UP_ARROW_BITMAP)); m_pBtnDownRight = new CPictureButton( ! CRect(CPoint(0, WindowRect.Height() - WindowRect.Width()), WindowRect.SizeRect().BottomRight()), this, CwgBitmapResourceHandle(WGRES_DOWN_ARROW_BITMAP)); - m_ClientRect = CRect(0, m_pBtnUpLeft->GetWindowRect().Height() + 1, - m_WindowRect.Width() - 1, m_WindowRect.Height() - m_pBtnUpLeft->GetWindowRect().Height() - 1); break; case HORIZONTAL: ! m_pBtnUpLeft = new CPictureButton(CRect(0, 0, WindowRect.Height() - 1, WindowRect.Height() - 1), this, CwgBitmapResourceHandle(WGRES_LEFT_ARROW_BITMAP)); m_pBtnDownRight = new CPictureButton( ! CRect(CPoint(WindowRect.Width() - WindowRect.Height(), 0), WindowRect.SizeRect().BottomRight()), this, CwgBitmapResourceHandle(WGRES_RIGHT_ARROW_BITMAP)); - m_ClientRect = CRect(m_pBtnUpLeft->GetWindowRect().Width() + 1, 0, - m_WindowRect.Width() - m_pBtnUpLeft->GetWindowRect().Width() - 1, m_WindowRect.Height() - 1); break; default: --- 45,64 ---- { case VERTICAL: ! m_ClientRect = CRect(0, m_WindowRect.Width() + 1, ! m_WindowRect.Width() - 1, m_WindowRect.Height() - m_WindowRect.Width() - 1); ! m_pBtnUpLeft = new CPictureButton(CRect(0, -m_WindowRect.Width(), m_WindowRect.Width() - 1, -1), this, CwgBitmapResourceHandle(WGRES_UP_ARROW_BITMAP)); m_pBtnDownRight = new CPictureButton( ! CRect(0, m_WindowRect.Height() + 1, m_WindowRect.Width(), m_WindowRect.Height() + m_WindowRect.Width()), this, CwgBitmapResourceHandle(WGRES_DOWN_ARROW_BITMAP)); break; case HORIZONTAL: ! m_ClientRect = CRect(m_WindowRect.Height() + 1, 0, ! m_WindowRect.Width() - m_WindowRect.Height() - 1, m_WindowRect.Height() - 1); ! m_pBtnUpLeft = new CPictureButton(CRect(-m_WindowRect.Height(), 0, -1, m_WindowRect.Height() - 1), this, CwgBitmapResourceHandle(WGRES_LEFT_ARROW_BITMAP)); m_pBtnDownRight = new CPictureButton( ! CRect(m_WindowRect.Width() + 1, 0, m_WindowRect.Width() + m_WindowRect.Height(), m_WindowRect.Height()), this, CwgBitmapResourceHandle(WGRES_RIGHT_ARROW_BITMAP)); break; default: *************** *** 118,124 **** case VERTICAL: { ! m_pBtnUpLeft->SetWindowRect(CRect(0, 0, m_WindowRect.Width() - 1, m_WindowRect.Width() - 1)); ! m_pBtnDownRight->SetWindowRect(CRect( ! CPoint(0, m_WindowRect.Height() - m_WindowRect.Width()), m_WindowRect.SizeRect().BottomRight())); m_ClientRect.SetTop(m_pBtnUpLeft->GetWindowRect().Height() + 1); m_ClientRect.SetBottom(m_WindowRect.Height() - m_pBtnUpLeft->GetWindowRect().Height() - 1); --- 118,124 ---- case VERTICAL: { ! m_pBtnUpLeft->SetWindowRect(CRect(0, -WindowRect.Width(), WindowRect.Width() - 1, -1)); ! m_pBtnDownRight->SetWindowRect( ! CRect(0, WindowRect.Height() + 1, WindowRect.Width(), WindowRect.Height() + WindowRect.Width())); m_ClientRect.SetTop(m_pBtnUpLeft->GetWindowRect().Height() + 1); m_ClientRect.SetBottom(m_WindowRect.Height() - m_pBtnUpLeft->GetWindowRect().Height() - 1); *************** *** 127,133 **** case HORIZONTAL: { ! m_pBtnUpLeft->SetWindowRect(CRect(0, 0, m_WindowRect.Height() - 1, m_WindowRect.Height() - 1)); ! m_pBtnDownRight->SetWindowRect(CRect( ! CPoint(m_WindowRect.Width() - m_WindowRect.Height(), 0), m_WindowRect.SizeRect().BottomRight())); m_ClientRect.SetLeft(m_pBtnUpLeft->GetWindowRect().Width() + 1); m_ClientRect.SetRight(m_WindowRect.Width() - m_pBtnUpLeft->GetWindowRect().Width() - 1); --- 127,133 ---- case HORIZONTAL: { ! m_pBtnUpLeft->SetWindowRect(CRect(-WindowRect.Height(), 0, -1, WindowRect.Height() - 1)); ! m_pBtnDownRight->SetWindowRect( ! CRect(WindowRect.Width() + 1, 0, WindowRect.Width() + WindowRect.Height(), WindowRect.Height())); m_ClientRect.SetLeft(m_pBtnUpLeft->GetWindowRect().Width() + 1); m_ClientRect.SetRight(m_WindowRect.Width() - m_pBtnUpLeft->GetWindowRect().Width() - 1); Index: wg_menu.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_menu.cpp,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** wg_menu.cpp 29 Jun 2004 18:03:40 -0000 1.48 --- wg_menu.cpp 29 Jun 2004 22:14:20 -0000 1.49 *************** *** 315,319 **** if (!m_bCachedRectsValid) { ! CRect SubRect(m_WindowRect); SubRect.Grow(-2); int iWidth = 5; --- 315,319 ---- if (!m_bCachedRectsValid) { ! CRect SubRect(m_WindowRect.SizeRect()); SubRect.Grow(-2); int iWidth = 5; *************** *** 635,639 **** if (!m_bCachedRectsValid) { ! CRect SubRect(m_WindowRect); SubRect.Grow(-2); int iHeight = 4; --- 635,639 ---- if (!m_bCachedRectsValid) { ! CRect SubRect(m_WindowRect.SizeRect()); SubRect.Grow(-2); int iHeight = 4; Index: wg_editbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_editbox.cpp,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** wg_editbox.cpp 29 Jun 2004 18:03:40 -0000 1.87 --- wg_editbox.cpp 29 Jun 2004 22:14:20 -0000 1.88 *************** *** 343,347 **** //Else if it's outside the control and the I Beam cursor is set, set it // back to a normal cursor. ! if (m_WindowRect.HitTest(pMouseMessage->Point) == CRect::RELPOS_INSIDE && !m_bLastMouseMoveInside) { m_bLastMouseMoveInside = true; --- 343,348 ---- //Else if it's outside the control and the I Beam cursor is set, set it // back to a normal cursor. ! if (m_WindowRect.SizeRect().HitTest(ViewToClient(pMouseMessage->Point)) == CRect::RELPOS_INSIDE ! && !m_bLastMouseMoveInside) { m_bLastMouseMoveInside = true; *************** *** 349,353 **** CApplication::Instance()->SetMouseCursor(&IBeamHandle); } ! else if (m_WindowRect.HitTest(pMouseMessage->Point) != CRect::RELPOS_INSIDE && m_bLastMouseMoveInside) { m_bLastMouseMoveInside= false; --- 350,355 ---- CApplication::Instance()->SetMouseCursor(&IBeamHandle); } ! else if (m_WindowRect.SizeRect().HitTest(ViewToClient(pMouseMessage->Point)) != CRect::RELPOS_INSIDE ! && m_bLastMouseMoveInside) { m_bLastMouseMoveInside= false; Index: wg_tooltip.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_tooltip.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** wg_tooltip.cpp 25 Jun 2004 13:34:15 -0000 1.19 --- wg_tooltip.cpp 29 Jun 2004 22:14:20 -0000 1.20 *************** *** 84,89 **** CPainter Painter(m_pSDLSurface); ! Painter.DrawRect(m_WindowRect, false); ! CRect SubRect(m_WindowRect); SubRect.Grow(-2); m_pRenderedString->Draw(m_pSDLSurface, SubRect, SubRect.TopLeft(), m_FontColor); --- 84,89 ---- CPainter Painter(m_pSDLSurface); ! Painter.DrawRect(m_WindowRect.SizeRect(), false); ! CRect SubRect(m_WindowRect.SizeRect()); SubRect.Grow(-2); m_pRenderedString->Draw(m_pSDLSurface, SubRect, SubRect.TopLeft(), m_FontColor); *************** *** 112,116 **** { // Timer has expired, so it's time to show the tooltip ! ShowTip(m_LastMousePosition + CPoint(-6, 18)); bHandled = true; } --- 112,116 ---- { // Timer has expired, so it's time to show the tooltip ! ShowTip(ViewToClient(m_LastMousePosition) + CPoint(-6, 18)); bHandled = true; } *************** *** 129,133 **** HideTip(); } ! if (m_pParentWindow->GetWindowRect().HitTest(m_LastMousePosition) == CRect::RELPOS_INSIDE) { m_pTimer->StartTimer(1000); --- 129,134 ---- HideTip(); } ! if (m_pParentWindow->GetWindowRect().SizeRect().HitTest( ! m_pParentWindow->ViewToClient(m_LastMousePosition)) == CRect::RELPOS_INSIDE) { m_pTimer->StartTimer(1000); |