コード例 #1
0
 public static ChatWindow ShowChatWindow(SubEnvironment owner, string tag, int group, bool input, bool userlist, bool output)
 {
     if (Window.InvokeRequired)
     {
         return((ChatWindow)(Window.Invoke(showChatWindow, new object[] { owner, tag, group, input, userlist, output })));
     }
     return(new ChatWindow(owner, tag, group, input, userlist, output));
 }
コード例 #2
0
        public ChatWindow(SubEnvironment owner, string tag, int group, bool input, bool userlist, bool output)
            : base(owner, tag, group)
        {
            this.SuspendLayout();

            this.Font      = new Font(FontFamily.GenericMonospace, 9f);
            this.BackColor = Color.White;
            this.ForeColor = Color.Black;

            if (userlist && output)
            {
                uiUserlistBox      = new ChatUserlistBox();
                uiOutputBox        = new ChatOutputBox();
                uiUserlistBox.Dock = DockStyle.Fill;
                uiOutputBox.Dock   = DockStyle.Fill;
                SplitContainer split = new SplitContainer();
                split.Dock = DockStyle.Fill;
                this.Controls.Add(split);
                this.ResumeLayout(false);
                this.PerformLayout();
                split.FixedPanel       = FixedPanel.Panel2;
                split.SplitterDistance = split.Width - 125;
                this.SuspendLayout();
                split.Panel1.Controls.Add(uiOutputBox);
                split.Panel2.Controls.Add(uiUserlistBox);
            }
            else
            {
                if (userlist)
                {
                    uiUserlistBox      = new ChatUserlistBox();
                    uiUserlistBox.Dock = DockStyle.Fill;
                    this.Controls.Add(uiUserlistBox);
                }
                if (output)
                {
                    uiOutputBox            = new ChatOutputBox();
                    uiOutputBox.Dock       = DockStyle.Fill;
                    this.BackColorChanged += new EventHandler(ChatWindow_BackColorChanged);
                    uiOutputBox.BackColor  = Color.White;
                    uiOutputBox.ReadOnly   = true;
                    this.Controls.Add(uiOutputBox);
                }
            }
            if (input)
            {
                uiInputBox            = new ChatInputBox();
                uiInputBox.Dock       = DockStyle.Bottom;
                uiInputBox.LineEntry += new StringCallback(uiInputBox_LineEntry); // += ReadInput;
                this.Activated       += new EventHandler(ChatWindow_Activated);
                this.Controls.Add(uiInputBox);
            }

            this.ResumeLayout(false);
            this.PerformLayout();
        }
コード例 #3
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();
        }
コード例 #4
0
 /// <summary>
 /// This creates a new download 'window' in the download manager of this user interface.
 /// </summary>
 /// <returns></returns>
 public static TransferWindow ShowTransferWindow(SubEnvironment owner)
 {
     return(null);
 }