/* S E T C O L W I D T H */ /*---------------------------------------------------------------------------- * %%Function: SetColWidth * %%Qualified: bg.Reporter.SetColWidth * %%Contact: rlittle * * ----------------------------------------------------------------------------*/ void SetColWidth(int iCol, int nPercent, BorderType btLeft, BorderType btRight) { float dPercent = (m_nWidth * (float)nPercent) / 100.0F; if (iCol > 0) { if (dPercent == 0) { dPercent = m_rcfDrawing.Right - m_mpicold[iCol - 1].dxpRight; } float dxpSpace = 0.0F; if (m_mpicold[iCol - 1].btRight != BorderType.None) { dxpSpace = 2.0F; } m_mpicold[iCol] = new COLD(m_mpicold[iCol - 1], dxpSpace, dPercent, btLeft, btRight); } else { m_mpicold[iCol] = new COLD(null, m_rcfDrawing.Left, dPercent, btLeft, btRight); } }
/* C O L D */ /*---------------------------------------------------------------------------- * %%Function: COLD * %%Qualified: bg.Reporter:COLD.COLD * %%Contact: rlittle * * * ----------------------------------------------------------------------------*/ public COLD(COLD coldPrev, float dxpLeftSpace, float dxpColIn, BorderType btLeftIn, BorderType btRightIn) { float xpPrev = 0; if (coldPrev != null) { xpPrev = coldPrev.xpLeft + coldPrev.dxpCol; } xpLeft = xpPrev + dxpLeftSpace; dxpCol = dxpColIn; btLeft = btLeftIn; btRight = btRightIn; }
/* D R A W T E X T I N C O L U M N */ /*---------------------------------------------------------------------------- * %%Function: DrawTextInColumn * %%Qualified: bg.Reporter.DrawTextInColumn * %%Contact: rlittle * * ----------------------------------------------------------------------------*/ public void DrawTextInColumn(Graphics gr, string s, Font font, SolidBrush br, int iCol, float y, int cColSpan, HorizontalAlignment jc) { int iColMax = iCol + cColSpan - 1; COLD cold = m_mpicold[iCol]; float dxpRight = m_mpicold[iColMax].dxpRight; float dxpWidth = 0.0F; if (cColSpan == 1) { dxpWidth = cold.dxpCol; } else { dxpWidth = dxpRight - cold.xpLeft; } RectangleF rectfClip = new RectangleF(cold.xpLeft, y, dxpWidth, y + 20); gr.SetClip(rectfClip); switch (jc) { case HorizontalAlignment.Left: gr.DrawString(s, font, br, cold.xpLeft, y); break; case HorizontalAlignment.Center: gr.DrawString(s, font, br, cold.xpLeft + (dxpWidth - gr.MeasureString(s, font).Width) / 2, y); break; case HorizontalAlignment.Right: gr.DrawString(s, font, br, cold.xpLeft + (dxpWidth - gr.MeasureString(s, font).Width), y); break; } gr.ResetClip(); }
/* S E T C O L W I D T H */ /*---------------------------------------------------------------------------- %%Function: SetColWidth %%Qualified: bg.Reporter.SetColWidth %%Contact: rlittle ----------------------------------------------------------------------------*/ void SetColWidth(int iCol, int nPercent, BorderType btLeft, BorderType btRight) { float dPercent = (m_nWidth * (float)nPercent) / 100.0F; if (iCol > 0) { if (dPercent == 0) { dPercent = m_rcfDrawing.Right - m_mpicold[iCol - 1].dxpRight; } float dxpSpace = 0.0F; if (m_mpicold[iCol - 1].btRight != BorderType.None) { dxpSpace = 2.0F; } m_mpicold[iCol] = new COLD(m_mpicold[iCol - 1], dxpSpace, dPercent, btLeft, btRight); } else { m_mpicold[iCol] = new COLD(null, m_rcfDrawing.Left, dPercent, btLeft, btRight); } }
/* C O L D */ /*---------------------------------------------------------------------------- %%Function: COLD %%Qualified: bg.Reporter:COLD.COLD %%Contact: rlittle ----------------------------------------------------------------------------*/ public COLD(COLD coldPrev, float dxpLeftSpace, float dxpColIn, BorderType btLeftIn, BorderType btRightIn) { float xpPrev = 0; if (coldPrev != null) { xpPrev = coldPrev.xpLeft + coldPrev.dxpCol; } xpLeft = xpPrev + dxpLeftSpace; dxpCol = dxpColIn; btLeft = btLeftIn; btRight = btRightIn; }