Ecere SDK/eC Forums https://ecere.org/community/ Print view |
|
Code Snippet03--SplashWindow(Timer driven) https://ecere.org/community/viewtopic.php?f=5&t=168 |
Page 1 of 2 |
Author: | samsam598 [ Wed Aug 24, 2011 10:59 pm ] |
Post subject: | Code Snippet03--SplashWindow(Timer driven) |
Purpose:Showing a startup screen before the main window shows.A label shows the seconds elapsed from 5 to 1,when it counts to 1,the splash window will close and the main window will get shown.In the future version a reall cool picture will be used instead of plain text message. Known Issue:Ideally the main windows should get shown after the splash windows destroyed,but right at this moment I don't know how to make it,so in this version the main windows is visible also when the splash window get shown at program startup.I just make the size of the splash windows bigger than the main window to hide this issue.Will fix it in the future version. main.ec Code: Select all
Code: Select all
|
Author: | jerome [ Thu Aug 25, 2011 12:55 am ] |
Post subject: | Re: Code Snippet03--SplashWindow(ver1) |
Sam, 1. Your 'App' class isn't working because it should be inheriting from 'GuiApplication', not GUIApplication, note the character case. I will double check, I might have made that mistake in my first post explaining this to you. It doesn't seem to matter though which Window gets created first, for whatever reason Windows always decides to draw the form on top first and then draw the splash on top. So the whole Init() and the Create() doesn't seem to make any difference. 2. To get the behavior that you probably want, I saw you set 'isModal = true' in the splash, which is good, but for it to work you need to set its 'master' to be 'mainForm': Code: Select all
4. By the way when you post code on the forums, you can make it syntax highlighted by using: [ code=eC ] [ /code ] (without the spaces of course). |
Author: | samsam598 [ Thu Aug 25, 2011 1:11 am ] |
Post subject: | Re: Code Snippet03--SplashWindow(ver1) |
Hi Jerome, I've made the modifications based on your guideline. 1.I tested both GuiAppliation and GUIApplication but it seems both work.Don't know why. 2.Revised. 3.Sorry that's an accident. 4.Got it. Sorry don't quite understand the point.Could you please further clarify? Appreciated. Sam |
Author: | jerome [ Thu Aug 25, 2011 1:16 am ] |
Post subject: | Re: Code Snippet03--SplashWindow(ver1) |
As you're saying, I was just saying the same thing. It doesn't make a difference in terms of how the windows show up. The 'master' and 'isModal' properties control which window will go on top. But if you put a MessageBox or a PrintLn or a breakpoint in your App::Init() function, you will see that it never gets executed if you use ':GUIApplication', but it will if you use ':GuiApplication'. If you don't have other needs for Init() or GuiApplication, you can take out the whole 'App : GuiApplication' class definition. |
Author: | samsam598 [ Thu Aug 25, 2011 1:25 am ] |
Post subject: | Re: Code Snippet03--SplashWindow(ver1) |
Got it! |
Author: | D.Bane [ Wed Sep 07, 2011 10:43 am ] |
Post subject: | Re: Code Snippet03--SplashWindow(Timer driven) |
Hi to all Long time since I had time to come here Sam, I tried to get my applications to ecere and had some encounters with splash screen as well. I would change few things in your code to make it seem activating in the order you want it. in main.ec add this to call of your main window class: Code: Select all
Code: Select all
Hope it helps you. D.Bane |
Author: | jerome [ Wed Sep 07, 2011 11:17 am ] |
Post subject: | Re: Code Snippet03--SplashWindow(Timer driven) |
Hey D.Bane! long time indeed! You're right you can see the windows popping up in that order if you set visible = false... But with the fix I proposed above (isModal / master) you can have both windows displayed at the same time, but the proper one on top. Depends on what you want to do of course. Do you have some time to play with Ecere lately? We are now using git and on github! You can keep up with the latest version of the SDK with a simple pull ! Take care, Jerome |
Author: | samsam598 [ Wed Sep 07, 2011 7:40 pm ] |
Post subject: | Re: Code Snippet03--SplashWindow(Timer driven) |
Thank you D.Bane!It really helps and the result is exactly what I want.Already updated the example. |
Author: | D.Bane [ Wed Sep 07, 2011 8:27 pm ] |
Post subject: | Re: Code Snippet03--SplashWindow(Timer driven) |
Hi. It is nice to be helpful and I am glad that it worked as you want it. The Jerome's way is great for splash screens like in Photoshop, where you have main window shown but not active for usage and you can see the splash screen. This is also good to make some effects around the window by using the main window behind it (a picture in it, etc...) I personally like the ones where you have splash screen and after that you have your main window show if everything loads/checks, etc. I still have not figured out how to make the transparency of it decrease/increase as well Jerome, yes I had time to play with Ecere and from all the things that I got across on the internet, this is by far the best one. I have great time troubling myself with ecere and finding how to do make its power work for me properly I need to do make install on the source code when I get it from Git right? Oh yes, I did not forget about you all, I just have very little time to come on forums..When I have time I try to buzz trough them as much as possible. So when I have more time, expect some questions Best regards, D.Bane. |
Author: | jerome [ Wed Sep 07, 2011 9:26 pm ] |
Post subject: | Re: Code Snippet03--SplashWindow(Timer driven) |
D.Bane, Yes first you do 'make', and then 'make install' if that succeeds (That will install it under C:\Program Files\Ecere SDK , you need an elevated command prompt on Vista/7 to do that -- it HAS to say Administrator at the top, you need to right click the cmd.exe icon and do 'Run as administrator'). Transparency -- I think that would be possible, but you'd need to set the 'alphaBlend' property of your Window to true, and it might not be fully working under Linux right now (that is, windows that are translucent with the rest of the desktop, like in the ColorSpheres and HiraganaCube sample). Could be tricky to do with an image / ramping opacity ... 'opacity' applies only to the 'background' color I believe. It would be interested to get a sample going I'm looking forward to your questions! As you might have noticed, Sam has been asking a lot of good questions lately, so you might even find some answers there! Cheers, Jerome |
All times are UTC-05:00 | Page 1 of 2 |
Powered by phpBB® Forum Software © phpBB Limited |