Exemple #1
0
        //returns final control height
        public void UpdateLayout()
        {
            if ((m_stsControls != null) && (m_bScrolledToTop))
            {
                TimelineStatus tsTop = m_stsControls.Peek();
                m_lmaMotion             = new LinearMotionAnimation(new Point(0, tsTop.Top), new Point(0, 0), 40, LinearMotionAnimation.MotionType.EaseIn);
                m_iAnimateTimeElapsed   = 0;
                tmrTweetAnimate.Enabled = true;
            }
            else
            {
                Stack <TimelineStatus> .Enumerator stsEnum = m_stsControls.GetEnumerator();
                TimelineStatus tsPrev = null;

                stsEnum.MoveNext();
                tsPrev = stsEnum.Current;

                while (stsEnum.MoveNext())
                {
                    stsEnum.Current.Top   = tsPrev.Bottom;
                    stsEnum.Current.Width = this.Width;
                    stsEnum.Current.Left  = 0;
                    stsEnum.Current.Invalidate();
                    tsPrev = stsEnum.Current;
                }
            }
        }
Exemple #2
0
        private void tmrTweetAnimate_Tick(object sender, EventArgs e)
        {
            if (m_lmaMotion == null)
            {
                tmrTweetAnimate.Enabled = false;
            }
            else
            {
                Stack <TimelineStatus> .Enumerator stsEnum = m_stsControls.GetEnumerator();
                TimelineStatus tsPrev = null;

                stsEnum.MoveNext();
                tsPrev = stsEnum.Current;
                stsEnum.Current.Top = m_lmaMotion.PositionForTime(m_iAnimateTimeElapsed).Y;

                while (stsEnum.MoveNext())
                {
                    stsEnum.Current.Top   = tsPrev.Bottom;
                    stsEnum.Current.Width = this.Width;
                    stsEnum.Current.Left  = 0;
                    stsEnum.Current.Invalidate();
                    tsPrev = stsEnum.Current;
                }
            }

            m_iAnimateTimeElapsed++;

            if (m_iAnimateTimeElapsed > m_lmaMotion.Duration)
            {
                tmrTweetAnimate.Enabled = false;
            }
        }
        public void Push(Status stToAdd, BasicAPI bAPI)
        {
            TimelineStatus tsNewStatus = new TimelineStatus(stToAdd, bAPI);
            TimelineStatus tsOldTop = null;

            DisableLoadingAnimation();

            if (m_stsControls.Count > 0)
                tsOldTop = m_stsControls.Peek();

            this.Controls.Add(tsNewStatus);
            m_stsControls.Push(tsNewStatus);
            tsNewStatus.UpdateLayout();
            tsNewStatus.BackColor = this.BackColor;
            HookupStatusEvents(tsNewStatus);

            m_iTotalControlHeight += tsNewStatus.Height;
            OnResize(EventArgs.Empty);

            if (m_bScrolledToTop)
            {
                if (tsOldTop != null)
                    tsNewStatus.Top = tsOldTop.Top - tsNewStatus.Height;
                else
                    tsNewStatus.Top = -(tsNewStatus.Height);
            }
            else
            {
                tsNewStatus.Top = 0;
                this.Top -= tsNewStatus.Height;
            }

            tsNewStatus.Visible = true;
            UpdateLayout();
        }
Exemple #4
0
 private void HookupStatusEvents(TimelineStatus tsNewStatus)
 {
     tsNewStatus.TextElementClicked  += new TweetTextField.TextElementClickHandler(this.Status_TextElementClicked);
     tsNewStatus.RetweetClicked      += new EventHandler(Status_RetweetClick);
     tsNewStatus.QuoteTweetClicked   += new EventHandler(Status_QuoteTweetClick);
     tsNewStatus.FavoriteClicked     += new EventHandler(Status_FavoriteClick);
     tsNewStatus.ReplyClicked        += new EventHandler(Status_ReplyClick);
     tsNewStatus.ConversationClicked += new EventHandler(Status_ConversationClick);
 }
 private void HookupStatusEvents(TimelineStatus tsNewStatus)
 {
     tsNewStatus.TextElementClicked += new TweetTextField.TextElementClickHandler(this.Status_TextElementClicked);
     tsNewStatus.RetweetClicked += new EventHandler(Status_RetweetClick);
     tsNewStatus.QuoteTweetClicked += new EventHandler(Status_QuoteTweetClick);
     tsNewStatus.FavoriteClicked += new EventHandler(Status_FavoriteClick);
     tsNewStatus.ReplyClicked += new EventHandler(Status_ReplyClick);
     tsNewStatus.ConversationClicked += new EventHandler(Status_ConversationClick);
 }
Exemple #6
0
        public void Push(Status stToAdd, BasicAPI bAPI)
        {
            TimelineStatus tsNewStatus = new TimelineStatus(stToAdd, bAPI);
            TimelineStatus tsOldTop    = null;

            DisableLoadingAnimation();

            if (m_stsControls.Count > 0)
            {
                tsOldTop = m_stsControls.Peek();
            }

            this.Controls.Add(tsNewStatus);
            m_stsControls.Push(tsNewStatus);
            tsNewStatus.UpdateLayout();
            tsNewStatus.BackColor = this.BackColor;
            HookupStatusEvents(tsNewStatus);

            m_iTotalControlHeight += tsNewStatus.Height;
            OnResize(EventArgs.Empty);

            if (m_bScrolledToTop)
            {
                if (tsOldTop != null)
                {
                    tsNewStatus.Top = tsOldTop.Top - tsNewStatus.Height;
                }
                else
                {
                    tsNewStatus.Top = -(tsNewStatus.Height);
                }
            }
            else
            {
                tsNewStatus.Top = 0;
                this.Top       -= tsNewStatus.Height;
            }

            tsNewStatus.Visible = true;
            UpdateLayout();
        }
Exemple #7
0
        private void tmlTimeline_RetweetClicked(object sender, TimelineStatus tsControl, Status stStatus)
        {
            DialogResult drAnswer = MessageBox.Show("Retweet to your followers?\n\n" + stStatus["text"], "Retweet", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);

            if (drAnswer == System.Windows.Forms.DialogResult.Yes)
                Accounts.ActiveAccount.BasicAPI.Retweet(RetweetCallback, null, stStatus["id"].ToString());
        }
Exemple #8
0
 private void tmlTimeline_FavoriteClicked(object sender, TimelineStatus tsControl, Status stStatus)
 {
     if (tsControl.Favorite)
         Accounts.ActiveAccount.BasicAPI.CreateFavorite(FavoriteCreateCallback, null, stStatus["id"].ToString());
     else
         Accounts.ActiveAccount.BasicAPI.DestroyFavorite(FavoriteDestroyCallback, null, stStatus["id"].ToString());
 }
Exemple #9
0
 private void tmlTimeline_QuoteTweetClicked(object sender, TimelineStatus tsControl, Status stStatus)
 {
     m_ftTweetForm.Avatar = m_twController.ActiveAccount.Avatar;
     m_ftTweetForm.ShowDialog("\"@" + stStatus.User["screen_name"].ToString() + ": " + stStatus["text"].ToString() + "\"");
 }