Exemplo n.º 1
0
        public void AddMessage(ChatMessage message)
        {
            messages.Add(message);
            logHeight += message.Size.Height;

            needsResize = true;
            bool scroll = (((this.ClientSize.Height - (int)logHeight + this.Margin.Bottom)- this.AutoScrollPosition.Y) <= this.Margin.Bottom);
            if (scroll)
            {//729,767,3
                MeasureTexts(CreateGraphics());//TODO: böse
                ScrollToBottom();
            }
            else
                this.AutoScrollMinSize = new Size(0, (int)logHeight);

            this.Invalidate();
        }
Exemplo n.º 2
0
 public RootPart(ChatMessage parentChatMessage,XmlElement xml,Font font = null)
     : base(xml, null,font)
 {
     this.parentChatMessage = parentChatMessage;
 }
Exemplo n.º 3
0
        private void ChatLogControl_MouseMove(object sender, MouseEventArgs e)
        {
            float currentPosition = ClientSize.Height + ((int)logHeight - this.ClientSize.Height) + AutoScrollPosition.Y;
            foreach (ChatMessage msg in messages)
            {
                currentPosition -= msg.Size.Height;
                if (e.Y > currentPosition && e.Y < currentPosition + msg.Size.Height)
                {
                    if (msg != previousChatMessage) {
                        if (previousChatMessage != null)
                            previousChatMessage.MouseLeave (new PointF (e.X, e.Y - currentPosition), e);
                        msg.MouseEnter (new PointF (e.X, e.Y - currentPosition),e);
                        previousChatMessage = msg;
                    }

                    msg.MouseMove(new PointF(e.X, e.Y - currentPosition), e);
                    break;
                }

            }
        }
Exemplo n.º 4
0
 private void Messages_ItemThrown(object sender, ChatMessage thrown)
 {
     logHeight -= thrown.Size.Height;
 }
Exemplo n.º 5
0
 private void Messages_ItemThrown(object sender, ChatMessage thrown)
 {
     logHeight -= thrown.Size.Height;
 }