⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 vmreportpage.cpp

📁 TOOL (Tiny Object Oriented Language) is an easily-embedded, object-oriented, C++-like-language inter
💻 CPP
📖 第 1 页 / 共 5 页
字号:
  
  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 );     
  }

  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 using the user supplied function to supply the
                     text

             INPUT:  pRegion - 
                     Top - 
                     Left - 
                     Bottom - 
                     Right - 
                     flags - 
                     PointSize - 
                     ID - 
            OUTPUT:  

           RETURNS:  void  - 
*/
void VMPage::PrintColumn( VMPrintRegion* pRegion, int Top, int Left, int Bottom, int Right, UINT flags, int PointSize, int ID )
{
  UINT OldColor;
  UINT OldMode;

  if ( pUserFunc == NULL )
  {
    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   + 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 using the user supplied function to supply the
                     text

             INPUT:  pRegion - 
                     Top - 
                     Left - 
                     Bottom - 
                     Right - 
                     flags - 
                     PointSize - 
                     ID - 
            OUTPUT:  

           RETURNS:  void  - 
*/
void VMPage::PrintColumn( VMPrintRegion* pRegion, double Top, double Left, double Bottom, double Right, UINT flags, int PointSize, int ID )
{
  UINT OldColor;
  UINT OldMode;

  if ( pUserFunc == NULL )
  {
    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   + 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 );     
  }
  
  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 );     
  }

  m_nNextPos = m_PrtDesc.m_NextCharPos;

  RestoreState();
}
/* End of function "VMPage::PrintColumn"
/*****************************************************************************/


/*****************************************************************************/
/*

     FUNCTION NAME:  VMPage::PrintRotatedText

       DESCRIPTION:  Prints rotated text

             INPUT:  Top - 
                     Left - 
                     Bottom - 
                     Right - 
                     flags - 
                     PointSize - 
                     Text - 
                     angle - 
            OUTPUT:  

           RETURNS:  void  
*/
void VMPage::PrintRotatedText( int Top, int Left, int Bottom, int Right, UINT flags, int PointSize, LPCSTR Text, int angle )
{
  SaveState();

  m_PrtDesc.Text = Text;

  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.RotationAngle = angle;
  ThePrinter.PrintText( &m_PrtDesc, m_Spacing );                       
  m_nNextPos = m_PrtDesc.m_NextCharPos;

  RestoreState();
}
/* End of function "VMPage::PrintRotatedText"
/*****************************************************************************/


/*****************************************************************************/
/*

     FUNCTION NAME:  VMPage::PrintRotatedText

       DESCRIPTION:  Prints rotated text

             INPUT:  Top - 
                     Left - 
                     Bottom - 
                     Right - 
                     flags - 
                     PointSize - 
                     Text - 
                     angle - 
            OUTPUT:  

           RETURNS:  void  
*/
void VMPage::PrintRotatedText( double Top, double Left, double Bottom, double Right, UINT flags, int PointSize, LPCSTR Text, int angle )
{
  SaveState();
  ConvertArea( Top, Left, Bottom, Right);
  PrintRotatedText( (int)Top, (int)Left, (int)Bottom, (int)Right, flags, PointSize, Text, angle );
  RestoreState();
}
/* End of function "VMPage::PrintRotatedText"
/*****************************************************************************/


///////////////////////////////////////////////////////////////////////////////
//
//           D R A W I N G   R O U T I N E S   ( S H A P E S )
//
///////////////////////////////////////////////////////////////////////////////


/*****************************************************************************/
/*

     FUNCTION NAME:  VMPage::Line

       DESCRIPTION:  Draws a line from point top,left to bottom,right 

             INPUT:  top - 
                     left - 
                     bottom - 
                     right - 
                     LineSize - 
                     flag - 
            OUTPUT:  

           RETURNS:  void  
*/
void VMPage::Line( int top, int left, int bottom, int right, int LineSize, UINT flag )
{     
  SaveState();

  if ( flag != IGNORE_PARAM )
  {
    m_PrtDesc.uPenFlags = flag;
  }

  m_PrtDesc.rc.top    = top;
  m_PrtDesc.rc.bottom = bottom;
  m_PrtDesc.rc.left   = left;
  m_PrtDesc.rc.right  = right;

  ThePrinter.DrawLine( &m_PrtDesc, LineSize );

  RestoreState();
}  
/* End of function "VMPage::Line"
/*****************************************************************************/


/*****************************************************************************/
/*

     FUNCTION NAME:  VMPage::Line

       DESCRIPTION:  Draws a line from point top,left to bottom,right 

             INPUT:  top - 
                     left - 
                     bottom - 
                     right - 
                     LineSize - 
                     flag - 
            OUTPUT:  

           RETURNS:  void  
*/
void VMPage::Line( double top, double left, double bottom, double right, int LineSize, UINT flag )
{           
  SaveState();

  if ( flag != IGNORE_PARAM )
  {
    m_PrtDesc.uPenFlags = flag;
  }

  ConvertArea( top, left, bottom, right );

  m_PrtDesc.rc.top    =(int) top;
  m_PrtDesc.rc.bottom =(int) bottom;
  m_PrtDesc.rc.left   =(int) left;
  m_PrtDesc.rc.right  =(int) right;

  ThePrinter.DrawLine( &m_PrtDesc, LineSize );

  RestoreState();
}  
/* End of function "VMPage::Line"
/*****************************************************************************/


/*****************************************************************************/
/*

     FUNCTION NAME:  VMPage::Box

       DESCRIPTION:  Draw a rectangle using parameters passed

             INPUT:  top - 
                     left - 
                     bottom - 
                     right - 
                     LineSize - 
                     Fillflags - 
                     PenFlags - 
            OUTPUT:  

           RETURNS:  void  
*/
void VMPage::Box( int top, int left, int bottom, int right, int LineSize, UINT Fillflags, UINT PenFlags )
{
  SaveState();

  if ( Fillflags != IGNORE_PARAM )
  {
    m_PrtDesc.uFillFlags = Fillflags;
  }
      
  if ( PenFlags != IGNORE_PARAM )
  {
    m_PrtDesc.uPenFlags = PenFlags;      
  }

  m_PrtDesc.rc.top    = top;    
  m_PrtDesc.rc.bottom = bottom;    
  m_PrtDesc.rc.left   = left;    
  m_PrtDesc.rc.right  = right;    

  ThePrinter.DrawRect( &m_PrtDesc, LineSize );

  RestoreState();
}
/* End of function "VMPage::Box"
/*****************************************************************************/


/*****************************************************************************/
/*

     FUNCTION NAME:  VMPage::Box

       DESCRIPTION:  Draw a rectangle using parameters passed

             INPUT:  top - 
                     left - 
                     bottom - 
                     right - 
                     LineSize - 
                     Fillflags - 
                     PenFlags - 
            OUTPUT:  

           RETURNS:  void  
*/
void VMPage::Box( double top, double left, double bottom, double right, int LineSize, UINT Fillflags, UINT PenFlags )
{
  SaveState();

  if ( Fillflags != IGNORE_PARAM )
  {
    m_PrtDesc.uFillFlags = Fillflags;
  }      
  if ( PenFlags != IGNORE_PARAM )
  {
    m_PrtDesc.uPenFlags = PenFlags;
  }
      
  ConvertArea( top, left, bottom, right );

  m_PrtDesc.rc.top    = (int)top;    
  m_PrtDesc.rc.bottom = (int)bottom;    
  m_PrtDesc.rc.left   = (int)left;    
  m_PrtDesc.rc.right  = (int)right;    

  ThePrinter.DrawRect( &m_PrtDesc, LineSize );

  RestoreState();
}
/* End of function "VMPage::Box"
/*****************************************************************************/


/*****************************************************************************/
/*

     FUNCTION NAME:  VMPage::Line

   

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -