Exemplo n.º 1
0
        public MessageEntry(ChatInterface controller, string usersname, CachedPictureBox picture, string initialMessage, DateTime timeStamp, Font message, Font timeStampFont)
        {
            this.controller = controller;
            OwnerUsername = usersname;
            InitializeComponent();

            messageFont = message;
            this.timeStampFont = timeStampFont;

            userName.Text = usersname;
            userName.Font = new Font(CustomFonts.Fonts.Families[1], 11, FontStyle.Bold);
            userName.Size = userName.PreferredSize;
            userName.TextAlign = ContentAlignment.MiddleLeft;
            userName.Anchor = AnchorStyles.Top | AnchorStyles.Left;

            userPicture = picture;
            userPicture.Location = new Point(0, 9);
            userPicture.Name = "UserPicture";
            userPicture.Size = new Size(48, 48);
            userPicture.TabIndex = 0;
            userPicture.TabStop = false;
            Controls.Add(userPicture);

            ts.Font = timeStampFont;
            ts.TextAlign = ContentAlignment.MiddleLeft;
            ts.ForeColor = Color.FromArgb(0xba, 0xbb, 0xbf);

            ts.Text = timeStamp.ToString(controller.connected.Client.MySelf.prefs.time24 ? "HH:mm" : "hh:mm tt");
            ts.Size = ts.PreferredSize;
            ts.Location = new Point(userName.Right, userName.Bottom - ts.PreferredHeight);

            ts.Anchor = AnchorStyles.Top | AnchorStyles.Left;

            baseText.Text = Regex.Replace(initialMessage, "\r\n|\r|\n", "\r\n");
            baseText.BorderStyle = System.Windows.Forms.BorderStyle.None;
            baseText.Font = message;
            baseText.Size = new Size(Width - 70, 10);
            baseText.Multiline = true;
            baseText.WordWrap = true;
            baseText.ReadOnly = true;
            baseText.Location = new Point(userName.Location.X, userName.Bottom + 5);
            baseText.Anchor = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
            baseText.GotFocus += baseText_GotFocus;
            baseText.MouseWheel += baseText_MouseWheel;

            lastMessage = new Tuple<Label,ChainLabel>(ts, baseText);
            lastTimeStamp = timeStamp;

            appended = new List<Tuple<Label, ChainLabel>>();

            this.ClientSize = this.PreferredSize;

            oldY = this.Location.Y;
            oldHeight = this.Height;
            this.SizeChanged += UpdateSize;
        }
Exemplo n.º 2
0
        public MessageEntry(ChatInterface controller, string usersname, CachedPictureBox picture, string initialMessage, DateTime timeStamp, Font message, Font timeStampFont)
        {
            this.controller = controller;
            OwnerUsername   = usersname;
            InitializeComponent();

            messageFont        = message;
            this.timeStampFont = timeStampFont;

            userName.Text      = usersname;
            userName.Font      = new Font(CustomFonts.Fonts.Families[1], 11, FontStyle.Bold);
            userName.Size      = userName.PreferredSize;
            userName.TextAlign = ContentAlignment.MiddleLeft;
            userName.Anchor    = AnchorStyles.Top | AnchorStyles.Left;

            userPicture          = picture;
            userPicture.Location = new Point(0, 9);
            userPicture.Name     = "UserPicture";
            userPicture.Size     = new Size(48, 48);
            userPicture.TabIndex = 0;
            userPicture.TabStop  = false;
            Controls.Add(userPicture);

            ts.Font      = timeStampFont;
            ts.TextAlign = ContentAlignment.MiddleLeft;
            ts.ForeColor = Color.FromArgb(0xba, 0xbb, 0xbf);

            ts.Text     = timeStamp.ToString(controller.connected.Client.MySelf.prefs.time24 ? "HH:mm" : "hh:mm tt");
            ts.Size     = ts.PreferredSize;
            ts.Location = new Point(userName.Right, userName.Bottom - ts.PreferredHeight);

            ts.Anchor = AnchorStyles.Top | AnchorStyles.Left;

            baseText.Text        = Regex.Replace(initialMessage, "\r\n|\r|\n", "\r\n");
            baseText.BorderStyle = System.Windows.Forms.BorderStyle.None;
            baseText.Font        = message;
            baseText.Size        = new Size(Width - 70, 10);
            baseText.Multiline   = true;
            baseText.WordWrap    = true;
            baseText.ReadOnly    = true;
            baseText.Location    = new Point(userName.Location.X, userName.Bottom + 5);
            baseText.Anchor      = AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
            baseText.GotFocus   += baseText_GotFocus;
            baseText.MouseWheel += baseText_MouseWheel;

            lastMessage   = new Tuple <Label, ChainLabel>(ts, baseText);
            lastTimeStamp = timeStamp;

            appended = new List <Tuple <Label, ChainLabel> >();

            this.ClientSize = this.PreferredSize;

            oldY              = this.Location.Y;
            oldHeight         = this.Height;
            this.SizeChanged += UpdateSize;
        }
Exemplo n.º 3
0
        public void ChangeChannel(string channelId)
        {
            if (activeChat != null)
            {
                if (activeChat.Id.Equals(channelId))
                {
                    return;
                }

                activeChat.Hide();
            }

            if (chats.ContainsKey(channelId))
            {
                chats[channelId].Show();
                activeChat = chats[channelId];
            }
            else
            {
                MessagesAdapter adapter = null;
                switch (channelId[0])
                {
                case 'D':
                    adapter = new DirectMessageAdapter(Client.DirectMessages.Find((c) => c.id == channelId), this, Client);
                    break;

                case 'C':
                    adapter = new ChannelAdapter(Client.ChannelLookup[channelId], this, Client);
                    break;

                case 'G':
                    adapter = new GroupAdapter(Client.GroupLookup[channelId], this, Client);
                    break;
                }

                if (adapter != null)
                {
                    activeChat          = new ChatInterface(adapter, this);
                    activeChat.Location = new Point(220, 0);
                    activeChat.Width    = Width - 220;
                    activeChat.Height   = Height;
                    activeChat.Anchor   = AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right | AnchorStyles.Top;
                    chats.Add(channelId, activeChat);
                    Controls.Add(activeChat);
                }
                else if (activeChat != null)
                {
                    activeChat.Show();
                }
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// Will likely handle all auto completes. Names, channels, and emojis.
 /// </summary>
 public static void AutoComplete(ChatInterface chat, int keyValue, Keys modifiers)
 {
 }
Exemplo n.º 5
0
 public static void EditLastMessage(ChatInterface chat, int keyValue, Keys modifiers)
 {
 }
Exemplo n.º 6
0
 public static void PreviousChannel(ChatInterface chat, int keyValue, Keys modifiers)
 {
 }
Exemplo n.º 7
0
 public static void QuickSwitcher(ChatInterface chat, int keyValue, Keys modifiers)
 {
 }
Exemplo n.º 8
0
 public static void ToggleFlexpane(ChatInterface chat, int keyValue, Keys modifiers)
 {
 }
Exemplo n.º 9
0
 public static void QuickSwitcher(ChatInterface chat, int keyValue, Keys modifiers)
 {
 }
Exemplo n.º 10
0
 public static void PreviousChannelUnread(ChatInterface chat, int keyValue, Keys modifiers)
 {
 }
Exemplo n.º 11
0
 public static void NextChannel(ChatInterface chat, int keyValue, Keys modifiers)
 {
 }
Exemplo n.º 12
0
 /// <summary>
 /// Will handle both forms of creating new snippets from pastes.
 /// </summary>
 public static void NewSnippet(ChatInterface chat, int keyValue, Keys modifiers)
 {
 }
Exemplo n.º 13
0
 public static void MarkRead(ChatInterface chat, int keyValue, Keys modifiers)
 {
 }
Exemplo n.º 14
0
 public static void KeyboardShortcutsOverlay(ChatInterface chat, int keyValue, Keys modifiers)
 {
 }
Exemplo n.º 15
0
 public static void HighlightToEndOfLine(ChatInterface chat, int keyValue, Keys modifiers)
 {
 }
Exemplo n.º 16
0
 public static void HighlightToEndOfLine(ChatInterface chat, int keyValue, Keys modifiers)
 {
 }
Exemplo n.º 17
0
 /// <summary>
 /// Will handle both forms of creating new snippets from pastes.
 /// </summary>
 public static void NewSnippet(ChatInterface chat, int keyValue, Keys modifiers)
 {
 }
Exemplo n.º 18
0
 public static void ReprintLastCommand(ChatInterface chat, int keyValue, Keys modifiers)
 {
 }
Exemplo n.º 19
0
 public static void KeyboardShortcutsOverlay(ChatInterface chat, int keyValue, Keys modifiers)
 {
 }
Exemplo n.º 20
0
 public static void ScrollThroughMessages(ChatInterface chat, int keyValue, Keys modifiers)
 {
 }
Exemplo n.º 21
0
 public static void EditLastMessage(ChatInterface chat, int keyValue, Keys modifiers)
 {
 }
Exemplo n.º 22
0
 public static void ToggleFlexpane(ChatInterface chat, int keyValue, Keys modifiers)
 {
 }
Exemplo n.º 23
0
 public static void ScrollThroughMessages(ChatInterface chat, int keyValue, Keys modifiers)
 {
 }
Exemplo n.º 24
0
 public static void NextChannelUnread(ChatInterface chat, int keyValue, Keys modifiers)
 {
 }
Exemplo n.º 25
0
 public static void MarkAllRead(ChatInterface chat, int keyValue, Keys modifiers)
 {
 }
Exemplo n.º 26
0
 public static void ReprintLastCommand(ChatInterface chat, int keyValue, Keys modifiers)
 {
 }
Exemplo n.º 27
0
        public void ChangeChannel(string channelId)
        {
            if (activeChat != null)
            {
                if (activeChat.Id.Equals(channelId))
                    return;

                activeChat.Hide();
            }

            if(chats.ContainsKey(channelId))
            {
                chats[channelId].Show();
                activeChat = chats[channelId];
            }
            else
            {
                MessagesAdapter adapter = null;
                switch (channelId[0])
                {
                    case 'D':
                        adapter = new DirectMessageAdapter(Client.DirectMessages.Find((c) => c.id == channelId), this, Client);
                        break;
                    case 'C':
                        adapter = new ChannelAdapter(Client.ChannelLookup[channelId], this, Client);
                        break;
                    case 'G':
                        adapter = new GroupAdapter(Client.GroupLookup[channelId], this, Client);
                        break;
                }

                if (adapter != null)
                {
                    activeChat = new ChatInterface(adapter, this);
                    activeChat.Location = new Point(220, 0);
                    activeChat.Width = Width - 220;
                    activeChat.Height = Height;
                    activeChat.Anchor = AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right | AnchorStyles.Top;
                    chats.Add(channelId, activeChat);
                    Controls.Add(activeChat);
                }
                else if (activeChat != null)
                    activeChat.Show();
            }
        }
Exemplo n.º 28
0
 /// <summary>
 /// Will likely handle all auto completes. Names, channels, and emojis.
 /// </summary>
 public static void AutoComplete(ChatInterface chat, int keyValue, Keys modifiers)
 {
 }