示例#1
0
 internal void SetRepresentationAndWidth(ScaleRepresentation sr, float p)
 {
     
     currentRepresentation = sr;
     TextMeasure = TextRenderer.MeasureText(currentRepresentation.Text, CellFont);
     Width = p;
     if (!Visible)
         Show();
 }
示例#2
0
        public Cell(float value, int width)
        {
           // whiteBrush = new SolidBrush(Color.FromArgb((int)(255 * SZSUtils.GetRandom()), (int)(255 * SZSUtils.GetRandom()), (int)(255 * SZSUtils.GetRandom())));

            string text = GetFormattedString(value);
            DefaultText = text;
            CurrentRepresentation = new ScaleRepresentation(text, 1);
            this.Value = value;
            this.Width = width;
            this.Height = STD_CELL_HEIGHT;
            this.CellFont = DEFAULT_FONT;
            
            
            this.Bounds = new RectangleF(0, 0, Cell.STD_CELL_WIDTH, Cell.STD_CELL_HEIGHT);

            TextMeasure = TextRenderer.MeasureText(CurrentRepresentation.Text, CellFont);

            fillBrush = whiteBrush;

            this.MouseEnter += new PInputEventHandler(Cell_MouseEnter);
            this.MouseLeave += new PInputEventHandler(Cell_MouseLeave);
        }