Beispiel #1
0
        /// <summary>
        /// cTor.
        /// </summary>
        internal PropanelButton()
        {
            DrawRegulator.SetDoubleBuffered(this);

            // NOTE: .NET is using the default vals for button's Width/Height
            // here. So set it explicitly.
            Width  = 30;
            Height = HEIGHT;

            pen1 = Pens.Black;
            pen2 = Pencils.DarkLine;

//			_rectBg = new Rectangle(0,0, Width, Height);
            _rectGr = new Rectangle(3, 3, Width - 6, Height - 6);


            Name    = "bu_Propanel";
            Visible = false;
            TabStop = false;

            Anchor = AnchorStyles.Top | AnchorStyles.Right;
            UseVisualStyleBackColor = true;

            Margin = new Padding(0);
        }
Beispiel #2
0
/*		void doCol0(int c0, int c1)
 *              {
 *                      for (int c = c0; c != c1; ++c)
 *                      {
 *                              int w = 0, wT;
 *                              for (int r = 0; r != RowCount; ++r)
 *                              {
 *                                      lock (Font)
 *                                      {
 *                                      //logfile.Log("doCol0 c= " + c + " r= " + r);
 *                                      wT = YataGraphics.MeasureWidth(this[r,c].text, Font);
 *                                      }
 *                                      this[r,c]._widthtext = wT;
 *                                      if ((wT += _padHori * 2) > w) w = wT;
 *                              }
 *                              Cols[c].width(w);
 *                      }
 *              }
 *              void doCol1(int c1, int c2)
 *              {
 *                      for (int c = c1; c != c2; ++c)
 *                      {
 *                              int w = 0, wT;
 *                              for (int r = 0; r != RowCount; ++r)
 *                              {
 *                                      lock (Font)
 *                                      {
 *                                      //logfile.Log("doCol1 c= " + c + " r= " + r);
 *                                      wT = YataGraphics.MeasureWidth(this[r,c].text, Font);
 *                                      }
 *                                      this[r,c]._widthtext = wT;
 *                                      if ((wT += _padHori * 2) > w) w = wT;
 *                              }
 *                              Cols[c].width(w);
 *                      }
 *              }
 *              void doCol2(int c2, int c3)
 *              {
 *                      for (int c = c2; c != c3; ++c)
 *                      {
 *                              int w = 0, wT;
 *                              for (int r = 0; r != RowCount; ++r)
 *                              {
 *                                      lock (Font)
 *                                      {
 *                                      //logfile.Log("doCol2 c= " + c + " r= " + r);
 *                                      wT = YataGraphics.MeasureWidth(this[r,c].text, Font);
 *                                      }
 *                                      this[r,c]._widthtext = wT;
 *                                      if ((wT += _padHori * 2) > w) w = wT;
 *                              }
 *                              Cols[c].width(w);
 *                      }
 *              }
 *              void doCol3(int c3, int c4)
 *              {
 *                      for (int c = c3; c != c4; ++c)
 *                      {
 *                              int w = 0, wT;
 *                              for (int r = 0; r != RowCount; ++r)
 *                              {
 *                                      lock (Font)
 *                                      {
 *                                      //logfile.Log("doCol3 c= " + c + " r= " + r);
 *                                      wT = YataGraphics.MeasureWidth(this[r,c].text, Font);
 *                                      }
 *                                      this[r,c]._widthtext = wT;
 *                                      if ((wT += _padHori * 2) > w) w = wT;
 *                              }
 *                              Cols[c].width(w);
 *                      }
 *              } */

        /// <summary>
        /// Initializes the frozen-labels on the colhead panel.
        /// </summary>
        void initFrozenLabels()
        {
            _labelid.Visible             =
                _labelfirst.Visible      =
                    _labelsecond.Visible = false;

            if (ColCount != 0)
            {
                _labelid.Visible = true;

                if (_initFrozenLabels)                 // TODO: FrozenLabels could be instantiated / updated-on-Reload better.
                {
                    DrawRegulator.SetDoubleBuffered(_labelid);
                    _labelid.BackColor = Colors.FrozenHead;

                    _labelid.Resize     += label_Resize;
                    _labelid.Paint      += labelid_Paint;
                    _labelid.MouseClick += labelid_MouseClick;
                    _labelid.MouseClick += (sender, e) => Select();
                }
                _panelCols.Controls.Add(_labelid);

                if (ColCount > 1)
                {
                    _labelfirst.Visible = (FrozenCount > FreezeId);                     // required after Font calibration

                    if (_initFrozenLabels)
                    {
                        DrawRegulator.SetDoubleBuffered(_labelfirst);
                        _labelfirst.BackColor = Colors.FrozenHead;

                        _labelfirst.Resize     += label_Resize;
                        _labelfirst.Paint      += labelfirst_Paint;
                        _labelfirst.MouseClick += labelfirst_MouseClick;
                        _labelfirst.MouseClick += (sender, e) => Select();
                    }
                    _panelCols.Controls.Add(_labelfirst);

                    if (ColCount > 2)
                    {
                        _labelsecond.Visible = (FrozenCount > FreezeFirst);                         // required after Font calibration

                        if (_initFrozenLabels)
                        {
                            DrawRegulator.SetDoubleBuffered(_labelsecond);
                            _labelsecond.BackColor = Colors.FrozenHead;

                            _labelsecond.Resize     += label_Resize;
                            _labelsecond.Paint      += labelsecond_Paint;
                            _labelsecond.MouseClick += labelsecond_MouseClick;
                            _labelsecond.MouseClick += (sender, e) => Select();
                        }
                        _panelCols.Controls.Add(_labelsecond);
                    }
                }
            }
            _initFrozenLabels = false;
        }
Beispiel #3
0
        /// <summary>
        /// cTor.
        /// </summary>
        /// <param name="grid"></param>
        internal YataPanelRows(YataGrid grid)
        {
            DrawRegulator.SetDoubleBuffered(this);

            _grid = grid;

            Dock      = DockStyle.Left;
            BackColor = Colors.RowheadPanel;
        }
Beispiel #4
0
        /// <summary>
        /// cTor.
        /// </summary>
        /// <param name="grid"></param>
        internal YataPanelCols(YataGrid grid)
        {
            DrawRegulator.SetDoubleBuffered(this);

            _grid = grid;

            Dock      = DockStyle.Top;
            BackColor = Colors.ColheadPanel;

            Height = YataGrid.HeightColhead;
        }
Beispiel #5
0
        /// <summary>
        /// cTor.
        /// </summary>
        /// <param name="grid"></param>
        /// <param name="w"></param>
        internal YataPanelFrozen(YataGrid grid, int w)
        {
            DrawRegulator.SetDoubleBuffered(this);

            _grid = grid;

            Dock      = DockStyle.Left;
            BackColor = Colors.FrozenPanel;

            Width = w;
        }
Beispiel #6
0
        /// <summary>
        /// cTor.
        /// </summary>
        internal YataTabs()
        {
            DrawRegulator.SetDoubleBuffered(this);

            Name     = "Tabs";
            TabIndex = 3;

            Dock      = DockStyle.Fill;
            Multiline = true;
            AllowDrop = true;
            DrawMode  = TabDrawMode.OwnerDrawFixed;
            SizeMode  = TabSizeMode.Fixed;

            Padding = new Point(0, 0);             // Padding uses Point and Margin uses Padding
            Margin  = new Padding(0);              // right got it.
        }
Beispiel #7
0
        /// <summary>
        /// cTor.
        /// </summary>
        /// <remarks>Each tabbed table gets its own Propanel.</remarks>
        internal Propanel(YataGrid grid)
        {
            DrawRegulator.SetDoubleBuffered(this);

            _grid = grid;

            if (Settings._gradient)
            {
                BackColor = Color.SkyBlue;
            }
            else
            {
                BackColor = Color.LightBlue;
            }

            Anchor  = AnchorStyles.Top | AnchorStyles.Right | AnchorStyles.Bottom;
            TabStop = false;             // <- the Propanel is not currently coded to cope w/ keyboard-input.

            if (Settings._font3 != null)
            {
//				Font.Dispose(); // be wary. Be very wary. -> Do NOT Dispose()
                // debug builds don't throw
                // but release builds CTD when invoking the SettingsEditor after
                // the Propanel has been opened ... eg.

                Font = Settings._font3;
            }
            else
            {
                Font = new Font("Verdana", 7.25F, FontStyle.Regular, GraphicsUnit.Point, (byte)0);
            }

            if (_heightr == -1)
            {
                _heightr = YataGraphics.MeasureHeight(YataGraphics.HEIGHT_TEST, Font) + _padVert * 2;
            }

            _editRect.Height = _heightr - 1;             // cf YataGrid.EditCell()

            HeightProps = _grid.ColCount * _heightr;

            int wT;

            for (int c = 0; c != _grid.ColCount; ++c)
            {
                wT = YataGraphics.MeasureWidth(_grid.Cols[c].text, Font);
                if (wT > _widthVars)
                {
                    _widthVars = wT;
                }
            }
            _widthVars += _padHori * 2 + 1;

            _scroll.Dock          = DockStyle.Right;
            _scroll.LargeChange   = _heightr;
            _scroll.ValueChanged += scroll_valuechanged;

            widthValcol();

            Controls.Add(_scroll);

            _grid.Controls.Add(this);

            _editor.Leave += editor_leave;

            Controls.Add(_editor);
        }