Esempio n. 1
0
        //====================Liuyang: 23, Jan, 2010============================
        //a new simulation datastore is created for each simulation form;
        //where the explicity ID is used rather than hashed ID, which can help user to understand more.
        //private DataStoreSimulation DataStoreSimulation = new DataStoreSimulation();
        //====================Liuyang: 23, Jan, 2010============================
        public SimulationForm()
        {
            InitializeComponent();

            this.toolStripContainer1.ContentPanel.SuspendLayout();
            this.toolStripContainer1.TopToolStripPanel.SuspendLayout();
            this.toolStripContainer1.SuspendLayout();
            this.SplitContainer.Panel1.SuspendLayout();
            this.SplitContainer.Panel2.SuspendLayout();
            this.SplitContainer.SuspendLayout();
            this.GroupBox_EnabledEvents.SuspendLayout();
            this.GroupBox_EventTrace.SuspendLayout();
            this.toolStrip1.SuspendLayout();
            this.MenuStrip_Trace.SuspendLayout();
            this.statusStrip1.SuspendLayout();
            this.TableLayoutPanel.SuspendLayout();
            this.SuspendLayout();
            resources = new System.ComponentModel.ComponentResourceManager(typeof (SimulationForm));

            if (Common.Utility.Utilities.IsUnixOS)
            {
                StateInfoControl = new StateInfoControl();
                StateInfoControl.Dock = DockStyle.Fill;
                SplitContainer.Dock = DockStyle.Right;
                this.StateInfoControl.Dock = DockStyle.Left;

                this.TableLayoutPanel.Controls.Add(this.SimulatorViewer);
                this.TableLayoutPanel.Controls.Add(this.SplitContainer);
                this.TableLayoutPanel.Controls.Add(this.StateInfoControl);

                InitializeResourceText();

                Timer_Run.Tick += new EventHandler(Timer_Drawing_Tick);
                Timer_Replay.Tick += new EventHandler(Timer_Replay_Tick);
                Timer_SimulateTrace.Tick += new EventHandler(Timer_SimulateTrace_Tick);

                //show the event window by default.
                Button_InteractionPane.Checked = true;

                Panel_ToolbarCover.BringToFront();

                this.ListView_EnabledEvents.OwnerDraw = true;
                this.ListView_EnabledEvents.DrawItem += new DrawListViewItemEventHandler(ListView_EnabledEvents_DrawItem);
                ListView_EnabledEvents.DrawColumnHeader +=
                    new DrawListViewColumnHeaderEventHandler(ListView_EnabledEvents_DrawColumnHeader);

                SimulatorViewer.Resize += new EventHandler(SimulatorViewer_Resize);
                Button_StatePane.Checked = true;
                StatusLabel.Text = Resources.Ready;

            }
            else
            {
                this.DockContainer = new Fireball.Docking.DockContainer();
                //
                // DockContainer
                //
                this.DockContainer.ActiveAutoHideContent = null;
                resources.ApplyResources(this.DockContainer, "DockContainer");
                //this.DockContainer.Name = "DockContainer";

                this.toolStripContainer1.ContentPanel.Controls.Add(this.DockContainer);
                //toolStripContainer1.ContentPanel.Controls.Add(this.gra)
                //toolStripContainer1.ContentPanel.Controls.Remove(this.TableLayoutPanel);
                this.TableLayoutPanel.Visible = false;

                //initialize the event window
                this.toolStripContainer1.ContentPanel.Controls.Remove(SplitContainer);
                SplitContainer.Dock = DockStyle.Fill;
                EventWindow = new DockableWindow();
                EventWindow.DockableAreas = DockAreas.DockRight | DockAreas.DockLeft | DockAreas.Float;
                EventWindow.CloseButton = false;
                EventWindow.Controls.Add(SplitContainer);

                //initialize the data store window.
                StatePane = new DockableWindow();
                StatePane.DockableAreas = DockAreas.DockLeft | DockAreas.DockRight | DockAreas.Float;
                StateInfoControl = new StateInfoControl();
                StateInfoControl.Dock = DockStyle.Fill;
                StatePane.Controls.Add(StateInfoControl);
                StatePane.CloseButton = false;

                InitializeResourceText();

                Timer_Run.Tick += new EventHandler(Timer_Drawing_Tick);
                Timer_Replay.Tick += new EventHandler(Timer_Replay_Tick);
                Timer_SimulateTrace.Tick += new EventHandler(Timer_SimulateTrace_Tick);

                //show the event window by default.
                Button_InteractionPane.Checked = true;

                //release the simulator viewer from the dockContainer
                DockContainer.Controls.Remove(SimulatorViewer);

                //Create the dummy DocumentTab to initialize the Document DockWindow in a proper way
                //actually, there should be a better way to do this by initialize the Document DockWindow directly.
                //since we are not sure about the how the Dock control is implemented, so we play this trick here.
                DockContainer.DocumentStyle = DocumentStyles.DockingWindow;
                DockableWindow SimulatorViewerTab = new DockableWindow();
                SimulatorViewerTab.Show(DockContainer, DockState.Document);

                //show the simulator viewer in the SimulatorViewerDockWindow
                SimulatorViewerDockWindow = SimulatorViewerTab.Parent.Parent;
                SimulatorViewerDockWindow.Controls.Clear();
                SimulatorViewerDockWindow.Controls.Add(SimulatorViewer);
                SimulatorViewerDockWindow.Controls.Add(Panel_ToolbarCover);

                Panel_ToolbarCover.BringToFront();

                this.ListView_EnabledEvents.OwnerDraw = true;
                this.ListView_EnabledEvents.DrawItem += new DrawListViewItemEventHandler(ListView_EnabledEvents_DrawItem);
                ListView_EnabledEvents.DrawColumnHeader +=
                    new DrawListViewColumnHeaderEventHandler(ListView_EnabledEvents_DrawColumnHeader);

                SimulatorViewer.Resize += new EventHandler(SimulatorViewer_Resize);
                Button_StatePane.Checked = true;
                StatusLabel.Text = Resources.Ready;

                //Common.Ultility.Ultility.SimulationForms.Add(this);
            }

            //SimulatorViewer.Invalidate();
            SimulatorViewer.Refresh();
            this.toolStripContainer1.ContentPanel.ResumeLayout(false);
            this.toolStripContainer1.TopToolStripPanel.ResumeLayout(false);
            this.toolStripContainer1.TopToolStripPanel.PerformLayout();
            this.toolStripContainer1.ResumeLayout(false);
            this.toolStripContainer1.PerformLayout();
            this.SplitContainer.Panel1.ResumeLayout(false);
            this.SplitContainer.Panel2.ResumeLayout(false);
            this.SplitContainer.ResumeLayout(false);
            this.GroupBox_EnabledEvents.ResumeLayout(false);
            this.GroupBox_EventTrace.ResumeLayout(false);
            this.toolStrip1.ResumeLayout(false);
            this.toolStrip1.PerformLayout();
            this.MenuStrip_Trace.ResumeLayout(false);
            this.statusStrip1.ResumeLayout(false);
            this.statusStrip1.PerformLayout();
            this.TableLayoutPanel.ResumeLayout(false);
            this.ResumeLayout(false);
            this.PerformLayout();
        }
Esempio n. 2
0
 /// <summary>
 /// Checks if a tab is a code tab
 /// </summary>
 /// <param name="tp">The tab to check</param>
 /// <returns>True if the tab is a code tab, otherwise false</returns>
 public static bool IsCodeTab(DockableWindow tp)
 {
     return (tp != null) && ((tp.GetType().Name == "CodeTab"));
 }
Esempio n. 3
0
 /// <summary>
 /// Checks if a tab window is a special tab
 /// </summary>
 /// <param name="tp">The window to check</param>
 /// <returns>True if the window is a special tab, otherwise false</returns>
 public static bool IsSpecialTab(DockableWindow tp)
 {
     return (tp != null) && (tp.GetType().Name != "CodeTab");
 }
Esempio n. 4
0
        /// <include file='CodeDoc\DockPanel.xml' path='//CodeDoc/Class[@name="DockPanel"]/Constructor[@name="()"]/*'/>
        public DockContainer()
        {
            m_extender = new DockPanelExtender(this);
            m_dragHandler = new DragHandler(this);
            m_panes = new DockPaneCollection();
            m_floatWindows = new FloatWindowCollection();

            SetStyle(ControlStyles.ResizeRedraw |
                ControlStyles.UserPaint |
                ControlStyles.AllPaintingInWmPaint, true);

            SuspendLayout();
            Font = SystemInformation.MenuFont;

            m_autoHideWindow = new AutoHideWindow(this);
            m_autoHideWindow.Visible = false;

            if (Environment.Version.Major == 1)
            {
                m_dummyControl = new DummyControl();
                m_dummyControl.Bounds = Rectangle.Empty;
                Controls.Add(m_dummyControl);
            }

            m_dockWindows = new DockWindowCollection(this);
            Controls.AddRange(new Control[]	{
                DockWindows[DockState.Document],
                DockWindows[DockState.DockLeft],
                DockWindows[DockState.DockRight],
                DockWindows[DockState.DockTop],
                DockWindows[DockState.DockBottom]
                });

            m_localWindowsHook = new LocalWindowsHook(HookType.WH_CALLWNDPROCRET);
            m_localWindowsHook.HookInvoked += new LocalWindowsHook.HookEventHandler(this.HookEventHandler);
            m_localWindowsHook.Install();

            m_dummyContent = new DockableWindow();
            ResumeLayout();
        }