[Wgui-cvs] wgui/src wg_button.cpp,1.38,1.39 wg_editbox.cpp,1.94,1.95 wg_frame.cpp,1.24,1.25 wg_group
Status: Beta
Brought to you by:
greenwire
|
From: Rob W. <gre...@us...> - 2004-11-23 23:06:35
|
Update of /cvsroot/wgui/wgui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23873/src Modified Files: wg_button.cpp wg_editbox.cpp wg_frame.cpp wg_groupbox.cpp wg_label.cpp wg_painter.cpp wg_tooltip.cpp Log Message: CFrame fixes. Index: wg_button.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_button.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** wg_button.cpp 16 Jul 2004 16:41:36 -0000 1.38 --- wg_button.cpp 23 Nov 2004 23:05:10 -0000 1.39 *************** *** 104,108 **** } SubRect.Grow(-2); ! m_pRenderedString->Draw(m_pSDLSurface, SubRect, FontCenterPoint, FontColor); } --- 104,111 ---- } SubRect.Grow(-2); ! if (m_pRenderedString.get()) ! { ! m_pRenderedString->Draw(m_pSDLSurface, SubRect, FontCenterPoint, FontColor); ! } } Index: wg_painter.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_painter.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** wg_painter.cpp 2 Apr 2004 17:26:16 -0000 1.21 --- wg_painter.cpp 23 Nov 2004 23:05:16 -0000 1.22 *************** *** 100,106 **** void CPainter::DrawRect(const CRect& Rect, bool bFilled, const CRGBColor& BorderColor, const CRGBColor& FillColor) { ! CRect RealRect((m_pWindow != 0) ? Rect + m_pWindow->GetClientRect().TopLeft() : Rect); if (m_pWindow) { RealRect.ClipTo(m_pWindow->GetClientRect()); } --- 100,107 ---- void CPainter::DrawRect(const CRect& Rect, bool bFilled, const CRGBColor& BorderColor, const CRGBColor& FillColor) { ! CRect RealRect(Rect); if (m_pWindow) { + RealRect = Rect + m_pWindow->GetClientRect().TopLeft(); RealRect.ClipTo(m_pWindow->GetClientRect()); } Index: wg_editbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_editbox.cpp,v retrieving revision 1.94 retrieving revision 1.95 diff -C2 -d -r1.94 -r1.95 *** wg_editbox.cpp 1 Sep 2004 18:57:31 -0000 1.94 --- wg_editbox.cpp 23 Nov 2004 23:05:11 -0000 1.95 *************** *** 276,281 **** } ! m_pRenderedString->Draw(m_pSDLSurface, SubRect, ! CPoint(SubRect.Left() + m_ScrollOffset, SubRect.Bottom() - m_pRenderedString->GetMaxFontHeight() / 4), FontColor); } --- 276,284 ---- } ! if (m_pRenderedString.get()) ! { ! m_pRenderedString->Draw(m_pSDLSurface, SubRect, ! CPoint(SubRect.Left() + m_ScrollOffset, SubRect.Bottom() - m_pRenderedString->GetMaxFontHeight() / 4), FontColor); ! } } Index: wg_label.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_label.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** wg_label.cpp 16 Jul 2004 16:41:36 -0000 1.20 --- wg_label.cpp 23 Nov 2004 23:05:16 -0000 1.21 *************** *** 61,65 **** CWindow::Draw(); ! m_pRenderedString->Draw(m_pSDLSurface, m_WindowRect.SizeRect(), m_WindowRect.SizeRect().BottomLeft(), m_FontColor); } --- 61,68 ---- CWindow::Draw(); ! if (m_pRenderedString.get()) ! { ! m_pRenderedString->Draw(m_pSDLSurface, m_WindowRect.SizeRect(), m_WindowRect.SizeRect().BottomLeft(), m_FontColor); ! } } Index: wg_tooltip.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_tooltip.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** wg_tooltip.cpp 19 Jul 2004 21:49:58 -0000 1.26 --- wg_tooltip.cpp 23 Nov 2004 23:05:17 -0000 1.27 *************** *** 88,92 **** CRect SubRect(m_WindowRect.SizeRect()); SubRect.Grow(-2); ! m_pRenderedString->Draw(m_pSDLSurface, SubRect, SubRect.TopLeft(), m_FontColor); } --- 88,95 ---- CRect SubRect(m_WindowRect.SizeRect()); SubRect.Grow(-2); ! if (m_pRenderedString.get()) ! { ! m_pRenderedString->Draw(m_pSDLSurface, SubRect, SubRect.TopLeft(), m_FontColor); ! } } Index: wg_frame.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_frame.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** wg_frame.cpp 30 Jun 2004 22:31:01 -0000 1.24 --- wg_frame.cpp 23 Nov 2004 23:05:16 -0000 1.25 *************** *** 40,49 **** m_pSavedSurface(0) { - m_sWindowText = sTitle; - m_pFrameCloseButton = new CPictureButton(CRect(0, 0, 12, 12), - this, CwgBitmapResourceHandle(WGRES_X_BITMAP)); - - SetWindowRect(WindowRect); // must be done after the buttons are created - if (pFontEngine) { --- 40,43 ---- *************** *** 54,60 **** --- 48,61 ---- m_pFontEngine = CApplication::Instance()->GetDefaultFontEngine(); } + + m_sWindowText = sTitle; + m_pFrameCloseButton = new CPictureButton(CRect(0, 0, 12, 12), + this, CwgBitmapResourceHandle(WGRES_X_BITMAP)); + std::auto_ptr<CRenderedString> pRenderedString(new CRenderedString(m_pFontEngine, m_sWindowText, CRenderedString::VALIGN_CENTER)); m_pRenderedString = pRenderedString; + SetWindowRect(WindowRect); // must be done after the buttons are created, and after the CRenderedString is created + CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_BUTTONUP); CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_MOVE); *************** *** 74,82 **** CPainter Painter(m_pSDLSurface); - Painter.DrawRect(m_WindowRect.SizeRect(), false, COLOR_LIGHTGRAY); - Painter.DrawHLine(0, m_WindowRect.Width(), m_WindowRect.Height(), COLOR_DARKGRAY); - Painter.DrawVLine(0, m_WindowRect.Height(), m_WindowRect.Width(), COLOR_DARKGRAY); CRect SubRect(m_WindowRect.SizeRect()); SubRect.Grow(-1); Painter.DrawRect(SubRect, false, COLOR_BLACK); Painter.DrawRect(m_TitleBarRect, true, m_TitleBarColor, m_TitleBarColor); --- 75,84 ---- CPainter Painter(m_pSDLSurface); CRect SubRect(m_WindowRect.SizeRect()); SubRect.Grow(-1); + Painter.DrawRect(SubRect, false, COLOR_LIGHTGRAY); + Painter.DrawHLine(0, SubRect.Width(), SubRect.Height(), COLOR_DARKGRAY); + Painter.DrawVLine(0, SubRect.Height(), SubRect.Width(), COLOR_DARKGRAY); + SubRect.Grow(-1); Painter.DrawRect(SubRect, false, COLOR_BLACK); Painter.DrawRect(m_TitleBarRect, true, m_TitleBarColor, m_TitleBarColor); *************** *** 85,89 **** TextClipRect.SetRight(TextClipRect.Right() - 16); TextClipRect.Grow(-1); ! m_pRenderedString->Draw(m_pSDLSurface, TextClipRect, m_TitleBarRect.TopLeft() + CPoint(6, m_iTitleBarHeight / 2), m_TitleBarTextColor); } --- 87,94 ---- TextClipRect.SetRight(TextClipRect.Right() - 16); TextClipRect.Grow(-1); ! if (m_pRenderedString.get()) ! { ! m_pRenderedString->Draw(m_pSDLSurface, TextClipRect, m_TitleBarRect.TopLeft() + CPoint(6, m_iTitleBarHeight / 2), m_TitleBarTextColor); ! } } *************** *** 117,130 **** { CWindow::SetWindowRect(WindowRect); ! m_TitleBarRect = CRect(2, 2, WindowRect.Width() - 3, m_iTitleBarHeight) + WindowRect.TopLeft(); ! m_pFrameCloseButton->SetWindowRect(CRect(WindowRect.Width() - 16, m_iTitleBarHeight / 2 - 5, WindowRect.Width() - 4, m_iTitleBarHeight / 2 + 7) + WindowRect.TopLeft()); ! m_ClientRect = CRect(2, m_iTitleBarHeight + 2, WindowRect.Height() - m_iTitleBarHeight - 1, WindowRect.Width() - 1); ! } ! ! ! void CFrame::MoveWindow(const CPoint& MoveDistance) ! { ! CWindow::MoveWindow(MoveDistance); ! m_TitleBarRect = m_TitleBarRect + MoveDistance; } --- 122,128 ---- { CWindow::SetWindowRect(WindowRect); ! m_TitleBarRect = CRect(2, 0, WindowRect.Width() - 3, m_iTitleBarHeight); ! m_pFrameCloseButton->SetWindowRect(CRect(WindowRect.Width() - 20, (-m_iTitleBarHeight / 2) - 5, WindowRect.Width() - 8, (-m_iTitleBarHeight / 2) + 7)); ! m_ClientRect = CRect(2, m_iTitleBarHeight + 2, WindowRect.Width() - 1, WindowRect.Height() - 1); } Index: wg_groupbox.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_groupbox.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** wg_groupbox.cpp 16 Jul 2004 16:41:36 -0000 1.18 --- wg_groupbox.cpp 23 Nov 2004 23:05:16 -0000 1.19 *************** *** 71,75 **** Painter.DrawRect(CRect(CPoint(6, 0), CPoint(14, 0) + Dims), true, m_BackgroundColor, m_BackgroundColor); ! m_pRenderedString->Draw(m_pSDLSurface, m_WindowRect.SizeRect(), CPoint(10, 0), m_FontColor); } --- 71,79 ---- Painter.DrawRect(CRect(CPoint(6, 0), CPoint(14, 0) + Dims), true, m_BackgroundColor, m_BackgroundColor); ! ! if (m_pRenderedString.get()) ! { ! m_pRenderedString->Draw(m_pSDLSurface, m_WindowRect.SizeRect(), CPoint(10, 0), m_FontColor); ! } } |