예제 #1
0
        public TransferManager()
        {
            this.Text       = "Transfers";
            this.AutoScroll = true;
#if NET
            this.VerticalScroll.Enabled   = true;
            this.HorizontalScroll.Enabled = false;
#endif

            BarButton         = new ToolBarWindowButton(this.Text, 0, this);
            BarButton.Click  += new EventHandler(BarButton_Click);
            BarButton.Visible = false;
            //int index = nIRC.UI.Environment.Window.WindowBar.Items.Count - 1;
            //for (index = 0; index < nIRC.UI.Environment.Window.WindowBar.Items.Count; index++)
            //{
            //    if (nIRC.UI.Environment.Window.WindowBar.Items[index] is ToolStripSeparator) break;
            //}

            nIRC.UI.Environment.Window.WindowBar.Items.Add(BarButton);
        }
예제 #2
0
파일: Window.cs 프로젝트: kaetemi/n-irc
        public Window(SubEnvironment owner, string tag, int group)
        {
            base.Name = tag;
            base.Text = tag;
            setTitle  = new StringCallback(SetTitle);
            setTag    = new StringCallback(SetTag);

            this.SubEnvironment = owner;
            owner.Windows.Add(this);

            BarButton            = new ToolBarWindowButton(tag, group, this);
            BarButton.ImageIndex = group;
            BarButton.Click     += new EventHandler(BarButton_Click);
            ToolStripItem item;
            int           index = nIRC.UI.Environment.Window.WindowBar.Items.IndexOf(owner.ToolBarSeperator) - 1;

            while (index > -1)
            {
                item = nIRC.UI.Environment.Window.WindowBar.Items[index];
                if (!(item is ToolBarWindowButton))
                {
                    break;
                }
                if (((ToolBarWindowButton)item).Group <= group)
                {
                    break;
                }
                index--;
            }

            nIRC.UI.Environment.Window.WindowBar.Items.Insert(index + 1, BarButton);

            this.TopLevel   = false;
            this.MdiParent  = nIRC.UI.Environment.Window;
            this.ClientSize = new Size(500, 300);
            this.Show();
        }