Quote from saeid on April 14, 2021, 11:24 amIn my publication, the startup actions take about one minute to run. I want that during this time a splash to be shown to the user. How can I do this?
And if it is impossible, what's your idea to suspend the main window of publication before running the startup actions and showing a picture or a gif instead?
In my publication, the startup actions take about one minute to run. I want that during this time a splash to be shown to the user. How can I do this?
And if it is impossible, what's your idea to suspend the main window of publication before running the startup actions and showing a picture or a gif instead?
Quote from Gaev on April 14, 2021, 4:18 pm@saeid
the startup actions take about one minute to run
a) That seems a rather long time ... how many commands/loops are there ?
b) are the startup actions in the pub's Startup section ... or in the PageEnter section of the first page ?
what's your idea to suspend the main window of publication before running the startup actions and showing a picture or a gif instead?
Why not just make the first page to be populated by the gif/image ... and the last command in your startup actions could be to ...
GotoPage "{nameOfYourSecondPageHere}"You could also consider placing a TextBox on the first page (with the splash image) whose content is a [variable] ... and update this [variable] periodically from within your startup actions ... to reduce the anxiety levels associated with users not knowing what is taking so long.
the startup actions take about one minute to run
a) That seems a rather long time ... how many commands/loops are there ?
b) are the startup actions in the pub's Startup section ... or in the PageEnter section of the first page ?
what's your idea to suspend the main window of publication before running the startup actions and showing a picture or a gif instead?
Why not just make the first page to be populated by the gif/image ... and the last command in your startup actions could be to ...
GotoPage "{nameOfYourSecondPageHere}"
You could also consider placing a TextBox on the first page (with the splash image) whose content is a [variable] ... and update this [variable] periodically from within your startup actions ... to reduce the anxiety levels associated with users not knowing what is taking so long.
Quote from PaulJonestindall on April 15, 2021, 3:39 pm@saeid
I agree with @gaev that does seem a bit long to load but I also have some programs that need to gather a lot of data from various places, calculate dates, do queries etc. before the user can even begin to use the program. I think the native splash screen doesn't quite work as intended so here are a few techniques that I use.
I use a container or text object on the bottom of my pub using a [StatusBar] variable.
The first line in my StartUp is Suspend "True" with SetVar "[StatusBar]" in various places in my start up code to inform the user of what's going on within the code.
The last line would then be Suspend "False".
I find the Suspend action rather important, it prevents the user starting any button actions before the startup is complete. This could be disastrous if you're loading DB tables or connecting to a network of some sort.If you want an actual splash window you could use a Container object with an image and text box with your status variable set at center screen and once your start up code finishes use MoveObject to take it off to the left of your pub window.
Gaev's suggestion also works. Keep in mind what you want your user to see when the program starts.
There are many different ways you can achieve a splash with varying effects. It just depends on how you want it to look.
I agree with @gaev that does seem a bit long to load but I also have some programs that need to gather a lot of data from various places, calculate dates, do queries etc. before the user can even begin to use the program. I think the native splash screen doesn't quite work as intended so here are a few techniques that I use.
I use a container or text object on the bottom of my pub using a [StatusBar] variable.
The first line in my StartUp is Suspend "True" with SetVar "[StatusBar]" in various places in my start up code to inform the user of what's going on within the code.
The last line would then be Suspend "False".
I find the Suspend action rather important, it prevents the user starting any button actions before the startup is complete. This could be disastrous if you're loading DB tables or connecting to a network of some sort.
If you want an actual splash window you could use a Container object with an image and text box with your status variable set at center screen and once your start up code finishes use MoveObject to take it off to the left of your pub window.
Gaev's suggestion also works. Keep in mind what you want your user to see when the program starts.
There are many different ways you can achieve a splash with varying effects. It just depends on how you want it to look.
Quote from saeid on April 17, 2021, 11:12 am@gaev
Thanks for your reply.
a) That seems a rather long time ... how many commands/loops are there ?
My startup actions read a .csv file that has a large number of data.
b) are the startup actions in the pub's Startup section ... or in the PageEnter section of the first page ?
My startup actions are in in the pub's Startup section.
Why not just make the first page to be populated by the gif/image ... and the last command in your startup actions could be to ...
Actually I want that my spalsh window doesn't have main menu, close button, minimize button and maximize button.
Thanks for your reply.
a) That seems a rather long time ... how many commands/loops are there ?
My startup actions read a .csv file that has a large number of data.
b) are the startup actions in the pub's Startup section ... or in the PageEnter section of the first page ?
My startup actions are in in the pub's Startup section.
Why not just make the first page to be populated by the gif/image ... and the last command in your startup actions could be to ...
Actually I want that my spalsh window doesn't have main menu, close button, minimize button and maximize button.
Quote from PaulJonestindall on April 17, 2021, 2:06 pmLots of ways to make a Splash.
Give this a look.
Lots of ways to make a Splash.
Give this a look.
Quote from Gaev on April 17, 2021, 2:15 pm@saeid
My startup actions read a .csv file that has a large number of data.
I know this is off topic, but can you share ...
a) how many lines of data there are in your csv file
b) whether you fetch this data one line at a time (i.e. via FileRead inside a Loop/EndLoop)Note that there is a dramatic difference between ...
- the straightforward method of reading a line at a time
and
- reading the entire file content into a [variable], doing a StrParse to split them into items within an [arrayedVariable], and accessing the items inside the Loop/EndLoop.Actually I want that my spalsh window doesn't have main menu, close button, minimize button and maximize button.
You might be able to get around the menu items issue by hiding/disabling menu items at design time ... and then showing/enabling them via script commands after your initialization process is completed ... details can be found here ...
https://winhelp.visualneo.com/Menus.html
Also, it has been a long time but I faintly recall that you could assign negative y co-ordinates to your image so it displays over the menu bar.
Finally, on this Help page ... https://winhelp.visualneo.com/Actions.html ... you can find information about scripting the ShutDown section of your pub ... you can setup a variable (e.g. [userShutDownAllowed]) and use its value to prevent shutdown requests by users during the startup phase of your Application
My startup actions read a .csv file that has a large number of data.
I know this is off topic, but can you share ...
a) how many lines of data there are in your csv file
b) whether you fetch this data one line at a time (i.e. via FileRead inside a Loop/EndLoop)
Note that there is a dramatic difference between ...
- the straightforward method of reading a line at a time
and
- reading the entire file content into a [variable], doing a StrParse to split them into items within an [arrayedVariable], and accessing the items inside the Loop/EndLoop.
Actually I want that my spalsh window doesn't have main menu, close button, minimize button and maximize button.
You might be able to get around the menu items issue by hiding/disabling menu items at design time ... and then showing/enabling them via script commands after your initialization process is completed ... details can be found here ...
https://winhelp.visualneo.com/Menus.html
Also, it has been a long time but I faintly recall that you could assign negative y co-ordinates to your image so it displays over the menu bar.
Finally, on this Help page ... https://winhelp.visualneo.com/Actions.html ... you can find information about scripting the ShutDown section of your pub ... you can setup a variable (e.g. [userShutDownAllowed]) and use its value to prevent shutdown requests by users during the startup phase of your Application
Quote from saeid on April 17, 2021, 3:06 pm@gaev
a) how many lines of data there are in your csv file
my .csv file has 40 rows and 41 columns.
b) whether you fetch this data one line at a time (i.e. via FileRead inside a Loop/EndLoop)
first of all, my publication reads the entire .csv file into a variable and then splits them into arrays by strparse. Finally the arrays is splitted into different variables inside a loop.
a) how many lines of data there are in your csv file
my .csv file has 40 rows and 41 columns.
b) whether you fetch this data one line at a time (i.e. via FileRead inside a Loop/EndLoop)
first of all, my publication reads the entire .csv file into a variable and then splits them into arrays by strparse. Finally the arrays is splitted into different variables inside a loop.
Quote from Gaev on April 17, 2021, 3:17 pm@saeid
Thank you for sharing this information.
.csv file has 40 rows and 41 columns.
reads the entire .csv file into a variable and then splits them into arrays by strparse. Finally the arrays is splitted into different variables inside a loop.40 lines is a small number; since you are reading the file contents from the disk in an efficient manner, it looks like you must have a LOT of processing for each line.
So, not much room for improvement :-(
Thank you for sharing this information.
.csv file has 40 rows and 41 columns.
reads the entire .csv file into a variable and then splits them into arrays by strparse. Finally the arrays is splitted into different variables inside a loop.
40 lines is a small number; since you are reading the file contents from the disk in an efficient manner, it looks like you must have a LOT of processing for each line.
So, not much room for improvement :-(