Ejemplo n.º 1
0
 void tabBar_TabChange(object sender, TabBar.TabChangedEventArgs e)
 {
     SectionView board = Sections[e.Tab.ID];
     this.deck.Controls.Clear();
     this.deck.Controls.Add(board);
     board.Show();
     board.Dock = DockStyle.Fill;
     activeBoard = board;
 }
Ejemplo n.º 2
0
        public CListView(SectionView sv)
        {
            this.DoubleBuffered = true;
            this.Section = sv;
            this.DragDrop +=CListView_DragDrop;
            this.AllowDrop = true;
            this.AllowsReoreder = true;
            this.Block = (Block)this.Section.Board.Stylesheet.Blocks["track"].Clone();
            this.HeaderBlock = (Block)this.Section.Board.Stylesheet.Blocks["columnheader"].Clone();
            this.PlayingBlock = (Block)this.Section.Board.Stylesheet.Blocks["track::playing"].Clone();
            this.BackColor = this.Block.BackColor;
            this.SelectedBlock = (Block)this.Section.Board.Stylesheet.Blocks["track::selected"].Clone();
            this.AlternateBlock = (Block)this.Section.Board.Stylesheet.Blocks["track::even"].Clone();
            InitializeComponent();
            AlternateRows = true;
            this.Paint += new PaintEventHandler(CListView_Paint);
            this.FullRowSelect = true;
               // lvwColumnSorter = new MediaChrome.ListViewColumnSorter();
            EngineImages = new Dictionary<string, Image>();

            this.timer1 = new Timer();
            this.timer1.Tick += new EventHandler(timer1_Tick);
            this.timer1.Interval = 150;
            this.timer1.Start();
            this.MouseUp += CListView_MouseUp;
            this.MouseWheel += new MouseEventHandler(CListView_MouseWheel);
            this.OwnerDraw = true;
            this.Scroll += new ScrollEventHandler(CListView_Scroll);
            this.VScroll = true;
        }
Ejemplo n.º 3
0
        public void AddSection(XmlElement _section)
        {
            Tab tab = new Tab();
                tab.Title = _section.GetAttribute("title");
                tab.ID = _section.GetAttribute("id");
                this.tabBar.Tabs.Add(tab);

                Board childBoard = new Board(this);
                SectionView sv = new SectionView(childBoard, this);
                childBoard.Section = sv;
                Sections.Add(tab.ID, sv);
                childBoard.LoadNodes(_section);
                childBoard.ScriptCalled += childBoard_ScriptCalled;
                childBoard.AutoResize();
                childBoard.Width = 31280;
                //if(_section.HasAttribute("padding"))
                //        childBoard.Padding = new Spider.Padding(_section.GetAttribute("padding"));
                this.deck.Controls.Add(sv);
                sv.Dock = DockStyle.Fill;
                if (_section.HasAttribute("playlist"))
                {
                    sv.Board.CustomHeight = true;
                    this.IsPlaylist = _section.GetAttribute("playlist") == "true";
                }
                if (this.IsPlaylist)
                {
                    sv.Board.MinimumSize = new Size(0, 0);
                    if (_section.HasAttribute("height"))
                    {
                        if (int.Parse(_section.GetAttribute("height")) < 1)
                        {
                            sv.Board.Hide();
                            sv.Board.Height = 0;
                        }
                        sv.Board.Height = int.Parse(_section.GetAttribute("height"));
                    }
                    else
                    {
                        sv.Board.Height = 120;
                    }
                    sv.Board.Left = 0;
                    sv.Board.Top = 0;
                    sv.Board.Width = this.Width;
                    sv.Board.Anchor |= AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
                    sv.ListView = new CListView(sv);
                    sv.Controls.Add(sv.ListView);
                    sv.ListView.Top = sv.Board.Height;

                    sv.ListView.Anchor |= AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
                    sv.ListView.Height = 1200;
                    sv.ListView.Width = this.Width;
                    sv.ListView.Columns.Add("No.", 52);
                    sv.ListView.AllowsReoreder = false;
                    sv.ListView.Columns.Add("Title", 300);
                    sv.ListView.Columns.Add("Artist", 100);
                    sv.ListView.Columns.Add("Duration", 100);
                    sv.ListView.Columns.Add("Album", 300);
                    sv.ListView.Columns.Add("User", 100);
                    sv.ListView.Columns.Add("Time", 100);
                    sv.ListView.BringToFront();
                }
        }