Esempio n. 1
0
        public Config(BounceWnd bounceWnd, Setup setup)
        {
            //
            // Required for Win Form Designer support
            //
            InitializeComponent();

            this.bounceWnd = bounceWnd;
            this.setup     = setup;

            CopyData(true);

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            toolTip1.SetToolTip(BallCount, "Number of balls");
            toolTip1.SetToolTip(Name, "Name to use for this setting");
            toolTip1.SetToolTip(Inverse, "More big balls than small balls");
            toolTip1.SetToolTip(Squared, "More small balls than big balls");
            toolTip1.SetToolTip(Linear, "Equal numbers of small and big balls");
            toolTip1.SetToolTip(EraseScreen, "Screen erased at start");
            toolTip1.SetToolTip(BallSizeMin, "Size of the smallest ball");
            toolTip1.SetToolTip(BallSizeMax, "Size of the largest ball");
            toolTip1.SetToolTip(WallElasticity, "Elasticity of the wall. 1.0 means no energy lost, 0.0 means all energy lost");
            toolTip1.SetToolTip(BallErase, "Old positions are erased");
            toolTip1.SetToolTip(BallCollisions, "Balls collide with each other");
            toolTip1.SetToolTip(BallGravity, "Gravity between balls");
            toolTip1.SetToolTip(BallGhost, "Number of positions to show before erase");
            toolTip1.SetToolTip(BallVelocity, "Initial speed of balls");
            toolTip1.SetToolTip(BallElasticity, "Elasticity of collisions between balls. 1.0 means no energy lost, 0.0 means all energy lost");
        }
Esempio n. 2
0
        public GlobalConfig(BounceWnd bounceWnd)
        {
            //
            // Required for Win Form Designer support
            //
            InitializeComponent();

            this.bounceWnd = bounceWnd;
            CopyData(true);

            toolTip1.SetToolTip(RestartCount, "# of frames to wait before restart (0 = never)");
            toolTip1.SetToolTip(RandomOnStartup, "Choose a random varset on startup or restart");
            toolTip1.SetToolTip(FullScreen, "Run the simulation full-screen");
        }
Esempio n. 3
0
        public Form1(string[] args)
        {
            //
            // Required for Win Form Designer support
            //
            InitializeComponent();

            CommandLine commandLine = new CommandLine(args);

            if (commandLine.SlashParams["/p"] != null)
            {
                string handleString = (string)commandLine.SlashParams["/p"];
                int    handle       = Int32.Parse(handleString);
                bounceWnd = new BounceWnd(this, (IntPtr)handle, true);
                Visible   = false;

                try
                {
                    Win32RECT corners = new Win32RECT();
                    corners.GetWindowRect(handle);
                    Console.WriteLine("Corners: {0}", corners);

                    this.Height = corners.Height;
                    this.Width  = corners.Width;
                    Console.WriteLine("height, width: {0} {1}",
                                      corners.Height, corners.Width);
                }
                catch (Exception e)
                {
                    Console.WriteLine("Exception: {0}", e);
                }
            }
            else if (commandLine.SlashParams["/c"] != null)
            {
                firstPaint = false;
            }
            else
            {
                bounceWnd = new BounceWnd(this, this.Handle, false);

                // if it's full screen, change the size and the border...
                SetFullScreen();
                Visible = true;
            }
        }