Beispiel #1
0
 public static void ShowInfo(string message)
 {
     MessageBox.Show(message,
                     StringConstants.GetString(StringNames.MESSAGE_BOX_TITLE_INFO),
                     MessageBoxButtons.OK,
                     MessageBoxIcon.Information);
 }
Beispiel #2
0
 public static void ShowWarning(string message)
 {
     MessageBox.Show(message,
                     StringConstants.GetString(StringNames.MESSAGE_BOX_TITLE_WARNING),
                     MessageBoxButtons.OK,
                     MessageBoxIcon.Warning);
 }
Beispiel #3
0
 public static DialogResult ShowConfirm(string message)
 {
     return(MessageBox.Show(message,
                            StringConstants.GetString(StringNames.MESSAGE_BOX_TITLE_CONFIRM),
                            MessageBoxButtons.YesNo,
                            MessageBoxIcon.Exclamation));
 }
Beispiel #4
0
 public static void ShowError(string message)
 {
     MessageBox.Show(message,
                     StringConstants.GetString(StringNames.MESSAGE_BOX_TITLE_ERROR),
                     MessageBoxButtons.OK,
                     MessageBoxIcon.Error);
 }
        protected override void OnPaint(PaintEventArgs e)
        {
            ClearScreen(e.Graphics);

            if (_processor != null && _currentImage != null)
            {
                // apply default stretch if necessary
                if (_currentImage.StretchType == StretchTypes.UseDefault)
                {
                    _currentImage.StretchType = _processor.SlideShowConfig.StretchDefault;
                }

                // draw the image
                _currentImage.Draw(e.Graphics);

                // paint the fileName label
                if (_processor.SlideShowConfig.DisplayFileInfoDefault)
                {
                    int   width    = Screen.PrimaryScreen.Bounds.Width - (int)_pauseLabel.GetBounds(e.Graphics).Width - 80;
                    SizeF textSize = e.Graphics.MeasureString(_processor.CurrentImage.PathAndFileName, new Font("Times New Roman", 10), width);
                    e.Graphics.FillRectangle(new SolidBrush(Color.Black), 0, 0, (int)textSize.Width, (int)textSize.Height);
                    e.Graphics.DrawString(_processor.CurrentImage.PathAndFileName, new Font("Times New Roman", 10f), new SolidBrush(Color.BlanchedAlmond), new RectangleF(0, 0, textSize.Width, textSize.Height));
                }

                // paint the pause label
                if (!_slideTimer.Enabled)
                {
                    e.Graphics.FillRegion(new SolidBrush(Color.Black), _pauseLabel);
                    e.Graphics.DrawString("PAUSED", new Font("Arial", 14f), new SolidBrush(Color.BlanchedAlmond), _pauseLabel.GetBounds(e.Graphics));
                }

                // paint the textfile text
                if (Utilities.EvaluateFlags(_processor.SlideShowConfig.DisplayTextDefault, _currentImage.TextDisplayFlag))
                {
                    string textStr  = _processor.CurrentImage.GetTextFileString();
                    SizeF  textSize = e.Graphics.MeasureString(textStr, new Font("Times New Roman", 10), Screen.PrimaryScreen.Bounds.Width);
                    int    y        = Screen.PrimaryScreen.Bounds.Height - (int)textSize.Height;
                    e.Graphics.FillRectangle(new SolidBrush(Color.Black), 0, y, Screen.PrimaryScreen.Bounds.Width, (int)textSize.Height);
                    e.Graphics.DrawString(textStr, new Font("Times New Roman", 10f), new SolidBrush(Color.BlanchedAlmond), new RectangleF(0, y, Screen.PrimaryScreen.Bounds.Width, (int)textSize.Height));
                }
            }
            else
            {
                if (_currentImage == null)
                {
                    DrawErrorMessage(e.Graphics, StringConstants.GetString(StringNames.SCRIPT_EMPTY));
                }
                else
                {
                    DrawErrorMessage(e.Graphics, StringConstants.GetString(StringNames.LOAD_SLIDESHOW_FAILED));
                }
            }

            base.OnPaint(e);
        }
        protected override void Save()
        {
            try
            {
                string input = _txtValue.Text;

                _scaleFactor = float.Parse(input);

                if (_scaleFactor < Utilities.MinScaleFactor || _scaleFactor > Utilities.MaxScaleFactor)
                {
                    MessageBoxes.ShowError(StringConstants.GetString(StringNames.SCALE_FACTOR_OUT_OF_RANGE));
                    return;
                }

                DialogResult = DialogResult.OK;
                Close();
            }
            catch
            {
                MessageBoxes.ShowError(StringConstants.GetString(StringNames.INVALID_SCALE_FACTOR));
            }
        }
Beispiel #7
0
        protected override void Save()
        {
            try
            {
                string input = _txtValue.Text;
                input = input.Trim();
                //				input = input.Replace(" ", "");
                input = input.Replace("(", "");
                input = input.Replace(")", "");
                input = input.Trim();

                string[] parts = input.Split(new char[] { ' ', ',', ';' });

                if (parts.GetLength(0) != 2)
                {
                    throw new Exception();
                }

                _offset = new Point(Int32.Parse(parts[0]), Int32.Parse(parts[1]));

                if (_offset.X < (0 - Utilities.MaxOffset) || _offset.X > Utilities.MaxOffset ||
                    _offset.Y < (0 - Utilities.MaxOffset) || _offset.Y > Utilities.MaxOffset)
                {
                    MessageBoxes.ShowError(StringConstants.GetString(StringNames.POINT_OUT_OF_RANGE));
                    return;
                }

                //				MessageBox.Show(String.Format("({0}, {1})", _offset.X, _offset.Y));

                DialogResult = DialogResult.OK;
                Close();
            }
            catch
            {
                MessageBoxes.ShowError(StringConstants.GetString(StringNames.INVALID_POINT_SYNTAX));
            }
        }
Beispiel #8
0
 public static void ShowInfo(string message, string[] items)
 {
     ListBoxResultsForm.Show(message,
                             StringConstants.GetString(StringNames.MESSAGE_BOX_TITLE_INFO),
                             items);
 }