//DateTime

        //====================================
        //  Constructor
        //====================================
        public Form1()
        {
            InitializeComponent();



            // Setup Sound Combo Box
            Sounds_ComboBox.Items.Add("(No Sound)"); // First Element is NO SOUND.
            string[] TempStrArray = System.IO.Directory.GetFiles("./Sound/");
            foreach (string path in TempStrArray)
            {
                string FileExtension = System.IO.Path.GetExtension(path);
                if (FileExtension == ".wav" || FileExtension == ".WAV")
                {
                    Sounds_ComboBox.Items.Add(System.IO.Path.GetFileNameWithoutExtension(path));
                }
            }
            Sounds_ComboBox.Text = "(No Sound)";

            ////////// Setup Enemy Texture Info //////////
            m_EnemySprInfo.Texture = Image.FromFile("./Images/Succubus.png");
            m_EnemySprInfo.W       = m_EnemySprInfo.Texture.Width;
            m_EnemySprInfo.H       = m_EnemySprInfo.Texture.Height;
            m_EnemySprInfo.X       = (int)((AnimationPanel.Width * 0.5) - (m_EnemySprInfo.W * 0.5));
            m_EnemySprInfo.Y       = (int)((AnimationPanel.Height * 0.5) - (m_EnemySprInfo.H * 0.5));
            //////////////////////////////////////////////


            AnimationFrames_Listview.Items.Add("Frame01");
            m_AnimationFrameInfoList.Add(new AnimatedFrameInfo());
            m_AnimationPicture_UVCoords_Panel_Rect = new Rectangle(0, 0, (int)(AnimationPicture_UVCoords_Panel.Width * 0.2), (int)(AnimationPicture_UVCoords_Panel.Height * 0.5));
            m_oPen_and_Brush.ClassGraphics         = AnimationPanel.CreateGraphics();
        }
Example #2
0
        public BfresEditor(bool HasModels)
        {
            InitializeComponent();

            STConsole stConsole = STConsole.Instance;

            stConsole.BorderStyle = BorderStyle.None;
            stConsole.Dock        = DockStyle.Fill;
            tabPage4.Controls.Add(stConsole);

            animationPanel = new AnimationPanel();
            animationPanel.CurrentAnimation = null;
            animationPanel.Dock             = DockStyle.Fill;
            timelineTabPage.Controls.Add(animationPanel);

            stTabControl1.myBackColor = FormThemes.BaseTheme.FormBackColor;
            stTabControl2.myBackColor = FormThemes.BaseTheme.FormBackColor;


            if (viewport == null)
            {
                viewport      = new Viewport();
                viewport.Dock = DockStyle.Fill;
            }

            stPanel5.Controls.Add(viewport);

            OnLoadedTab();

            if (HasModels)
            {
                stTabControl1.SelectedIndex = 1;
            }
        }
        private void AddressList_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (Comment.Text == "")
            {
                Comment.Text = GetNameDefaultName((uint)AddressList.SelectedIndex);
            }

            if (AddressList.SelectedIndex <= 0)
            {
                AnimationPanel.Hide();
                AnimationImportButton.Hide();
                AnimationExportButton.Hide();
                NOTIFY_KeepEmpty.Show();
                return;
            }
            NOTIFY_KeepEmpty.Hide();
            AnimationImportButton.Show();

            uint addr = U.toOffset((uint)P0.Value);

            if (U.isSafetyOffset(addr))
            {
                AnimationPanel.Show();
                AnimationExportButton.Show();
                ShowFrameUpDown.Value = 0;
                ShowFrameUpDown_ValueChanged(null, null);
            }
            else
            {
                AnimationPanel.Hide();
                AnimationExportButton.Hide();
            }
        }
Example #4
0
 private void OnTimerTick(object sender, System.EventArgs e)
 {
     for (int i = _panels.Count - 1; i >= 0; i--)
     {
         AnimationPanel currentPanel = _panels[i];
         DateTime       startTime    = currentPanel.StartTime;
         int            xDelta       = (int)Math.Round((DateTime.Now - startTime).TotalSeconds * XSpeed, 0);
         Point          newLocation  = new Point(currentPanel.StartBounds.X + xDelta, currentPanel.StartBounds.Y);
         // Check before or after collision (in this example before replacing the AnimationPanel)
         if (newLocation.X > this.Width)
         {
             // I chose to remove after it reaches the edge, do whatever you want
             _panels.RemoveAt(i);
             Controls.Remove(currentPanel);
         }
         else
         {
             currentPanel.Location = newLocation;
         }
     }
     if (_panels.Count == 0)
     {
         _timer.Enabled = false;
     }
 }
 //================================================
 //  Clear Frame Button
 //================================================
 private void Clear_Frame_Button_Click(object sender, EventArgs e)
 {
     m_AnimationFrameInfoList.RemoveAt(m_iCurrentFrameIndex);
     m_AnimationFrameInfoList.Insert(m_iCurrentFrameIndex, new AnimatedFrameInfo());
     m_iCurrentlySelectedTextureID = -1;
     AnimationPanel.Invalidate();
 }
        //================================================
        //  AnimationFrames_Listview ~ Changed Selection
        //================================================
        private void AnimationFrames_Listview_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (AnimationFrames_Listview.SelectedIndices.Count > 0)
            {
                // Set CurrentFrame Selected and Current Sprite Selection
                m_iCurrentFrameIndex          = AnimationFrames_Listview.SelectedIndices[0];
                m_iCurrentlySelectedTextureID = -1;


                // Modify the Main Controls display to current chosen options
                if (m_AnimationFrameInfoList.Count > m_iCurrentFrameIndex)
                {
                    Tint_screen_Checkbox.Checked        = m_AnimationFrameInfoList.ElementAt(m_iCurrentFrameIndex).m_bTintScreen;
                    TintScreenRed_numericUpDown.Value   = m_AnimationFrameInfoList.ElementAt(m_iCurrentFrameIndex).m_iTintScreenRed;
                    TintScreenGreen_numericUpDown.Value = m_AnimationFrameInfoList.ElementAt(m_iCurrentFrameIndex).m_iTintScreenGreen;
                    TintScreenBlue_numericUpDown.Value  = m_AnimationFrameInfoList.ElementAt(m_iCurrentFrameIndex).m_iTintScreenBlue;
                    TintScreenAlpha_numericUpDown.Value = m_AnimationFrameInfoList.ElementAt(m_iCurrentFrameIndex).m_iTintScreenAlpha;

                    TintCharacter_CheckBox.Checked         = m_AnimationFrameInfoList.ElementAt(m_iCurrentFrameIndex).m_bTintCharacter;
                    TintCharacterRed_NumericUpDown.Value   = m_AnimationFrameInfoList.ElementAt(m_iCurrentFrameIndex).m_iTintCharacterRed;
                    TintCharacterGreen_NumericUpDown.Value = m_AnimationFrameInfoList.ElementAt(m_iCurrentFrameIndex).m_iTintCharacterGreen;
                    TintCharacterBlue_NumericUpDown.Value  = m_AnimationFrameInfoList.ElementAt(m_iCurrentFrameIndex).m_iTintCharacterBlue;

                    Sounds_ComboBox.Text = m_AnimationFrameInfoList.ElementAt(m_iCurrentFrameIndex).m_sSoundFilename;
                    Sounds_ComboBox.Text = Sounds_ComboBox.Text != "" ? Sounds_ComboBox.Text : "(No Sound)";

                    WaitTime_NumericUpDown.Value = m_AnimationFrameInfoList.ElementAt(m_iCurrentFrameIndex).m_iWaitTimeTillNextFrame;

                    Animation_Partially_Completed_CheckBox.Checked = m_AnimationFrameInfoList.ElementAt(m_iCurrentFrameIndex).m_bAnimationPartiallyCompleted;
                }

                // Update Panel
                AnimationPanel.Invalidate();
            }
        }
        private void openToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog.FileName = "";
            OpenFileDialog.Filter   = "XML Files (*.xml)|*.xml";

            if (OpenFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                if (ResetEverything())
                {
                    // Read XML
                    m_oClassXML.ReadFromXML(OpenFileDialog.FileName);

                    // Convert XML Animation To Editor Version
                    m_AnimationFrameInfoList = ConvertListValuesBetweenGameandEditor(m_oClassXML.GetAnimFrameInfoList(), false);

                    // Add In the Animation Frames to the List
                    for (; AnimationFrames_Listview.Items.Count < m_AnimationFrameInfoList.Count;)
                    {
                        AnimationFrames_Listview.Items.Add("Frame" + (AnimationFrames_Listview.Items.Count + 1 < 10 ? "0" : "") + (AnimationFrames_Listview.Items.Count + 1).ToString());
                    }

                    // Set Current Frame to Select and deselect Sprites
                    m_iCurrentFrameIndex          = 0;
                    m_iCurrentlySelectedTextureID = -1;

                    // Check Boxes As Appropriate
                    Relative_to_Screen_Checkbox.Checked = m_oClassXML.GetRelativeToScreen();

                    // Update Panel
                    AnimationPanel.Invalidate();
                }
            }
        }
 //================================================
 //  Paste Frame Button
 //================================================
 private void Paste_Frame_Button_Click(object sender, EventArgs e)
 {
     m_AnimationFrameInfoList.RemoveAt(m_iCurrentFrameIndex);
     m_AnimationFrameInfoList.Insert(m_iCurrentFrameIndex, CopyAnimFrameInfo(m_AnimFrameInfo_ClipboardCopy));
     m_iCurrentlySelectedTextureID = -1;
     AnimationPanel.Invalidate();
 }
Example #9
0
        public BfresEditor(bool HasModels)
        {
            InitializeComponent();

            animationPanel = new AnimationPanel();
            animationPanel.CurrentAnimation = null;
            animationPanel.Dock             = DockStyle.Fill;
            timelineTabPage.Controls.Add(animationPanel);

            stTabControl2.myBackColor = FormThemes.BaseTheme.FormBackColor;

            //Always create an instance of the viewport unless opengl is disabled
            if (viewport == null && Runtime.UseOpenGL || viewport.IsDisposed && Runtime.UseOpenGL)
            {
                viewport            = new Viewport(ObjectEditor.GetDrawableContainers());
                viewport.Dock       = DockStyle.Fill;
                viewport.DisplayAll = DisplayAll;
            }

            //If the option is enabled by settings, and it has models display the viewport
            if (Runtime.UseOpenGL && Runtime.DisplayViewport && HasModels)
            {
                stPanel5.Controls.Add(viewport);
                DisplayViewport = true;
            }
            else
            {
                DisplayViewport = false;
                splitContainer1.Panel1Collapsed = true;
            }
        }
 //================================================
 //  Tint Screen Alpha ~ NumericUpDown
 //================================================
 private void TintScreenAlpha_numericUpDown_ValueChanged(object sender, EventArgs e)
 {
     m_AnimationFrameInfoList.ElementAt(m_iCurrentFrameIndex).m_iTintScreenAlpha = (int)TintScreenAlpha_numericUpDown.Value;
     if (Tint_screen_Checkbox.Checked)
     {
         AnimationPanel.Invalidate();
     }
 }
Example #11
0
 public abstract Rect GetInitialChildPlacement(
     UIElement child,
     Rect currentPlacement,
     Rect targetPlacement,
     AnimationPanel activeLayout,
     ref AnimationRate animationRate,
     out object placementArgs,
     out bool isDone);
 //================================================
 //  Texture Height ~ NumericUpDown
 //================================================
 private void TextureHeight_NumericUpDown_ValueChanged(object sender, EventArgs e)
 {
     if (m_iCurrentlySelectedTextureID >= 0)
     {
         m_AnimationFrameInfoList.ElementAt(m_iCurrentFrameIndex).m_SpriteInfoList.ElementAt(m_iCurrentlySelectedTextureID).H = (int)TextureHeight_NumericUpDown.Value;
         AnimationPanel.Invalidate();
     }
 }
 //================================================
 //  Remove Sprite Button
 //================================================
 private void Remove_Sprite_Button_Click(object sender, EventArgs e)
 {
     if (m_iSpriteAddRemoveStatePlaceHolder == (uint)SpriteAddRemoveState.AddSpriteMode)
     {
         m_iSpriteAddRemoveStatePlaceHolder = (uint)SpriteAddRemoveState.RemoveSpriteMode;
         m_iCurrentlySelectedTextureID      = -1;
         AnimationPanel.Invalidate();
     }
 }
        //====================================
        //  Move Sprite
        //====================================
        private void MouseMoveSprite(int Mouse_X, int Mouse_Y)
        {
            int XPos = Mouse_X - (int)((m_AnimationFrameInfoList.ElementAt(m_iCurrentFrameIndex).m_SpriteInfoList.ElementAt(m_iCurrentlySelectedTextureID).W *m_iZoom) * 0.5);
            int YPos = Mouse_Y - (int)((m_AnimationFrameInfoList.ElementAt(m_iCurrentFrameIndex).m_SpriteInfoList.ElementAt(m_iCurrentlySelectedTextureID).H *m_iZoom) * 0.5);

            m_AnimationFrameInfoList.ElementAt(m_iCurrentFrameIndex).m_SpriteInfoList.ElementAt(m_iCurrentlySelectedTextureID).X = XPos;
            m_AnimationFrameInfoList.ElementAt(m_iCurrentFrameIndex).m_SpriteInfoList.ElementAt(m_iCurrentlySelectedTextureID).Y = YPos;
            AnimationPanel.Invalidate();
        }
Example #15
0
 public abstract Rect GetNextChildPlacement(
     UIElement child,
     TimeSpan currentTime,
     Rect currentPlacement,
     Rect targetPlacement,
     AnimationPanel activeLayout,
     AnimationRate animationRate,
     ref object placementArgs,
     out bool isDone);
 //================================================
 //  Remove Frame Button
 //================================================
 private void Remove_Frame_Button_Click(object sender, EventArgs e)
 {
     AnimationFrames_Listview.Items.RemoveAt(AnimationFrames_Listview.Items.Count - 1);
     m_AnimationFrameInfoList.RemoveAt(m_iCurrentFrameIndex);
     if (m_iCurrentFrameIndex >= AnimationFrames_Listview.Items.Count)
     {
         m_iCurrentFrameIndex = AnimationFrames_Listview.Items.Count - 1;
     }
     m_iCurrentlySelectedTextureID = -1;
     AnimationPanel.Invalidate();
 }
 //================================================
 //  Swap Sprite Button
 //================================================
 private void SwapSprite_Button_Click(object sender, EventArgs e)
 {
     if (m_iCurrentlySelectedTextureID >= 0)
     {
         string TextureName = GetImageNameByState();
         Image  Texture     = GetImageFromList(TextureName);
         m_AnimationFrameInfoList.ElementAt(m_iCurrentFrameIndex).m_SpriteInfoList.ElementAt(m_iCurrentlySelectedTextureID).TextureName = TextureName;
         m_AnimationFrameInfoList.ElementAt(m_iCurrentFrameIndex).m_SpriteInfoList.ElementAt(m_iCurrentlySelectedTextureID).Texture     = Texture;
         m_AnimationFrameInfoList.ElementAt(m_iCurrentFrameIndex).m_SpriteInfoList.ElementAt(m_iCurrentlySelectedTextureID).BlitRect    = GetAnimationSpriteFullBlitRect(Texture);
         AnimationPanel.Invalidate();
     }
 }
Example #18
0
        internal UIElement RegisterPresenter(SwitchPresenter presenter)
        {
            UIElement      result = null;
            AnimationPanel ignore;

            result = AnimationPanel.FindAncestorChildOfAnimationPanel(presenter, out ignore);
            if (result != null)
            {
                _presenters.Add(presenter);
                presenter.SwapTheTemplate(ActiveSwitchTemplate, false);
            }
            return(result);
        }
Example #19
0
    private void OnButtonStartClick(object sender, System.EventArgs e)
    {
        AnimationPanel newPanel = new AnimationPanel
        {
            Bounds      = new Rectangle(10, 10, 50, 50),
            BorderStyle = BorderStyle.FixedSingle,
        };

        _panels.Add(newPanel);
        Controls.Add(newPanel);
        newPanel.StartBounds = newPanel.Bounds;
        newPanel.StartTime   = DateTime.Now;
        _timer.Enabled       = true;
    }
Example #20
0
        protected override Size ArrangeOverride(Size finalSize)
        {
            AnimationPanel layout = (Layouts.Count == 0) ? _defaultLayoutCanvas : this.ActiveLayout;

            if (this.IsScrollingPhysically)
            {
                layout.PhysicalScrollOffset = _offset;
            }
            else
            {
                layout.PhysicalScrollOffset = ZeroVector;
            }

            return(layout.ArrangeChildrenCore(InternalChildren, finalSize));
        }
 public override Rect GetInitialChildPlacement(UIElement child, Rect currentPlacement,
                                               Rect targetPlacement, AnimationPanel activeLayout, ref AnimationRate animationRate,
                                               out object placementArgs, out bool isDone)
 {
     isDone = (animationRate.HasSpeed && animationRate.Speed <= 0) || (animationRate.HasDuration && animationRate.Duration.Ticks == 0);
     if (!isDone)
     {
         Vector startVector    = new Vector(currentPlacement.Left + (currentPlacement.Width / 2), currentPlacement.Top + (currentPlacement.Height / 2));
         Vector finalVector    = new Vector(targetPlacement.Left + (targetPlacement.Width / 2), targetPlacement.Top + (targetPlacement.Height / 2));
         Vector distanceVector = startVector - finalVector;
         animationRate = new AnimationRate(animationRate.HasDuration ? animationRate.Duration
                                 : TimeSpan.FromMilliseconds(distanceVector.Length / animationRate.Speed));
     }
     placementArgs = currentPlacement;
     return(currentPlacement);
 }
 //====================================
 // Add New Sprite
 //====================================
 private void RemoveSpriteFromAnimationPanel(int iSelectedTexture)
 {
     if (iSelectedTexture >= 0)
     {
         m_AnimationFrameInfoList.ElementAt(m_iCurrentFrameIndex).m_SpriteInfoList.RemoveAt(iSelectedTexture);
         foreach (SpriteInfo SprInfo in m_AnimationFrameInfoList.ElementAt(m_iCurrentFrameIndex).m_SpriteInfoList)
         {
             if (SprInfo.ID > iSelectedTexture)
             {
                 SprInfo.ID--;
             }
         }
         m_iCurrentlySelectedTextureID = -1;
         AnimationPanel.Invalidate();
     }
 }
Example #23
0
        private void AddressList_SelectedIndexChanged(object sender, EventArgs e)
        {
            this.SKILLICON.Image = DrawIcon((uint)AddressList.SelectedIndex, this.IconBaseAddress);

            uint anime = this.AnimeBaseAddress + (4 * (uint)AddressList.SelectedIndex);
            uint a     = Program.ROM.p32(anime);

            ANIMATION.Value = a;
            if (U.isSafetyOffset(a))
            {
                AnimationPanel.Show();
                AnimationExportButton.Show();
                ShowFrameUpDown.Value = 0;
                ShowFrameUpDown_ValueChanged(null, null);
            }
            else
            {
                AnimationPanel.Hide();
                AnimationExportButton.Hide();
            }
        }
        //====================================
        //  Play Complete Animation
        //====================================
        private void PlayCompleteAnimation()
        {
            int iTempCurrentFrameIndexHolder = m_iCurrentFrameIndex;

            // Start at First Element
            m_iCurrentFrameIndex = 0;

            // Play Entire Animation
            while (m_iCurrentFrameIndex < m_AnimationFrameInfoList.Count)
            {
                AnimationPanel.Invalidate();
                AnimationPanel.Update();
                PlaySelectedSound(true);
                System.Threading.Thread.Sleep(m_AnimationFrameInfoList.ElementAt(m_iCurrentFrameIndex).m_iWaitTimeTillNextFrame);
                m_iCurrentFrameIndex++;
            }

            // Go Back to Previously Selected Frame
            m_iCurrentFrameIndex = iTempCurrentFrameIndexHolder;
            AnimationPanel.Invalidate();
        }
Example #25
0
    void Start()
    {
        loader         = GetComponent <PdxLoader>();
        animationPanel = GetComponent <AnimationPanel>();
        assimpLoader   = GetComponent <AssimpLoader>();

        /*fbxExporter = GetComponent<FBXExporterForUnity>();
        *  fbxImporter = GetComponent<FBXImporterForUnity>();*/

        toggleShadows.isOn      = 1 == PlayerPrefs.GetInt("toggleshadows", 1);
        toggleAA.isOn           = 1 == PlayerPrefs.GetInt("toggleaa", 1);
        togglePlane.isOn        = 1 == PlayerPrefs.GetInt("toggleplane", 1);
        toggleLocators.isOn     = 1 == PlayerPrefs.GetInt("togglelocators", 1);
        toggleLocatorNames.isOn = 1 == PlayerPrefs.GetInt("togglelocatornames", 1);
        toggleBoneNames.isOn    = 1 == PlayerPrefs.GetInt("togglebonenames", 1);
        toggleBones.isOn        = 1 == PlayerPrefs.GetInt("togglebones", 1);

        showBones     = toggleBones.isOn;
        showBoneNames = toggleBoneNames.isOn;

        ToggleShadows();
        TooglePlane();
        ToggleAA();
        ToggleBoneNames();
        ToggleBones();
        ToggleLocatorNames();
        ToggleLocators();

        panelShaders.gameObject.SetActive(false);

        meshPath.text = animPath.text = fbxPath.text = "";
        saveAnimButton.interactable = saveMeshButton.interactable = saveFbxButton.interactable = false;

        bigStatus.gameObject.SetActive(false);

        attachButton.SetActive(false);
        snowSlider.gameObject.SetActive(false);
        shaderPanel.SetActive(false);
    }
Example #26
0
        protected override Size MeasureOverride(Size availableSize)
        {
            AnimationPanel layout      = (Layouts.Count == 0) ? _defaultLayoutCanvas : this.ActiveLayout;
            Size           measureSize = layout.MeasureChildrenCore(this.InternalChildren, availableSize);

            if (this.IsScrollingPhysically)
            {
                Size viewport = availableSize;
                Size extent   = measureSize;

                //
                // Make sure our offset works with the new size of the panel.  We don't want to show
                // any whitespace if the user scrolled all the way down and then increased the size of the panel.
                //
                Vector newOffset = new Vector(
                    Math.Max(0, Math.Min(_offset.X, extent.Width - viewport.Width)),
                    Math.Max(0, Math.Min(_offset.Y, extent.Height - viewport.Height)));

                this.SetScrollingData(viewport, extent, newOffset);
            }

            return(measureSize);
        }
 private void newToolStripMenuItem_Click(object sender, EventArgs e)
 {
     ResetEverything();
     AnimationPanel.Invalidate();
 }
Example #28
0
 public override Rect GetNextChildPlacement(UIElement child, TimeSpan currentTime, Rect currentPlacement, Rect targetPlacement, AnimationPanel activeLayout, AnimationRate animationRate, ref object placementArgs, out bool isDone)
 {
     throw new InvalidOperationException(ErrorMessages.GetMessage(ErrorMessages.DefaultAnimatorCantAnimate));
 }
        public override Rect GetNextChildPlacement(UIElement child, TimeSpan currentTime,
                                                   Rect currentPlacement, Rect targetPlacement, AnimationPanel activeLayout,
                                                   AnimationRate animationRate, ref object placementArgs, out bool isDone)
        {
            Rect result = targetPlacement;

            isDone = true;
            if (_equation != null)
            {
                Rect     from     = (Rect)placementArgs;
                TimeSpan duration = animationRate.Duration;
                isDone = currentTime >= duration;
                if (!isDone)
                {
                    double x      = _equation.Evaluate(currentTime, from.Left, targetPlacement.Left, duration);
                    double y      = _equation.Evaluate(currentTime, from.Top, targetPlacement.Top, duration);
                    double width  = Math.Max(0, _equation.Evaluate(currentTime, from.Width, targetPlacement.Width, duration));
                    double height = Math.Max(0, _equation.Evaluate(currentTime, from.Height, targetPlacement.Height, duration));
                    result = new Rect(x, y, width, height);
                }
            }
            return(result);
        }
Example #30
0
        public Expando()
            : base()
        {
            this.components = new System.ComponentModel.Container();

            this.SetStyle(ControlStyles.DoubleBuffer, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.UserPaint, true);
            this.SetStyle(ControlStyles.ResizeRedraw, true);
            this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
            this.SetStyle(ControlStyles.Selectable, true);
            this.TabStop = true;

            this.systemSettings = ThemeManager.GetSystemExplorerBarSettings();

            this.customSettings = new ExpandoInfo();
            this.customSettings.Expando = this;
            this.customSettings.SetDefaultEmptyValues();

            this.customHeaderSettings = new HeaderInfo();
            this.customHeaderSettings.Expando = this;
            this.customHeaderSettings.SetDefaultEmptyValues();

            this.BackColor = this.systemSettings.Expando.NormalBackColor;

            this.expandedHeight = 100;

            this.animate = false;
            this.animatingFade = false;
            this.animatingSlide = false;
            this.animationImage = null;
            this.slideEndHeight = -1;
            this.animationHelper = null;
            this.fadeHeights = new int[AnimationHelper.NumAnimationFrames];

            this.Size = new Size(this.systemSettings.Header.BackImageWidth, this.expandedHeight);
            this.titleBarHeight = this.systemSettings.Header.BackImageHeight;
            this.headerHeight = this.titleBarHeight;
            this.oldWidth = this.Width;

            this.collapsed = false;

            this.specialGroup = false;

            this.focusState = FocusStates.None;

            this.titleImage = null;
            this.watermark = null;

            this.Font = new Font(this.TitleFont.Name, 8.25f, FontStyle.Regular);

            this.autoLayout = false;

            this.taskpane = null;

            this.itemList = new ItemCollection(this);
            this.hiddenControls = new ArrayList();

            this.dummyPanel = new AnimationPanel();
            this.dummyPanel.Size = this.Size;
            this.dummyPanel.Location = new Point(-1000, 0);

            this.canCollapse = true;

            this.showFocusCues = false;
            this.useDefaultTabHandling = true;

            this.CalcAnimationHeights();

            this.slideAnimationBatched = false;

            this.dragging = false;
            this.dragStart = Point.Empty;

            this.beginUpdateCount = 0;

            this.initialising = false;
            this.layout = false;
        }
        /// <summary>
        /// Initializes a new instance of the Expando class with default settings
        /// </summary>
        public Expando()
            : base()
        {
            // This call is required by the Windows.Forms Form Designer.
            this.components = new System.ComponentModel.Container();

            // set control styles
            this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            this.SetStyle(ControlStyles.UserPaint, true);
            this.SetStyle(ControlStyles.ResizeRedraw, true);
            this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
            this.SetStyle(ControlStyles.Selectable, true);
            this.TabStop = true;

            // get the system theme settings
            this.systemSettings = ThemeManager.GetSystemExplorerBarSettings();

            this.customSettings = new ExpandoInfo();
            this.customSettings.Expando = this;
            this.customSettings.SetDefaultEmptyValues();

            this.customHeaderSettings = new HeaderInfo();
            this.customHeaderSettings.Expando = this;
            this.customHeaderSettings.SetDefaultEmptyValues();

            this.BackColor = this.systemSettings.Expando.NormalBackColor;

            // the height of the Expando in the expanded state
            this.expandedHeight = 100;

            // animation
            this.animate = false;
            this.animatingFade = false;
            this.animatingSlide = false;
            this.animationImage = null;
            this.slideEndHeight = -1;
            this.animationHelper = null;
            this.fadeHeights = new int[AnimationHelper.NumAnimationFrames];

            // size
            this.Size = new Size(this.systemSettings.Header.BackImageWidth, this.expandedHeight);
            this.titleBarHeight = this.systemSettings.Header.BackImageHeight;
            this.headerHeight = this.titleBarHeight;
            this.oldWidth = this.Width;

            // start expanded
            this.collapsed = false;

            // not a special group
            this.specialGroup = false;

            // unfocused titlebar
            this.focusState = FocusStates.None;

            // no title image
            this.titleImage = null;
            this.watermark = null;

            this.Font = new Font(this.TitleFont.Name, 8.25f, FontStyle.Regular);

            // don't get the Expando to layout its items itself
            this.autoLayout = false;

            // don't know which TaskPane we belong to
            this.taskpane = null;

            // internal list of items
            this.itemList = new ItemCollection(this);
            this.hiddenControls = new ArrayList();

            // initialise the dummyPanel
            this.dummyPanel = new AnimationPanel();
            this.dummyPanel.Size = this.Size;
            this.dummyPanel.Location = new Point(-1000, 0);

            this.canCollapse = true;

            this.showFocusCues = false;
            this.useDefaultTabHandling = true;

            this.CalcAnimationHeights();

            this.slideAnimationBatched = false;

            this.dragging = false;
            this.dragStart = Point.Empty;

            this.beginUpdateCount = 0;

            this.initialising = false;
            this.layout = false;
        }
Example #32
0
 protected void SetActiveLayout(AnimationPanel value)
 {
     this.SetValue(SwitchPanel.ActiveLayoutPropertyKey, value);
 }