Esempio n. 1
0
 internal clsBeatChords(Forms.IFrmDGV frm, DataGridView dgv)
 {
     DGV = dgv;
     Frm = frm;
     DGV_CellValidating_Handler = new DataGridViewCellValidatingEventHandler(DGV_CellValidating);
     DGV.CellValidating        += DGV_CellValidating_Handler;
     //DGV.CellValidating += new DataGridViewCellValidatingEventHandler(DGV_CellValidating);
 }
Esempio n. 2
0
        internal void SelectBar(Forms.IFrmDGV frm, int bar) //not called?
        {
            DataGridView dgv = frm.Prop_dgvLyrics;

            if (!dgv.Visible)
            {
                return;
            }
            DataGridViewColumn col = dgv.Columns[bar];

            col.Selected = true;
        }
Esempio n. 3
0
        internal void InitDGV(Forms.IFrmDGV frm)
        {
            //if (NumBars == 0) NumBars = new clsMTime.clsBBT(P.F.MaxTicks).Bar + 1;
            if (frm == null)
            {
                return;
            }
            int vmult = 6;

            if (frm == P.frmSC)
            {
                vmult = 4;            //use less space
            }
            DataGridView dgv = frm.Prop_dgvLyrics;

            dgv.DoubleBuffered(true);
            //clsMTime.clsBBT bbtmax = new clsMTime.clsBBT(P.F.MaxTicks);
            //NumBars = bbtmax.Bar + 1;
            //bbtmax = new clsMTime.clsBBT(NumBars, 0, 0);
            BarToBBT = new clsMTime.clsBBT[NumBars + 1];
            for (int bar = 0; bar <= NumBars; bar++) //end at one after numbars
            {
                BarToBBT[bar] = new clsMTime.clsBBT(bar, 0, 0);
            }
            while (dgv.Rows.Count > 0)
            {
                dgv.Rows.RemoveAt(0);
            }
            dgv.DefaultCellStyle.Font = new Font("Microsoft Sans Serif", 8.25F, FontStyle.Regular);
            //dgv.Width = frm.panNoteMap.Width;
            dgv.Height        = ((int)dgv.DefaultCellStyle.Font.GetHeight()) * vmult + 10; //lines
            dgv.SelectionMode = DataGridViewSelectionMode.CellSelect;                      //to avoid error on reinit
            dgv.ColumnCount   = NumBars;
            SetColumnWidth(frm);
            //dgv.SelectionMode = DataGridViewSelectionMode.FullColumnSelect;
            DataGridViewRow row = new DataGridViewRow();

            row.Height = dgv.Height;
            for (int bar = 0; bar < NumBars; bar++)
            {
                DataGridViewTextBoxCell cell = new DataGridViewTextBoxCell();
                row.Cells.Add(cell);
            }
            dgv.Rows.Add(row); //this will reset P.F.CurrentBBT
            ShowDGVCells(dgv);
        }
Esempio n. 4
0
        internal void SetColumnWidth(Forms.IFrmDGV frm)
        {
            if (!LyricsExist)
            {
                return;
            }
            DataGridView dgv = frm.Prop_dgvLyrics;
            int          pixlo = 0, pixhi = 0;

            for (int bar = 0; bar < NumBars; bar++)
            {
                DataGridViewColumn col = dgv.Columns[bar];
                col.SortMode = DataGridViewColumnSortMode.NotSortable;
                col.Selected = true;
                pixhi        = frm.TicksToPix(BarToBBT[bar + 1].Ticks);
                col.Width    = pixhi - pixlo;
                pixlo        = pixhi;
            }
        }