private void InstantiateImageRegionSelectionControl()
        {
            this.imageRegionSelectionControl1 = new FlatRedBall.SpecializedXnaControls.ImageRegionSelectionControl();

            this.imageRegionSelectionControl1.CurrentTexture         = null;
            this.imageRegionSelectionControl1.DesiredFramesPerSecond = 10;
            this.imageRegionSelectionControl1.Dock = System.Windows.Forms.DockStyle.Fill;
            //this.imageRegionSelectionControl1.Width = 100;
            //this.imageRegionSelectionControl1.Height = 100;
            //this.imageRegionSelectionControl1.Location = new System.Drawing.Point(0, 23);
            this.imageRegionSelectionControl1.Name = "imageRegionSelectionControl1";
            //this.imageRegionSelectionControl1.Size = new System.Drawing.Size(296, 264);
            this.imageRegionSelectionControl1.TabIndex = 0;
            this.imageRegionSelectionControl1.Text     = "imageRegionSelectionControl1";
            this.Controls.Add(this.imageRegionSelectionControl1);
            this.imageRegionSelectionControl1.BringToFront();
            this.imageRegionSelectionControl1.RoundRectangleSelectorToUnit = true;

            this.imageRegionSelectionControl1.Click          += HandleClick;
            this.imageRegionSelectionControl1.MouseWheelZoom += HandleMouseWheelZoom;

            this.imageRegionSelectionControl1.RegionChanged    += HandleRegionChanged;
            this.imageRegionSelectionControl1.EndRegionChanged += HandleEndRegionChanged;
            this.imageRegionSelectionControl1.SystemManagers.Renderer.Camera.CameraCenterOnScreen =
                RenderingLibrary.CameraCenterOnScreen.TopLeft;
        }
        private void InstantiateImageRegionSelectionControl()
        {
            this.imageRegionSelectionControl1 = new FlatRedBall.SpecializedXnaControls.ImageRegionSelectionControl();

            this.imageRegionSelectionControl1.CurrentTexture = null;
            this.imageRegionSelectionControl1.DesiredFramesPerSecond = 10;
            this.imageRegionSelectionControl1.Dock = System.Windows.Forms.DockStyle.Fill;
            //this.imageRegionSelectionControl1.Width = 100;
            //this.imageRegionSelectionControl1.Height = 100;
            //this.imageRegionSelectionControl1.Location = new System.Drawing.Point(0, 23);
            this.imageRegionSelectionControl1.Name = "imageRegionSelectionControl1";
            //this.imageRegionSelectionControl1.Size = new System.Drawing.Size(296, 264);
            this.imageRegionSelectionControl1.TabIndex = 0;
            this.imageRegionSelectionControl1.Text = "imageRegionSelectionControl1";
            this.Controls.Add(this.imageRegionSelectionControl1);
            this.imageRegionSelectionControl1.BringToFront();
            this.imageRegionSelectionControl1.RoundRectangleSelectorToUnit = true;

            this.imageRegionSelectionControl1.Click += HandleClick;
            this.imageRegionSelectionControl1.MouseWheelZoom += HandleMouseWheelZoom;

            this.imageRegionSelectionControl1.RegionChanged += HandleRegionChanged;

            this.imageRegionSelectionControl1.SystemManagers.Renderer.Camera.CameraCenterOnScreen =
                RenderingLibrary.CameraCenterOnScreen.TopLeft;
        }
Esempio n. 3
0
        public MainControl()
        {
            mSelf = this;
            InitializeComponent();


            mScrollBarControlLogic = new ScrollBarControlLogic(PreviewSplitContainer.Panel1);

            ApplicationEvents.Self.WireframePanning += delegate { mScrollBarControlLogic.UpdateScrollBars(); };
            ApplicationEvents.Self.WireframeTextureChange += ScrollBarHandleTextureChange;
            ApplicationEvents.Self.AfterZoomChange += delegate
            {
                mScrollBarControlLogic.ZoomPercentage = (float)ApplicationState.Self.WireframeZoomValue;
                mScrollBarControlLogic.UpdateScrollBars();
            };

            this.imageRegionSelectionControl1 = new FlatRedBall.SpecializedXnaControls.ImageRegionSelectionControl();
            imageRegionSelectionControl1.Click += new EventHandler(HandleImageRegionSelectionControlClick);
            this.PreviewSplitContainer.Panel1.Controls.Add(this.imageRegionSelectionControl1);

            // 
            // imageRegionSelectionControl1
            // 
            // Winforms has issues with controls that contain custom controls
            // and if this control was in custom code, it caused all kinds of
            // issues.  So we'll just instantiate it here as a workaround.
            this.imageRegionSelectionControl1.CurrentTexture = null;
            this.imageRegionSelectionControl1.DesiredFramesPerSecond = 30F;
            this.imageRegionSelectionControl1.Dock = System.Windows.Forms.DockStyle.Fill;
            //this.imageRegionSelectionControl1.Width = 100;
            //this.imageRegionSelectionControl1.Height = 100;
            this.imageRegionSelectionControl1.Location = new System.Drawing.Point(0, 23);
            this.imageRegionSelectionControl1.Name = "imageRegionSelectionControl1";
            this.imageRegionSelectionControl1.Size = new System.Drawing.Size(296, 264);
            this.imageRegionSelectionControl1.TabIndex = 0;
            this.imageRegionSelectionControl1.Text = "imageRegionSelectionControl1";
            this.imageRegionSelectionControl1.BringToFront();

            SelectedState.Self.Initialize(this.AnimationTreeView);
            if (this.DesignMode == false)
            {
                HandleRegionXnaInitialize();
                this.imageRegionSelectionControl1.XnaUpdate += new Action(HandleXnaUpdate);
            }
            PropertyGridManager.Self.Initialize(SelectedItemPropertyGrid, this.tileMapInfoWindow1);
            PropertyGridManager.Self.AnimationChainChange += RaiseAnimationChainChanges;
            PropertyGridManager.Self.AnimationFrameChange += HandleAnimationFrameChanges;


            TreeViewManager.Self.Initialize(AnimationTreeView);
            TreeViewManager.Self.AnimationChainsChange += RaiseAnimationChainChanges;

            StatusBarManager.Self.Initialize(statusStrip1, CursorStatusLabel);

            WireframeManager.Self.AnimationFrameChange += HandleAnimationFrameChanges;

            PopulateUnitTypeComboBox();

            PreviewManager.Self.Initialize(PreviewGraphicsControl, previewControls1);
        }
Esempio n. 4
0
        public MainControl()
        {
            mSelf = this;
            InitializeComponent();


            mScrollBarControlLogic = new ScrollBarControlLogic(PreviewSplitContainer.Panel1);

            ApplicationEvents.Self.WireframePanning       += delegate { mScrollBarControlLogic.UpdateScrollBars(); };
            ApplicationEvents.Self.WireframeTextureChange += ScrollBarHandleTextureChange;
            ApplicationEvents.Self.AfterZoomChange        += delegate
            {
                mScrollBarControlLogic.ZoomPercentage = (float)ApplicationState.Self.WireframeZoomValue;
                mScrollBarControlLogic.UpdateScrollBars();
            };

            this.imageRegionSelectionControl1   = new FlatRedBall.SpecializedXnaControls.ImageRegionSelectionControl();
            imageRegionSelectionControl1.Click += new EventHandler(HandleImageRegionSelectionControlClick);
            this.PreviewSplitContainer.Panel1.Controls.Add(this.imageRegionSelectionControl1);

            //
            // imageRegionSelectionControl1
            //
            // Winforms has issues with controls that contain custom controls
            // and if this control was in custom code, it caused all kinds of
            // issues.  So we'll just instantiate it here as a workaround.
            this.imageRegionSelectionControl1.CurrentTexture         = null;
            this.imageRegionSelectionControl1.DesiredFramesPerSecond = 30F;
            this.imageRegionSelectionControl1.Dock = System.Windows.Forms.DockStyle.Fill;
            //this.imageRegionSelectionControl1.Width = 100;
            //this.imageRegionSelectionControl1.Height = 100;
            this.imageRegionSelectionControl1.Location = new System.Drawing.Point(0, 23);
            this.imageRegionSelectionControl1.Name     = "imageRegionSelectionControl1";
            this.imageRegionSelectionControl1.Size     = new System.Drawing.Size(296, 264);
            this.imageRegionSelectionControl1.TabIndex = 0;
            this.imageRegionSelectionControl1.Text     = "imageRegionSelectionControl1";
            this.imageRegionSelectionControl1.BringToFront();

            this.zoomControl1.PropertyChanged += HandleEditorControlsPropertyChanged;

            SelectedState.Self.Initialize(this.AnimationTreeView);
            if (this.DesignMode == false)
            {
                HandleRegionXnaInitialize();
                this.imageRegionSelectionControl1.XnaUpdate += new Action(HandleXnaUpdate);
            }
            PropertyGridManager.Self.Initialize(SelectedItemPropertyGrid, this.tileMapInfoWindow1);
            PropertyGridManager.Self.AnimationChainChange += RaiseAnimationChainChanges;
            PropertyGridManager.Self.AnimationFrameChange += HandleAnimationFrameChanges;


            TreeViewManager.Self.Initialize(AnimationTreeView);
            TreeViewManager.Self.AnimationChainsChange += RaiseAnimationChainChanges;

            StatusBarManager.Self.Initialize(statusStrip1, CursorStatusLabel);

            WireframeManager.Self.AnimationFrameChange += HandleAnimationFrameChanges;

            PopulateUnitTypeComboBox();

            PreviewManager.Self.Initialize(PreviewGraphicsControl, previewControls1);
        }