Esempio n. 1
0
        private static void SplashImageAssync(ComplexDlgOptions Options)
        {
            SplashDialog thisSplash = null;

            System.Drawing.Image thisImage = null;

            if (splashDialogs.ContainsKey(Options.GUIID))
            {
                thisSplash = splashDialogs[Options.GUIID];
                if (thisSplash.InvokeRequired)
                {
                    thisSplash.Invoke(new AsyncCallDlgOptions(SplashImageAssync), Options);
                }
            }

            if (thisSplash != null)
            {
                Options.AppendShowHideTo(thisSplash);
            }
            else
            {
                thisSplash = new SplashDialog();
                splashDialogs.Add(Options.GUIID, thisSplash);
            }

            Options.AppendTo(thisSplash);

            #region Splash specific Options

            if (File.Exists(Options.Param1))
            {
                try
                {
                    thisImage = System.Drawing.Bitmap.FromFile(Options.Param1);
                }
                catch (Exception)
                {
                    ErrorLevel = 1;
                    return;
                }

                if (thisImage != null)
                {
                    thisSplash.Image = thisImage;
                }
            }

            #endregion Splash specific Options

            if (!Options.Hide && !thisSplash.Visible)
            {
                thisSplash.Show();
            }
        }
Esempio n. 2
0
        /// <summary>
        /// Creates or updates a window containing a progress bar or an image.
        /// </summary>
        /// <param name="ProgressParam1">
        /// <para>If the progress window already exists: If Param1 is the word OFF, the window is destroyed. If Param1 is the word SHOW, the window is shown if it is currently hidden.</para>
        /// <para>Otherwise, if Param1 is an pure number, its bar's position is changed to that value. If Param1 is blank, its bar position will be unchanged but its text will be updated to reflect any new strings provided in SubText, MainText, and WinTitle. In both of these modes, if the window doesn't yet exist, it will be created with the defaults for all options.</para>
        /// <para>If the progress window does not exist: A new progress window is created (replacing any old one), and Param1 is a string of zero or more options from the list below.</para>
        /// </param>
        /// <param name="SubText">The text to display below the image or bar indicator. Although word-wrapping will occur, to begin a new line explicitly, use linefeed (`n). To set an existing window's text to be blank, specify %A_Space%. For the purpose of auto-calculating the window's height, blank lines can be reserved in a way similar to MainText below.</param>
        /// <param name="MainText">
        /// <para>The text to display above the image or bar indicator (its font is semi-bold). Although word-wrapping will occur, to begin a new line explicitly, use linefeed (`n).</para>
        /// <para>If blank or omitted, no space will be reserved in the window for MainText. To reserve space for single line to be added later, or to set an existing window's text to be blank, specify %A_Space%. To reserve extra lines beyond the first, append one or more linefeeds (`n).</para>
        /// <para>Once the height of MainText's control area has been set, it cannot be changed without recreating the window.</para>
        /// </param>
        /// <param name="WinTitle">The text to display below the image or bar indicator. Although word-wrapping will occur, to begin a new line explicitly, use linefeed (`n). To set an existing window's text to be blank, specify %A_Space%. For the purpose of auto-calculating the window's height, blank lines can be reserved in a way similar to MainText below.</param>
        /// <param name="FontName">
        /// <para>The name of the font to use for both MainText and SubText. The font table lists the fonts included with the various versions of Windows. If unspecified or if the font cannot be found, the system's default GUI font will be used.</para>
        /// <para>See the options section below for how to change the size, weight, and color of the font.</para>
        /// </param>
        public static void Progress(string ProgressParam1, string SubText, string MainText, string WinTitle, string FontName)
        {
            InitDialoges();

            var progressOptions = new ComplexDlgOptions()
            {
                SubText  = SubText,
                MainText = MainText,
                WinTitle = WinTitle,
            };

            progressOptions.ParseGuiID(ProgressParam1);
            progressOptions.ParseComplexOptions(ProgressParam1);

            ProgressAssync(progressOptions);
        }
Esempio n. 3
0
        private static void ProgressAssync(ComplexDlgOptions Options)
        {
            ProgressDialog thisProgress = null;

            if (progressDialgos.ContainsKey(Options.GUIID))
            {
                thisProgress = progressDialgos[Options.GUIID];
                if (thisProgress.InvokeRequired)
                {
                    thisProgress.Invoke(new AsyncCallDlgOptions(ProgressAssync), Options);
                }
            }

            if (thisProgress != null)
            {
                Options.AppendShowHideTo(thisProgress);
            }
            else
            {
                thisProgress = new ProgressDialog();
                progressDialgos.Add(Options.GUIID, thisProgress);
            }

            Options.AppendTo(thisProgress);

            #region Parse Progress specific Options

            short num;
            if (!short.TryParse(Options.Param1, out num))
            {
                num = 0;
            }
            thisProgress.ProgressValue = num;

            #endregion Parse Progress specific Options

            if (!Options.Hide && !thisProgress.Visible)
            {
                thisProgress.Show();
            }
        }
Esempio n. 4
0
        /// <summary>
        /// Creates or updates a window containing a progress bar or an image.
        /// </summary>
        /// <param name="ImageFile">
        /// <para>If this is the word OFF, the window is destroyed. If this is the word SHOW, the window is shown if it is currently hidden.</para>
        /// <para>Otherwise, this is the file name of the BMP, GIF, or JPG image to display (to display other file formats such as PNG, TIF, and ICO, consider using the Gui command to create a window containing a picture control).</para>
        /// <para>ImageFile is assumed to be in %A_WorkingDir% if an absolute path isn't specified. If ImageFile and Options are blank and the window already exists, its image will be unchanged but its text will be updated to reflect any new strings provided in SubText, MainText, and WinTitle.</para>
        /// <para>For newly created windows, if ImageFile is blank or there is a problem loading the image, the window will be displayed without the picture.</para>
        /// </param>
        /// <param name="Options">A string of zero or more options from the list further below.</param>
        /// <param name="SubText">The text to display below the image or bar indicator. Although word-wrapping will occur, to begin a new line explicitly, use linefeed (`n). To set an existing window's text to be blank, specify %A_Space%. For the purpose of auto-calculating the window's height, blank lines can be reserved in a way similar to MainText below.</param>
        /// <param name="MainText">
        /// <para>The text to display above the image or bar indicator (its font is semi-bold). Although word-wrapping will occur, to begin a new line explicitly, use linefeed (`n).</para>
        /// <para>If blank or omitted, no space will be reserved in the window for MainText. To reserve space for single line to be added later, or to set an existing window's text to be blank, specify %A_Space%. To reserve extra lines beyond the first, append one or more linefeeds (`n).</para>
        /// <para>Once the height of MainText's control area has been set, it cannot be changed without recreating the window.</para>
        /// </param>
        /// <param name="WinTitle">The title of the window. If omitted and the window is being newly created, the title defaults to the name of the script (without path). If the B (borderless) option has been specified, there will be no visible title bar but the window can still be referred to by this title in commands such as WinMove.</param>
        /// <param name="FontName">
        /// <para>The name of the font to use for both MainText and SubText. The font table lists the fonts included with the various versions of Windows. If unspecified or if the font cannot be found, the system's default GUI font will be used.</para>
        /// <para>See the options section below for how to change the size, weight, and color of the font.</para>
        /// </param>
        public static void SplashImage(string ImageFile, string Options, string SubText, string MainText, string WinTitle, string FontName)
        {
            InitDialoges();

            if (string.IsNullOrEmpty(ImageFile))
            {
                return;
            }

            var splashOptions = new ComplexDlgOptions()
            {
                SubText  = SubText,
                MainText = MainText,
                WinTitle = WinTitle,
            };

            splashOptions.ParseGuiID(ImageFile);
            splashOptions.ParseComplexOptions(Options);

            SplashImageAssync(splashOptions);
        }
Esempio n. 5
0
        private static void SplashImageAssync(ComplexDlgOptions Options) {

            SplashDialog thisSplash = null;
            System.Drawing.Image thisImage = null;


            if(splashDialogs.ContainsKey(Options.GUIID)) {
                thisSplash = splashDialogs[Options.GUIID];
                if(thisSplash.InvokeRequired) {
                    thisSplash.Invoke(new AsyncCallDlgOptions(SplashImageAssync), Options);
                }
            }

            if(thisSplash != null) {
                Options.AppendShowHideTo(thisSplash);
            } else {
                thisSplash = new SplashDialog();
                splashDialogs.Add(Options.GUIID, thisSplash);
            }

            Options.AppendTo(thisSplash);

            #region Splash specific Options

            if(File.Exists(Options.Param1)) {
                try {
                    thisImage = System.Drawing.Bitmap.FromFile(Options.Param1);
                } catch(Exception) {
                    ErrorLevel = 1;
                    return;
                }

                if(thisImage != null) {
                    thisSplash.Image = thisImage;
                }
            }

            #endregion

            if(!Options.Hide && !thisSplash.Visible)
                thisSplash.Show();

        }
Esempio n. 6
0
        /// <summary>
        /// Creates or updates a window containing a progress bar or an image.
        /// </summary>
        /// <param name="ImageFile">
        /// <para>If this is the word OFF, the window is destroyed. If this is the word SHOW, the window is shown if it is currently hidden.</para>
        /// <para>Otherwise, this is the file name of the BMP, GIF, or JPG image to display (to display other file formats such as PNG, TIF, and ICO, consider using the Gui command to create a window containing a picture control).</para>
        /// <para>ImageFile is assumed to be in %A_WorkingDir% if an absolute path isn't specified. If ImageFile and Options are blank and the window already exists, its image will be unchanged but its text will be updated to reflect any new strings provided in SubText, MainText, and WinTitle.</para>
        /// <para>For newly created windows, if ImageFile is blank or there is a problem loading the image, the window will be displayed without the picture.</para>
        /// </param>
        /// <param name="Options">A string of zero or more options from the list further below.</param>
        /// <param name="SubText">The text to display below the image or bar indicator. Although word-wrapping will occur, to begin a new line explicitly, use linefeed (`n). To set an existing window's text to be blank, specify %A_Space%. For the purpose of auto-calculating the window's height, blank lines can be reserved in a way similar to MainText below.</param>
        /// <param name="MainText">
        /// <para>The text to display above the image or bar indicator (its font is semi-bold). Although word-wrapping will occur, to begin a new line explicitly, use linefeed (`n).</para>
        /// <para>If blank or omitted, no space will be reserved in the window for MainText. To reserve space for single line to be added later, or to set an existing window's text to be blank, specify %A_Space%. To reserve extra lines beyond the first, append one or more linefeeds (`n).</para>
        /// <para>Once the height of MainText's control area has been set, it cannot be changed without recreating the window.</para>
        /// </param>
        /// <param name="WinTitle">The title of the window. If omitted and the window is being newly created, the title defaults to the name of the script (without path). If the B (borderless) option has been specified, there will be no visible title bar but the window can still be referred to by this title in commands such as WinMove.</param>
        /// <param name="FontName">
        /// <para>The name of the font to use for both MainText and SubText. The font table lists the fonts included with the various versions of Windows. If unspecified or if the font cannot be found, the system's default GUI font will be used.</para>
        /// <para>See the options section below for how to change the size, weight, and color of the font.</para>
        /// </param>
        public static void SplashImage(string ImageFile, string Options, string SubText, string MainText, string WinTitle, string FontName) {

            InitDialoges();

            if(string.IsNullOrEmpty(ImageFile))
                return;

            var splashOptions = new ComplexDlgOptions()
            {
                SubText = SubText,
                MainText = MainText,
                WinTitle = WinTitle,
            };
            splashOptions.ParseGuiID(ImageFile);
            splashOptions.ParseComplexOptions(Options);


            SplashImageAssync(splashOptions);
        }
Esempio n. 7
0
        private static void ProgressAssync(ComplexDlgOptions Options) {
            ProgressDialog thisProgress = null;

            if(progressDialgos.ContainsKey(Options.GUIID)) {
                thisProgress = progressDialgos[Options.GUIID];
                if(thisProgress.InvokeRequired) {
                    thisProgress.Invoke(new AsyncCallDlgOptions(ProgressAssync), Options);
                }
            }

            if(thisProgress != null) {
                Options.AppendShowHideTo(thisProgress);
            } else {
                thisProgress = new ProgressDialog();
                progressDialgos.Add(Options.GUIID, thisProgress);
            }

            Options.AppendTo(thisProgress);

            #region Parse Progress specific Options

            short num;
            if(!short.TryParse(Options.Param1, out num)) {
                num = 0;
            }
            thisProgress.ProgressValue = num;

            #endregion

            if(!Options.Hide && !thisProgress.Visible)
                thisProgress.Show();
        }
Esempio n. 8
0
        /// <summary>
        /// Creates or updates a window containing a progress bar or an image.
        /// </summary>
        /// <param name="ProgressParam1">
        /// <para>If the progress window already exists: If Param1 is the word OFF, the window is destroyed. If Param1 is the word SHOW, the window is shown if it is currently hidden.</para>
        /// <para>Otherwise, if Param1 is an pure number, its bar's position is changed to that value. If Param1 is blank, its bar position will be unchanged but its text will be updated to reflect any new strings provided in SubText, MainText, and WinTitle. In both of these modes, if the window doesn't yet exist, it will be created with the defaults for all options.</para>
        /// <para>If the progress window does not exist: A new progress window is created (replacing any old one), and Param1 is a string of zero or more options from the list below.</para>
        /// </param>
        /// <param name="SubText">The text to display below the image or bar indicator. Although word-wrapping will occur, to begin a new line explicitly, use linefeed (`n). To set an existing window's text to be blank, specify %A_Space%. For the purpose of auto-calculating the window's height, blank lines can be reserved in a way similar to MainText below.</param>
        /// <param name="MainText">
        /// <para>The text to display above the image or bar indicator (its font is semi-bold). Although word-wrapping will occur, to begin a new line explicitly, use linefeed (`n).</para>
        /// <para>If blank or omitted, no space will be reserved in the window for MainText. To reserve space for single line to be added later, or to set an existing window's text to be blank, specify %A_Space%. To reserve extra lines beyond the first, append one or more linefeeds (`n).</para>
        /// <para>Once the height of MainText's control area has been set, it cannot be changed without recreating the window.</para>
        /// </param>
        /// <param name="WinTitle">The text to display below the image or bar indicator. Although word-wrapping will occur, to begin a new line explicitly, use linefeed (`n). To set an existing window's text to be blank, specify %A_Space%. For the purpose of auto-calculating the window's height, blank lines can be reserved in a way similar to MainText below.</param>
        /// <param name="FontName">
        /// <para>The name of the font to use for both MainText and SubText. The font table lists the fonts included with the various versions of Windows. If unspecified or if the font cannot be found, the system's default GUI font will be used.</para>
        /// <para>See the options section below for how to change the size, weight, and color of the font.</para>
        /// </param>
        public static void Progress(string ProgressParam1, string SubText, string MainText, string WinTitle, string FontName) {

            InitDialoges();

            var progressOptions = new ComplexDlgOptions()
            {
                SubText = SubText,
                MainText = MainText,
                WinTitle = WinTitle,
            };
            progressOptions.ParseGuiID(ProgressParam1);
            progressOptions.ParseComplexOptions(ProgressParam1);

            ProgressAssync(progressOptions);
        }