FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

form as a splash screen?

 
Post new topic   Reply to topic     Forum Index -> DFL
View previous topic :: View next topic  
Author Message
Keyframe



Joined: 04 Nov 2007
Posts: 9

PostPosted: Fri Apr 25, 2008 7:47 am    Post subject: form as a splash screen? Reply with quote

I'm not sure about this, but shouldn't the following code work?

splash.d
Code:

/*
   Generated by Entice Designer
   Entice Designer written by Christopher E. Miller
   www.dprogramming.com/entice.php
*/
module splash;

import dfl.all;


class Splash: dfl.form.Form
{
   this()
   {
      initializeSplash();
      
      //@  Other Splash initialization code here.
      
   }
   
   
   private void initializeSplash()
   {
      // Do not manually modify this function.
      //~Entice Designer 0.8.5.02 code begins here.
      //~DFL Form
      backColor = dfl.all.Color(0, 0, 0);
      controlBox = false;
      formBorderStyle = dfl.all.FormBorderStyle.NONE;
      opacity = 0.65;
      showInTaskbar = false;
      startPosition = dfl.all.FormStartPosition.CENTER_SCREEN;
      clientSize = dfl.all.Size(640, 360);
      //~Entice Designer 0.8.5.02 code ends here.
   }
}


and application splash_test.d
Code:

module splash_test;

import tango.core.Thread;
import dfl.all;
import splash;

int main()
{
        Form myForm2;

        myForm2 = new Splash;

        myForm2.showDialog();
        Thread.sleep(5);   
        myForm2.close();
       

// ----------------------------
       
        Form myForm;
        Label myLabel;

        myForm = new Form;
        myForm.text = "DFL Test";

        myLabel = new Label;
        myLabel.font = new Font("Verdana", 14f);
        myLabel.text = "test";
        myLabel.location = Point(15, 15);
        myLabel.autoSize = true;
        myLabel.parent = myForm;

        Application.run(myForm);
       

        return 0;
}


evidently, I can't close first form, only with alt+f4, and I wan't to use it as a splash screen, to display for several seconds and auto close and proceed with application as usual.

edit: nm, I was stupid and using showDialog instead of show().. however I wonder if this is the way to make splash screen? Any better ideas? Since now I have a waiting hourglass when I do thread.sleep - and I don't wan't that Smile
Back to top
View user's profile Send private message
Chris Miller



Joined: 27 Mar 2004
Posts: 514
Location: The Internet

PostPosted: Fri Apr 25, 2008 10:24 am    Post subject: Re: form as a splash screen? Reply with quote

There are timers, or the recently added Application.doEvents(millisecondsDelay): Application.doEvents(5000); // Do events for 5 seconds and then continue.
Back to top
View user's profile Send private message
Keyframe



Joined: 04 Nov 2007
Posts: 9

PostPosted: Fri Apr 25, 2008 6:54 pm    Post subject: Reply with quote

Excellent, I have my splash screen now Smile Though there was a slight headache with Entice (it deleted my custom code whenever I changed somethign visually Smile ).

Now, is there a way I can disable keyboard input processing for the form somehow? since I don't want the user to be able to shut off the splash screen with alt-f4, let him wait while its done (its a fancy screen for loading basically) - and then resume control to the master form that shows up later.
Back to top
View user's profile Send private message
Chris Miller



Joined: 27 Mar 2004
Posts: 514
Location: The Internet

PostPosted: Sun Apr 27, 2008 9:04 am    Post subject: Reply with quote

Keyframe wrote:
Though there was a slight headache with Entice (it deleted my custom code whenever I changed somethign visually Smile ).
I suspect you were adding code where it told you not to. The initialize function is separate so you can ignore it or even fold it up.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DFL All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group