Пример #1
0
 void m_dbwrap_ChangedSongDatabase(object sender, EventArgs e)
 {
     m_db = m_dbwrap.Database;
     m_panegrp = null;
     panel1.Invalidate();
 }
Пример #2
0
        /*
        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();
        }
Пример #3
0
 protected void AddPaneGrp(PaneGrp grp)
 {
     m_pages.AddPaneGrp(grp);
     m_stack.Remove(grp);
 }
Пример #4
0
 public int ExtraPageCount(PaneGrp paneGrp)
 {
     return paneGrp.CountExtraSheets(m_heightWithDelim, m_heightWithoutDelim, m_maxPageHeight);            
 }
Пример #5
0
 public void AddPaneGrp(PaneGrp grp)
 {
     foreach (Pane pane in grp.Panes)
     {
         if (!LastPage.CanAddPane(pane)) AddPage();
         LastPage.AddPane(pane);
     }
 }
Пример #6
0
 public SongFormatter(string text, SongFormatOptions options)
 {
     m_panegrp = new PaneGrp();
     m_text = text;
     m_options = options;
 }
Пример #7
0
 public OutlineFormatter(OutlineFormatOptions options, IEnumerable<SongData> songs)
 {
     m_options = options;
     m_songs = songs;
     Result = new PaneGrp();
 }