示例#1
0
        void initialize()
        {
            brain     = new Brain();
            sequences = new List <CreationSequence>();

            charting = new Charting();
            display  = new Display();

            animation = new Animation(display);
            creation  = new Creation(display);
            stateBar  = new StateBar();

            Controls.Add(display);
            Controls.Add(charting);

            Padding margin = new Padding(10, 50, 10, 10);

            animation.setBar(stateBar);
            animation.setMargin(margin);
            creation.setMargin(margin);

            margin = new Padding(0, 0, rightPanel.Width + 20, 100);
            charting.setMargin(margin);
            display.setMargin(margin);

            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            SetStyle(ControlStyles.Selectable, false);

            trackBarDensity.KeyDown += keySuppress;
            trackBarFrame.KeyDown   += keySuppress;
            trackBarLength.KeyDown  += keySuppress;
            trackBarPace.KeyDown    += keySuppress;
            trackBarScale.KeyDown   += keySuppress;

            rightPanel.Controls.Add(stateBar);
            stateBar.show();

            length = trackBarLength.Value * 10;
            pace   = trackBarPace.Value * 100;

            animation.changePace(pace);
            animation.animationStop   += new EventHandler(animationStop);
            animation.balanceFinished += new EventHandler(balanceFinished);
            animation.queryAccepted   += new EventHandler(queryAccepted);
            animation.frameChanged    += new EventHandler(frameChanged);
            animation.framesChanged   += new EventHandler(framesChanged);

            creation.animationStop    += new EventHandler(animationStop);
            creation.creationFinished += new EventHandler(creationFinished);
            creation.frameChanged     += new EventHandler(frameChanged);
            creation.framesChanged    += new EventHandler(framesChanged);

            Presentation.factorChanged += new EventHandler(factorChanged);
            Presentation.sizeChanged   += new EventHandler(sizeChanged);

            resize();
        }
示例#2
0
 public void setBar(StateBar stateBar)
 {
     this.stateBar = stateBar;
 }