📄 vmreportpage.cpp
字号:
}
/* End of function "VMPage::Print"
/*****************************************************************************/
/*****************************************************************************/
/*
FUNCTION NAME: VMPage::Print
DESCRIPTION: Prints into a region using user defined function for data
INPUT: pRegion -
row -
col -
TextFlags -
PointSize -
ID -
OUTPUT:
RETURNS: The next print line location in inches using the current
font size and line spacing
*/
double VMPage::Print( VMPrintRegion* pRegion, double row, double col, UINT TextFlags, int PointSize, int ID )
{
UINT OldColor;
UINT OldMode;
if ( pUserFunc == NULL )
{
return( 0 );
}
SaveState();
ConvertPosition( row, col );
m_PrtDesc.rc.top = (int)row + pRegion->FirstY;
m_PrtDesc.rc.bottom = pRegion->bottom;
m_PrtDesc.rc.right = pRegion->right;
m_PrtDesc.rc.left = pRegion->FirstX;
if ( pRegion->FillColor > FILL_NONE )
{
OldMode = m_PrtDesc.pDC->SetBkMode( TRANSPARENT );
}
if ( pRegion->FillColor > FILL_LTGRAY )
{
OldColor = SetColor( COLOR_WHITE );
}
int res = Print( pUserFunc( ID ),(int)col + pRegion->FirstX, TextFlags, PointSize );
if ( pRegion->FillColor > FILL_NONE )
{
m_PrtDesc.pDC->SetBkMode( OldMode );
}
if ( pRegion->FillColor > FILL_LTGRAY )
{
SetColor( OldColor );
}
int nLineSpacing = m_Spacing > 1
? (int)( ConvertToMappedUnits( m_PrtDesc.PointSize / 72.0, VERTRES ) * ( m_Spacing - 1 ) )
: 0;
RestoreState();
return( ConvertToInches( (int)( ( res-pRegion->FirstY ) + nLineSpacing ), VERTRES ) );
}
/* End of function "VMPage::Print"
/*****************************************************************************/
/*****************************************************************************/
/*
FUNCTION NAME: VMPage::PrintColumn
DESCRIPTION: Prints text clipped to a bounding rectangle. See the header
for default parameters. Allows for newspaper like columns
INPUT: Top -
Left -
Bottom -
Right -
flags -
PointSize -
Text -
OUTPUT:
RETURNS: void
*/
void VMPage::PrintColumn( int Top, int Left, int Bottom, int Right, UINT flags, int PointSize, LPCSTR Text )
{
if ( Left > SetRightMargin( 0 ) )
{
return;
}
if ( Top > SetBottomMargin( 0 ) )
{
return;
}
SaveState();
m_PrtDesc.Text = Text;
if( PointSize > 0 )
{
m_PrtDesc.PointSize = PointSize;
}
if ( flags != IGNORE_PARAM )
{
m_PrtDesc.uTextFlags = flags;
}
m_PrtDesc.rc.left = Left;
m_PrtDesc.rc.top = Top;
m_PrtDesc.rc.right = Right;
m_PrtDesc.rc.bottom = Bottom;
ThePrinter.PrintText( &m_PrtDesc, m_Spacing );
m_nNextPos = m_PrtDesc.m_NextCharPos;
RestoreState();
}
/* End of function "VMPage::PrintColumn"
/*****************************************************************************/
/*****************************************************************************/
/*
FUNCTION NAME: VMPage::PrintColumn
DESCRIPTION: Prints text clipped to a bounding rectangle. See the header
for default parameters. Allows for newspaper like columns
INPUT: Top -
Left -
Bottom -
Right -
flags -
PointSize -
Text -
OUTPUT:
RETURNS: void
*/
void VMPage::PrintColumn( double Top, double Left, double Bottom, double Right, UINT flags, int PointSize, LPCSTR Text )
{
if ( Left > SetRightMargin( 0.0 ) )
{
return;
}
if ( Top > SetBottomMargin( 0.0 ) )
{
return;
}
SaveState();
m_PrtDesc.Text = Text;
ConvertArea( Top, Left, Bottom, Right );
if ( PointSize > 0 )
{
m_PrtDesc.PointSize = PointSize;
}
if( flags != IGNORE_PARAM )
{
m_PrtDesc.uTextFlags = flags;
}
m_PrtDesc.rc.left = (int)Left;
m_PrtDesc.rc.top = (int)Top;
m_PrtDesc.rc.right = (int)Right;
m_PrtDesc.rc.bottom = (int)Bottom;
ThePrinter.PrintText( &m_PrtDesc, m_Spacing );
m_nNextPos = m_PrtDesc.m_NextCharPos;
RestoreState();
}
/* End of function "VMPage::PrintColumn"
/*****************************************************************************/
/*****************************************************************************/
/*
FUNCTION NAME: VMPage::PrintColumn
DESCRIPTION: Prints text clipped to a bounding rectangle. See the header
for default parameters. Allows for newspaper like columns
using the user hook function to supply the text
INPUT: Top -
Left -
Bottom -
Right -
flags -
PointSize -
ID -
OUTPUT:
RETURNS: void
*/
void VMPage::PrintColumn( int Top, int Left, int Bottom, int Right, UINT flags, int PointSize, int ID )
{
if ( pUserFunc == NULL )
{
return;
}
if ( Left > SetRightMargin( 0 ) )
{
return;
}
if ( Top > SetBottomMargin( 0 ) )
{
return;
}
SaveState();
m_PrtDesc.Text = pUserFunc( ID );
if ( PointSize > 0 )
{
m_PrtDesc.PointSize = PointSize;
}
if ( flags != IGNORE_PARAM )
{
m_PrtDesc.uTextFlags = flags;
}
m_PrtDesc.rc.left = Left;
m_PrtDesc.rc.top = Top;
m_PrtDesc.rc.right = Right;
m_PrtDesc.rc.bottom = Bottom;
ThePrinter.PrintText( &m_PrtDesc, m_Spacing );
m_nNextPos = m_PrtDesc.m_NextCharPos;
RestoreState();
}
/* End of function "VMPage::PrintColumn"
/*****************************************************************************/
/*****************************************************************************/
/*
FUNCTION NAME: VMPage::PrintColumn
DESCRIPTION: Prints text clipped to a bounding rectangle. See the header
for default parameters. Allows for newspaper like columns
using the user hook function to supply the text
INPUT: Top -
Left -
Bottom -
Right -
flags -
PointSize -
ID -
OUTPUT:
RETURNS: void
*/
void VMPage::PrintColumn( double Top, double Left, double Bottom, double Right, UINT flags, int PointSize, int ID )
{
if ( pUserFunc == NULL )
{
return;
}
if ( Left > SetRightMargin( 0.0 ) )
{
return;
}
if ( Top > SetBottomMargin( 0.0 ) )
{
return;
}
SaveState();
m_PrtDesc.Text = pUserFunc( ID );
ConvertArea( Top, Left, Bottom, Right );
if ( PointSize > 0 )
{
m_PrtDesc.PointSize = PointSize;
}
if ( flags != IGNORE_PARAM )
{
m_PrtDesc.uTextFlags = flags;
}
m_PrtDesc.rc.left = (int)Left;
m_PrtDesc.rc.top = (int)Top;
m_PrtDesc.rc.right = (int)Right;
m_PrtDesc.rc.bottom = (int)Bottom;
ThePrinter.PrintText( &m_PrtDesc, m_Spacing );
m_nNextPos = m_PrtDesc.m_NextCharPos;
RestoreState();
}
/* End of function "VMPage::PrintColumn"
/*****************************************************************************/
/*****************************************************************************/
/*
FUNCTION NAME: VMPage::PrintColumn
DESCRIPTION: Prints text clipped to a bounding rectangle in a region.
See the header for default parameters. Allows for newspaper
like columns
INPUT: pRegion -
Top -
Left -
Bottom -
Right -
flags -
PointSize -
Text -
OUTPUT:
RETURNS: void -
*/
void VMPage::PrintColumn( VMPrintRegion* pRegion, int Top, int Left, int Bottom, int Right, UINT flags,int PointSize, LPCSTR Text )
{
UINT OldColor;
UINT OldMode;
SaveState();
m_PrtDesc.Text = Text;
if ( PointSize > 0 )
{
m_PrtDesc.PointSize = PointSize;
}
if ( flags != IGNORE_PARAM )
{
m_PrtDesc.uTextFlags = flags;
}
m_PrtDesc.rc.left = Left + pRegion->FirstX;
m_PrtDesc.rc.top = Top + pRegion->FirstY;
m_PrtDesc.rc.right = Right + pRegion->FirstX;
m_PrtDesc.rc.bottom = Bottom + pRegion->FirstY;
if ( m_PrtDesc.rc.bottom > pRegion->bottom )
{
m_PrtDesc.rc.bottom=pRegion->bottom;
}
if ( m_PrtDesc.rc.left > pRegion->right )
{
m_PrtDesc.rc.left=pRegion->right;
}
if ( m_PrtDesc.rc.top > pRegion->bottom )
{
m_PrtDesc.rc.top=pRegion->bottom;
}
if ( m_PrtDesc.rc.right > pRegion->right )
{
m_PrtDesc.rc.right=pRegion->right;
}
if ( pRegion->FillColor > FILL_NONE )
{
OldMode = m_PrtDesc.pDC->SetBkMode( TRANSPARENT );
}
if ( pRegion->FillColor > FILL_LTGRAY )
{
OldColor= SetColor( COLOR_WHITE );
}
ThePrinter.PrintText( &m_PrtDesc, m_Spacing );
if ( pRegion->FillColor > FILL_NONE )
{
m_PrtDesc.pDC->SetBkMode( OldMode );
}
if ( pRegion->FillColor > FILL_LTGRAY )
{
SetColor( OldColor );
}
RestoreState();
}
/* End of function "VMPage::PrintColumn"
/*****************************************************************************/
/*****************************************************************************/
/*
FUNCTION NAME: VMPage::PrintColumn
DESCRIPTION: Prints text clipped to a bounding rectangle in a region.
See the header for default parameters. Allows for newspaper
like columns
INPUT: pRegion -
Top -
Left -
Bottom -
Right -
flags -
PointSize -
Text -
OUTPUT:
RETURNS: void -
*/
void VMPage::PrintColumn( VMPrintRegion* pRegion, double Top, double Left, double Bottom, double Right, UINT flags, int PointSize, LPCSTR Text )
{
UINT OldColor;
UINT OldMode;
SaveState();
m_PrtDesc.Text = Text;
ConvertArea( Top, Left, Bottom, Right );
if ( PointSize > 0 )
{
m_PrtDesc.PointSize = PointSize;
}
if ( flags != IGNORE_PARAM )
{
m_PrtDesc.uTextFlags = flags;
}
m_PrtDesc.rc.left = (int)Left + pRegion->FirstX;
m_PrtDesc.rc.top = (int)Top + pRegion->FirstY;
m_PrtDesc.rc.right = (int)Right + pRegion->FirstX;
m_PrtDesc.rc.bottom = (int)Bottom + pRegion->FirstY;
if ( m_PrtDesc.rc.bottom > pRegion->bottom )
{
m_PrtDesc.rc.bottom = pRegion->bottom;
}
if ( m_PrtDesc.rc.left > pRegion->right )
{
m_PrtDesc.rc.left = pRegion->right;
}
if ( m_PrtDesc.rc.top > pRegion->bottom )
{
m_PrtDesc.rc.top = pRegion->bottom;
}
if ( m_PrtDesc.rc.right > pRegion->right )
{
m_PrtDesc.rc.right = pRegion->right;
}
if ( pRegion->FillColor > FILL_NONE )
{
OldMode = m_PrtDesc.pDC->SetBkMode( TRANSPARENT );
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -