void m_dbwrap_ChangedSongDatabase(object sender, EventArgs e) { m_db = m_dbwrap.Database; m_panegrp = null; panel1.Invalidate(); }
/* public ISongSource SongSource { get { return m_source; } set { m_source = value; m_bsrc = m_source.GetBindingSource(); m_bsrc.PositionChanged += src_PositionChanged; } } */ private void Redraw() { if (m_drawtext != null) { if (edcolumns.Value == 1) { SongFormatter fmt = new SongFormatter(m_drawtext, CfgTools.CreateSongViewFormatOptions(panel1.Width / ViewScale)); fmt.Run(); m_panegrp = fmt.Result; panel1.Height = (int)(m_panegrp.FullHeight * ViewScale); m_colheight = m_colwidth = 0; } else { SongFormatter fmt = new SongFormatter(m_drawtext, CfgTools.CreateSongViewFormatOptions(panel1.Width / ViewScale / (int)edcolumns.Value)); fmt.Run(); m_panegrp = fmt.Result; int colcnt = (int)edcolumns.Value; m_colwidth = (ClientSize.Width - 8 - m_colhspace * (colcnt - 1)) / colcnt; m_colheight = ClientSize.Height - 8 - panel2.Height; m_cols.Clear(); m_cols.Add(new List<Pane>()); float colhi = 0; foreach (Pane pane in m_panegrp.Panes) { if (colhi + pane.Height * ViewScale > m_colheight) { m_cols.Add(new List<Pane>()); colhi = 0; } List<Pane> lastpanes = m_cols[m_cols.Count - 1]; if (lastpanes.Count == 0 && pane.IsDelimiter) { // preskocime delimitery na zacatku } else { colhi += pane.Height * ViewScale; lastpanes.Add(pane); } } panel1.Height = m_colheight; panel1.Width = m_cols.Count * m_colwidth + (m_cols.Count - 1) * m_colhspace; } } else { m_panegrp = null; panel1.Height = 0; } panel1.Invalidate(); }
protected void AddPaneGrp(PaneGrp grp) { m_pages.AddPaneGrp(grp); m_stack.Remove(grp); }
public int ExtraPageCount(PaneGrp paneGrp) { return paneGrp.CountExtraSheets(m_heightWithDelim, m_heightWithoutDelim, m_maxPageHeight); }
public void AddPaneGrp(PaneGrp grp) { foreach (Pane pane in grp.Panes) { if (!LastPage.CanAddPane(pane)) AddPage(); LastPage.AddPane(pane); } }
public SongFormatter(string text, SongFormatOptions options) { m_panegrp = new PaneGrp(); m_text = text; m_options = options; }
public OutlineFormatter(OutlineFormatOptions options, IEnumerable<SongData> songs) { m_options = options; m_songs = songs; Result = new PaneGrp(); }