www.pudn.com > XRayImg.rar
To Read all the content
[file head]:
#include "stdafx.h"
#include "PPHtmlDrawer.h"
#include "atlconv.h" // for Unicode conversion - requires #include <afxdisp.h> // MFC OLE automation classes
#include <shellapi.h>
#pragma comment(lib, "comctl32.lib")
/*
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
*/
#define PPHTMLDRAWER_NO_HOVERLINK -2 //A hot area is not exist under the cursor
#define PPHTMLDRAWER_BREAK_CHARS _T(" -.,!:;)}]?") //A set of the chars to break line in the text wrap mode
enum {
MODE_DRAW = 0,
MODE_FIRSTPASS,
MODE_SECONDPASS
};
/*
#define m_szOffsetShadow.cx 4 //
#define m_szOffsetShadow.cy 4 //
#define m_szDepthShadow.cx 7 //
#define m_szDepthShadow.cy 7 //
#define PPHTMLDRAWER_SHADOW_COLOR RGB (64, 64, 64) //A gradient shadow's color
*/
/////////////////////////////////////////////////////////////////////////////
// CPPHtmlDrawer
CPPHtmlDrawer::CPPHtmlDrawer()
{
m_nNumPass = MODE_FIRSTPASS;
... ...
[file tail]:
... ...
if (sz.cx > nRealSize)
{
sResult = str.Left(i);
str = str.Mid(i);
::GetTextExtentPoint32(m_hDC, sResult, i, &amt;sz);
nRealSize = sz.cx;
return sResult;
} //if
} //for
::GetTextExtentPoint32(m_hDC, str, i, &amt;sz);
//RUS: Невозможно разбить строку, выводим целиком
sResult = str;
str.Empty();
}
else
{
//RUS: В отставшееся место текущей строки не влазит ни одного слова
sz.cx = 0;
} //if
}
else
{
sResult = str.Left(nLastIndex + 1);
str = str.Mid(nLastIndex + 1);
sResult.TrimRight();
::GetTextExtentPoint32(m_hDC, sResult, sResult.GetLength(), &amt;sz);
// str.TrimRight();
str.TrimLeft();
} //if
nRealSize = sz.cx;
return sResult;
} //End of GetWordWrap
int CPPHtmlDrawer::GetCountOfChars(CPPString str, TCHAR tchar /*= _T(' ')*/)
{
int nCount = 0;
//ENG:
//RUS:
for (int i = 0; i < str.GetLength(); i++)
{
if (tchar == str.GetAt(i))
nCount++;
} //if
return nCount;
}