[Wgui-cvs] wgui/src wg_tooltip.cpp,1.21,1.22 wg_view.cpp,1.39,1.40 wg_window.cpp,1.48,1.49
Status: Beta
Brought to you by:
greenwire
|
From: Rob W. <gre...@us...> - 2004-07-06 16:32:35
|
Update of /cvsroot/wgui/wgui/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10078/src Modified Files: 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.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** wg_view.cpp 30 Jun 2004 22:31:02 -0000 1.39 --- wg_view.cpp 6 Jul 2004 16:32:25 -0000 1.40 *************** *** 44,48 **** m_bFullScreen(bFullScreen), m_pMenu(0), ! m_pFloatingWindow(0) { if (m_pInstance) --- 44,49 ---- m_bFullScreen(bFullScreen), m_pMenu(0), ! m_pFloatingWindow(0), ! m_pScreenSurface(0) { if (m_pInstance) *************** *** 57,62 **** CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_BUTTONUP, CMessageServer::PRIORITY_FIRST); ! SetWindowRect( WindowRect ); ! SetWindowText( sTitle ); CApplication::Instance()->GetApplicationLog().AddLogEntry("Created new CView : " + sTitle, APP_LOG_INFO); Draw(); --- 58,63 ---- CMessageServer::Instance().RegisterMessageClient(this, CMessage::MOUSE_BUTTONUP, CMessageServer::PRIORITY_FIRST); ! SetWindowRect(WindowRect); ! SetWindowText(sTitle); CApplication::Instance()->GetApplicationLog().AddLogEntry("Created new CView : " + sTitle, APP_LOG_INFO); Draw(); *************** *** 142,146 **** if (pMessage->Destination() == this || pMessage->Destination() == 0) { ! PaintToSurface(*m_pScreenSurface, CPoint(0, 0)); SDL_UpdateRect(m_pScreenSurface, 0, 0, 0, 0); bHandled = true; --- 143,153 ---- if (pMessage->Destination() == this || pMessage->Destination() == 0) { ! SDL_Surface* pFloatingSurface = SDL_CreateRGBSurface(SDL_SWSURFACE, m_WindowRect.Width(), m_WindowRect.Height(), ! 32, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000); ! PaintToSurface(*m_pScreenSurface, *pFloatingSurface, CPoint(0, 0)); ! SDL_Rect SourceRect = CRect(m_WindowRect.SizeRect()).SDLRect(); ! SDL_Rect DestRect = CRect(m_WindowRect.SizeRect()).SDLRect(); ! SDL_BlitSurface(pFloatingSurface, &SourceRect, m_pScreenSurface, &DestRect); ! SDL_FreeSurface(pFloatingSurface); SDL_UpdateRect(m_pScreenSurface, 0, 0, 0, 0); bHandled = true; Index: wg_window.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_window.cpp,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** wg_window.cpp 6 Jul 2004 05:30:38 -0000 1.48 --- wg_window.cpp 6 Jul 2004 16:32:25 -0000 1.49 *************** *** 248,252 **** ! void CWindow::PaintToSurface(SDL_Surface& Surface, const CPoint& Offset) const { if (m_bVisible) --- 248,252 ---- ! void CWindow::PaintToSurface(SDL_Surface& ScreenSurface, SDL_Surface& FloatingSurface, const CPoint& Offset) const { if (m_bVisible) *************** *** 254,262 **** 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); } } --- 254,262 ---- SDL_Rect SourceRect = CRect(m_WindowRect.SizeRect()).SDLRect(); SDL_Rect DestRect = CRect(m_WindowRect + Offset).SDLRect(); ! SDL_BlitSurface(m_pSDLSurface, &SourceRect, &ScreenSurface, &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(ScreenSurface, FloatingSurface, NewOffset); } } Index: wg_tooltip.cpp =================================================================== RCS file: /cvsroot/wgui/wgui/src/wg_tooltip.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** wg_tooltip.cpp 6 Jul 2004 05:30:38 -0000 1.21 --- wg_tooltip.cpp 6 Jul 2004 16:32:25 -0000 1.22 *************** *** 98,101 **** --- 98,117 ---- + void CToolTip::PaintToSurface(SDL_Surface& ScreenSurface, SDL_Surface& FloatingSurface, const CPoint& Offset) const + { + if (m_bVisible) + { + SDL_Rect SourceRect = CRect(m_WindowRect.SizeRect()).SDLRect(); + SDL_Rect DestRect = CRect(m_WindowRect + Offset).SDLRect(); + SDL_BlitSurface(m_pSDLSurface, &SourceRect, &FloatingSurface, &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(ScreenSurface, FloatingSurface, NewOffset); + } + } + } + + bool CToolTip::HandleMessage(CMessage* pMessage) { |