wgui-cvs Mailing List for wGui (Page 6)
Status: Beta
Brought to you by:
greenwire
You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
(47) |
May
(7) |
Jun
(29) |
Jul
(41) |
Aug
(5) |
Sep
(4) |
Oct
|
Nov
(5) |
Dec
(15) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(14) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(16) |
Oct
(1) |
Nov
|
Dec
(5) |
| 2006 |
Jan
(5) |
Feb
(10) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
|
From: Rob W. <gre...@us...> - 2004-06-30 22:31:13
|
Update of /cvsroot/wgui/wgui/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8424/includes Modified Files: wg_window.h Log Message: Draw architecture changes. Index: wg_window.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_window.h,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** wg_window.h 29 Jun 2004 18:03:40 -0000 1.39 --- wg_window.h 30 Jun 2004 22:31:01 -0000 1.40 *************** *** 130,141 **** virtual CPoint ClientToView(const CPoint& Point) const; ! //! Translate the given CRect from view coordinates, to the window's coordinates //! \param Rect A CRect in view coordinates virtual CRect ViewToClient(const CRect& Rect) const; ! //! Translate the given CPoint from view coordinates, to the window's coordinates //! \param Point A CPoint in view coordinates virtual CPoint ViewToClient(const CPoint& Point) const; //! Set the WindowText of the control //! \param sText The text to assign to the window --- 130,149 ---- virtual CPoint ClientToView(const CPoint& Point) const; ! //! Translate the given CRect from view coordinates, to the window's client coordinates //! \param Rect A CRect in view coordinates virtual CRect ViewToClient(const CRect& Rect) const; ! //! Translate the given CPoint from view coordinates, to the window's client coordinates //! \param Point A CPoint in view coordinates virtual CPoint ViewToClient(const CPoint& Point) const; + //! Translate the given CRect from view coordinates, to the window's coordinates + //! \param Rect A CRect in view coordinates + virtual CRect ViewToWindow(const CRect& Rect) const; + + //! Translate the given CPoint from view coordinates, to the window's coordinates + //! \param Point A CPoint in view coordinates + virtual CPoint ViewToWindow(const CPoint& Point) const; + //! Set the WindowText of the control //! \param sText The text to assign to the window |
|
From: Rob W. <gre...@us...> - 2004-06-30 22:31:12
|
Update of /cvsroot/wgui/wgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8424 Modified Files: CHANGES Log Message: Draw architecture changes. Index: CHANGES =================================================================== RCS file: /cvsroot/wgui/wgui/CHANGES,v retrieving revision 1.144 retrieving revision 1.145 diff -C2 -d -r1.144 -r1.145 *** CHANGES 29 Jun 2004 18:03:30 -0000 1.144 --- CHANGES 30 Jun 2004 22:30:52 -0000 1.145 *************** *** 3,6 **** --- 3,7 ---- + Added CWindow: PaintToSurface() which blits the window's sirface to the surface it is passed. + Added CWindow: ViewToClient() which does the opposite of ClientToView() + + Added CWindow: ViewToWindow() which converts view coordinates to window coordinates + Changed CWindow: CWindows now have their own SDL surfaces for drawing, which is then blitted to the final surface on a screen update + Changed CWindow: GetClientRect() now returns the client rect in the window's coordinates, not in the screen coordinates |
|
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); |
Update of /cvsroot/wgui/wgui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11393/src Modified Files: wg_button.cpp wg_checkbox.cpp wg_editbox.cpp wg_frame.cpp wg_listbox.cpp wg_menu.cpp wg_scrollbar.cpp wg_window.cpp Log Message: Draw architecture changes. Index: wg_button.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_button.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** wg_button.cpp 28 Jun 2004 23:03:35 -0000 1.34 --- wg_button.cpp 29 Jun 2004 18:03:40 -0000 1.35 *************** *** 121,128 **** bool bResult = false; ! // wUtil::Trace(std::string("[Button - ") + m_sWindowText + "] Mouse Click at: " + stdex::itoa(ViewToWindow(Point).XPos()) + ", " + stdex::itoa(ViewToWindow(Point).YPos())); if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (m_eButtonState == UP) && ! (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { SetButtonState(DOWN); --- 121,128 ---- bool bResult = false; ! // wUtil::Trace(std::string("[Button - ") + m_sWindowText + "] Mouse Click at: " + stdex::itoa(ViewToClient(Point).XPos()) + ", " + stdex::itoa(ViewToClient(Point).YPos())); if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (m_eButtonState == UP) && ! (m_WindowRect.SizeRect().HitTest(ViewToClient(Point)) == CRect::RELPOS_INSIDE)) { SetButtonState(DOWN); *************** *** 140,144 **** if (! CWindow::OnMouseButtonUp(Point, Button) && m_bVisible && (m_eButtonState == DOWN) && ! (m_MouseButton == Button) && (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { SetButtonState(UP); --- 140,144 ---- if (! CWindow::OnMouseButtonUp(Point, Button) && m_bVisible && (m_eButtonState == DOWN) && ! (m_MouseButton == Button) && (m_WindowRect.SizeRect().HitTest(ViewToClient(Point)) == CRect::RELPOS_INSIDE)) { SetButtonState(UP); Index: wg_scrollbar.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_scrollbar.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** wg_scrollbar.cpp 25 Jun 2004 19:37:51 -0000 1.34 --- wg_scrollbar.cpp 29 Jun 2004 18:03:40 -0000 1.35 *************** *** 153,157 **** if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && ! m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE) { if (Button == CMouseMessage::WHEELUP) --- 153,157 ---- if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && ! m_WindowRect.SizeRect().HitTest(ViewToClient(Point)) == CRect::RELPOS_INSIDE) { if (Button == CMouseMessage::WHEELUP) Index: wg_menu.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_menu.cpp,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** wg_menu.cpp 25 Jun 2004 19:37:51 -0000 1.47 --- wg_menu.cpp 29 Jun 2004 18:03:40 -0000 1.48 *************** *** 258,262 **** if (! CMenuBase::OnMouseButtonDown(Point, Button) && m_bVisible && (Button == CMouseMessage::LEFT) && ! (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { UpdateCachedRects(); --- 258,262 ---- if (! CMenuBase::OnMouseButtonDown(Point, Button) && m_bVisible && (Button == CMouseMessage::LEFT) && ! (m_WindowRect.SizeRect().HitTest(ViewToClient(Point)) == CRect::RELPOS_INSIDE)) { UpdateCachedRects(); *************** *** 478,482 **** bool CPopupMenu::IsInsideChild(const CPoint& Point) const { ! if (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE) { return true; --- 478,482 ---- bool CPopupMenu::IsInsideChild(const CPoint& Point) const { ! if (m_WindowRect.SizeRect().HitTest(ViewToClient(Point)) == CRect::RELPOS_INSIDE) { return true; *************** *** 541,545 **** if (! CMenuBase::OnMouseButtonDown(Point, Button) && m_bVisible && ! (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { UpdateCachedRects(); --- 541,545 ---- if (! CMenuBase::OnMouseButtonDown(Point, Button) && m_bVisible && ! (m_WindowRect.SizeRect().HitTest(ViewToClient(Point)) == CRect::RELPOS_INSIDE)) { UpdateCachedRects(); Index: wg_editbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_editbox.cpp,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** wg_editbox.cpp 25 Jun 2004 19:37:51 -0000 1.86 --- wg_editbox.cpp 29 Jun 2004 18:03:40 -0000 1.87 *************** *** 259,263 **** if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (Button == CMouseMessage::LEFT) && !m_bReadOnly && ! (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { bool fSkipCursorPositioning = false; --- 259,263 ---- if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (Button == CMouseMessage::LEFT) && !m_bReadOnly && ! (m_WindowRect.SizeRect().HitTest(ViewToClient(Point)) == CRect::RELPOS_INSIDE)) { bool fSkipCursorPositioning = false; Index: wg_checkbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_checkbox.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** wg_checkbox.cpp 25 Jun 2004 19:37:51 -0000 1.20 --- wg_checkbox.cpp 29 Jun 2004 18:03:40 -0000 1.21 *************** *** 87,91 **** if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (m_eCheckBoxState != DISABLED) && ! (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { m_MouseButton = Button; --- 87,91 ---- if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (m_eCheckBoxState != DISABLED) && ! (m_WindowRect.SizeRect().HitTest(ViewToClient(Point)) == CRect::RELPOS_INSIDE)) { m_MouseButton = Button; *************** *** 102,106 **** if (! CWindow::OnMouseButtonUp(Point, Button) && m_bVisible && (m_eCheckBoxState != DISABLED) && (m_MouseButton == Button) && ! (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { CMessage::EMessageType MessageType = CMessage::UNKNOWN; --- 102,106 ---- if (! CWindow::OnMouseButtonUp(Point, Button) && m_bVisible && (m_eCheckBoxState != DISABLED) && (m_MouseButton == Button) && ! (m_WindowRect.SizeRect().HitTest(ViewToClient(Point)) == CRect::RELPOS_INSIDE)) { CMessage::EMessageType MessageType = CMessage::UNKNOWN; Index: wg_window.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_window.cpp,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** wg_window.cpp 25 Jun 2004 19:37:51 -0000 1.43 --- wg_window.cpp 29 Jun 2004 18:03:41 -0000 1.44 *************** *** 192,201 **** ! CRect CWindow::ViewToWindow(const CRect& Rect) const { ! CRect WindowRect(Rect - m_WindowRect.TopLeft()); if (m_pParentWindow) { ! WindowRect = m_pParentWindow->ViewToWindow(WindowRect); } return WindowRect; --- 192,201 ---- ! CRect CWindow::ViewToClient(const CRect& Rect) const { ! CRect WindowRect(Rect - m_WindowRect.TopLeft() - m_ClientRect.TopLeft()); if (m_pParentWindow) { ! WindowRect = m_pParentWindow->ViewToClient(WindowRect); } return WindowRect; *************** *** 203,212 **** ! CPoint CWindow::ViewToWindow(const CPoint& Point) const { ! CPoint WindowPoint(Point - m_WindowRect.TopLeft()); if (m_pParentWindow) { ! WindowPoint = m_pParentWindow->ViewToWindow(WindowPoint); } return WindowPoint; --- 203,212 ---- ! CPoint CWindow::ViewToClient(const CPoint& Point) const { ! CPoint WindowPoint(Point - m_WindowRect.TopLeft() - m_ClientRect.TopLeft()); if (m_pParentWindow) { ! WindowPoint = m_pParentWindow->ViewToClient(WindowPoint); } return WindowPoint; *************** *** 263,267 **** bool bResult = false; ! if (m_bVisible && (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { for (std::list<CWindow*>::reverse_iterator iter = m_ChildWindows.rbegin(); iter != m_ChildWindows.rend(); ++iter) --- 263,267 ---- bool bResult = false; ! if (m_bVisible && (m_WindowRect.SizeRect().HitTest(ViewToClient(Point)) == CRect::RELPOS_INSIDE)) { for (std::list<CWindow*>::reverse_iterator iter = m_ChildWindows.rbegin(); iter != m_ChildWindows.rend(); ++iter) *************** *** 283,287 **** bool bResult = false; ! if (m_bVisible && (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { for (std::list<CWindow*>::reverse_iterator iter = m_ChildWindows.rbegin(); iter != m_ChildWindows.rend(); ++iter) --- 283,287 ---- bool bResult = false; ! if (m_bVisible && (m_WindowRect.SizeRect().HitTest(ViewToClient(Point)) == CRect::RELPOS_INSIDE)) { for (std::list<CWindow*>::reverse_iterator iter = m_ChildWindows.rbegin(); iter != m_ChildWindows.rend(); ++iter) Index: wg_listbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_listbox.cpp,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** wg_listbox.cpp 25 Jun 2004 19:37:51 -0000 1.39 --- wg_listbox.cpp 29 Jun 2004 18:03:40 -0000 1.40 *************** *** 175,179 **** if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (Button == CMouseMessage::LEFT) && ! (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { if (CApplication::Instance()->GetKeyFocus() != this) --- 175,179 ---- if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (Button == CMouseMessage::LEFT) && ! (m_WindowRect.SizeRect().HitTest(ViewToClient(Point)) == CRect::RELPOS_INSIDE)) { if (CApplication::Instance()->GetKeyFocus() != this) Index: wg_frame.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_frame.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** wg_frame.cpp 25 Jun 2004 19:37:51 -0000 1.22 --- wg_frame.cpp 29 Jun 2004 18:03:40 -0000 1.23 *************** *** 142,146 **** if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && ! (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { if (m_TitleBarRect.HitTest(Point) == CRect::RELPOS_INSIDE) --- 142,146 ---- if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && ! (m_WindowRect.SizeRect().HitTest(ViewToClient(Point)) == CRect::RELPOS_INSIDE)) { if (m_TitleBarRect.HitTest(Point) == CRect::RELPOS_INSIDE) |
|
From: Rob W. <gre...@us...> - 2004-06-29 18:03:49
|
Update of /cvsroot/wgui/wgui/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11393/tests Modified Files: TestView1.cpp Log Message: Draw architecture changes. Index: TestView1.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/tests/TestView1.cpp,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** TestView1.cpp 25 Jun 2004 19:37:51 -0000 1.68 --- TestView1.cpp 29 Jun 2004 18:03:41 -0000 1.69 *************** *** 202,206 **** if (! CView::OnMouseButtonDown(Point, Button) && m_bVisible && (Button == wGui::CMouseMessage::RIGHT) && ! (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == wGui::CRect::RELPOS_INSIDE)) { m_pContextMenu->Show(Point); --- 202,206 ---- if (! CView::OnMouseButtonDown(Point, Button) && m_bVisible && (Button == wGui::CMouseMessage::RIGHT) && ! (m_WindowRect.SizeRect().HitTest(ViewToClient(Point)) == wGui::CRect::RELPOS_INSIDE)) { m_pContextMenu->Show(Point); |
|
From: Rob W. <gre...@us...> - 2004-06-29 18:03:48
|
Update of /cvsroot/wgui/wgui/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11393/includes Modified Files: wg_window.h Log Message: Draw architecture changes. Index: wg_window.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_window.h,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** wg_window.h 25 Jun 2004 19:37:50 -0000 1.38 --- wg_window.h 29 Jun 2004 18:03:40 -0000 1.39 *************** *** 132,140 **** //! Translate the given CRect from view coordinates, to the window's coordinates //! \param Rect A CRect in view coordinates ! virtual CRect ViewToWindow(const CRect& Rect) const; //! Translate the given CPoint from view coordinates, to the window's coordinates //! \param Point A CPoint in view coordinates ! virtual CPoint ViewToWindow(const CPoint& Point) const; //! Set the WindowText of the control --- 132,140 ---- //! Translate the given CRect from view coordinates, to the window's coordinates //! \param Rect A CRect in view coordinates ! virtual CRect ViewToClient(const CRect& Rect) const; //! Translate the given CPoint from view coordinates, to the window's coordinates //! \param Point A CPoint in view coordinates ! virtual CPoint ViewToClient(const CPoint& Point) const; //! Set the WindowText of the control |
|
From: Rob W. <gre...@us...> - 2004-06-29 18:03:48
|
Update of /cvsroot/wgui/wgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11393 Modified Files: CHANGES Log Message: Draw architecture changes. Index: CHANGES =================================================================== RCS file: /cvsroot/wgui/wgui/CHANGES,v retrieving revision 1.143 retrieving revision 1.144 diff -C2 -d -r1.143 -r1.144 *** CHANGES 25 Jun 2004 19:37:46 -0000 1.143 --- CHANGES 29 Jun 2004 18:03:30 -0000 1.144 *************** *** 1,5 **** 0.3.3 -> 0.4.0 - + Added CWindow: PaintToSurface() which blits the window's sirface to the surface it is passed. + Added CRect: SizeRect() which returns a CRect the same size as the Rect, but with a top left coordinate of (0, 0) + Changed CWindow: CWindows now have their own SDL surfaces for drawing, which is then blitted to the final surface on a screen update + Changed CWindow: GetClientRect() now returns the client rect in the window's coordinates, not in the screen coordinates --- 1,6 ---- 0.3.3 -> 0.4.0 + Added CRect: SizeRect() which returns a CRect the same size as the Rect, but with a top left coordinate of (0, 0) + + Added CWindow: PaintToSurface() which blits the window's sirface to the surface it is passed. + + Added CWindow: ViewToClient() which does the opposite of ClientToView() + Changed CWindow: CWindows now have their own SDL surfaces for drawing, which is then blitted to the final surface on a screen update + Changed CWindow: GetClientRect() now returns the client rect in the window's coordinates, not in the screen coordinates |
|
From: Rob W. <gre...@us...> - 2004-06-28 23:03:46
|
Update of /cvsroot/wgui/wgui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31161/src Modified Files: wg_button.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.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** wg_view.cpp 25 Jun 2004 19:37:51 -0000 1.36 --- wg_view.cpp 28 Jun 2004 23:03:35 -0000 1.37 *************** *** 24,27 **** --- 24,28 ---- #include "wgui_include_config.h" + #include "wutil_debug.h" #include "wg_view.h" #include "wg_error.h" *************** *** 176,179 **** --- 177,181 ---- if (!m_pFloatingWindow || !m_pFloatingWindow->OnMouseButtonDown(pMouseMessage->Point, pMouseMessage->Button)) { + // wUtil::Trace(std::string("Mouse Click at: ") + stdex::itoa(pMouseMessage->Point.XPos()) + ", " + stdex::itoa(pMouseMessage->Point.YPos())); OnMouseButtonDown(pMouseMessage->Point, pMouseMessage->Button); } Index: wg_button.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_button.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** wg_button.cpp 25 Jun 2004 19:37:51 -0000 1.33 --- wg_button.cpp 28 Jun 2004 23:03:35 -0000 1.34 *************** *** 24,27 **** --- 24,28 ---- #include "wgui_include_config.h" + #include "wutil_debug.h" #include "wg_button.h" #include "wg_application.h" *************** *** 120,126 **** bool bResult = false; if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (m_eButtonState == UP) && ! (m_MouseButton == Button) && (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { SetButtonState(DOWN); --- 121,128 ---- bool bResult = false; + // wUtil::Trace(std::string("[Button - ") + m_sWindowText + "] Mouse Click at: " + stdex::itoa(ViewToWindow(Point).XPos()) + ", " + stdex::itoa(ViewToWindow(Point).YPos())); if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (m_eButtonState == UP) && ! (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { SetButtonState(DOWN); |
|
From: Rob W. <gre...@us...> - 2004-06-25 19:38:04
|
Update of /cvsroot/wgui/wgui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8505/src Modified Files: wg_button.cpp wg_checkbox.cpp wg_dropdown.cpp wg_editbox.cpp wg_frame.cpp wg_groupbox.cpp wg_label.cpp wg_listbox.cpp wg_menu.cpp wg_picture.cpp wg_progress.cpp wg_scrollbar.cpp wg_textbox.cpp wg_toolbar.cpp wg_view.cpp wg_window.cpp Log Message: Draw architecture changes. Index: wg_view.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_view.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** wg_view.cpp 25 Jun 2004 13:34:15 -0000 1.35 --- wg_view.cpp 25 Jun 2004 19:37:51 -0000 1.36 *************** *** 59,62 **** --- 59,63 ---- SetWindowText( sTitle ); CApplication::Instance()->GetApplicationLog().AddLogEntry("Created new CView : " + sTitle, APP_LOG_INFO); + Draw(); } Index: wg_editbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_editbox.cpp,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** wg_editbox.cpp 25 Jun 2004 13:34:15 -0000 1.85 --- wg_editbox.cpp 25 Jun 2004 19:37:51 -0000 1.86 *************** *** 70,73 **** --- 70,74 ---- CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_GAININGKEYFOCUS); CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_LOSINGKEYFOCUS); + Draw(); } *************** *** 257,262 **** bool bResult = false; ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (m_WindowRect.HitTest(Point) == CRect::RELPOS_INSIDE) && ! (Button == CMouseMessage::LEFT) && !m_bReadOnly) { bool fSkipCursorPositioning = false; --- 258,263 ---- bool bResult = false; ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (Button == CMouseMessage::LEFT) && !m_bReadOnly && ! (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { bool fSkipCursorPositioning = false; Index: wg_checkbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_checkbox.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** wg_checkbox.cpp 25 Jun 2004 13:34:15 -0000 1.19 --- wg_checkbox.cpp 25 Jun 2004 19:37:51 -0000 1.20 *************** *** 39,42 **** --- 39,43 ---- CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_BUTTONUP); CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_LCLICK); + Draw(); } *************** *** 85,90 **** bool bResult = false; ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (m_WindowRect.HitTest(Point) == CRect::RELPOS_INSIDE) && ! (m_eCheckBoxState != DISABLED)) { m_MouseButton = Button; --- 86,91 ---- bool bResult = false; ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (m_eCheckBoxState != DISABLED) && ! (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { m_MouseButton = Button; *************** *** 100,105 **** bool bResult = false; ! if (! CWindow::OnMouseButtonUp(Point, Button) && m_bVisible && (m_WindowRect.HitTest(Point) == CRect::RELPOS_INSIDE) && ! (m_eCheckBoxState != DISABLED) && (m_MouseButton == Button)) { CMessage::EMessageType MessageType = CMessage::UNKNOWN; --- 101,106 ---- bool bResult = false; ! if (! CWindow::OnMouseButtonUp(Point, Button) && m_bVisible && (m_eCheckBoxState != DISABLED) && (m_MouseButton == Button) && ! (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { CMessage::EMessageType MessageType = CMessage::UNKNOWN; Index: wg_button.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_button.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** wg_button.cpp 25 Jun 2004 13:34:15 -0000 1.32 --- wg_button.cpp 25 Jun 2004 19:37:51 -0000 1.33 *************** *** 120,125 **** bool bResult = false; ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (m_WindowRect.HitTest(Point) == CRect::RELPOS_INSIDE) && ! (m_eButtonState != DISABLED)) { SetButtonState(DOWN); --- 120,126 ---- bool bResult = false; ! ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (m_eButtonState == UP) && ! (m_MouseButton == Button) && (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { SetButtonState(DOWN); *************** *** 136,141 **** bool bResult = false; ! if (! CWindow::OnMouseButtonUp(Point, Button) && m_bVisible && (m_WindowRect.HitTest(Point) == CRect::RELPOS_INSIDE) && ! (m_eButtonState == DOWN) && (m_MouseButton == Button)) { SetButtonState(UP); --- 137,142 ---- bool bResult = false; ! if (! CWindow::OnMouseButtonUp(Point, Button) && m_bVisible && (m_eButtonState == DOWN) && ! (m_MouseButton == Button) && (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { SetButtonState(UP); Index: wg_progress.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_progress.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** wg_progress.cpp 4 May 2004 16:11:13 -0000 1.13 --- wg_progress.cpp 25 Jun 2004 19:37:51 -0000 1.14 *************** *** 36,39 **** --- 36,40 ---- { m_BGColor = DEFAULT_FG_COLOR; + Draw(); } Index: wg_groupbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_groupbox.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** wg_groupbox.cpp 25 Jun 2004 13:34:15 -0000 1.14 --- wg_groupbox.cpp 25 Jun 2004 19:37:51 -0000 1.15 *************** *** 50,53 **** --- 50,54 ---- m_pRenderedString = pRenderedString; m_BGColor = CApplication::Instance()->GetDefaultBGColor(); + Draw(); } Index: wg_dropdown.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_dropdown.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** wg_dropdown.cpp 25 Jun 2004 13:34:15 -0000 1.20 --- wg_dropdown.cpp 25 Jun 2004 19:37:51 -0000 1.21 *************** *** 58,61 **** --- 58,62 ---- CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_LCLICK); CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_VALUECHANGE); + Draw(); } Index: wg_scrollbar.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_scrollbar.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** wg_scrollbar.cpp 25 Jun 2004 13:34:15 -0000 1.33 --- wg_scrollbar.cpp 25 Jun 2004 19:37:51 -0000 1.34 *************** *** 45,53 **** { case VERTICAL: ! m_pBtnUpLeft = new CPictureButton( ! CRect(WindowRect.TopLeft(), CPoint(WindowRect.Right(), WindowRect.Top() + WindowRect.Width())), this, CwgBitmapResourceHandle(WGRES_UP_ARROW_BITMAP)); m_pBtnDownRight = new CPictureButton( ! CRect(CPoint(WindowRect.Left(), WindowRect.Bottom() - WindowRect.Width()), WindowRect.BottomRight()), this, CwgBitmapResourceHandle(WGRES_DOWN_ARROW_BITMAP)); m_ClientRect = CRect(0, m_pBtnUpLeft->GetWindowRect().Height() + 1, --- 45,52 ---- { 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, *************** *** 55,63 **** break; case HORIZONTAL: ! m_pBtnUpLeft = new CPictureButton( ! CRect(WindowRect.TopLeft(), CPoint(WindowRect.Left() + WindowRect.Height(), WindowRect.Bottom())), this, CwgBitmapResourceHandle(WGRES_LEFT_ARROW_BITMAP)); m_pBtnDownRight = new CPictureButton( ! CRect(CPoint(WindowRect.Right() - WindowRect.Height(), WindowRect.Top()), WindowRect.BottomRight()), this, CwgBitmapResourceHandle(WGRES_RIGHT_ARROW_BITMAP)); m_ClientRect = CRect(m_pBtnUpLeft->GetWindowRect().Width() + 1, 0, --- 54,61 ---- 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, *************** *** 73,76 **** --- 71,75 ---- CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_MOVE); CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_LCLICK); + Draw(); } *************** *** 119,128 **** case VERTICAL: { ! m_ThumbRect.SetLeft(m_WindowRect.Left()); ! m_ThumbRect.SetRight(m_WindowRect.Right()); ! m_pBtnUpLeft->SetWindowRect(CRect(m_WindowRect.TopLeft(), ! CPoint(m_WindowRect.Right(), m_WindowRect.Top() + m_WindowRect.Width()))); m_pBtnDownRight->SetWindowRect(CRect( ! CPoint(m_WindowRect.Left(), m_WindowRect.Bottom() - m_WindowRect.Width()), m_WindowRect.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, 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); *************** *** 131,140 **** case HORIZONTAL: { ! m_ThumbRect.SetTop(m_WindowRect.Top()); ! m_ThumbRect.SetBottom(m_WindowRect.Bottom()); ! m_pBtnUpLeft->SetWindowRect(CRect(m_WindowRect.TopLeft(), ! CPoint(m_WindowRect.Left() + m_WindowRect.Height(), m_WindowRect.Bottom()))); m_pBtnDownRight->SetWindowRect(CRect( ! CPoint(m_WindowRect.Right() - m_WindowRect.Height(), m_WindowRect.Top()), m_WindowRect.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(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); *************** *** 159,163 **** bool bResult = false; ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && m_WindowRect.HitTest(Point) == CRect::RELPOS_INSIDE) { if (Button == CMouseMessage::WHEELUP) --- 152,157 ---- bool bResult = false; ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && ! m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE) { if (Button == CMouseMessage::WHEELUP) Index: wg_menu.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_menu.cpp,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** wg_menu.cpp 25 Jun 2004 13:34:15 -0000 1.46 --- wg_menu.cpp 25 Jun 2004 19:37:51 -0000 1.47 *************** *** 206,209 **** --- 206,210 ---- { CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_MOVE); + Draw(); } *************** *** 256,261 **** bool bResult = false; ! if (! CMenuBase::OnMouseButtonDown(Point, Button) && m_bVisible && (m_WindowRect.HitTest(Point) == CRect::RELPOS_INSIDE) && ! (Button == CMouseMessage::LEFT)) { UpdateCachedRects(); --- 257,262 ---- bool bResult = false; ! if (! CMenuBase::OnMouseButtonDown(Point, Button) && m_bVisible && (Button == CMouseMessage::LEFT) && ! (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { UpdateCachedRects(); *************** *** 374,377 **** --- 375,379 ---- m_bVisible = false; CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_BUTTONDOWN); + Draw(); } *************** *** 476,480 **** bool CPopupMenu::IsInsideChild(const CPoint& Point) const { ! if (m_WindowRect.HitTest(Point) == CRect::RELPOS_INSIDE) { return true; --- 478,482 ---- bool CPopupMenu::IsInsideChild(const CPoint& Point) const { ! if (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE) { return true; *************** *** 538,542 **** bool bResult = false; ! if (! CMenuBase::OnMouseButtonDown(Point, Button) && m_bVisible && (m_WindowRect.HitTest(Point) == CRect::RELPOS_INSIDE)) { UpdateCachedRects(); --- 540,545 ---- bool bResult = false; ! if (! CMenuBase::OnMouseButtonDown(Point, Button) && m_bVisible && ! (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { UpdateCachedRects(); Index: wg_window.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_window.cpp,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** wg_window.cpp 25 Jun 2004 13:34:15 -0000 1.42 --- wg_window.cpp 25 Jun 2004 19:37:51 -0000 1.43 *************** *** 41,49 **** m_sWindowText(""), m_BGColor(DEFAULT_BG_COLOR), ! m_ClientRect(0, 0, WindowRect.Width() - 1, WindowRect.Height() - 1), m_pParentWindow(0), m_pSDLSurface(0), ! m_bVisible(true), ! m_bDrawCompleted(false) { if (!CApplication::Instance()) --- 41,48 ---- m_sWindowText(""), m_BGColor(DEFAULT_BG_COLOR), ! m_ClientRect(WindowRect.SizeRect()), m_pParentWindow(0), m_pSDLSurface(0), ! m_bVisible(true) { if (!CApplication::Instance()) *************** *** 97,101 **** CRect CWindow::GetClientRect(void) const { ! CRect ClientRect(m_ClientRect + m_WindowRect.TopLeft()); ClientRect.ClipTo(m_WindowRect); return ClientRect; --- 96,100 ---- CRect CWindow::GetClientRect(void) const { ! CRect ClientRect(m_ClientRect); ClientRect.ClipTo(m_WindowRect); return ClientRect; *************** *** 171,174 **** --- 170,217 ---- + CRect CWindow::ClientToView(const CRect& Rect) const + { + CRect ScreenRect(Rect + m_ClientRect.TopLeft() + m_WindowRect.TopLeft()); + if (m_pParentWindow) + { + ScreenRect = m_pParentWindow->ClientToView(ScreenRect); + } + return ScreenRect; + } + + + CPoint CWindow::ClientToView(const CPoint& Point) const + { + CPoint ScreenPoint(Point + m_ClientRect.TopLeft() + m_WindowRect.TopLeft()); + if (m_pParentWindow) + { + ScreenPoint = m_pParentWindow->ClientToView(ScreenPoint); + } + return ScreenPoint; + } + + + CRect CWindow::ViewToWindow(const CRect& Rect) const + { + CRect WindowRect(Rect - m_WindowRect.TopLeft()); + if (m_pParentWindow) + { + WindowRect = m_pParentWindow->ViewToWindow(WindowRect); + } + return WindowRect; + } + + + CPoint CWindow::ViewToWindow(const CPoint& Point) const + { + CPoint WindowPoint(Point - m_WindowRect.TopLeft()); + if (m_pParentWindow) + { + WindowPoint = m_pParentWindow->ViewToWindow(WindowPoint); + } + return WindowPoint; + } + + void CWindow::SetWindowText(const std::string& sText) { *************** *** 183,187 **** Painter.DrawRect(m_WindowRect.SizeRect(), true, m_BGColor, m_BGColor); CMessageServer::Instance().QueueMessage(new CMessage(CMessage::APP_PAINT, 0, this)); - m_bDrawCompleted = true; } --- 226,229 ---- *************** *** 189,196 **** void CWindow::PaintToSurface(SDL_Surface& Surface, const CPoint& Offset) const { - if (!m_bDrawCompleted) - { - Draw(); - } if (m_bVisible) { --- 231,234 ---- *************** *** 225,229 **** bool bResult = false; ! if (m_bVisible && (m_WindowRect.HitTest(Point) == CRect::RELPOS_INSIDE)) { for (std::list<CWindow*>::reverse_iterator iter = m_ChildWindows.rbegin(); iter != m_ChildWindows.rend(); ++iter) --- 263,267 ---- bool bResult = false; ! if (m_bVisible && (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { for (std::list<CWindow*>::reverse_iterator iter = m_ChildWindows.rbegin(); iter != m_ChildWindows.rend(); ++iter) *************** *** 245,249 **** bool bResult = false; ! if (m_bVisible && (m_WindowRect.HitTest(Point) == CRect::RELPOS_INSIDE)) { for (std::list<CWindow*>::reverse_iterator iter = m_ChildWindows.rbegin(); iter != m_ChildWindows.rend(); ++iter) --- 283,287 ---- bool bResult = false; ! if (m_bVisible && (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { for (std::list<CWindow*>::reverse_iterator iter = m_ChildWindows.rbegin(); iter != m_ChildWindows.rend(); ++iter) Index: wg_label.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_label.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** wg_label.cpp 25 Jun 2004 13:34:15 -0000 1.18 --- wg_label.cpp 25 Jun 2004 19:37:51 -0000 1.19 *************** *** 47,50 **** --- 47,51 ---- m_pRenderedString = pRenderedString; m_BGColor = CApplication::Instance()->GetDefaultBGColor(); + Draw(); } Index: wg_toolbar.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_toolbar.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** wg_toolbar.cpp 2 Apr 2004 17:26:16 -0000 1.12 --- wg_toolbar.cpp 25 Jun 2004 19:37:51 -0000 1.13 *************** *** 37,40 **** --- 37,41 ---- m_BGColor = COLOR_LIGHTGRAY; CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_LCLICK); + Draw(); } Index: wg_listbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_listbox.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** wg_listbox.cpp 25 Jun 2004 13:34:15 -0000 1.38 --- wg_listbox.cpp 25 Jun 2004 19:37:51 -0000 1.39 *************** *** 59,62 **** --- 59,63 ---- CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_VALUECHANGE); CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_VALUECHANGING); + Draw(); } *************** *** 173,178 **** bool bResult = false; ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (m_WindowRect.HitTest(Point) == CRect::RELPOS_INSIDE) && ! (Button == CMouseMessage::LEFT)) { if (CApplication::Instance()->GetKeyFocus() != this) --- 174,179 ---- bool bResult = false; ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (Button == CMouseMessage::LEFT) && ! (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { if (CApplication::Instance()->GetKeyFocus() != this) Index: wg_textbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_textbox.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** wg_textbox.cpp 25 Jun 2004 13:34:15 -0000 1.20 --- wg_textbox.cpp 25 Jun 2004 19:37:51 -0000 1.21 *************** *** 83,86 **** --- 83,87 ---- CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_GAININGKEYFOCUS); CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_LOSINGKEYFOCUS); + Draw(); } Index: wg_picture.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_picture.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** wg_picture.cpp 2 Apr 2004 17:26:16 -0000 1.12 --- wg_picture.cpp 25 Jun 2004 19:37:51 -0000 1.13 *************** *** 41,44 **** --- 41,45 ---- m_ClientRect.Grow(-1); } + Draw(); } *************** *** 55,58 **** --- 56,60 ---- m_ClientRect.Grow(-1); } + Draw(); } *************** *** 68,76 **** CWindow::Draw(); ! CRect PictureRect = GetClientRect(); ! SDL_Rect SourceRect = PictureRect.SDLRect(); ! SourceRect.x = 0; ! SourceRect.y = 0; ! SDL_Rect DestRect = PictureRect.SDLRect(); SDL_BlitSurface(m_hBitmap.Bitmap(), &SourceRect, m_pSDLSurface, &DestRect); --- 70,75 ---- CWindow::Draw(); ! SDL_Rect SourceRect = m_ClientRect.SizeRect().SDLRect(); ! SDL_Rect DestRect = m_ClientRect.SDLRect(); SDL_BlitSurface(m_hBitmap.Bitmap(), &SourceRect, m_pSDLSurface, &DestRect); *************** *** 78,82 **** if (m_bDrawBorder) { ! Painter.DrawRect(m_WindowRect, false, m_BorderColor); } } --- 77,81 ---- if (m_bDrawBorder) { ! Painter.DrawRect(m_WindowRect.SizeRect(), false, m_BorderColor); } } *************** *** 86,90 **** { CWindow::SetWindowRect(WindowRect); ! m_ClientRect = m_WindowRect; m_ClientRect.Grow(-1); } --- 85,89 ---- { CWindow::SetWindowRect(WindowRect); ! m_ClientRect = m_WindowRect.SizeRect(); m_ClientRect.Grow(-1); } Index: wg_frame.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_frame.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** wg_frame.cpp 14 Apr 2004 16:21:21 -0000 1.21 --- wg_frame.cpp 25 Jun 2004 19:37:51 -0000 1.22 *************** *** 141,145 **** bool bResult = false; ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (m_WindowRect.HitTest(Point) == CRect::RELPOS_INSIDE)) { if (m_TitleBarRect.HitTest(Point) == CRect::RELPOS_INSIDE) --- 141,146 ---- bool bResult = false; ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && ! (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == CRect::RELPOS_INSIDE)) { if (m_TitleBarRect.HitTest(Point) == CRect::RELPOS_INSIDE) |
|
From: Rob W. <gre...@us...> - 2004-06-25 19:38:03
|
Update of /cvsroot/wgui/wgui/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8505/tests Modified Files: ConfigEditor.cpp MessagingTest.cpp TestFrame2.cpp TestView1.cpp TestView1.h TestView2.cpp Log Message: Draw architecture changes. Index: ConfigEditor.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/tests/ConfigEditor.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ConfigEditor.cpp 2 Apr 2004 17:26:16 -0000 1.4 --- ConfigEditor.cpp 25 Jun 2004 19:37:51 -0000 1.5 *************** *** 114,119 **** { m_pConfigStore = new wUtil::CConfigStore(); ! ! new CLabel(ClientToScreen(CRect(5, 10, 80, 25)), this, "Config Level:"); m_pConfigLevel = new CDropDown(CRect(85, 10, 200, 30), this, 0, 15); m_pConfigLevel->AddItem(wGui::SListItem("Global", 0, wGui::COLOR_GREEN)); --- 114,119 ---- { m_pConfigStore = new wUtil::CConfigStore(); ! ! new CLabel(ClientToView(CRect(5, 10, 80, 25)), this, "Config Level:"); m_pConfigLevel = new CDropDown(CRect(85, 10, 200, 30), this, 0, 15); m_pConfigLevel->AddItem(wGui::SListItem("Global", 0, wGui::COLOR_GREEN)); *************** *** 121,142 **** m_pConfigLevel->AddItem(wGui::SListItem("Local")); ! new CLabel(ClientToScreen(CRect(5, 40, 80, 55)), this, "Font Path:"); ! m_pFontPath = new CEditBox(ClientToScreen(CRect(85, 40, 200, 60)), this); ! ! new CLabel(ClientToScreen(CRect(5, 70, 80, 85)), this, "Font Name:"); ! m_pFontName = new CEditBox(ClientToScreen(CRect(85, 70, 200, 90)), this); ! ! new CLabel(ClientToScreen(CRect(5, 100, 80, 115)), this, "Font Size:"); ! m_pFontSize = new CEditBox(ClientToScreen(CRect(85, 100, 200, 120)), this); ! m_pExitButton = new CButton(ClientToScreen(CRect(220, 10, 290, 30)), this, "Exit"); ! m_pLoadButton = new CButton(ClientToScreen(CRect(220, 35, 290, 55)), this, "Load"); ! m_pSaveButton = new CButton(ClientToScreen(CRect(220, 60, 290, 80)), this, "Save"); m_pStatusLabel = new CLabel(CRect(5, 325, 290, 345), this, "Status: Select a configuration level to edit."); ! CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_LCLICK); CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_VALUECHANGE); ! } --- 121,142 ---- m_pConfigLevel->AddItem(wGui::SListItem("Local")); ! new CLabel(ClientToView(CRect(5, 40, 80, 55)), this, "Font Path:"); ! m_pFontPath = new CEditBox(ClientToView(CRect(85, 40, 200, 60)), this); ! new CLabel(ClientToView(CRect(5, 70, 80, 85)), this, "Font Name:"); ! m_pFontName = new CEditBox(ClientToView(CRect(85, 70, 200, 90)), this); ! ! new CLabel(ClientToView(CRect(5, 100, 80, 115)), this, "Font Size:"); ! m_pFontSize = new CEditBox(ClientToView(CRect(85, 100, 200, 120)), this); ! ! m_pExitButton = new CButton(ClientToView(CRect(220, 10, 290, 30)), this, "Exit"); ! m_pLoadButton = new CButton(ClientToView(CRect(220, 35, 290, 55)), this, "Load"); ! m_pSaveButton = new CButton(ClientToView(CRect(220, 60, 290, 80)), this, "Save"); m_pStatusLabel = new CLabel(CRect(5, 325, 290, 345), this, "Status: Select a configuration level to edit."); ! CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_LCLICK); CMessageServer::Instance().RegisterMessageClient(this, CMessage::CTRL_VALUECHANGE); ! } *************** *** 200,204 **** m_pConfigStore->SetStringEntry("FONTPATH", m_pFontPath->GetWindowText()); m_pConfigStore->SetStringEntry("DEFAULTFONTSIZE", m_pFontSize->GetWindowText()); ! if ( m_pConfigLevel->GetWindowText() == "Global" ) { --- 200,204 ---- m_pConfigStore->SetStringEntry("FONTPATH", m_pFontPath->GetWindowText()); m_pConfigStore->SetStringEntry("DEFAULTFONTSIZE", m_pFontSize->GetWindowText()); ! if ( m_pConfigLevel->GetWindowText() == "Global" ) { *************** *** 213,217 **** m_pConfigStore->StoreToFile("wgui.conf"); } ! m_pStatusLabel->SetWindowText("Status: Configuration data saved succesfully!"); bHandled = true; --- 213,217 ---- m_pConfigStore->StoreToFile("wgui.conf"); } ! m_pStatusLabel->SetWindowText("Status: Configuration data saved succesfully!"); bHandled = true; *************** *** 252,256 **** m_pStatusLabel->SetWindowText("Status: Configuration data loaded succesfully!"); } ! else { m_pStatusLabel->SetWindowText("Status: Failed to load configuration data!"); --- 252,256 ---- m_pStatusLabel->SetWindowText("Status: Configuration data loaded succesfully!"); } ! else { m_pStatusLabel->SetWindowText("Status: Failed to load configuration data!"); Index: TestFrame2.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/tests/TestFrame2.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TestFrame2.cpp 25 Jun 2004 13:34:16 -0000 1.6 --- TestFrame2.cpp 25 Jun 2004 19:37:51 -0000 1.7 *************** *** 36,40 **** wGui::CFrame(wGui::CRect(0, 0, 140, 80) + Location, pParent, pFontEngine, "Simple Frame", false) { ! m_pButton = new wGui::CButton(ClientToScreen(wGui::CRect(20, 20, 150, 40)), this, "Test Button"); } --- 36,40 ---- wGui::CFrame(wGui::CRect(0, 0, 140, 80) + Location, pParent, pFontEngine, "Simple Frame", false) { ! m_pButton = new wGui::CButton(ClientToView(wGui::CRect(20, 20, 150, 40)), this, "Test Button"); } Index: MessagingTest.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/tests/MessagingTest.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MessagingTest.cpp 2 Apr 2004 17:26:16 -0000 1.4 --- MessagingTest.cpp 25 Jun 2004 19:37:51 -0000 1.5 *************** *** 103,112 **** SetWindowText(std::string("Messaging Test - wGui version ") + CwgStringResourceHandle(WGRES_VERSION_STRING).String()); ! m_pExitButton = new CButton(ClientToScreen(CRect(320, 20, 380, 40)), this, "Exit"); ! new CLabel(ClientToScreen(CRect(20, 20, 300, 40)), this, "Numbers should increment from left to right."); for (int iLeft = 20; iLeft < 340; iLeft += 60) { ! new CTestLabel(ClientToScreen(CRect(iLeft, 50, iLeft + 40, 70)), this); } --- 103,112 ---- SetWindowText(std::string("Messaging Test - wGui version ") + CwgStringResourceHandle(WGRES_VERSION_STRING).String()); ! m_pExitButton = new CButton(ClientToView(CRect(320, 20, 380, 40)), this, "Exit"); ! new CLabel(ClientToView(CRect(20, 20, 300, 40)), this, "Numbers should increment from left to right."); for (int iLeft = 20; iLeft < 340; iLeft += 60) { ! new CTestLabel(ClientToView(CRect(iLeft, 50, iLeft + 40, 70)), this); } Index: TestView2.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/tests/TestView2.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** TestView2.cpp 2 Apr 2004 17:26:16 -0000 1.8 --- TestView2.cpp 25 Jun 2004 19:37:51 -0000 1.9 *************** *** 31,36 **** SetWindowText(std::string("Test App 2 - wGui version ") + wGui::CwgStringResourceHandle(wGui::WGRES_VERSION_STRING).String()); ! m_pCreateFrameButton = new wGui::CButton(ClientToScreen(wGui::CRect(20, 20, 140, 40)), this, "Create Frame"); ! m_pExitButton = new wGui::CButton(ClientToScreen(wGui::CRect(20, 50, 140, 70)), this, "Exit"); wGui::CMessageServer::Instance().RegisterMessageClient(this, wGui::CMessage::CTRL_LCLICK); --- 31,36 ---- SetWindowText(std::string("Test App 2 - wGui version ") + wGui::CwgStringResourceHandle(wGui::WGRES_VERSION_STRING).String()); ! m_pCreateFrameButton = new wGui::CButton(ClientToView(wGui::CRect(20, 20, 140, 40)), this, "Create Frame"); ! m_pExitButton = new wGui::CButton(ClientToView(wGui::CRect(20, 50, 140, 70)), this, "Exit"); wGui::CMessageServer::Instance().RegisterMessageClient(this, wGui::CMessage::CTRL_LCLICK); Index: TestView1.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/tests/TestView1.cpp,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** TestView1.cpp 25 Jun 2004 13:34:16 -0000 1.67 --- TestView1.cpp 25 Jun 2004 19:37:51 -0000 1.68 *************** *** 37,40 **** --- 37,41 ---- { m_ClientRect.Grow(-1); + Draw(); } *************** *** 45,50 **** wGui::CPainter Painter(m_pSDLSurface); ! Painter.DrawRect(m_WindowRect, false, wGui::COLOR_WHITE); Painter.DrawRect(m_ClientRect, false, wGui::COLOR_RED); } --- 46,55 ---- wGui::CPainter Painter(m_pSDLSurface); ! Painter.DrawRect(m_WindowRect.SizeRect(), false, wGui::COLOR_WHITE); Painter.DrawRect(m_ClientRect, false, wGui::COLOR_RED); + Painter.DrawLine(wGui::CPoint(10, 70), wGui::CPoint(60, 70)); + Painter.DrawLine(wGui::CPoint(20, 30), wGui::CPoint(60, 50), wGui::COLOR_GREEN); + Painter.DrawLine(wGui::CPoint(60, 30), wGui::CPoint(70, 100), wGui::COLOR_RED); + Painter.DrawLine(wGui::CPoint(20, 30), wGui::CPoint(20, 100), wGui::COLOR_BLUE); } *************** *** 77,123 **** GetMenu()->InsertMenuItem(wGui::SMenuItem("Help", 0, pContextSubmenu)); ! m_pButton = new wGui::CButton(ClientToScreen(wGui::CRect(20, 40, 100, 60)), this, "Test Button"); ! m_pButton2 = new wGui::CButton(ClientToScreen(wGui::CRect(130, 40, 210, 60)), this, "Disabled"); m_pButton2->SetButtonState(wGui::CButton::DISABLED); ! m_pBtnPass = new wGui::CButton(ClientToScreen(wGui::CRect(330, 280, 400, 300)), this, "Show Pass"); ! m_pButtonCopyText = new wGui::CButton(ClientToScreen(wGui::CRect(30, 180, 160, 200)), this, "Copy Selected Text"); ! m_pProgressBar = new wGui::CProgress(ClientToScreen(wGui::CRect(20, 70, 210, 90)), this); m_pProgressBar->SetMaxLimit(50); ! m_pBtnQuit = new wGui::CButton(ClientToScreen(wGui::CRect(525, 10, 600, 30)), this, "Quit"); ! m_pBtnWaitCursor = new wGui::CButton(ClientToScreen(wGui::CRect(500, 50, 600, 70)), this, "Wait Cursor"); ! m_pBtnPointerCursor = new wGui::CButton(ClientToScreen(wGui::CRect(500, 80, 600, 100)), this, "Pointer Cursor"); ! m_pBtnDefaultCursor = new wGui::CButton(ClientToScreen(wGui::CRect(500, 110, 600, 130)), this, "Default Cursor"); ! new wGui::CLabel(ClientToScreen(wGui::CRect(20, 95, 90, 110)), this, "Test Label"); ! m_pEditBox = new wGui::CEditBox(ClientToScreen(wGui::CRect(20, 120, 200, 140)), this); m_pEditBox->SetWindowText("Edit This is a really long message to see what happens when there is a long message in an editbox."); ! m_pEditBox2 = new wGui::CEditBox(ClientToScreen(wGui::CRect(20, 150, 200, 170)), this); m_pEditBox2->SetWindowText("Edit2"); ! m_pEditBox3 = new wGui::CEditBox(ClientToScreen(wGui::CRect(20, 210, 200, 230)), this); m_pEditBox3->SetWindowText("ReadOnly Edit Box"); m_pEditBox3->SetReadOnly(true); ! m_pPassBox = new wGui::CEditBox(ClientToScreen(wGui::CRect(225, 280, 325, 300)), this); m_pPassBox->SetUsePasswordMask(true); ! m_pPassShow = new wGui::CEditBox(ClientToScreen(wGui::CRect(225, 305, 325, 325)), this); ! m_pTextBox = new wGui::CTextBox(ClientToScreen(wGui::CRect(225, 330, 470, 450)), this); m_pTextBox->SetWindowText("This is a multiline text box.\nThis should be the second line.\nThe third goes here.\nAnd this is a really long line that should extend beyond the right border.\nNow we follow with a bunch of newlines.\n\n\n\n\n\nThe End."); ! m_pGroupBox = new wGui::CGroupBox(ClientToScreen(wGui::CRect(225, 160, 470, 260)), this, "GroupBox"); ! m_pBigassEditBox = new wGui::CEditBox(ClientToScreen(wGui::CRect(240, 175, 460, 210)), m_pGroupBox, wGui::CApplication::Instance()->GetFontEngine("Vera.ttf", 25)); m_pBigassEditBox->SetWindowText("Big box to test stuff"); new wGui::CToolTip(m_pBigassEditBox, "This is a Big Ass Editbox"); ! m_pTimerButton = new wGui::CButton(ClientToScreen(wGui::CRect(20, 250, 120, 270)), this, "Timer Stopped"); ! m_pTimerLabel = new wGui::CLabel(ClientToScreen(wGui::CRect(140, 250, 210, 270)), this, "Count: 0"); ! m_pCheckBox = new wGui::CCheckBox(ClientToScreen(wGui::CRect(224, 124, 236, 136)), this); ! new wGui::CLabel(ClientToScreen(wGui::CRect(245, 120, 380, 140)), this, "Read-Only EditBox2"); ! m_pVScrollBar = new wGui::CScrollBar( ! wGui::CRect(m_ClientRect.Right() - 12, m_ClientRect.Top(), m_ClientRect.Right(), m_ClientRect.Bottom() - 12), this, wGui::CScrollBar::VERTICAL); ! m_pHScrollBar = new wGui::CScrollBar( ! wGui::CRect(m_ClientRect.Left(), m_ClientRect.Bottom() - 12, m_ClientRect.Right() - 12, m_ClientRect.Bottom()), this, wGui::CScrollBar::HORIZONTAL); ! m_pTestWindow = new CTestWindow(ClientToScreen(wGui::CRect(240, 10, 340, 110)), this); new wGui::CToolTip(m_pTestWindow, "A line drawing test"); try { ! m_pPicture = new wGui::CPicture(ClientToScreen(wGui::CRect(370, 10, 470, 110)), this, "testpic.bmp", true); new wGui::CToolTip(m_pPicture, "A bitmap loading test"); } --- 82,126 ---- GetMenu()->InsertMenuItem(wGui::SMenuItem("Help", 0, pContextSubmenu)); ! m_pButton = new wGui::CButton(wGui::CRect(20, 40, 100, 60), this, "Test Button"); ! m_pButton2 = new wGui::CButton(wGui::CRect(130, 40, 210, 60), this, "Disabled"); m_pButton2->SetButtonState(wGui::CButton::DISABLED); ! m_pBtnPass = new wGui::CButton(wGui::CRect(330, 280, 400, 300), this, "Show Pass"); ! m_pButtonCopyText = new wGui::CButton(wGui::CRect(30, 180, 160, 200), this, "Copy Selected Text"); ! m_pProgressBar = new wGui::CProgress(wGui::CRect(20, 70, 210, 90), this); m_pProgressBar->SetMaxLimit(50); ! m_pBtnQuit = new wGui::CButton(wGui::CRect(525, 10, 600, 30), this, "Quit"); ! m_pBtnWaitCursor = new wGui::CButton(wGui::CRect(500, 50, 600, 70), this, "Wait Cursor"); ! m_pBtnPointerCursor = new wGui::CButton(wGui::CRect(500, 80, 600, 100), this, "Pointer Cursor"); ! m_pBtnDefaultCursor = new wGui::CButton(wGui::CRect(500, 110, 600, 130), this, "Default Cursor"); ! new wGui::CLabel(wGui::CRect(20, 95, 90, 110), this, "Test Label"); ! m_pEditBox = new wGui::CEditBox(wGui::CRect(20, 120, 200, 140), this); m_pEditBox->SetWindowText("Edit This is a really long message to see what happens when there is a long message in an editbox."); ! m_pEditBox2 = new wGui::CEditBox(wGui::CRect(20, 150, 200, 170), this); m_pEditBox2->SetWindowText("Edit2"); ! m_pEditBox3 = new wGui::CEditBox(wGui::CRect(20, 210, 200, 230), this); m_pEditBox3->SetWindowText("ReadOnly Edit Box"); m_pEditBox3->SetReadOnly(true); ! m_pPassBox = new wGui::CEditBox(wGui::CRect(225, 280, 325, 300), this); m_pPassBox->SetUsePasswordMask(true); ! m_pPassShow = new wGui::CEditBox(wGui::CRect(225, 305, 325, 325), this); ! m_pTextBox = new wGui::CTextBox(wGui::CRect(225, 330, 470, 450), this); m_pTextBox->SetWindowText("This is a multiline text box.\nThis should be the second line.\nThe third goes here.\nAnd this is a really long line that should extend beyond the right border.\nNow we follow with a bunch of newlines.\n\n\n\n\n\nThe End."); ! m_pGroupBox = new wGui::CGroupBox(wGui::CRect(225, 160, 470, 260), this, "GroupBox"); ! m_pBigassEditBox = new wGui::CEditBox(wGui::CRect(15, 15, 220, 65), m_pGroupBox, wGui::CApplication::Instance()->GetFontEngine("Vera.ttf", 25)); m_pBigassEditBox->SetWindowText("Big box to test stuff"); new wGui::CToolTip(m_pBigassEditBox, "This is a Big Ass Editbox"); ! m_pTimerButton = new wGui::CButton(wGui::CRect(20, 250, 120, 270), this, "Timer Stopped"); ! m_pTimerLabel = new wGui::CLabel(wGui::CRect(140, 250, 210, 270), this, "Count: 0"); ! m_pCheckBox = new wGui::CCheckBox(wGui::CRect(224, 124, 236, 136), this); ! new wGui::CLabel(wGui::CRect(245, 120, 380, 140), this, "Read-Only EditBox2"); ! m_pVScrollBar = new wGui::CScrollBar(wGui::CRect(m_ClientRect.Width() - 12, 0, m_ClientRect.Width(), m_ClientRect.Height() - 12), this, wGui::CScrollBar::VERTICAL); ! m_pHScrollBar = new wGui::CScrollBar(wGui::CRect(0, m_ClientRect.Height() - 12, m_ClientRect.Width() - 12, m_ClientRect.Height()), this, wGui::CScrollBar::HORIZONTAL); ! m_pTestWindow = new CTestWindow(wGui::CRect(240, 10, 340, 110), this); new wGui::CToolTip(m_pTestWindow, "A line drawing test"); try { ! m_pPicture = new wGui::CPicture(wGui::CRect(370, 10, 470, 110), this, "testpic.bmp", true); new wGui::CToolTip(m_pPicture, "A bitmap loading test"); } *************** *** 128,132 **** } ! m_pToolBar = new wGui::CToolBar(ClientToScreen(wGui::CRect(0, 0, 170, 24)), this); wGui::CButton* pButton = new wGui::CPictureButton(wGui::CRect(0, 0, 20, 20), this, wGui::CwgBitmapResourceHandle(wGui::WGRES_UP_ARROW_BITMAP)); new wGui::CToolTip(pButton, "Clear Edit Box 1"); --- 131,135 ---- } ! m_pToolBar = new wGui::CToolBar(wGui::CRect(0, 0, 170, 24), this); wGui::CButton* pButton = new wGui::CPictureButton(wGui::CRect(0, 0, 20, 20), this, wGui::CwgBitmapResourceHandle(wGui::WGRES_UP_ARROW_BITMAP)); new wGui::CToolTip(pButton, "Clear Edit Box 1"); *************** *** 172,181 **** pContextSubmenu3->InsertMenuItem(wGui::SMenuItem("Empty submenu", 0, pContextSubmenu4)); ! m_pDropDown = new wGui::CDropDown(ClientToScreen(wGui::CRect(240, 230, 430, 248)), m_pGroupBox); m_pDropDown->AddItem(wGui::SListItem("Item1")); m_pDropDown->AddItem(wGui::SListItem("Item2", 0, wGui::COLOR_BLUE)); m_pDropDown->AddItem(wGui::SListItem("Item3", 0, wGui::COLOR_RED)); m_pDropDown->AddItem(wGui::SListItem("Item4")); ! m_pListBox = new wGui::CListBox(ClientToScreen(wGui::CRect(20, 290, 200, 360)), this); m_pListBox->AddItem(wGui::SListItem("Item1")); m_pListBox->AddItem(wGui::SListItem("Item2", 0, wGui::COLOR_BLUE)); --- 175,184 ---- pContextSubmenu3->InsertMenuItem(wGui::SMenuItem("Empty submenu", 0, pContextSubmenu4)); ! m_pDropDown = new wGui::CDropDown(wGui::CRect(15, 70, 205, 88), m_pGroupBox); m_pDropDown->AddItem(wGui::SListItem("Item1")); m_pDropDown->AddItem(wGui::SListItem("Item2", 0, wGui::COLOR_BLUE)); m_pDropDown->AddItem(wGui::SListItem("Item3", 0, wGui::COLOR_RED)); m_pDropDown->AddItem(wGui::SListItem("Item4")); ! m_pListBox = new wGui::CListBox(wGui::CRect(20, 290, 200, 360), this); m_pListBox->AddItem(wGui::SListItem("Item1")); m_pListBox->AddItem(wGui::SListItem("Item2", 0, wGui::COLOR_BLUE)); *************** *** 194,215 **** - void CTestView::Draw(void) const - { - CView::Draw(); - - wGui::CPainter Painter(m_pSDLSurface); - Painter.DrawLine(ClientToScreen(wGui::CPoint(250, 80)), ClientToScreen(wGui::CPoint(320, 80))); - Painter.DrawLine(ClientToScreen(wGui::CPoint(260, 40)), ClientToScreen(wGui::CPoint(320, 60)), wGui::COLOR_GREEN); - Painter.DrawLine(ClientToScreen(wGui::CPoint(320, 40)), ClientToScreen(wGui::CPoint(310, 110)), wGui::COLOR_RED); - Painter.DrawLine(ClientToScreen(wGui::CPoint(260, 40)), ClientToScreen(wGui::CPoint(260, 110)), wGui::COLOR_BLUE); - } - - bool CTestView::OnMouseButtonDown(wGui::CPoint Point, unsigned int Button) { bool bResult = false; ! if (! CView::OnMouseButtonDown(Point, Button) && m_bVisible && (m_WindowRect.HitTest(Point) == wGui::CRect::RELPOS_INSIDE) && ! (Button == wGui::CMouseMessage::RIGHT)) { m_pContextMenu->Show(Point); --- 197,206 ---- bool CTestView::OnMouseButtonDown(wGui::CPoint Point, unsigned int Button) { bool bResult = false; ! if (! CView::OnMouseButtonDown(Point, Button) && m_bVisible && (Button == wGui::CMouseMessage::RIGHT) && ! (m_WindowRect.SizeRect().HitTest(ViewToWindow(Point)) == wGui::CRect::RELPOS_INSIDE)) { m_pContextMenu->Show(Point); Index: TestView1.h =================================================================== RCS file: /cvsroot/wgui/wgui/tests/TestView1.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** TestView1.h 2 Apr 2004 17:26:16 -0000 1.24 --- TestView1.h 25 Jun 2004 19:37:51 -0000 1.25 *************** *** 43,47 **** public: CTestView(void); - virtual void Draw(void) const; virtual bool OnMouseButtonDown(wGui::CPoint Point, unsigned int Button); virtual bool HandleMessage(wGui::CMessage* pMessage); --- 43,46 ---- |
|
From: Rob W. <gre...@us...> - 2004-06-25 19:38:00
|
Update of /cvsroot/wgui/wgui/includes/unit_tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8505/includes/unit_tests Modified Files: wg_button_unittests.h wg_checkbox_unittests.h wg_window_unittests.h Log Message: Draw architecture changes. Index: wg_window_unittests.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/unit_tests/wg_window_unittests.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** wg_window_unittests.h 15 Apr 2004 16:45:00 -0000 1.8 --- wg_window_unittests.h 25 Jun 2004 19:37:50 -0000 1.9 *************** *** 89,94 **** pWindow1->SetVisible(false); ensure("CWindow SetVisible", !pWindow1->IsVisible()); ! ensure("CWindow ClientToScreen", pWindow1->ClientToScreen(wGui::CPoint(3, 4)) == wGui::CPoint(5, 9)); ! ensure("CWindow ClientToScreen", pWindow1->ClientToScreen(wGui::CRect(1, 1, 4, 4)) == wGui::CRect(3, 6, 6, 9)); ensure("CWindow GetWindowText", pWindow1->GetWindowText().empty()); pWindow1->SetWindowText("Foo"); --- 89,94 ---- pWindow1->SetVisible(false); ensure("CWindow SetVisible", !pWindow1->IsVisible()); ! ensure("CWindow ClientToView", pWindow1->ClientToView(wGui::CPoint(3, 4)) == wGui::CPoint(5, 9)); ! ensure("CWindow ClientToView", pWindow1->ClientToView(wGui::CRect(1, 1, 4, 4)) == wGui::CRect(3, 6, 6, 9)); ensure("CWindow GetWindowText", pWindow1->GetWindowText().empty()); pWindow1->SetWindowText("Foo"); Index: wg_checkbox_unittests.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/unit_tests/wg_checkbox_unittests.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** wg_checkbox_unittests.h 2 Apr 2004 17:26:15 -0000 1.2 --- wg_checkbox_unittests.h 25 Jun 2004 19:37:50 -0000 1.3 *************** *** 61,69 **** ensure("CCheckBox - OnMouseButtonDown (outside bounds)", !pCheckBox1->OnMouseButtonDown(wGui::CPoint(0, 0), wGui::CMouseMessage::LEFT)); ensure("CCheckBox - OnMouseButtonDown (in bounds)", pCheckBox1->OnMouseButtonDown( ! View.ClientToScreen(pCheckBox1->GetWindowRect().TopLeft()) + wGui::CPoint(1, 1), wGui::CMouseMessage::LEFT)); ensure_equals("CCheckBox - OnMouseButtonDown (CheckBox State)", pCheckBox1->GetCheckBoxState(), wGui::CCheckBox::UNCHECKED); ensure(! Client1.bNewMessage); ensure("CCheckBox - OnMouseButtonUp (in bounds)", pCheckBox1->OnMouseButtonUp( ! View.ClientToScreen(pCheckBox1->GetWindowRect().TopLeft()) + wGui::CPoint(1, 1), wGui::CMouseMessage::LEFT)); while (Server.MessageAvailable()) { --- 61,69 ---- ensure("CCheckBox - OnMouseButtonDown (outside bounds)", !pCheckBox1->OnMouseButtonDown(wGui::CPoint(0, 0), wGui::CMouseMessage::LEFT)); ensure("CCheckBox - OnMouseButtonDown (in bounds)", pCheckBox1->OnMouseButtonDown( ! View.ClientToView(pCheckBox1->GetWindowRect().TopLeft()) + wGui::CPoint(1, 1), wGui::CMouseMessage::LEFT)); ensure_equals("CCheckBox - OnMouseButtonDown (CheckBox State)", pCheckBox1->GetCheckBoxState(), wGui::CCheckBox::UNCHECKED); ensure(! Client1.bNewMessage); ensure("CCheckBox - OnMouseButtonUp (in bounds)", pCheckBox1->OnMouseButtonUp( ! View.ClientToView(pCheckBox1->GetWindowRect().TopLeft()) + wGui::CPoint(1, 1), wGui::CMouseMessage::LEFT)); while (Server.MessageAvailable()) { *************** *** 73,79 **** ensure("CCheckBox - OnMouseButtonUp (message)", Client1.bNewMessage && (Client1.eLastMessage == wGui::CMessage::CTRL_LCLICK)); ensure("CCheckBox - OnMouseButtonDown (middle CheckBox)", pCheckBox1->OnMouseButtonDown( ! View.ClientToScreen(pCheckBox1->GetWindowRect().TopLeft()) + wGui::CPoint(1, 1), wGui::CMouseMessage::MIDDLE)); ensure("CCheckBox - OnMouseButtonUp (middle CheckBox)", pCheckBox1->OnMouseButtonUp( ! View.ClientToScreen(pCheckBox1->GetWindowRect().TopLeft()) + wGui::CPoint(1, 1), wGui::CMouseMessage::MIDDLE)); while (Server.MessageAvailable()) { --- 73,79 ---- ensure("CCheckBox - OnMouseButtonUp (message)", Client1.bNewMessage && (Client1.eLastMessage == wGui::CMessage::CTRL_LCLICK)); ensure("CCheckBox - OnMouseButtonDown (middle CheckBox)", pCheckBox1->OnMouseButtonDown( ! View.ClientToView(pCheckBox1->GetWindowRect().TopLeft()) + wGui::CPoint(1, 1), wGui::CMouseMessage::MIDDLE)); ensure("CCheckBox - OnMouseButtonUp (middle CheckBox)", pCheckBox1->OnMouseButtonUp( ! View.ClientToView(pCheckBox1->GetWindowRect().TopLeft()) + wGui::CPoint(1, 1), wGui::CMouseMessage::MIDDLE)); while (Server.MessageAvailable()) { Index: wg_button_unittests.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/unit_tests/wg_button_unittests.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wg_button_unittests.h 2 Apr 2004 17:26:15 -0000 1.3 --- wg_button_unittests.h 25 Jun 2004 19:37:50 -0000 1.4 *************** *** 69,77 **** ensure("CButton - OnMouseButtonDown (outside bounds)", !pButton1->OnMouseButtonDown(wGui::CPoint(0, 0), wGui::CMouseMessage::LEFT)); ensure("CButton - OnMouseButtonDown (in bounds)", pButton1->OnMouseButtonDown( ! View.ClientToScreen(pButton1->GetWindowRect().TopLeft()) + wGui::CPoint(1, 1), wGui::CMouseMessage::LEFT)); ensure_equals("CButton - OnMouseButtonDown (Button State)", pButton1->GetButtonState(), wGui::CButton::DOWN); ensure(! Client1.bNewMessage); ensure("CButton - OnMouseButtonUp (in bounds)", pButton1->OnMouseButtonUp( ! View.ClientToScreen(pButton1->GetWindowRect().TopLeft()) + wGui::CPoint(1, 1), wGui::CMouseMessage::LEFT)); while (Server.MessageAvailable()) { --- 69,77 ---- ensure("CButton - OnMouseButtonDown (outside bounds)", !pButton1->OnMouseButtonDown(wGui::CPoint(0, 0), wGui::CMouseMessage::LEFT)); ensure("CButton - OnMouseButtonDown (in bounds)", pButton1->OnMouseButtonDown( ! View.ClientToView(pButton1->GetWindowRect().TopLeft()) + wGui::CPoint(1, 1), wGui::CMouseMessage::LEFT)); ensure_equals("CButton - OnMouseButtonDown (Button State)", pButton1->GetButtonState(), wGui::CButton::DOWN); ensure(! Client1.bNewMessage); ensure("CButton - OnMouseButtonUp (in bounds)", pButton1->OnMouseButtonUp( ! View.ClientToView(pButton1->GetWindowRect().TopLeft()) + wGui::CPoint(1, 1), wGui::CMouseMessage::LEFT)); while (Server.MessageAvailable()) { *************** *** 81,87 **** ensure("CButton - OnMouseButtonUp (message)", Client1.bNewMessage && (Client1.eLastMessage == wGui::CMessage::CTRL_LCLICK)); ensure("CButton - OnMouseButtonDown (middle button)", pButton1->OnMouseButtonDown( ! View.ClientToScreen(pButton1->GetWindowRect().TopLeft()) + wGui::CPoint(1, 1), wGui::CMouseMessage::MIDDLE)); ensure("CButton - OnMouseButtonUp (middle button)", pButton1->OnMouseButtonUp( ! View.ClientToScreen(pButton1->GetWindowRect().TopLeft()) + wGui::CPoint(1, 1), wGui::CMouseMessage::MIDDLE)); while (Server.MessageAvailable()) { --- 81,87 ---- ensure("CButton - OnMouseButtonUp (message)", Client1.bNewMessage && (Client1.eLastMessage == wGui::CMessage::CTRL_LCLICK)); ensure("CButton - OnMouseButtonDown (middle button)", pButton1->OnMouseButtonDown( ! View.ClientToView(pButton1->GetWindowRect().TopLeft()) + wGui::CPoint(1, 1), wGui::CMouseMessage::MIDDLE)); ensure("CButton - OnMouseButtonUp (middle button)", pButton1->OnMouseButtonUp( ! View.ClientToView(pButton1->GetWindowRect().TopLeft()) + wGui::CPoint(1, 1), wGui::CMouseMessage::MIDDLE)); while (Server.MessageAvailable()) { |
|
From: Rob W. <gre...@us...> - 2004-06-25 19:38:00
|
Update of /cvsroot/wgui/wgui/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8505/includes Modified Files: wg_window.h Log Message: Draw architecture changes. Index: wg_window.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_window.h,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** wg_window.h 25 Jun 2004 13:34:15 -0000 1.37 --- wg_window.h 25 Jun 2004 19:37:50 -0000 1.38 *************** *** 122,134 **** virtual SDL_Surface* GetSDLSurface(void) { return m_pSDLSurface; } ! //! Translate the given CRect into screen coordinates //! \param Rect A CRect in client coordinates ! // TODO: fix ! virtual CRect ClientToScreen(const CRect& Rect) const { return Rect + GetClientRect().TopLeft(); } ! //! Translate the given CPoint into screen coordinates //! \param Point A CPoint in client coordinates ! // TODO: fix ! virtual CPoint ClientToScreen(const CPoint& Point) const { return Point + GetClientRect().TopLeft(); } //! Set the WindowText of the control --- 122,140 ---- virtual SDL_Surface* GetSDLSurface(void) { return m_pSDLSurface; } ! //! Translate the given CRect into view coordinates //! \param Rect A CRect in client coordinates ! virtual CRect ClientToView(const CRect& Rect) const; ! //! Translate the given CPoint into view coordinates //! \param Point A CPoint in client coordinates ! virtual CPoint ClientToView(const CPoint& Point) const; ! ! //! Translate the given CRect from view coordinates, to the window's coordinates ! //! \param Rect A CRect in view coordinates ! virtual CRect ViewToWindow(const CRect& Rect) const; ! ! //! Translate the given CPoint from view coordinates, to the window's coordinates ! //! \param Point A CPoint in view coordinates ! virtual CPoint ViewToWindow(const CPoint& Point) const; //! Set the WindowText of the control *************** *** 210,216 **** bool m_bVisible; - //! Indicates if the control has been drawn yet or not - mutable bool m_bDrawCompleted; - private: void operator=(CWindow) { } //!< The assignment operator is not allowed for CWindow objects --- 216,219 ---- |
|
From: Rob W. <gre...@us...> - 2004-06-25 19:37:59
|
Update of /cvsroot/wgui/wgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8505 Modified Files: CHANGES Log Message: Draw architecture changes. Index: CHANGES =================================================================== RCS file: /cvsroot/wgui/wgui/CHANGES,v retrieving revision 1.142 retrieving revision 1.143 diff -C2 -d -r1.142 -r1.143 *** CHANGES 25 Jun 2004 13:34:15 -0000 1.142 --- CHANGES 25 Jun 2004 19:37:46 -0000 1.143 *************** *** 3,6 **** --- 3,8 ---- + Added CRect: SizeRect() which returns a CRect the same size as the Rect, but with a top left coordinate of (0, 0) + Changed CWindow: CWindows now have their own SDL surfaces for drawing, which is then blitted to the final surface on a screen update + + Changed CWindow: GetClientRect() now returns the client rect in the window's coordinates, not in the screen coordinates + + Changed CWindow: renamed ClientToScreen() to ClientToView() + Removed CWindow: DrawPostChild(), DrawChildren(), DrawBG(), DrawChildren, and StartDrawProc() has been removed |
|
From: Rob W. <gre...@us...> - 2004-06-25 13:34:29
|
Update of /cvsroot/wgui/wgui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21468/src Modified Files: wg_button.cpp wg_checkbox.cpp wg_dropdown.cpp wg_editbox.cpp wg_groupbox.cpp wg_label.cpp wg_listbox.cpp wg_menu.cpp wg_scrollbar.cpp wg_textbox.cpp wg_tooltip.cpp wg_view.cpp wg_window.cpp Log Message: Draw architecture changes. Index: wg_view.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_view.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** wg_view.cpp 23 Apr 2004 19:38:47 -0000 1.34 --- wg_view.cpp 25 Jun 2004 13:34:15 -0000 1.35 *************** *** 98,102 **** void CView::SetWindowRect(const CRect& WindowRect ) { ! m_WindowRect = WindowRect; m_ClientRect = CRect(0, 0, m_WindowRect.Width(), m_WindowRect.Height()); --- 98,102 ---- void CView::SetWindowRect(const CRect& WindowRect ) { ! CWindow::SetWindowRect(WindowRect); m_ClientRect = CRect(0, 0, m_WindowRect.Width(), m_WindowRect.Height()); *************** *** 112,120 **** } ! m_pSDLSurface = SDL_SetVideoMode(m_WindowRect.Width(), m_WindowRect.Height(), DEFAULT_BPP, iFlags); ! if (m_pSDLSurface == NULL) throw( Wg_Ex_SDL(std::string("Could not set video mode : ") + SDL_GetError()) ); - - CMessageServer::Instance().QueueMessage(new CMessage(CMessage::APP_PAINT, this, this)); } --- 112,118 ---- } ! m_pScreenSurface = SDL_SetVideoMode(m_WindowRect.Width(), m_WindowRect.Height(), DEFAULT_BPP, iFlags); ! if (m_pScreenSurface == NULL) throw( Wg_Ex_SDL(std::string("Could not set video mode : ") + SDL_GetError()) ); } *************** *** 141,147 **** if (pMessage->Destination() == this || pMessage->Destination() == 0) { ! StartDrawProc(); ! // if this is a broadcasted message, don't mark it as handled ! bHandled = (pMessage->Destination() == this); } break; --- 139,145 ---- if (pMessage->Destination() == this || pMessage->Destination() == 0) { ! PaintToSurface(*m_pScreenSurface, CPoint(0, 0)); ! SDL_UpdateRect(m_pScreenSurface, 0, 0, 0, 0); ! bHandled = true; } break; *************** *** 151,154 **** --- 149,153 ---- if (pResizeMessage && pResizeMessage->Source() == CApplication::Instance()) { + CWindow::SetWindowRect(CRect(m_WindowRect.TopLeft(), m_WindowRect.TopLeft() + pResizeMessage->Value())); Uint32 iFlags = SDL_SWSURFACE | SDL_ANYFORMAT; if(m_bResizable) *************** *** 157,171 **** } - m_WindowRect.SetBottom(m_WindowRect.Top() + pResizeMessage->Value().YPos()); - m_WindowRect.SetRight(m_WindowRect.Left() + pResizeMessage->Value().XPos()); m_ClientRect = CRect(m_ClientRect.Left(), m_ClientRect.Top(), m_WindowRect.Width(), m_WindowRect.Height()); m_ClientRect.ClipTo(m_WindowRect); ! m_pSDLSurface = SDL_SetVideoMode(m_WindowRect.Width(), m_WindowRect.Height(), DEFAULT_BPP, iFlags); ! if (m_pSDLSurface == NULL) throw( Wg_Ex_SDL(std::string("Could not set video mode : ") + SDL_GetError()) ); ! StartDrawProc(); } break; --- 156,168 ---- } m_ClientRect = CRect(m_ClientRect.Left(), m_ClientRect.Top(), m_WindowRect.Width(), m_WindowRect.Height()); m_ClientRect.ClipTo(m_WindowRect); ! m_pScreenSurface = SDL_SetVideoMode(m_WindowRect.Width(), m_WindowRect.Height(), DEFAULT_BPP, iFlags); ! if (m_pScreenSurface == NULL) throw( Wg_Ex_SDL(std::string("Could not set video mode : ") + SDL_GetError()) ); ! bHandled = true; } break; Index: wg_editbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_editbox.cpp,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** wg_editbox.cpp 14 Apr 2004 16:21:21 -0000 1.84 --- wg_editbox.cpp 25 Jun 2004 13:34:15 -0000 1.85 *************** *** 74,80 **** CEditBox::~CEditBox(void) // virtual ! { delete m_pCursorTimer; ! delete m_pDblClickTimer; } --- 74,80 ---- CEditBox::~CEditBox(void) // virtual ! { delete m_pCursorTimer; ! delete m_pDblClickTimer; } *************** *** 84,88 **** m_BGColor = bReadOnly ? COLOR_LIGHTGRAY : COLOR_WHITE; m_bReadOnly = bReadOnly; ! StartDrawProc(); } --- 84,88 ---- m_BGColor = bReadOnly ? COLOR_LIGHTGRAY : COLOR_WHITE; m_bReadOnly = bReadOnly; ! Draw(); } *************** *** 140,147 **** CPainter Painter(m_pSDLSurface); ! CRect SubRect(m_WindowRect); SubRect.Grow(-3); ! Painter.DrawRect(m_WindowRect, false, COLOR_BLACK); ! CPoint FontCenterPoint = m_WindowRect.Center(); if (m_bUseMask) --- 140,147 ---- CPainter Painter(m_pSDLSurface); ! CRect SubRect(m_WindowRect.SizeRect()); SubRect.Grow(-3); ! Painter.DrawRect(m_WindowRect.SizeRect(), false, COLOR_BLACK); ! CPoint FontCenterPoint = m_WindowRect.SizeRect().Center(); if (m_bUseMask) *************** *** 237,241 **** } ! m_pRenderedString->Draw(m_pSDLSurface, SubRect, CPoint(SubRect.Left() + m_ScrollOffset, SubRect.Bottom() - m_pRenderedString->GetMaxFontHeight() / 4), FontColor); } --- 237,241 ---- } ! m_pRenderedString->Draw(m_pSDLSurface, SubRect, CPoint(SubRect.Left() + m_ScrollOffset, SubRect.Bottom() - m_pRenderedString->GetMaxFontHeight() / 4), FontColor); } *************** *** 256,260 **** { bool bResult = false; ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (m_WindowRect.HitTest(Point) == CRect::RELPOS_INSIDE) && (Button == CMouseMessage::LEFT) && !m_bReadOnly) --- 256,260 ---- { bool bResult = false; ! if (! CWindow::OnMouseButtonDown(Point, Button) && m_bVisible && (m_WindowRect.HitTest(Point) == CRect::RELPOS_INSIDE) && (Button == CMouseMessage::LEFT) && !m_bReadOnly) *************** *** 286,290 **** CRect SubRect(m_WindowRect); SubRect.Grow(-3); ! int xDelta = abs(Point.XPos() - (CharRects[0].Left() + Offset.XPos() + SubRect.Left())); m_SelStart = 0; --- 286,290 ---- CRect SubRect(m_WindowRect); SubRect.Grow(-3); ! int xDelta = abs(Point.XPos() - (CharRects[0].Left() + Offset.XPos() + SubRect.Left())); m_SelStart = 0; *************** *** 297,305 **** } } ! m_DragStart = m_SelStart; m_SelLength = 0; m_bMouseDown = true; ! StartDrawProc(); bResult = true; } --- 297,305 ---- } } ! m_DragStart = m_SelStart; m_SelLength = 0; m_bMouseDown = true; ! Draw(); bResult = true; } *************** *** 325,329 **** m_SelStart = 0; m_SelLength = stdex::safe_static_cast<int>(m_sWindowText.length()); ! StartDrawProc(); bHandled = true; } --- 325,329 ---- m_SelStart = 0; m_SelLength = stdex::safe_static_cast<int>(m_sWindowText.length()); ! Draw(); bHandled = true; } *************** *** 382,386 **** } bHandled = true; ! StartDrawProc(); } } --- 382,386 ---- } bHandled = true; ! Draw(); } } *************** *** 394,398 **** { m_bDrawCursor = !m_bDrawCursor; ! StartDrawProc(); } bHandled = true; --- 394,398 ---- { m_bDrawCursor = !m_bDrawCursor; ! Draw(); } bHandled = true; *************** *** 404,408 **** m_pCursorTimer->StartTimer(750, true); m_bDrawCursor = true; ! StartDrawProc(); bHandled = true; } --- 404,408 ---- m_pCursorTimer->StartTimer(750, true); m_bDrawCursor = true; ! Draw(); bHandled = true; } *************** *** 412,416 **** { m_pCursorTimer->StopTimer(); ! StartDrawProc(); bHandled = true; } --- 412,416 ---- { m_pCursorTimer->StopTimer(); ! Draw(); bHandled = true; } *************** *** 617,621 **** m_pRenderedString = pRenderedString; m_bDrawCursor = true; ! StartDrawProc(); } break; --- 617,621 ---- m_pRenderedString = pRenderedString; m_bDrawCursor = true; ! Draw(); } break; Index: wg_checkbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_checkbox.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** wg_checkbox.cpp 2 Apr 2004 17:26:16 -0000 1.18 --- wg_checkbox.cpp 25 Jun 2004 13:34:15 -0000 1.19 *************** *** 53,57 **** { m_eCheckBoxState = eState; ! StartDrawProc(); } } --- 53,57 ---- { m_eCheckBoxState = eState; ! Draw(); } } *************** *** 62,69 **** CWindow::Draw(); ! CRect SubRect(m_WindowRect); SubRect.Grow(-1); CPainter Painter(m_pSDLSurface); ! Painter.DrawRect(m_WindowRect, false, COLOR_BLACK); if (m_eCheckBoxState != DISABLED) { --- 62,69 ---- CWindow::Draw(); ! CRect SubRect(m_WindowRect.SizeRect()); SubRect.Grow(-1); CPainter Painter(m_pSDLSurface); ! Painter.DrawRect(m_WindowRect.SizeRect(), false, COLOR_BLACK); if (m_eCheckBoxState != DISABLED) { Index: wg_tooltip.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_tooltip.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** wg_tooltip.cpp 2 Apr 2004 17:26:16 -0000 1.18 --- wg_tooltip.cpp 25 Jun 2004 13:34:15 -0000 1.19 *************** *** 68,72 **** SetWindowRect(m_BoundingRect + DrawPoint); SetVisible(true); ! StartDrawProc(); } --- 68,72 ---- SetWindowRect(m_BoundingRect + DrawPoint); SetVisible(true); ! Draw(); } Index: wg_groupbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_groupbox.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** wg_groupbox.cpp 2 Apr 2004 17:26:16 -0000 1.13 --- wg_groupbox.cpp 25 Jun 2004 13:34:15 -0000 1.14 *************** *** 64,74 **** CPainter Painter(m_pSDLSurface); ! Painter.DrawRect(CRect(m_WindowRect.Left(), m_WindowRect.Top() + 5, m_WindowRect.Right(), m_WindowRect.Bottom()), false, DEFAULT_LINE_COLOR); CPoint Dims, Offset; m_pRenderedString->GetMetrics(&Dims, &Offset, 0); ! Painter.DrawRect(CRect(m_WindowRect.TopLeft() + CPoint(6, 0), m_WindowRect.TopLeft() + CPoint(14, 0) + Dims), true, m_BGColor, m_BGColor); ! m_pRenderedString->Draw(m_pSDLSurface, m_WindowRect, m_WindowRect.TopLeft() + CPoint(10, 0), m_FontColor); } --- 64,74 ---- CPainter Painter(m_pSDLSurface); ! Painter.DrawRect(CRect(0, 5, m_WindowRect.Width(), m_WindowRect.Height()), false, DEFAULT_LINE_COLOR); CPoint Dims, Offset; m_pRenderedString->GetMetrics(&Dims, &Offset, 0); ! Painter.DrawRect(CRect(CPoint(6, 0), CPoint(14, 0) + Dims), true, m_BGColor, m_BGColor); ! m_pRenderedString->Draw(m_pSDLSurface, m_WindowRect.SizeRect(), CPoint(10, 0), m_FontColor); } Index: wg_label.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_label.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** wg_label.cpp 2 Apr 2004 17:26:16 -0000 1.17 --- wg_label.cpp 25 Jun 2004 13:34:15 -0000 1.18 *************** *** 60,64 **** CWindow::Draw(); ! m_pRenderedString->Draw(m_pSDLSurface, m_WindowRect, m_WindowRect.BottomLeft(), m_FontColor); } --- 60,64 ---- CWindow::Draw(); ! m_pRenderedString->Draw(m_pSDLSurface, m_WindowRect.SizeRect(), m_WindowRect.SizeRect().BottomLeft(), m_FontColor); } Index: wg_scrollbar.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_scrollbar.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** wg_scrollbar.cpp 27 Apr 2004 18:13:51 -0000 1.32 --- wg_scrollbar.cpp 25 Jun 2004 13:34:15 -0000 1.33 *************** *** 68,72 **** break; } ! m_ThumbRect = GetClientRect(); RepositionThumb(); CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_BUTTONUP); --- 68,72 ---- break; } ! m_ThumbRect = m_ClientRect; RepositionThumb(); CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_BUTTONUP); *************** *** 88,92 **** if (bRedraw) { ! StartDrawProc(); } } --- 88,92 ---- if (bRedraw) { ! Draw(); } } *************** *** 224,233 **** { case VERTICAL: ! m_Value = ConstrainValue((pMouseMessage->Point.YPos() - GetClientRect().Top()) * ! (m_MaxLimit - m_MinLimit) / GetClientRect().Height() + m_MinLimit); break; case HORIZONTAL: ! m_Value = ConstrainValue((pMouseMessage->Point.XPos() - GetClientRect().Left()) * ! (m_MaxLimit - m_MinLimit) / GetClientRect().Width() + m_MinLimit); break; default: --- 224,233 ---- { case VERTICAL: ! m_Value = ConstrainValue((pMouseMessage->Point.YPos() - m_ClientRect.Top()) * ! (m_MaxLimit - m_MinLimit) / m_ClientRect.Height() + m_MinLimit); break; case HORIZONTAL: ! m_Value = ConstrainValue((pMouseMessage->Point.XPos() - m_ClientRect.Left()) * ! (m_MaxLimit - m_MinLimit) / m_ClientRect.Width() + m_MinLimit); break; default: *************** *** 239,243 **** CMessageServer::Instance().QueueMessage(new TIntMessage(CMessage::CTRL_VALUECHANGING, m_pParentWindow, this, m_Value)); RepositionThumb(); ! StartDrawProc(); } } --- 239,243 ---- CMessageServer::Instance().QueueMessage(new TIntMessage(CMessage::CTRL_VALUECHANGING, m_pParentWindow, this, m_Value)); RepositionThumb(); ! Draw(); } } *************** *** 279,288 **** case VERTICAL: { ! int iThumbHeight = GetClientRect().Height() / (m_MaxLimit - m_MinLimit + 1); if (iThumbHeight < 10) { iThumbHeight = 10; } ! m_ThumbRect.SetTop(GetClientRect().Top() + (GetClientRect().Height() - iThumbHeight) * (m_Value - m_MinLimit) / (m_MaxLimit - m_MinLimit) - 1); m_ThumbRect.SetBottom(m_ThumbRect.Top() + iThumbHeight); break; --- 279,288 ---- case VERTICAL: { ! int iThumbHeight = m_ClientRect.Height() / (m_MaxLimit - m_MinLimit + 1); if (iThumbHeight < 10) { iThumbHeight = 10; } ! m_ThumbRect.SetTop(m_ClientRect.Top() + (m_ClientRect.Height() - iThumbHeight) * (m_Value - m_MinLimit) / (m_MaxLimit - m_MinLimit) - 1); m_ThumbRect.SetBottom(m_ThumbRect.Top() + iThumbHeight); break; *************** *** 290,299 **** case HORIZONTAL: { ! int iThumbWidth = GetClientRect().Width() / (m_MaxLimit - m_MinLimit + 1); if (iThumbWidth < 10) { iThumbWidth = 10; } ! m_ThumbRect.SetLeft(GetClientRect().Left() + (GetClientRect().Width() - iThumbWidth) * (m_Value - m_MinLimit) / (m_MaxLimit - m_MinLimit) - 1); m_ThumbRect.SetRight(m_ThumbRect.Left() + iThumbWidth); break; --- 290,299 ---- case HORIZONTAL: { ! int iThumbWidth = m_ClientRect.Width() / (m_MaxLimit - m_MinLimit + 1); if (iThumbWidth < 10) { iThumbWidth = 10; } ! m_ThumbRect.SetLeft(m_ClientRect.Left() + (m_ClientRect.Width() - iThumbWidth) * (m_Value - m_MinLimit) / (m_MaxLimit - m_MinLimit) - 1); m_ThumbRect.SetRight(m_ThumbRect.Left() + iThumbWidth); break; Index: wg_menu.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_menu.cpp,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** wg_menu.cpp 13 Apr 2004 15:28:56 -0000 1.45 --- wg_menu.cpp 25 Jun 2004 13:34:15 -0000 1.46 *************** *** 84,88 **** m_MenuItems.erase(m_MenuItems.begin() + iPosition); m_bCachedRectsValid = false; ! StartDrawProc(); } --- 84,88 ---- m_MenuItems.erase(m_MenuItems.begin() + iPosition); m_bCachedRectsValid = false; ! Draw(); } *************** *** 153,157 **** if (pOldHighlight != m_pHighlightedItem) { ! StartDrawProc(); } } --- 153,157 ---- if (pOldHighlight != m_pHighlightedItem) { ! Draw(); } } *************** *** 160,164 **** m_pPopupTimer->StopTimer(); m_pHighlightedItem = 0; ! StartDrawProc(); } break; --- 160,164 ---- m_pPopupTimer->StopTimer(); m_pHighlightedItem = 0; ! Draw(); } break; *************** *** 433,437 **** pView->SetFloatingWindow(this); } ! StartDrawProc(); } --- 433,437 ---- pView->SetFloatingWindow(this); } ! Draw(); } Index: wg_button.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_button.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** wg_button.cpp 2 Apr 2004 17:26:16 -0000 1.31 --- wg_button.cpp 25 Jun 2004 13:34:15 -0000 1.32 *************** *** 53,56 **** --- 53,57 ---- m_BGColor = CApplication::Instance()->GetDefaultFGColor(); CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_BUTTONUP); + Draw(); } *************** *** 67,71 **** { m_eButtonState = eState; ! StartDrawProc(); } } --- 68,72 ---- { m_eButtonState = eState; ! Draw(); } } *************** *** 76,84 **** CWindow::Draw(); ! CPoint FontCenterPoint = m_WindowRect.Center(); ! CRect SubRect(m_WindowRect); SubRect.Grow(-1); CPainter Painter(m_pSDLSurface); ! Painter.DrawRect(m_WindowRect, false, COLOR_BLACK); CRGBColor FontColor = DEFAULT_LINE_COLOR; switch (m_eButtonState) --- 77,85 ---- CWindow::Draw(); ! CPoint FontCenterPoint = m_WindowRect.SizeRect().Center(); ! CRect SubRect(m_WindowRect.SizeRect()); SubRect.Grow(-1); CPainter Painter(m_pSDLSurface); ! Painter.DrawRect(m_WindowRect.SizeRect(), false, COLOR_BLACK); CRGBColor FontColor = DEFAULT_LINE_COLOR; switch (m_eButtonState) *************** *** 220,224 **** std::auto_ptr<CBitmapResourceHandle> phBitmap(new CBitmapResourceHandle(hBitmap)); m_phBitmap = phBitmap; ! StartDrawProc(); } --- 221,225 ---- std::auto_ptr<CBitmapResourceHandle> phBitmap(new CBitmapResourceHandle(hBitmap)); m_phBitmap = phBitmap; ! Draw(); } Index: wg_dropdown.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_dropdown.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** wg_dropdown.cpp 13 Apr 2004 15:28:56 -0000 1.19 --- wg_dropdown.cpp 25 Jun 2004 13:34:15 -0000 1.20 *************** *** 165,169 **** m_pListBox->SetNewParent(m_pListBox->GetAncestor(PARENT)); m_pListBox->SetVisible(true); - m_pListBox->StartDrawProc(); } } --- 165,168 ---- *************** *** 180,184 **** pView->SetFloatingWindow(0); } - CMessageServer::Instance().QueueMessage(new CMessage(CMessage::APP_PAINT, 0, this)); } } --- 179,182 ---- Index: wg_window.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_window.cpp,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** wg_window.cpp 13 Apr 2004 15:28:56 -0000 1.41 --- wg_window.cpp 25 Jun 2004 13:34:15 -0000 1.42 *************** *** 40,52 **** CWindow::CWindow(const CRect& WindowRect, CWindow* pParent) : m_sWindowText(""), - m_WindowRect(WindowRect), m_BGColor(DEFAULT_BG_COLOR), m_ClientRect(0, 0, WindowRect.Width() - 1, WindowRect.Height() - 1), m_pParentWindow(0), m_pSDLSurface(0), ! m_bVisible(true) ! { ! ! if (!CApplication::Instance()) { --- 40,50 ---- CWindow::CWindow(const CRect& WindowRect, CWindow* pParent) : m_sWindowText(""), m_BGColor(DEFAULT_BG_COLOR), m_ClientRect(0, 0, WindowRect.Width() - 1, WindowRect.Height() - 1), m_pParentWindow(0), m_pSDLSurface(0), ! m_bVisible(true), ! m_bDrawCompleted(false) ! { if (!CApplication::Instance()) { *************** *** 54,60 **** } m_BGColor = CApplication::Instance()->GetDefaultBGColor(); SetNewParent(pParent); - CMessageServer::Instance().RegisterMessageClient(this, CMessage::APP_PAINT); } --- 52,58 ---- } + SetWindowRect(WindowRect); m_BGColor = CApplication::Instance()->GetDefaultBGColor(); SetNewParent(pParent); } *************** *** 65,68 **** --- 63,68 ---- CMessageServer::Instance().DeregisterMessageClient(this); + if (m_pSDLSurface) + SDL_FreeSurface(m_pSDLSurface); while (m_ChildWindows.size() > 0) { *************** *** 77,81 **** { m_WindowRect = WindowRect; ! CMessageServer::Instance().QueueMessage(new CMessage(CMessage::APP_PAINT, GetAncestor(PARENT), this)); } --- 77,84 ---- { m_WindowRect = WindowRect; ! if (m_pSDLSurface) ! SDL_FreeSurface(m_pSDLSurface); ! m_pSDLSurface = SDL_CreateRGBSurface(SDL_SWSURFACE, m_WindowRect.Width(), m_WindowRect.Height(), 32, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000); ! Draw(); // we need to redraw here because we've got a new empty buffer } *************** *** 88,92 **** (*iter)->MoveWindow(MoveDistance); } ! CMessageServer::Instance().QueueMessage(new CMessage(CMessage::APP_PAINT, GetAncestor(PARENT), this)); } --- 91,95 ---- (*iter)->MoveWindow(MoveDistance); } ! CMessageServer::Instance().QueueMessage(new CMessage(CMessage::APP_PAINT, 0, this)); } *************** *** 129,134 **** ! CView* CWindow::GetView(void) const // virtual ! { return dynamic_cast<CView*>(GetAncestor(ROOT)); } --- 132,137 ---- ! CView* CWindow::GetView(void) const // virtual ! { return dynamic_cast<CView*>(GetAncestor(ROOT)); } *************** *** 171,182 **** { m_sWindowText = sText; ! StartDrawProc(); ! } ! ! ! void CWindow::DrawBG(void) const ! { ! CPainter Painter(m_pSDLSurface); ! Painter.DrawRect(m_WindowRect, true, m_BGColor, m_BGColor); } --- 174,178 ---- { m_sWindowText = sText; ! Draw(); } *************** *** 184,218 **** void CWindow::Draw(void) const { ! } ! void CWindow::DrawChildren(void) const { ! for (std::list<CWindow*>::const_iterator iter = m_ChildWindows.begin(); iter != m_ChildWindows.end(); ++iter) { ! (*iter)->DrawProc(); } - } - - - void CWindow::DrawPostChild(void) const - { - - } - - - void CWindow::DrawProc(void) const - { if (m_bVisible) { ! DrawBG(); ! Draw(); ! DrawChildren(); ! DrawPostChild(); ! CView* pView = GetView(); ! if (pView && pView->GetFloatingWindow() && m_WindowRect.Overlaps(pView->GetFloatingWindow()->GetWindowRect())) { ! CMessageServer::Instance().QueueMessage(new CMessage(CMessage::APP_PAINT, pView->GetFloatingWindow(), this)); } } --- 180,205 ---- void CWindow::Draw(void) const { ! CPainter Painter(m_pSDLSurface); ! Painter.DrawRect(m_WindowRect.SizeRect(), true, m_BGColor, m_BGColor); ! CMessageServer::Instance().QueueMessage(new CMessage(CMessage::APP_PAINT, 0, this)); ! m_bDrawCompleted = true; } ! void CWindow::PaintToSurface(SDL_Surface& Surface, const CPoint& Offset) const { ! if (!m_bDrawCompleted) { ! Draw(); } if (m_bVisible) { ! SDL_Rect SourceRect = CRect(m_WindowRect.SizeRect()).SDLRect(); ! SDL_Rect DestRect = CRect(m_WindowRect + Offset).SDLRect(); ! SDL_BlitSurface(m_pSDLSurface, &SourceRect, &Surface, &DestRect); ! CPoint NewOffset = m_ClientRect.TopLeft() + m_WindowRect.TopLeft() + Offset; ! for (std::list<CWindow*>::const_iterator iter = m_ChildWindows.begin(); iter != m_ChildWindows.end(); ++iter) { ! (*iter)->PaintToSurface(Surface, NewOffset); } } *************** *** 220,233 **** - void CWindow::StartDrawProc(void) const - { - if (m_bVisible) - { - DrawProc(); - SDL_UpdateRect(m_pSDLSurface, m_WindowRect.Left(), m_WindowRect.Top(), m_WindowRect.Width(), m_WindowRect.Height()); - } - } - - void CWindow::SetNewParent(CWindow* pNewParent) { --- 207,210 ---- *************** *** 239,243 **** { pNewParent->RegisterChildWindow(this); - m_pSDLSurface = pNewParent->GetAncestor(ROOT)->m_pSDLSurface; } m_pParentWindow = pNewParent; --- 216,219 ---- *************** *** 297,320 **** ! bool CWindow::HandleMessage(CMessage* pMessage) { bool bHandled = false; - if (pMessage) - { - switch(pMessage->MessageType()) - { - case CMessage::APP_PAINT : - if (pMessage->Destination() == this) - { - StartDrawProc(); - bHandled = true; - } - break; - default : - break; - } - } - return bHandled; } --- 273,280 ---- ! bool CWindow::HandleMessage(CMessage* /*pMessage*/) { bool bHandled = false; return bHandled; } Index: wg_listbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_listbox.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** wg_listbox.cpp 27 Apr 2004 18:13:51 -0000 1.37 --- wg_listbox.cpp 25 Jun 2004 13:34:15 -0000 1.38 *************** *** 72,76 **** { m_iItemHeight = iItemHeight; ! StartDrawProc(); } --- 72,76 ---- { m_iItemHeight = iItemHeight; ! Draw(); } *************** *** 83,87 **** int iMax = (m_Items.size() - 1) < 0 ? 0 : stdex::safe_static_cast<int>(m_Items.size() - 1); m_pVScrollbar->SetMaxLimit(iMax); ! StartDrawProc(); return stdex::safe_static_cast<int>(m_Items.size()); } --- 83,87 ---- int iMax = (m_Items.size() - 1) < 0 ? 0 : stdex::safe_static_cast<int>(m_Items.size() - 1); m_pVScrollbar->SetMaxLimit(iMax); ! Draw(); return stdex::safe_static_cast<int>(m_Items.size()); } *************** *** 96,100 **** int iMax = (m_Items.size() - 1) < 0 ? 0 : stdex::safe_static_cast<int>(m_Items.size() - 1); m_pVScrollbar->SetMaxLimit(iMax); ! StartDrawProc(); } } --- 96,100 ---- int iMax = (m_Items.size() - 1) < 0 ? 0 : stdex::safe_static_cast<int>(m_Items.size() - 1); m_pVScrollbar->SetMaxLimit(iMax); ! Draw(); } } *************** *** 106,110 **** m_SelectedItems.clear(); m_pVScrollbar->SetMaxLimit(0); ! StartDrawProc(); } --- 106,110 ---- m_SelectedItems.clear(); m_pVScrollbar->SetMaxLimit(0); ! Draw(); } *************** *** 131,135 **** CPainter Painter(m_pSDLSurface); ! Painter.DrawRect(m_WindowRect, false, COLOR_BLACK); CRect ClientRect(GetClientRect()); int iStartIndex = m_pVScrollbar->GetValue(); --- 131,135 ---- CPainter Painter(m_pSDLSurface); ! Painter.DrawRect(m_WindowRect.SizeRect(), false, COLOR_BLACK); CRect ClientRect(GetClientRect()); int iStartIndex = m_pVScrollbar->GetValue(); *************** *** 186,190 **** // Prep the new selection m_iFocusedItem = (Point.YPos() - ClientRect.Top()) / m_iItemHeight + m_pVScrollbar->GetValue(); ! StartDrawProc(); } bResult = true; --- 186,190 ---- // Prep the new selection m_iFocusedItem = (Point.YPos() - ClientRect.Top()) / m_iItemHeight + m_pVScrollbar->GetValue(); ! Draw(); } bResult = true; *************** *** 216,220 **** } CMessageServer::Instance().QueueMessage(new TIntMessage(CMessage::CTRL_VALUECHANGE, pDestination, this, m_iFocusedItem)); ! StartDrawProc(); } bResult = true; --- 216,220 ---- } CMessageServer::Instance().QueueMessage(new TIntMessage(CMessage::CTRL_VALUECHANGE, pDestination, this, m_iFocusedItem)); ! Draw(); } bResult = true; *************** *** 252,256 **** } ! StartDrawProc(); bHandled = true; } --- 252,256 ---- } ! Draw(); bHandled = true; } *************** *** 266,270 **** m_pVScrollbar->SetValue(m_pVScrollbar->GetValue() - 1); } ! StartDrawProc(); bHandled = true; } --- 266,270 ---- m_pVScrollbar->SetValue(m_pVScrollbar->GetValue() - 1); } ! Draw(); bHandled = true; } *************** *** 285,289 **** } m_pVScrollbar->SetValue(m_iFocusedItem); ! StartDrawProc(); bHandled=true; break; --- 285,289 ---- } m_pVScrollbar->SetValue(m_iFocusedItem); ! Draw(); bHandled=true; break; *************** *** 302,306 **** } m_pVScrollbar->SetValue(m_iFocusedItem); ! StartDrawProc(); bHandled=true; break; --- 302,306 ---- } m_pVScrollbar->SetValue(m_iFocusedItem); ! Draw(); bHandled=true; break; *************** *** 311,315 **** { SetSelection(m_iFocusedItem, !IsSelected(m_iFocusedItem)); ! StartDrawProc(); } bHandled = true; --- 311,315 ---- { SetSelection(m_iFocusedItem, !IsSelected(m_iFocusedItem)); ! Draw(); } bHandled = true; *************** *** 330,334 **** if (pMessage->Source() == m_pVScrollbar) { ! StartDrawProc(); bHandled = true; } --- 330,334 ---- if (pMessage->Source() == m_pVScrollbar) { ! Draw(); bHandled = true; } Index: wg_textbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_textbox.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** wg_textbox.cpp 5 May 2004 14:52:35 -0000 1.19 --- wg_textbox.cpp 25 Jun 2004 13:34:15 -0000 1.20 *************** *** 101,105 **** m_BGColor = bReadOnly ? COLOR_LIGHTGRAY : COLOR_WHITE; m_bReadOnly = bReadOnly; ! StartDrawProc(); } --- 101,105 ---- m_BGColor = bReadOnly ? COLOR_LIGHTGRAY : COLOR_WHITE; m_bReadOnly = bReadOnly; ! Draw(); } *************** *** 157,163 **** CPainter Painter(m_pSDLSurface); ! Painter.DrawRect(m_WindowRect, false, COLOR_BLACK); CPoint FontCenterPoint = m_WindowRect.Center(); ! CRect TextRect(GetClientRect()); CRGBColor FontColor = m_bReadOnly ? DEFAULT_DISABLED_LINE_COLOR : DEFAULT_LINE_COLOR; --- 157,163 ---- CPainter Painter(m_pSDLSurface); ! Painter.DrawRect(m_WindowRect.SizeRect(), false, COLOR_BLACK); CPoint FontCenterPoint = m_WindowRect.Center(); ! CRect TextRect(m_ClientRect); CRGBColor FontColor = m_bReadOnly ? DEFAULT_DISABLED_LINE_COLOR : DEFAULT_LINE_COLOR; *************** *** 349,353 **** m_SelLength = 0; m_bMouseDown = true; ! StartDrawProc(); bResult = true; } --- 349,353 ---- m_SelLength = 0; m_bMouseDown = true; ! Draw(); bResult = true; } *************** *** 383,387 **** m_SelStart = 0; m_SelLength = stdex::safe_static_cast<int>(m_sWindowText.length()); ! StartDrawProc(); bHandled = true; } --- 383,387 ---- m_SelStart = 0; m_SelLength = stdex::safe_static_cast<int>(m_sWindowText.length()); ! Draw(); bHandled = true; } *************** *** 470,474 **** } bHandled = true; ! StartDrawProc(); } } --- 470,474 ---- } bHandled = true; ! Draw(); } } *************** *** 480,484 **** //This redraws the whole control each time we want to show/not show the cursor, that's probably a bad idea. m_bDrawCursor = !m_bDrawCursor; ! StartDrawProc(); bHandled = true; } --- 480,484 ---- //This redraws the whole control each time we want to show/not show the cursor, that's probably a bad idea. m_bDrawCursor = !m_bDrawCursor; ! Draw(); bHandled = true; } *************** *** 489,493 **** m_pCursorTimer->StartTimer(750, true); m_bDrawCursor = true; ! StartDrawProc(); bHandled = true; } --- 489,493 ---- m_pCursorTimer->StartTimer(750, true); m_bDrawCursor = true; ! Draw(); bHandled = true; } *************** *** 497,501 **** { m_pCursorTimer->StopTimer(); ! StartDrawProc(); bHandled = true; } --- 497,501 ---- { m_pCursorTimer->StopTimer(); ! Draw(); bHandled = true; } *************** *** 777,781 **** m_bDrawCursor = true; m_bScrollToCursor = true; // a key was pressed, so we need to make sure that the cursor is visible ! StartDrawProc(); } break; --- 777,781 ---- m_bDrawCursor = true; m_bScrollToCursor = true; // a key was pressed, so we need to make sure that the cursor is visible ! Draw(); } break; *************** *** 786,790 **** if (pMessage->Source() == m_pVerticalScrollBar || pMessage->Source() == m_pHorizontalScrollBar) { ! StartDrawProc(); bHandled = true; } --- 786,790 ---- if (pMessage->Source() == m_pVerticalScrollBar || pMessage->Source() == m_pHorizontalScrollBar) { ! Draw(); bHandled = true; } |
|
From: Rob W. <gre...@us...> - 2004-06-25 13:34:28
|
Update of /cvsroot/wgui/wgui/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21468/tests Modified Files: Notepad.cpp TestFrame2.cpp TestView1.cpp Log Message: Draw architecture changes. Index: TestView1.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/tests/TestView1.cpp,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** TestView1.cpp 4 May 2004 16:11:13 -0000 1.66 --- TestView1.cpp 25 Jun 2004 13:34:16 -0000 1.67 *************** *** 46,50 **** wGui::CPainter Painter(m_pSDLSurface); Painter.DrawRect(m_WindowRect, false, wGui::COLOR_WHITE); ! Painter.DrawRect(GetClientRect(), false, wGui::COLOR_RED); } --- 46,50 ---- wGui::CPainter Painter(m_pSDLSurface); Painter.DrawRect(m_WindowRect, false, wGui::COLOR_WHITE); ! Painter.DrawRect(m_ClientRect, false, wGui::COLOR_RED); } *************** *** 364,372 **** { CView::HandleMessage(pMessage); ! wGui::CRect NewRect = GetClientRect(); NewRect.SetLeft(NewRect.Right() - 12); NewRect.SetBottom(NewRect.Bottom() - 12); m_pVScrollBar->SetWindowRect(NewRect); ! NewRect = GetClientRect(); NewRect.SetTop(NewRect.Bottom() - 12); NewRect.SetRight(NewRect.Right() - 12); --- 364,372 ---- { CView::HandleMessage(pMessage); ! wGui::CRect NewRect = m_ClientRect; NewRect.SetLeft(NewRect.Right() - 12); NewRect.SetBottom(NewRect.Bottom() - 12); m_pVScrollBar->SetWindowRect(NewRect); ! NewRect = m_ClientRect; NewRect.SetTop(NewRect.Bottom() - 12); NewRect.SetRight(NewRect.Right() - 12); Index: TestFrame2.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/tests/TestFrame2.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** TestFrame2.cpp 2 Apr 2004 17:26:16 -0000 1.5 --- TestFrame2.cpp 25 Jun 2004 13:34:16 -0000 1.6 *************** *** 53,57 **** wGui::CPainter Painter(m_pSDLSurface); Painter.DrawRect(m_WindowRect, false, wGui::COLOR_WHITE); ! Painter.DrawRect(GetClientRect(), false, wGui::COLOR_RED); } --- 53,57 ---- wGui::CPainter Painter(m_pSDLSurface); Painter.DrawRect(m_WindowRect, false, wGui::COLOR_WHITE); ! Painter.DrawRect(m_ClientRect, false, wGui::COLOR_RED); } Index: Notepad.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/tests/Notepad.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Notepad.cpp 13 Apr 2004 19:15:26 -0000 1.3 --- Notepad.cpp 25 Jun 2004 13:34:16 -0000 1.4 *************** *** 105,109 **** GetMenu()->InsertMenuItem(SMenuItem("Format", 0, pContextSubmenu)); ! m_pTextBox = new CTextBox(GetClientRect(), this); m_pTextBox->SetScrollBarVisibility(CScrollBar::VERTICAL, CTextBox::SCROLLBAR_VIS_ALWAYS); m_pTextBox->SetWindowText("This is a sample notepad application.\nLoad and Save doesn't work here yet, since the UI for that requires some sort of dialog type thing, which we don't really have yet (see the CFrame class)."); --- 105,109 ---- GetMenu()->InsertMenuItem(SMenuItem("Format", 0, pContextSubmenu)); ! m_pTextBox = new CTextBox(m_ClientRect, this); m_pTextBox->SetScrollBarVisibility(CScrollBar::VERTICAL, CTextBox::SCROLLBAR_VIS_ALWAYS); m_pTextBox->SetWindowText("This is a sample notepad application.\nLoad and Save doesn't work here yet, since the UI for that requires some sort of dialog type thing, which we don't really have yet (see the CFrame class)."); *************** *** 134,138 **** case CUT_TEXT: App()->m_sClipboard = m_pTextBox->GetSelText(); ! m_pTextBox->SetWindowText(m_pTextBox->GetWindowText().substr(0, m_pTextBox->GetSelectionStart()) + m_pTextBox->GetWindowText().substr(m_pTextBox->GetSelectionStart() + m_pTextBox->GetSelectionLength())); break; --- 134,138 ---- case CUT_TEXT: App()->m_sClipboard = m_pTextBox->GetSelText(); ! m_pTextBox->SetWindowText(m_pTextBox->GetWindowText().substr(0, m_pTextBox->GetSelectionStart()) + m_pTextBox->GetWindowText().substr(m_pTextBox->GetSelectionStart() + m_pTextBox->GetSelectionLength())); break; *************** *** 157,162 **** { CView::HandleMessage(pMessage); ! m_pTextBox->SetWindowRect(GetClientRect()); ! StartDrawProc(); } break; --- 157,162 ---- { CView::HandleMessage(pMessage); ! m_pTextBox->SetWindowRect(m_ClientRect); ! Draw(); } break; |
|
From: Rob W. <gre...@us...> - 2004-06-25 13:34:24
|
Update of /cvsroot/wgui/wgui/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21468/includes Modified Files: wg_range_control.h wg_rect.h wg_view.h wg_window.h Log Message: Draw architecture changes. Index: wg_rect.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_rect.h,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** wg_rect.h 3 Jun 2004 19:10:52 -0000 1.30 --- wg_rect.h 25 Jun 2004 13:34:15 -0000 1.31 *************** *** 144,147 **** --- 144,151 ---- int Height(void) const { return abs(m_Bottom - m_Top + 1); } + //! Creates a CRect that has the same width and height of the rect, but has 0, 0 as it's top left coordinate + //! \return A CRect + CRect SizeRect(void) const { return CRect(0, 0, abs(m_Right - m_Left), abs(m_Bottom - m_Top)); } + //! Assignment operator will copy the values of the other rect CRect& operator=(const CRect& r); // assignment operator Index: wg_view.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_view.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** wg_view.h 3 Jun 2004 19:10:52 -0000 1.24 --- wg_view.h 25 Jun 2004 13:34:15 -0000 1.25 *************** *** 110,113 **** --- 110,114 ---- CMenu* m_pMenu; //!< A pointer to the view's menu CWindow* m_pFloatingWindow; //!< A pointer to the current floating window. This will be drawn overtop of everything else. + SDL_Surface* m_pScreenSurface; //!< A pointer to the actual screen surface Index: wg_range_control.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_range_control.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** wg_range_control.h 3 Jun 2004 19:10:52 -0000 1.4 --- wg_range_control.h 25 Jun 2004 13:34:15 -0000 1.5 *************** *** 84,88 **** if (bRedraw) { ! StartDrawProc(); } } --- 84,88 ---- if (bRedraw) { ! Draw(); } } Index: wg_window.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_window.h,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** wg_window.h 3 Jun 2004 19:10:52 -0000 1.36 --- wg_window.h 25 Jun 2004 13:34:15 -0000 1.37 *************** *** 124,131 **** --- 124,133 ---- //! Translate the given CRect into screen coordinates //! \param Rect A CRect in client coordinates + // TODO: fix virtual CRect ClientToScreen(const CRect& Rect) const { return Rect + GetClientRect().TopLeft(); } //! Translate the given CPoint into screen coordinates //! \param Point A CPoint in client coordinates + // TODO: fix virtual CPoint ClientToScreen(const CPoint& Point) const { return Point + GetClientRect().TopLeft(); } *************** *** 138,160 **** virtual std::string GetWindowText(void) { return m_sWindowText; } ! //! The rendering chain for windows ! //! DrawProc() is the primary draw method and calls the other draw methods ! virtual void DrawProc(void) const; ! ! //! Render the background for the control ! //! Draws the background as a filled CRect ! virtual void DrawBG(void) const; ! ! //! Render the control itself virtual void Draw(void) const; ! //! Call DrawProc() for any children of the current windows ! virtual void DrawChildren(void) const; ! ! //! The last chance to do any further drawing ! virtual void DrawPostChild(void) const; ! ! //! This calls DrawProc, then updates the relevant screen area ! virtual void StartDrawProc(void) const; //! Transfer the ownership of the window, so it has a new parent --- 140,150 ---- virtual std::string GetWindowText(void) { return m_sWindowText; } ! //! Render the window itself virtual void Draw(void) const; ! //! Blit the window to the given surface, using m_WindowRect as the offset into the surface ! //! \param Surface A reference to the surface that the window will be copied to ! //! \param Offset This is the current offset into the Surface that should be used as reference ! virtual void PaintToSurface(SDL_Surface& Surface, const CPoint& Offset) const; //! Transfer the ownership of the window, so it has a new parent *************** *** 199,203 **** std::string m_sWindowText; ! //! The area the control occupies CRect m_WindowRect; --- 189,193 ---- std::string m_sWindowText; ! //! The area the control occupies, these coordinates are in respect to the parent's client rect CRect m_WindowRect; *************** *** 214,223 **** std::list<CWindow*> m_ChildWindows; ! //! A pointer to the SDL surface that the window exists on, and should use for drawing itself SDL_Surface* m_pSDLSurface; ! //! If this is false, the control will not draw itself bool m_bVisible; private: void operator=(CWindow) { } //!< The assignment operator is not allowed for CWindow objects --- 204,216 ---- std::list<CWindow*> m_ChildWindows; ! //! A pointer to the SDL surface buffer that the window draws to SDL_Surface* m_pSDLSurface; ! //! If this is false, the control will not paint itself bool m_bVisible; + //! Indicates if the control has been drawn yet or not + mutable bool m_bDrawCompleted; + private: void operator=(CWindow) { } //!< The assignment operator is not allowed for CWindow objects |
|
From: Rob W. <gre...@us...> - 2004-06-25 13:34:23
|
Update of /cvsroot/wgui/wgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21468 Modified Files: CHANGES Log Message: Draw architecture changes. Index: CHANGES =================================================================== RCS file: /cvsroot/wgui/wgui/CHANGES,v retrieving revision 1.141 retrieving revision 1.142 diff -C2 -d -r1.141 -r1.142 *** CHANGES 17 Jun 2004 15:31:03 -0000 1.141 --- CHANGES 25 Jun 2004 13:34:15 -0000 1.142 *************** *** 1,3 **** --- 1,7 ---- 0.3.3 -> 0.4.0 + + Added CWindow: PaintToSurface() which blits the window's sirface to the surface it is passed. + + Added CRect: SizeRect() which returns a CRect the same size as the Rect, but with a top left coordinate of (0, 0) + + Changed CWindow: CWindows now have their own SDL surfaces for drawing, which is then blitted to the final surface on a screen update + + Removed CWindow: DrawPostChild(), DrawChildren(), DrawBG(), DrawChildren, and StartDrawProc() has been removed |
|
From: Rob W. <gre...@us...> - 2004-06-17 15:31:12
|
Update of /cvsroot/wgui/wgui/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14533/includes Modified Files: wgui_win32_config.h Log Message: Version bump. Index: wgui_win32_config.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wgui_win32_config.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** wgui_win32_config.h 23 Apr 2004 03:45:43 -0000 1.9 --- wgui_win32_config.h 17 Jun 2004 15:31:03 -0000 1.10 *************** *** 3,6 **** /* Version number of package */ ! #define VERSION "0.3.3" --- 3,6 ---- /* Version number of package */ ! #define VERSION "0.4.0" |
|
From: Rob W. <gre...@us...> - 2004-06-17 15:31:12
|
Update of /cvsroot/wgui/wgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14533 Modified Files: CHANGES Doxyfile Log Message: Version bump. Index: Doxyfile =================================================================== RCS file: /cvsroot/wgui/wgui/Doxyfile,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** Doxyfile 23 Apr 2004 03:45:43 -0000 1.15 --- Doxyfile 17 Jun 2004 15:31:03 -0000 1.16 *************** *** 24,28 **** # if some version control system is used. ! PROJECT_NUMBER = 0.3.3 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) --- 24,28 ---- # if some version control system is used. ! PROJECT_NUMBER = 0.4.0 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) Index: CHANGES =================================================================== RCS file: /cvsroot/wgui/wgui/CHANGES,v retrieving revision 1.140 retrieving revision 1.141 diff -C2 -d -r1.140 -r1.141 *** CHANGES 5 May 2004 14:52:34 -0000 1.140 --- CHANGES 17 Jun 2004 15:31:03 -0000 1.141 *************** *** 1,2 **** --- 1,5 ---- + 0.3.3 -> 0.4.0 + + 0.3.2 -> 0.3.3 + Added CRangeControl class: An abstraction of all controls that have a value that's constricted to a certain range (progress bar, scroll bar, etc) |
|
From: Rob W. <gre...@us...> - 2004-06-08 15:19:27
|
Update of /cvsroot/wgui/wgui/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23022/includes Modified Files: Makefile.in wgui_config.h.in Log Message: Version 0.3.3 release. Index: Makefile.in =================================================================== RCS file: /cvsroot/wgui/wgui/includes/Makefile.in,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Makefile.in 22 Apr 2004 16:39:45 -0000 1.20 --- Makefile.in 8 Jun 2004 15:18:28 -0000 1.21 *************** *** 116,119 **** --- 116,120 ---- wg_point.h \ wg_progress.h \ + wg_range_control.h \ wg_rect.h \ wg_renderedstring.h \ Index: wgui_config.h.in =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wgui_config.h.in,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** wgui_config.h.in 23 Apr 2004 02:28:39 -0000 1.11 --- wgui_config.h.in 8 Jun 2004 15:18:28 -0000 1.12 *************** *** 1,16 **** /* includes/wgui_config.h.in. Generated from configure.in by autoheader. */ - #undef ENABLE_NLS - #undef HAVE_CATGETS - #undef HAVE_GETTEXT - #undef HAVE_LC_MESSAGES - #undef HAVE_STPCPY - #undef HAVE_LIBSM - #undef PACKAGE_LOCALE_DIR - #undef PACKAGE_DOC_DIR - #undef PACKAGE_DATA_DIR - #undef PACKAGE_PIXMAPS_DIR - #undef PACKAGE_HELP_DIR - #undef PACKAGE_MENU_DIR - #undef PACKAGE_SOURCE_DIR /* Define to 1 if you have the <inttypes.h> header file. */ --- 1,3 ---- |
|
From: Rob W. <gre...@us...> - 2004-06-08 15:18:50
|
Update of /cvsroot/wgui/wgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23022 Modified Files: Makefile.in NEWS aclocal.m4 configure Log Message: Version 0.3.3 release. Index: aclocal.m4 =================================================================== RCS file: /cvsroot/wgui/wgui/aclocal.m4,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** aclocal.m4 20 Apr 2004 18:38:08 -0000 1.8 --- aclocal.m4 8 Jun 2004 15:18:27 -0000 1.9 *************** *** 847,851 **** dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS dnl ! AC_DEFUN(AM_PATH_SDL, [dnl dnl Get the cflags and libraries from the sdl-config script --- 847,851 ---- dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS dnl ! AC_DEFUN([AM_PATH_SDL], [dnl dnl Get the cflags and libraries from the sdl-config script Index: NEWS =================================================================== RCS file: /cvsroot/wgui/wgui/NEWS,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** NEWS 23 Apr 2004 03:45:43 -0000 1.8 --- NEWS 8 Jun 2004 15:18:27 -0000 1.9 *************** *** 1,4 **** --- 1,6 ---- For more current news, see Sourceforge at http://sourceforge.net/projects/wgui/ + 06/08/04 - Version 0.3.3 is released. + 04/22/04 - Version 0.3.2 is released. Index: Makefile.in =================================================================== RCS file: /cvsroot/wgui/wgui/Makefile.in,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** Makefile.in 23 Apr 2004 02:28:39 -0000 1.23 --- Makefile.in 8 Jun 2004 15:18:26 -0000 1.24 *************** *** 129,135 **** uninstall-recursive check-recursive installcheck-recursive DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \ ! Makefile.in NEWS TODO acconfig.h acinclude.m4 aclocal.m4 \ ! config.guess config.sub configure configure.in depcomp \ ! install-sh missing mkinstalldirs DIST_SUBDIRS = $(SUBDIRS) all: all-recursive --- 129,135 ---- uninstall-recursive check-recursive installcheck-recursive DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \ ! Makefile.in NEWS TODO acinclude.m4 aclocal.m4 config.guess \ ! config.sub configure configure.in depcomp install-sh missing \ ! mkinstalldirs DIST_SUBDIRS = $(SUBDIRS) all: all-recursive Index: configure =================================================================== RCS file: /cvsroot/wgui/wgui/configure,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** configure 22 Apr 2004 16:39:44 -0000 1.18 --- configure 8 Jun 2004 15:18:27 -0000 1.19 *************** *** 1,8 **** #! /bin/sh # Guess values for system-dependent variables and create Makefiles. ! # Generated by GNU Autoconf 2.57. # ! # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 ! # Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. --- 1,7 ---- #! /bin/sh [...2398 lines suppressed...] sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } *************** *** 5707,5714 **** as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ ! X"$as_dir" : 'X\(//\)[^/]' \| \ ! X"$as_dir" : 'X\(//\)$' \| \ ! X"$as_dir" : 'X\(/\)' \| \ ! . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } --- 5976,5983 ---- as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ ! X"$as_dir" : 'X\(//\)[^/]' \| \ ! X"$as_dir" : 'X\(//\)$' \| \ ! X"$as_dir" : 'X\(/\)' \| \ ! . : '\(.\)' 2>/dev/null || echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } |
|
From: Rob W. <gre...@us...> - 2004-06-08 03:40:59
|
Update of /cvsroot/wgui/wgui/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21721/includes Modified Files: wg_application.h Log Message: Documentation fix. Index: wg_application.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_application.h,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** wg_application.h 3 Jun 2004 18:40:51 -0000 1.35 --- wg_application.h 8 Jun 2004 03:40:49 -0000 1.36 *************** *** 185,191 **** //! This Global config is read-only. Any changes should be made to the wGui.conf file outside of the app //! wGui will search directories for the wGui.conf file in the following order, and will include the settings from each: ! //! 1) <system settings> (for *nix this is probably /etc/wGui/, for windows systems this is c:\documents and settings\default user\application data\wGui) ! //! 2) ~/ (home directory, for Windows NT builds, this is c:\documents and settings\<username>\application data\wGui) ! //! 3) Current Directory //! So any settings found in the current directory will override the settings in the global directory //! \return A const reference to the Global Configration --- 185,192 ---- //! This Global config is read-only. Any changes should be made to the wGui.conf file outside of the app //! wGui will search directories for the wGui.conf file in the following order, and will include the settings from each: ! //! - 1) <system settings> (for *nix this is probably /etc/wGui/, for windows systems this is c:\\documents and settings\\default user\\application data\\wGui) ! //! - 2) ~/ (home directory, for Windows NT builds, this is c:\\documents and settings\\<username>\\application data\\wGui) ! //! - 3) Current Directory ! //! . //! So any settings found in the current directory will override the settings in the global directory //! \return A const reference to the Global Configration |
|
From: Rob W. <gre...@us...> - 2004-06-07 18:54:45
|
Update of /cvsroot/wgui/wgui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16613 Modified Files: AUTHORS BUGS README Log Message: Documentation updates for the 0.3.3 release. Index: README =================================================================== RCS file: /cvsroot/wgui/wgui/README,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** README 23 Apr 2004 03:45:43 -0000 1.18 --- README 7 Jun 2004 18:54:15 -0000 1.19 *************** *** 1,5 **** 0.3.3 ! For this release we've added a pair of new classes: wUtil::CLog and CTextBox. Due to problems with VC6, use of the VC.NET and .NET 2003 compilers is suggested for building on Windows. --- 1,10 ---- 0.3.3 ! This release only contains a few minor changes, the most notable of which is the addition of the CRangeControl class, ! which is now the base class for the CProgressBar and CScrollBar controls. ! ! This is to be the last 0.3.x release. The next release will hopefully be the 0.4.0 release which will have some fairly significant ! changes to the drawing code. The intention of these changes is to fix several bugs (like the Z-Order bug), improve performance, ! and enable us to add some new cool features. Due to problems with VC6, use of the VC.NET and .NET 2003 compilers is suggested for building on Windows. Index: BUGS =================================================================== RCS file: /cvsroot/wgui/wgui/BUGS,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** BUGS 13 Apr 2004 15:28:53 -0000 1.13 --- BUGS 7 Jun 2004 18:54:05 -0000 1.14 *************** *** 1,5 **** ! Known bugs for 0.3.2 ! - Bug #825743 - Popup menu Z-order can run into problems when popups overlap - Floating windows may flicker in debug builds and on slower machines - The wGui library is currently built to the src directory instead of the lib directory when using GNU Make --- 1,5 ---- ! Known bugs for 0.3.3 ! - Bug #825743 - Popup menu Z-order can run into problems when popups overlap. This has been partially fixed, but may still flicker. - Floating windows may flicker in debug builds and on slower machines - The wGui library is currently built to the src directory instead of the lib directory when using GNU Make Index: AUTHORS =================================================================== RCS file: /cvsroot/wgui/wgui/AUTHORS,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** AUTHORS 12 Sep 2003 16:23:04 -0000 1.4 --- AUTHORS 7 Jun 2004 18:54:02 -0000 1.5 *************** *** 3,10 **** --- 3,17 ---- Rob Wiskow - ro...@bo... Willie Zutz - wil...@bi... + + + + Past wGui Developers + Lucio Asnaghi (aka kRAkEn/gORe) - kra...@li... + Contributors Oldrich Dlouhy + |
|
From: Rob W. <gre...@us...> - 2004-06-03 19:15:06
|
Update of /cvsroot/wgui/wgui/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15384/includes Modified Files: wg_resource_handle.h Log Message: Documentation fixes. Index: wg_resource_handle.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_resource_handle.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** wg_resource_handle.h 3 Jun 2004 19:10:52 -0000 1.18 --- wg_resource_handle.h 3 Jun 2004 19:14:57 -0000 1.19 *************** *** 168,171 **** --- 168,172 ---- CCursorResourceHandle(TResourceId resId) : CResourceHandle(resId) { } + //! A copying constructor //! \param resHandle An existing resource handle that will be cloned CCursorResourceHandle(const CCursorResourceHandle& resHandle) : |
Update of /cvsroot/wgui/wgui/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14331/includes Modified Files: wg_button.h wg_checkbox.h wg_dropdown.h wg_editbox.h wg_error.h wg_frame.h wg_groupbox.h wg_label.h wg_listbox.h wg_menu.h wg_message.h wg_message_server.h wg_point.h wg_progress.h wg_range_control.h wg_rect.h wg_resource_handle.h wg_scrollbar.h wg_textbox.h wg_timer.h wg_toolbar.h wg_view.h wg_window.h Log Message: Documentation fixes. Index: wg_textbox.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_textbox.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** wg_textbox.h 13 Apr 2004 19:15:26 -0000 1.11 --- wg_textbox.h 3 Jun 2004 19:10:52 -0000 1.12 *************** *** 59,65 **** --- 59,67 ---- virtual void SetReadOnly(bool bReadOnly); + //! Indicates if the text box is in read-only mode //! \return true if the control is read-only virtual bool IsReadOnly(void) const { return m_bReadOnly; } + //! Gets the currently selected text //! \return The currently selected text in the edit box, if the edit box is in Password Mask mode, this will always return an empty string virtual std::string GetSelText(void) const; *************** *** 70,76 **** virtual void SetSelection(std::string::size_type iSelStart, int iSelLength); ! //! \return The start of the selection virtual std::string::size_type GetSelectionStart(void) const { return m_SelStart; } //! \return The length of the selection virtual int GetSelectionLength(void) const { return m_SelLength; } --- 72,80 ---- virtual void SetSelection(std::string::size_type iSelStart, int iSelLength); ! //! Gets the start of the selection ! //! \return The index of the start of the selection virtual std::string::size_type GetSelectionStart(void) const { return m_SelStart; } + //! Gets the selection length //! \return The length of the selection virtual int GetSelectionLength(void) const { return m_SelLength; } *************** *** 94,98 **** virtual EScrollBarVisibility GetScrollBarVisibility(CScrollBar::EScrollBarType ScrollBarType) const { return m_ScrollBarVisibilityMap.find(ScrollBarType)->second; } ! // CWindow overrides --- 98,102 ---- virtual EScrollBarVisibility GetScrollBarVisibility(CScrollBar::EScrollBarType ScrollBarType) const { return m_ScrollBarVisibilityMap.find(ScrollBarType)->second; } ! // CWindow overrides *************** *** 164,168 **** unsigned int m_iRowHeight; //!< The row height unsigned int m_iMaxWidth; //!< The width of the longest line (in pixels) ! private: --- 168,172 ---- unsigned int m_iRowHeight; //!< The row height unsigned int m_iMaxWidth; //!< The width of the longest line (in pixels) ! private: Index: wg_groupbox.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_groupbox.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** wg_groupbox.h 2 Apr 2004 17:26:14 -0000 1.12 --- wg_groupbox.h 3 Jun 2004 19:10:52 -0000 1.13 *************** *** 59,62 **** --- 59,63 ---- void SetFontColor(CRGBColor& FontColor) { m_FontColor = FontColor; } + //! Gets the font color for the label od the group box //! \return The color of the text in the label CRGBColor GetFontColor(void) { return m_FontColor; } Index: wg_frame.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_frame.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** wg_frame.h 2 Apr 2004 17:26:13 -0000 1.15 --- wg_frame.h 3 Jun 2004 19:10:52 -0000 1.16 *************** *** 67,70 **** --- 67,71 ---- void SetTitleBarHeight(int iTitleBarHeight); + //! Indicates if the frame is resizable (set in the object constructor) //! \return true if the frame is resizable bool IsResizable(void) { return m_bResizable; } *************** *** 74,77 **** --- 75,79 ---- void AttachMenu(CMenu* pMenu); + //! Gets the menu for a frame //! \return A pointer to the frame's menu, 0 if the view doesn't have a menu CMenu* GetMenu(void) { return m_pMenu; } Index: wg_checkbox.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_checkbox.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** wg_checkbox.h 2 Apr 2004 17:26:13 -0000 1.14 --- wg_checkbox.h 3 Jun 2004 19:10:52 -0000 1.15 *************** *** 57,60 **** --- 57,61 ---- }; + //! Gets the current state of the checkbox //! \return The current checkbox state EState GetCheckBoxState(void) const { return m_eCheckBoxState; } Index: wg_listbox.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_listbox.h,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** wg_listbox.h 2 Apr 2004 17:26:14 -0000 1.24 --- wg_listbox.h 3 Jun 2004 19:10:52 -0000 1.25 *************** *** 71,77 **** --- 71,79 ---- virtual ~CListBox(void); + //! Gets the height of the items //! \return The height of the items in the listbox unsigned int GetItemHeight(void) { return m_iItemHeight; } + //! Sets the heigh of the items in the listbox //! \param iItemHeight The height of the items in the listbox void SetItemHeight(unsigned int iItemHeight); *************** *** 94,97 **** --- 96,100 ---- void ClearItems(void); + //! Gets the number of items in the listbox //! \return The number of items in the list int Size(void) { return stdex::safe_static_cast<int>(m_Items.size()); } Index: wg_window.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_window.h,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** wg_window.h 20 Apr 2004 18:59:06 -0000 1.35 --- wg_window.h 3 Jun 2004 19:10:52 -0000 1.36 *************** *** 68,71 **** --- 68,72 ---- virtual void SetWindowRect(const CRect& WindowRect); + //! Gets the window's rectangle //! \return A copy of the CRect that the window represents virtual CRect GetWindowRect(void) const { return m_WindowRect; } *************** *** 100,103 **** --- 101,105 ---- virtual CWindow* GetAncestor(EAncestor eAncestor) const; + //! Gets the view the window is a part of //! \return A pointer to the view object for the window (if one exists), this assumes that the view is the root ancestor virtual CView* GetView(void) const; *************** *** 116,119 **** --- 118,122 ---- virtual void SetVisible(bool bVisible); + //! Gets the SDL surface the window draws to //! \return A pointer to the window's SDL surface virtual SDL_Surface* GetSDLSurface(void) { return m_pSDLSurface; } Index: wg_timer.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_timer.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** wg_timer.h 2 Apr 2004 17:26:14 -0000 1.16 --- wg_timer.h 3 Jun 2004 19:10:52 -0000 1.17 *************** *** 59,65 **** --- 59,67 ---- void StopTimer(void); + //! Indicates if the timer is currently running //! \return true is the timer is currently running bool IsRunning(void) { return m_TimerID != 0; } + //! Gets the number of times the timer has triggered since it was last reset //! \return The count of times the timer has fired long int GetCount(void) const { return m_iCounter; } *************** *** 68,71 **** --- 70,74 ---- void ResetCount(void) { m_iCounter = 0; } + //! Gets the owner of the timer //! \return A pointer to the owner of the timer CMessageClient* GetOwner(void) { return m_pOwner; } Index: wg_progress.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_progress.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** wg_progress.h 4 May 2004 16:11:13 -0000 1.17 --- wg_progress.h 3 Jun 2004 19:10:52 -0000 1.18 *************** *** 47,50 **** --- 47,51 ---- virtual ~CProgress(void); + //! Gets the color of the bar //! \return The bar color CRGBColor GetBarColor(void) { return m_BarColor; } Index: wg_message.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_message.h,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** wg_message.h 23 Apr 2004 19:38:47 -0000 1.29 --- wg_message.h 3 Jun 2004 19:10:52 -0000 1.30 *************** *** 83,92 **** --- 83,95 ---- virtual ~CMessage(void) { } + //! Gets the message type //! \return The message type of the message const EMessageType MessageType(void) { return m_MessageType; } + //! Gets the intended destination for the message //! \return A pointer to the destination of the message (0 for no specific destination, or to broadcast to all) const CMessageClient* Destination(void) { return m_pDestination; } + //! Gets the source of the message //! \return A pointer to the source of the message const CMessageClient* Source(void) { return m_pSource; } *************** *** 139,145 **** unsigned char ScanCode, SDLMod Modifiers, SDLKey Key, Uint16 Unicode); ! unsigned char ScanCode; //!< \param ScanCode The scan code of the key pressed ! SDLMod Modifiers; //!< \param Modifiers Any modifier keys that are being pressed (alt, ctrl, shift, etc) ! SDLKey Key; //!< \param Key The SDLKey that defines the key pressed Uint16 Unicode; //!< The unicode character the keypress corresponds to }; --- 142,148 ---- unsigned char ScanCode, SDLMod Modifiers, SDLKey Key, Uint16 Unicode); ! unsigned char ScanCode; //!< The scan code of the key pressed ! SDLMod Modifiers; //!< Any modifier keys that are being pressed (alt, ctrl, shift, etc) ! SDLKey Key; //!< The SDLKey that defines the key pressed Uint16 Unicode; //!< The unicode character the keypress corresponds to }; Index: wg_scrollbar.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_scrollbar.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** wg_scrollbar.h 3 Jun 2004 18:40:52 -0000 1.23 --- wg_scrollbar.h 3 Jun 2004 19:10:52 -0000 1.24 *************** *** 59,62 **** --- 59,63 ---- virtual void SetJumpAmount(int iJumpAmount) { m_iJumpAmount = iJumpAmount; } + //! Get the amount that the scrollbar will jump by when the arrow buttons are clicked //! \return The amount the scrollbar jumps by when clicked above or below the thumb virtual int GetJumpAmount(void) const { return m_iJumpAmount; } Index: wg_range_control.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_range_control.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wg_range_control.h 4 May 2004 16:11:13 -0000 1.3 --- wg_range_control.h 3 Jun 2004 19:10:52 -0000 1.4 *************** *** 54,58 **** virtual void SetMinLimit(T minLimit) { m_MinLimit = minLimit; } ! //! \return The minimum limit of the progress bar virtual T GetMinLimit(void) const { return m_MinLimit; } --- 54,59 ---- virtual void SetMinLimit(T minLimit) { m_MinLimit = minLimit; } ! //! Gets the lower limit of the control ! //! \return The minimum limit of the control virtual T GetMinLimit(void) const { return m_MinLimit; } *************** *** 61,71 **** virtual void SetMaxLimit(T maxLimit) { m_MaxLimit = maxLimit; } ! //! \return The maximum limit of the progress bar virtual T GetMaxLimit(void) const { return m_MaxLimit; } ! //! Set the current steo size. //! \param stepSize The amount to increment the value by for Increment() and Decrement() calls virtual void SetStepSize(T stepSize) { m_StepSize = stepSize; } //! \return The current step size virtual T GetStepSize(void) const { return m_StepSize; } --- 62,74 ---- virtual void SetMaxLimit(T maxLimit) { m_MaxLimit = maxLimit; } ! //! Gets teh upper limit of the control ! //! \return The maximum limit of the control virtual T GetMaxLimit(void) const { return m_MaxLimit; } ! //! Set the current step size. //! \param stepSize The amount to increment the value by for Increment() and Decrement() calls virtual void SetStepSize(T stepSize) { m_StepSize = stepSize; } + //! Gets the current step size of the control //! \return The current step size virtual T GetStepSize(void) const { return m_StepSize; } *************** *** 85,88 **** --- 88,92 ---- } + //! Gets the current value of the control //! \return The current value virtual T GetValue(void) const { return m_Value; } Index: wg_button.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_button.h,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** wg_button.h 2 Apr 2004 17:26:13 -0000 1.26 --- wg_button.h 3 Jun 2004 19:10:52 -0000 1.27 *************** *** 61,64 **** --- 61,65 ---- }; + //! Gets the current state of the button //! \return The current button state EState GetButtonState(void) const { return m_eButtonState; } Index: wg_editbox.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_editbox.h,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** wg_editbox.h 13 Apr 2004 19:15:26 -0000 1.54 --- wg_editbox.h 3 Jun 2004 19:10:52 -0000 1.55 *************** *** 58,61 **** --- 58,62 ---- void SetUsePasswordMask(bool bUseMask) { m_bUseMask = bUseMask; } + //! Indicates if the edit box is using a password mask //! \return true if the control is a password box bool UsingPasswordMask(void) const { return m_bUseMask; } *************** *** 65,71 **** --- 66,74 ---- void SetReadOnly(bool bReadOnly); + //! Indicates if the edit box is operating in read-only mode //! \return true if the control is read-only bool IsReadOnly(void) const { return m_bReadOnly; } + //! Gets the currently selected text //! \return The currently selected text in the edit box, if the edit box is in Password Mask mode, this will always return an empty string std::string GetSelText(void) const; *************** *** 76,82 **** void SetSelection(std::string::size_type iSelStart, int iSelLength); ! //! \return The start of the selection virtual std::string::size_type GetSelectionStart(void) const { return m_SelStart; } //! \return The length of the selection virtual int GetSelectionLength(void) const { return m_SelLength; } --- 79,87 ---- void SetSelection(std::string::size_type iSelStart, int iSelLength); ! //! Gets the starting index of the selection ! //! \return The index of the start of the selection virtual std::string::size_type GetSelectionStart(void) const { return m_SelStart; } + //! Gets the length of the selection //! \return The length of the selection virtual int GetSelectionLength(void) const { return m_SelLength; } Index: wg_view.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_view.h,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** wg_view.h 13 Apr 2004 15:28:56 -0000 1.23 --- wg_view.h 3 Jun 2004 19:10:52 -0000 1.24 *************** *** 58,64 **** --- 58,66 ---- virtual ~CView(void); + //! Indicates if the view is resizable (set in the constructor) //! \return true if the view is resizable bool IsResizable(void) { return m_bResizable; } + //! Indicates id the view is fullscreen (set in the constructor) //! \return true if the view was created as fullscreen bool IsFullScreen(void) { return m_bFullScreen; } *************** *** 68,71 **** --- 70,74 ---- void AttachMenu(CMenu* pMenu); + //! Gets the menu for the view //! \return A pointer to the view's menu, 0 if the view doesn't have a menu CMenu* GetMenu(void) { return m_pMenu; } *************** *** 81,87 **** void SetFloatingWindow(CWindow* pWindow) { m_pFloatingWindow = pWindow; } //! \return a pointer to the current floating window CWindow* GetFloatingWindow(void) const { return m_pFloatingWindow; } ! // CWindow Overrides --- 84,91 ---- void SetFloatingWindow(CWindow* pWindow) { m_pFloatingWindow = pWindow; } + //! Gets teh current floating window //! \return a pointer to the current floating window CWindow* GetFloatingWindow(void) const { return m_pFloatingWindow; } ! // CWindow Overrides Index: wg_label.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_label.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** wg_label.h 2 Apr 2004 17:26:14 -0000 1.17 --- wg_label.h 3 Jun 2004 19:10:52 -0000 1.18 *************** *** 59,62 **** --- 59,63 ---- void SetFontColor(CRGBColor& FontColor) { m_FontColor = FontColor; } + //! Gets the font color for the label //! \return The color of the text in the label CRGBColor GetFontColor(void) { return m_FontColor; } Index: wg_message_server.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_message_server.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** wg_message_server.h 2 Apr 2004 17:26:14 -0000 1.22 --- wg_message_server.h 3 Jun 2004 19:10:52 -0000 1.23 *************** *** 77,80 **** --- 77,81 ---- }; + //! Gets the single instance of the message server //! \return The single valid instance of the message server, or create one if it doesn't already exist static CMessageServer& Instance(void); *************** *** 102,108 **** --- 103,111 ---- void QueueMessage(CMessage* pMessage); + //! Indicates if there are any messages available //! \return true if there's a message available in the queue bool MessageAvailable(void) { return m_MessageQueue.size() > 0; } + //! Sets the server to ignore any new incoming messages (messages already in the queue are unaffected) //! \param bIgnore if true, the message queue will ignore any new messages void IgnoreAllNewMessages(bool bIgnore) { m_bIgnoreAllNewMessages = bIgnore; } Index: wg_rect.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_rect.h,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** wg_rect.h 13 Apr 2004 15:28:56 -0000 1.29 --- wg_rect.h 3 Jun 2004 19:10:52 -0000 1.30 *************** *** 79,119 **** void SetBottom(const int bottom) { m_Bottom = bottom; } //! \return The Top position int Top(void) const { return m_Top; } //! \return The Left position int Left(void) const { return m_Left; } //! \return The Right position int Right(void) const { return m_Right; } //! \return The Bottom position int Bottom(void) const { return m_Bottom; } //! \return A point representing the Top Left corner of the CRect CPoint TopLeft(void) const { return CPoint(m_Left, m_Top); } //! \return A point representing the Top Right corner of the CRect CPoint TopRight(void) const { return CPoint(m_Right, m_Top); } //! \return A point representing the Bottom Left corner of the CRect CPoint BottomLeft(void) const { return CPoint(m_Left, m_Bottom); } //! \return A point representing the Bottom Right corner of the CRect CPoint BottomRight(void) const { return CPoint(m_Right, m_Bottom); } ! //! \return A point representing the center of the CRect CPoint Center(void) const { return CPoint((m_Left + m_Right) / 2, (m_Top + m_Bottom) / 2); } //! \return A point representing the CenterLeft point of the CRect CPoint CenterLeft(void) const { return CPoint( m_Left, (m_Top + m_Bottom) / 2); } //! \return A point representing the CenterTop point of the CRect CPoint CenterTop(void) const { return CPoint( (m_Left + m_Right) / 2, m_Top ); } //! \return A point representing the Bottom Left corner of the CRect CPoint CenterBottom(void) const { return CPoint( (m_Left + m_Right) / 2, m_Bottom ); } //! \return A point representing the Bottom Right corner of the CRect CPoint CenterRight(void) const { return CPoint( m_Right, (m_Top + m_Bottom) / 2); } --- 79,131 ---- void SetBottom(const int bottom) { m_Bottom = bottom; } + //! Gets the top of the rectangle //! \return The Top position int Top(void) const { return m_Top; } + //! Gets the left of the rectangle //! \return The Left position int Left(void) const { return m_Left; } + //! Gets the right of the rectangle //! \return The Right position int Right(void) const { return m_Right; } + //! Gets the bottom of the rectangle //! \return The Bottom position int Bottom(void) const { return m_Bottom; } + //! Gets the top-left corner of the rectangle //! \return A point representing the Top Left corner of the CRect CPoint TopLeft(void) const { return CPoint(m_Left, m_Top); } + //! Gets the top-right corner of the rectangle //! \return A point representing the Top Right corner of the CRect CPoint TopRight(void) const { return CPoint(m_Right, m_Top); } + //! Gets the bottom left corner of the rectangle //! \return A point representing the Bottom Left corner of the CRect CPoint BottomLeft(void) const { return CPoint(m_Left, m_Bottom); } + //! Gets the bottom-right corner of the rectangle //! \return A point representing the Bottom Right corner of the CRect CPoint BottomRight(void) const { return CPoint(m_Right, m_Bottom); } ! //! Gets the center of the rectangle //! \return A point representing the center of the CRect CPoint Center(void) const { return CPoint((m_Left + m_Right) / 2, (m_Top + m_Bottom) / 2); } + //! Gets the left side's center of the rectangle //! \return A point representing the CenterLeft point of the CRect CPoint CenterLeft(void) const { return CPoint( m_Left, (m_Top + m_Bottom) / 2); } + //! Get the top's center of the rectangle //! \return A point representing the CenterTop point of the CRect CPoint CenterTop(void) const { return CPoint( (m_Left + m_Right) / 2, m_Top ); } + //! Gets the bottom's center of the rectangle //! \return A point representing the Bottom Left corner of the CRect CPoint CenterBottom(void) const { return CPoint( (m_Left + m_Right) / 2, m_Bottom ); } + //! Gets the right side's center of the rectangle //! \return A point representing the Bottom Right corner of the CRect CPoint CenterRight(void) const { return CPoint( m_Right, (m_Top + m_Bottom) / 2); } *************** *** 124,130 **** --- 136,144 ---- SDL_Rect SDLRect(void) const; + //! Gets the width of the rectangle //! \return The width (along the X axis) of the CRect int Width(void) const { return abs(m_Right - m_Left + 1); } + //! Gets the height of the rectangle //! \return The height (along the Y axis) of the CRect int Height(void) const { return abs(m_Bottom - m_Top + 1); } *************** *** 182,186 **** }; ! //! \brief The HitTest will test to see where a point is in relation to the rect //! \param p The point to test against the CRect //! \return The appropriate values of the ERelativePosition enum are ORed together --- 196,200 ---- }; ! //! The HitTest will test to see where a point is in relation to the rect //! \param p The point to test against the CRect //! \return The appropriate values of the ERelativePosition enum are ORed together Index: wg_error.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_error.h,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** wg_error.h 2 Apr 2004 17:26:13 -0000 1.12 --- wg_error.h 3 Jun 2004 19:10:52 -0000 1.13 *************** *** 39,42 **** --- 39,43 ---- { public: + //! Standard constructor //! \param sWhat A string for more information on what caused the exception Wg_Ex_Base(const std::string& sWhat) : m_sWhat(sWhat) { } *************** *** 45,51 **** --- 46,54 ---- virtual ~Wg_Ex_Base(void) throw() { } + //! Gets a text description of the exception //! \return A string describing what caused the exception virtual const char* what() const throw() { return m_sWhat.c_str(); } + //! Gets a text description of the exception //! \return A std::string reference describing what caused the exception virtual const std::string& std_what() const throw() { return m_sWhat; } *************** *** 60,63 **** --- 63,67 ---- { public: + //! Standard constructor //! \param sWhat A string for more information on what caused the exception Wg_Ex_SDL(const std::string& sWhat) : Wg_Ex_Base(sWhat) { } *************** *** 69,72 **** --- 73,77 ---- { public: + //! Standard constructor //! \param sWhat A string for more information on what caused the exception Wg_Ex_FreeType(const std::string& sWhat) : Wg_Ex_Base(sWhat) { } *************** *** 78,81 **** --- 83,87 ---- { public: + //! Standard constructor //! \param sWhat A string for more information on what caused the exception Wg_Ex_App(const std::string& sWhat) : Wg_Ex_Base(sWhat) { } *************** *** 87,90 **** --- 93,97 ---- { public: + //! Standard constructor //! \param sWhat A string for more information on what caused the exception Wg_Ex_Range(const std::string& sWhat) : Wg_Ex_Base(sWhat) { } Index: wg_menu.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_menu.h,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** wg_menu.h 2 Apr 2004 17:26:14 -0000 1.32 --- wg_menu.h 3 Jun 2004 19:10:52 -0000 1.33 *************** *** 90,93 **** --- 90,94 ---- void RemoveMenuItem(int iPosition); + //! Gets the number of items in a menu //! \return The number of items in the menu int GetMenuItemCount(void) const { return stdex::safe_static_cast<int>(m_MenuItems.size()); } *************** *** 228,231 **** --- 229,233 ---- bool IsInsideChild(const CPoint& Point) const; + //! Indicates if the popup menu has any popup parents //! \return true is the Popup menu doesn't have any popup parents bool IsRootPopup(void) { return !(dynamic_cast<CPopupMenu*>(m_pParentWindow)); } Index: wg_toolbar.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_toolbar.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** wg_toolbar.h 3 Jun 2004 18:40:52 -0000 1.13 --- wg_toolbar.h 3 Jun 2004 19:10:52 -0000 1.14 *************** *** 73,76 **** --- 73,77 ---- void Clear(void); + //! Gets the number of items on the toolbar (including spacers) //! \return The number of buttons in the toolbar unsigned int GetButtonCount(void) { return stdex::safe_static_cast<unsigned int>(m_vpButtons.size()); } Index: wg_dropdown.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_dropdown.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** wg_dropdown.h 2 Apr 2004 17:26:13 -0000 1.13 --- wg_dropdown.h 3 Jun 2004 19:10:52 -0000 1.14 *************** *** 81,84 **** --- 81,85 ---- void ClearItems(void) { m_pListBox->ClearItems(); } + //! Gets the current number of items in the listbox //! \return The number of items in the list int Size(void) { return m_pListBox->Size(); } Index: wg_resource_handle.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_resource_handle.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** wg_resource_handle.h 2 Apr 2004 17:26:14 -0000 1.17 --- wg_resource_handle.h 3 Jun 2004 19:10:52 -0000 1.18 *************** *** 50,53 **** --- 50,54 ---- CResourceHandle(TResourceId resId); + //! A copying constructor //! \param resHandle An existing resource handle that will be cloned CResourceHandle(const CResourceHandle& resHandle); *************** *** 56,62 **** --- 57,65 ---- virtual ~CResourceHandle(void); + //! Gets the resource ID of the handle //! \return The resource ID of the handle TResourceId GetResourceId(void) { return m_ResourceId; } + //! Gets the handle's internal reference count //! \return The reference count of the handle unsigned int GetRefCount(void) { return m_RefCountMap[m_ResourceId]; } *************** *** 87,90 **** --- 90,94 ---- CBitmapResourceHandle(TResourceId resId) : CResourceHandle(resId) { } + //! A copying constructor //! \param resHandle An existing resource handle that will be cloned CBitmapResourceHandle(const CBitmapResourceHandle& resHandle) : *************** *** 94,97 **** --- 98,102 ---- virtual ~CBitmapResourceHandle(void); + //! Gets the handle's bitmap //! \return An SDL_Surface pointer (the bitmap) SDL_Surface* Bitmap(void) const; *************** *** 133,136 **** --- 138,142 ---- CStringResourceHandle(TResourceId resId) : CResourceHandle(resId) { } + //! A copying constructor //! \param resHandle An existing resource handle that will be cloned CStringResourceHandle(const CStringResourceHandle& resHandle) : *************** *** 141,144 **** --- 147,151 ---- //! Returns the string + //! \return A string const std::string String(void) const; *************** *** 169,172 **** --- 176,180 ---- //! Returns the SDL Cursor pointer + //! \return A pointer to an SDL cursor object SDL_Cursor* Cursor(void) const; Index: wg_point.h =================================================================== RCS file: /cvsroot/wgui/wgui/includes/wg_point.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** wg_point.h 2 Apr 2004 17:26:14 -0000 1.16 --- wg_point.h 3 Jun 2004 19:10:52 -0000 1.17 *************** *** 60,66 **** --- 60,68 ---- void SetY(const int y) { m_YPos = y; } + //! Gets the X coordinate //! \return X coordinate int XPos(void) const { return m_XPos; } + //! Gets the Y coordinate //! \return Y coordinate int YPos(void) const { return m_YPos; } *************** *** 81,93 **** --- 83,99 ---- bool operator!=(const CPoint& p) const { return ((m_XPos != p.m_XPos) || (m_YPos != p.m_YPos)); } + //! Indicates if a point is to the left of the point //! \return true if the point is to the left of point p bool leftof(const CPoint& p) const { return (m_XPos < p.m_XPos); } + //! Indicates if a point is to the right of the point //! \return true if the point is to the right of point p bool rightof(const CPoint& p) const { return (m_XPos > p.m_XPos); } + //! Indicates if a point is above the point //! \return true if the point is above point p bool above(const CPoint& p) const { return (m_YPos < p.m_YPos); } + //! Indicates if a point is below the point //! \return true if the point is below point p bool below(const CPoint& p) const { return (m_YPos > p.m_YPos); } |