Ejemplo n.º 1
0
        public MainForm(string strOpenFileName)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            m_dkm = new DockingManager(this, VisualStyle.IDE);
            Globals.ActiveDocumentChanged += new EventHandler(OnActiveDocumentChanged);
            m_doc            = Globals.ActiveDocument;
            Globals.MainForm = this;

            // Create all the "Contents" used to display the various animation components

            m_ctlPreviewPanel      = new PreviewPanel(m_doc);
            Globals.PreviewControl = m_ctlPreviewPanel.PreviewControl;
            m_ctlPreviewPanel.Dock = DockStyle.Fill;
            Controls.Add(m_ctlPreviewPanel);
            m_dkm.InnerControl = m_ctlPreviewPanel;

            m_frmStrips             = new StripsForm(m_doc);
            Globals.StripsForm      = m_frmStrips;
            m_tntStrips             = m_dkm.Contents.Add(m_frmStrips, m_frmStrips.Text);
            m_tntStrips.DisplaySize = new Size(ClientSize.Width / 4, ClientSize.Height / 2);
            m_wcStrips = m_dkm.AddContentWithState(m_tntStrips, State.DockLeft);

            m_frmBitmaps             = new BitmapsForm(m_doc);
            m_tntBitmaps             = m_dkm.Contents.Add(m_frmBitmaps, m_frmBitmaps.Text);
            m_tntBitmaps.DisplaySize = new Size(ClientSize.Width / 4, ClientSize.Height / 2);
            m_dkm.AddContentWithState(m_tntBitmaps, State.DockTop);

            // Add the Bitmaps form to the StripForm's Zone

            m_dkm.AddContentToZone(m_tntBitmaps, m_wcStrips.ParentZone, 1);

            m_frmFrames         = new StripForm(m_doc);
            Globals.StripForm   = m_frmFrames;
            m_tntFrames         = m_dkm.Contents.Add(m_frmFrames, m_frmFrames.Text);
            m_frmFrames.Content = m_tntFrames;
            int cx = ClientSize.Width - (ClientSize.Width / 4);
            int cy = ClientSize.Height / 3;

            m_tntFrames.DisplaySize = new Size(cx, cy);
            m_dkm.AddContentWithState(m_tntFrames, State.DockBottom);

            m_frmCombiner             = new CombinerForm();
            m_tntCombiner             = m_dkm.Contents.Add(m_frmCombiner, m_frmCombiner.Text);
            m_tntCombiner.DisplaySize = new Size(ClientSize.Width / 2, ClientSize.Height / 2);
//			m_dkm.AddContentWithState(m_tntCombiner, State.Floating);
//			m_dkm.HideContent(m_tntCombiner);

            // Do a little wiring

            ((StripControl)Globals.StripControl).FrameOffsetChanged +=
                new FrameOffsetEventHandler(((PreviewControl)Globals.PreviewControl).OnFrameOffsetChanged);
            ((PreviewControl)Globals.PreviewControl).FrameOffsetChanged +=
                new FrameOffsetEventHandler(((StripControl)Globals.StripControl).OnFrameOffsetChanged);

            // We always have a document around

            if (strOpenFileName == null)
            {
                NewDocument();
            }
            else
            {
                OpenDocument(strOpenFileName);
            }
        }
Ejemplo n.º 2
0
        public MainForm(string strOpenFileName)
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            m_dkm = new DockingManager(this, VisualStyle.IDE);
            Globals.ActiveDocumentChanged += new EventHandler(OnActiveDocumentChanged);
            m_doc = Globals.ActiveDocument;
            Globals.MainForm = this;

            // Create all the "Contents" used to display the various animation components

            m_ctlPreviewPanel = new PreviewPanel(m_doc);
            Globals.PreviewControl = m_ctlPreviewPanel.PreviewControl;
            m_ctlPreviewPanel.Dock = DockStyle.Fill;
            Controls.Add(m_ctlPreviewPanel);
            m_dkm.InnerControl = m_ctlPreviewPanel;

            m_frmStrips = new StripsForm(m_doc);
            Globals.StripsForm = m_frmStrips;
            m_tntStrips = m_dkm.Contents.Add(m_frmStrips, m_frmStrips.Text);
            m_tntStrips.DisplaySize = new Size(ClientSize.Width / 4, ClientSize.Height / 2);
            m_wcStrips = m_dkm.AddContentWithState(m_tntStrips, State.DockLeft);

            m_frmBitmaps = new BitmapsForm(m_doc);
            m_tntBitmaps = m_dkm.Contents.Add(m_frmBitmaps, m_frmBitmaps.Text);
            m_tntBitmaps.DisplaySize = new Size(ClientSize.Width / 4, ClientSize.Height / 2);
            m_dkm.AddContentWithState(m_tntBitmaps, State.DockTop);

            // Add the Bitmaps form to the StripForm's Zone

            m_dkm.AddContentToZone(m_tntBitmaps, m_wcStrips.ParentZone, 1);

            m_frmFrames = new StripForm(m_doc);
            Globals.StripForm = m_frmFrames;
            m_tntFrames = m_dkm.Contents.Add(m_frmFrames, m_frmFrames.Text);
            m_frmFrames.Content = m_tntFrames;
            int cx = ClientSize.Width - (ClientSize.Width / 4);
            int cy = ClientSize.Height / 3;
            m_tntFrames.DisplaySize = new Size(cx, cy);
            m_dkm.AddContentWithState(m_tntFrames, State.DockBottom);

            m_frmCombiner = new CombinerForm();
            m_tntCombiner = m_dkm.Contents.Add(m_frmCombiner, m_frmCombiner.Text);
            m_tntCombiner.DisplaySize = new Size(ClientSize.Width / 2, ClientSize.Height / 2);
            //			m_dkm.AddContentWithState(m_tntCombiner, State.Floating);
            //			m_dkm.HideContent(m_tntCombiner);

            // Do a little wiring

            ((StripControl)Globals.StripControl).FrameOffsetChanged +=
                    new FrameOffsetEventHandler(((PreviewControl)Globals.PreviewControl).OnFrameOffsetChanged);
            ((PreviewControl)Globals.PreviewControl).FrameOffsetChanged +=
                new FrameOffsetEventHandler(((StripControl)Globals.StripControl).OnFrameOffsetChanged);

            // We always have a document around

            if (strOpenFileName == null)
                NewDocument();
            else
                OpenDocument(strOpenFileName);
        }