MCPcopy Create free account
hub / github.com/ajkhoury/ReClassEx / OnPaint

Method OnPaint

ReClass/CClassView.cpp:716–845  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

714}
715
716void CClassView::OnPaint( )
717{
718 CPaintDC PaintDC( this ); // draw context for painting
719 CMemDC MemDC( PaintDC, this );
720 CDC *Dc = &MemDC.GetDC( );
721
722 VIEWINFO ViewInfo;
723 ULONG ClassSize;
724 int XPos, YPos;
725 NODESIZE DrawMax;
726 CRect ClientRect;
727
728 GetClientRect( &ClientRect );
729 //ClientRect.bottom += g_FontHeight;
730
731 Dc->FillSolidRect( &ClientRect, g_crBackground );
732
733 if (m_pClass != NULL)
734 {
735 Dc->SelectObject( &g_ViewFont );
736
737 m_Hotspots.clear( );
738
739 ClassSize = m_pClass->GetMemorySize( );
740 m_Memory.SetSize( ClassSize );
741 ReClassReadMemory( (LPVOID)m_pClass->GetOffset( ), m_Memory.Data( ), ClassSize );
742
743 #ifdef _DEBUG
744 ViewInfo.pChildView = this; // For testing
745 #endif
746 ViewInfo.Address = m_pClass->GetOffset( );
747 ViewInfo.Data = m_Memory.Data( );
748 ViewInfo.Classes = &g_ReClassApp.m_Classes;
749 ViewInfo.ClientRect = &ClientRect;
750 ViewInfo.Dc = Dc;
751 ViewInfo.Level = 0;
752 ViewInfo.Hotspots = &m_Hotspots;
753 ViewInfo.MultiSelected = (BOOL)(m_Selected.size( ) > 1);
754
755 if (m_Scroll.IsWindowVisible( ))
756 {
757 ViewInfo.ClientRect->right -= SB_WIDTH;
758 ViewInfo.ClientRect->bottom -= SB_WIDTH;
759 }
760
761 YPos = m_Scroll.GetScrollPos( ) * g_FontHeight;
762 XPos = m_HScroll.GetScrollPos( );
763
764 //
765 // Do the draw!
766 //
767 DrawMax = m_pClass->Draw( &ViewInfo, 0 - XPos, -YPos );
768
769 // Dirty hack, fix Draw methods
770 DrawMax.x += XPos;
771 DrawMax.y += YPos; //+ g_FontHeight;
772
773 if (m_pClass->m_RequestPosition != -1)

Callers

nothing calls this directly

Calls 13

ReClassReadMemoryFunction · 0.85
clearMethod · 0.80
GetOffsetMethod · 0.80
DataMethod · 0.80
SetScrollInfoMethod · 0.80
WidthMethod · 0.80
GetChildViewMethod · 0.80
GetMemorySizeMethod · 0.45
SetSizeMethod · 0.45
sizeMethod · 0.45
DrawMethod · 0.45
HeightMethod · 0.45

Tested by

no test coverage detected