예제 #1
0
        internal Stopwatch(TeaTimer._TeaTimer oTT, TeaTimer oParent, double dOpacity)
        {
            InitializeComponent();
            this._oTT     = oTT;
            this._oParent = oParent;

            //get embedded images
            System.Reflection.Assembly oAssembly = System.Reflection.Assembly.GetExecutingAssembly();
            imgPause      = new Bitmap(oAssembly.GetManifestResourceStream("TeaTimer.smallpause.gif"));
            imgPlay       = new Bitmap(oAssembly.GetManifestResourceStream("TeaTimer.smallplay.gif"));
            btnStop.Image = new Bitmap(oAssembly.GetManifestResourceStream("TeaTimer.smallstop.gif"));

            //tooltips
            tip.SetToolTip(btnStop, "Stop and Remove timer");
            tip.SetToolTip(btnPause, "Pause/Resume timer");
            tip.SetToolTip(tbarOpacity, "Adjust opacity");

            updatePauseBtn();
            TeaTimer.dispIcon(pbxIcon, oTT.VisualAlert);
            update();
            FadeForm(dOpacity);
            tbarOpacity.Value = (int)(dOpacity * 100);

            //event handlers
            timUpdate.Tick     += new EventHandler(timUpdate_Tick);
            _oExpired           = new EventHandler(_oTT_Expired);
            _oTT.Expired       += _oExpired;
            _oStatusChanged     = new EventHandler(_oTT_StatusChanged);
            _oTT.StatusChanged += _oStatusChanged;

            timUpdate.Start();
        }
예제 #2
0
        private void update()
        {
            this.Text    = lblName.Text = _oTT.Name;
            lblTime.Text = TeaTimer.getFormattedTime(_oTT.getTimeLeft());
            //tooltip
            StringBuilder sTemp = new StringBuilder();

            sTemp.Append(_oTT.Name);
            sTemp.Append("\nTotal: ");
            sTemp.Append(TeaTimer.getFormattedTime(_oTT.Time));
            sTemp.Append("\nElapsed: ");
            sTemp.Append(TeaTimer.getFormattedTime(_oTT.getTimeElapsed()));
            sTemp.Append("\nWill pop: ");
            sTemp.Append(_oTT.Paused?"*** PAUSED ***":TeaTimer.getTimeString(_oTT.Finished));
            sTemp.Append("\nVisual alert: ");
            sTemp.Append(_oTT.VisualAlert.Length > 0?"yes":"no");
            sTemp.Append("\nAudible alert: ");
            sTemp.Append(_oTT.AudibleAlert.Length > 0?"yes":"no");
            sTemp.Append("\nProgram: ");
            sTemp.Append(_oTT.ProcessAlert.Length > 0?"yes":"no");
            sTemp.Append("\nRepeating: ");
            sTemp.Append(_oTT.Recurring?"yes":"no");
            tip.SetToolTip(lblTime, sTemp.ToString());
            tip.SetToolTip(pbxIcon, sTemp.ToString());
        }
예제 #3
0
 internal Stopwatch(EventHandler oScrollHandler, double dOpacity)
 {
     InitializeComponent();
     TeaTimer.dispIcon(pbxIcon, "App.ico");
     this.Text        = "Set my opactiy";
     lblName.Text     = "Slide me -->";
     btnPause.Visible = false;
     btnStop.Visible  = false;
     FadeForm(dOpacity);
     tbarOpacity.Value   = (int)(dOpacity * 100);
     tbarOpacity.Scroll += oScrollHandler;
     tip.SetToolTip(tbarOpacity, "Adjust opacity");
 }
예제 #4
0
        public TimerPop(string sName, string sIcon, string sSoundFile, bool bMovable)
        {
            InitializeComponent();

            this.FormBorderStyle = bMovable?FormBorderStyle.FixedToolWindow:FormBorderStyle.None;
            lblName.Text         = sName;
            this.Text            = sName + " (Tea Timer)";
            if (sIcon != null)
            {
                TeaTimer.dispIcon(pictureBox1, sIcon);
            }
            this.FadeForm(Fade.Up);
            if (sSoundFile != null)
            {
                TeaTimer.playSound(sSoundFile);
            }
        }
예제 #5
0
 private void btnOk_Click(object sender, System.EventArgs e)
 {
     //this.FadeForm(Fade.Down);
     this.Close();
     TeaTimer.stopSound();
 }