Exemplo n.º 1
0
		public ChannelPage(ConnectionGroup group, string channel)
			: base(channel)
		{
			this.tInf = new RichTextBox();
			this.tChan = new RichTextBox();

			this.tInf.Dock = DockStyle.Top;
			this.tInf.Text = "";
			this.tInf.ReadOnly = true;
			this.tInf.BackColor = Color.FromArgb(224, 255, 192);
			this.tInf.TabIndex = 1;
			this.tInf.Multiline = false;
			this.tInf.Height = 21;
			this.tInf.LinkClicked += new LinkClickedEventHandler(MainForm.thisfrm.tLog_LinkClicked);
			this.tInf.PreviewKeyDown += new PreviewKeyDownEventHandler(MainForm.thisfrm.tLine_PreviewKeyDown);
			this.tInf.TabStop = false;

			this.splCon = new SplitContainer();
			this.splCon.TabStop = false;
			this.splCon.Dock = DockStyle.Fill;
			this.splCon.FixedPanel = FixedPanel.Panel2;
			this.splCon.SplitterDistance = Width - 160;
			this.splCon.TabIndex = 2;

			this.tChan.Dock = DockStyle.Fill;
			this.tChan.Text = "";
			this.tChan.ReadOnly = true;
			this.tChan.BackColor = Color.White;
			this.tChan.LinkClicked += new LinkClickedEventHandler(MainForm.thisfrm.tLog_LinkClicked);
			this.tChan.PreviewKeyDown += new PreviewKeyDownEventHandler(MainForm.thisfrm.tLine_PreviewKeyDown);
			this.tChan.TabStop = false;
			this.tChan.LanguageOption = RichTextBoxLanguageOptions.DualFont;

			this.userList = new ListBox();
			this.userList.Dock = DockStyle.Fill;
			this.userList.Sorted = true;
			this.userList.IntegralHeight = false;
			this.userList.ContextMenuStrip = MainForm.thisfrm.userContext;
			this.userList.SelectionMode = SelectionMode.MultiExtended;
			this.userList.PreviewKeyDown += new PreviewKeyDownEventHandler(MainForm.thisfrm.tLine_PreviewKeyDown);
			this.userList.TabStop = false;

			if (channel.StartsWith("#"))
			{
				this.splCon.Panel1.Controls.Add(this.tChan);
				this.splCon.Panel2.Controls.Add(this.userList);
				this.Controls.Add(this.splCon);

				this.Controls.Add(this.tInf);
			}
			else
				this.Controls.Add(this.tChan);
			this.Padding = new Padding(3);

			this.topic = "";
			this.chanmode.init();
			this.tChanged = 0;
			this.selected = false;
			this.group = group;
		}
Exemplo n.º 2
0
        /// <summary>
        /// ShowDialog대신 사용한다.
        /// Option중에는 ConnectionGroup에 따라 다른 설정이 저장되어 있는 것이 있으므로
        /// ConnectionGroup을 인자로 받는다.
        /// </summary>
        /// <param name="con"> 현재 지정된 ConnectionGroup </param>
        public void Open(ConnectionGroup con)
        {
            tGroup.SelectedIndex = -1;
            this.con = con;
            tGroup.Text = con.Text;
            tHost.Text = con.host;
            cEncode.SelectedIndex = EncodeIndex(con.encode);
            passmsg = tPass.Text;
            usermsg = tUser.Text;
            qmsg = tQuit.Text;
            vermsg = tVersion.Text;

            fontDialog.Font = fonttemp = MainForm.thisfrm.Font;
            fontTextUpdate();

            this.Font = MainForm.thisfrm.Font;

            this.ShowDialog(MainForm.thisfrm);
        }
Exemplo n.º 3
0
 private int GroupEndLocation(ConnectionGroup cgroup)
 {
     return tabControl.TabPages.IndexOf(cgroup.pLog) + cgroup.channelPages.Count;
 }
Exemplo n.º 4
0
 private int GroupLocation(ConnectionGroup cgroup)
 {
     return tabControl.TabPages.IndexOf(cgroup.pLog);
 }
Exemplo n.º 5
0
 private void addNewTab(object sender = null, EventArgs e = null)
 {
     ServerGroup tba = OptionForm.thisfrm.Groups[0];
     foreach (ServerGroup sgroup in OptionForm.thisfrm.Groups)
     {
         bool pos = true;
         foreach (ConnectionGroup cgroup in connectionGroups)
         {
             if (cgroup.sGroup == sgroup)
             {
                 pos = false;
                 break;
             }
         }
         if (pos)
         {
             tba = sgroup;
             break;
         }
     }
     ConnectionGroup nGroup = new ConnectionGroup(tba, OptionForm.thisfrm.defaultNick);
     tabControl.Controls.Add(nGroup.pLog);
     connectionGroups.Add(nGroup);
     SelectedGroup = nGroup;
 }
Exemplo n.º 6
0
 public void SetProperty(ConnectionGroup pCon, bool bnick)
 {
     if (pCon == SelectedGroup)
     {
         if (bnick)
             Util.setText(tNick, pCon.nick);
         else
         {
             Util.setText(bConnect, Util.ConnectedString(pCon.connected));
             setPing(pCon.ping);
         }
     }
 }
Exemplo n.º 7
0
 public bool isSelected(ConnectionGroup cp)
 {
     return SelectedGroup == cp;
 }
Exemplo n.º 8
0
 public void InsertChan(ConnectionGroup cGroup, ChannelPage pChan)
 {
     Util.insertTab(tabControl, pChan, GroupEndLocation(cGroup));
 }
Exemplo n.º 9
0
 public ChannelPage FindChan(ConnectionGroup connectionGroup, string channel)
 {
     foreach (ChannelPage pChan in connectionGroup.channelPages)
     {
         if (pChan.Text == channel) return pChan;
     }
     return null;
 }