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

Method AddText

ReClass/CNodeBase.cpp:38–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38int CNodeBase::AddText( const PVIEWINFO View, int x, int y, DWORD color, int HitID, const wchar_t* fmt, ... )
39{
40 if (fmt == NULL)
41 return x;
42
43 wchar_t wcsbuf[1024] = { 0 };
44
45 va_list va_alist;
46 va_start( va_alist, fmt );
47 _vsnwprintf( wcsbuf, ARRAYSIZE( wcsbuf ), fmt, va_alist );
48 va_end( va_alist );
49
50 int width = (int)(wcslen( wcsbuf )) * g_FontWidth;
51
52 if ((y >= -(g_FontHeight)) && (y + g_FontHeight <= View->ClientRect->bottom + g_FontHeight))
53 {
54 CRect pos;
55 if (HitID != HS_NONE)
56 {
57 if (width >= g_FontWidth * 2)
58 pos.SetRect( x, y, x + width, y + g_FontHeight );
59 else
60 pos.SetRect( x, y, x + g_FontWidth * 2, y + g_FontHeight );
61
62 AddHotSpot( View, pos, wcsbuf, HitID, HS_EDIT );
63 }
64
65 pos.SetRect( x, y, 0, 0 );
66
67 View->Dc->SetTextColor( color );
68 View->Dc->SetBkMode( TRANSPARENT );
69 View->Dc->DrawText( wcsbuf, pos, DT_LEFT | DT_NOCLIP | DT_NOPREFIX );
70 }
71
72 return x + width;
73}
74
75int CNodeBase::AddText( const PVIEWINFO View, int x, int y, DWORD color, int HitID, const char* fmt, ... )
76{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected