Exemplo n.º 1
0
        /// <summary>
        /// Displays the GTK window.
        /// </summary>
        /// <param name="editor">The editor.</param>
        /// <param name="windowTitle">The window title.</param>
        /// <returns>if window has been displayed, otherwise false</returns>
        private bool DisplayGTKWindow(TraceLabSDK.IWorkspaceUnitEditor editor, String windowTitle)
        {
            DockItem dockingWindow = m_dockFrame.GetItem(windowTitle);

            if (dockingWindow == null)
            {
                dockingWindow = m_dockFrame.AddItem(windowTitle);
                dockingWindow.DefaultLocation = "Workspace/Bottom";
                dockingWindow.Behavior        = DockItemBehavior.Normal;

                dockingWindow.Visible = true;

                //Float window
                m_dockFrame.SetStatus(dockingWindow, DockItemStatus.Floating);
                Gdk.Rectangle floatRectangle = dockingWindow.FloatingPosition;
                floatRectangle.Width  = 350;
                floatRectangle.Height = 180;

                //location of info box next to the component node just sligthly below cursor click
                floatRectangle.X = 150;
                floatRectangle.Y = 150;
                dockingWindow.SetFloatMode(floatRectangle);
            }
            else
            {
                //if already exists just set it visible
                dockingWindow.Visible = true;
            }

            dockingWindow.Label   = windowTitle;
            dockingWindow.Content = editor as Widget;

            return(true);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Shows the component info pad.
        /// </summary>
        /// <param name="component">Component.</param>
        /// <param name="defaultLocationX">Default location x for the floating window</param>
        /// <param name="defaultLocationY">Default location y for the floating window</param>
        /// <param name="onVisibleChanged">The action that is executed when visibility of window changes.</param>
        internal void ShowComponentInfoPad(BasicNodeControl component,
                                           int defaultLocationX, int defaultLocationY, System.Action <Boolean> onVisibleChanged)
        {
            DockItem infoDockItem = m_mainWindowDockFrame.GetItem(component.ExperimentNode.ID);

            if (infoDockItem == null)
            {
                infoDockItem         = m_mainWindowDockFrame.AddItem(component.ExperimentNode.ID);
                infoDockItem.Content = CreateInfoWidget(component);

                infoDockItem.Label         = component.ExperimentNode.Data.Metadata.Label;
                infoDockItem.DefaultHeight = 150;
                infoDockItem.DefaultWidth  = 200;

                infoDockItem.DefaultLocation = GetLocation();

                infoDockItem.Visible = true;

                //attach action on visible changed, so that if window is closed then it toggles off the info icon
                infoDockItem.VisibleChanged += (object sender, EventArgs e) =>
                {
                    bool isVisible = ((DockItem)sender).Visible;
                    onVisibleChanged(isVisible);
                };

                AttachMouseOverHighlightHandlers(component, infoDockItem);

                infoPads.AddLast(infoDockItem);

                //Float window
                //this line allows setting window as floating automatically, to consider in future
                m_mainWindowDockFrame.SetStatus(infoDockItem, DockItemStatus.Floating);
                Gdk.Rectangle floatRectangle = infoDockItem.FloatingPosition;
                floatRectangle.Width  = 350;
                floatRectangle.Height = 180;

                //location of info box next to the component node just sligthly below cursor click
                floatRectangle.X = defaultLocationX;
                floatRectangle.Y = defaultLocationY + 20;
                infoDockItem.SetFloatMode(floatRectangle);
            }
            else
            {
                //if already exists just set it visible
                infoDockItem.Visible = true;
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Shows the component info pad.
        /// </summary>
        /// <param name="component">Component.</param>
        /// <param name="defaultLocationX">Default location x for the floating window</param>
        /// <param name="defaultLocationY">Default location y for the floating window</param>
        /// <param name="onVisibleChanged">The action that is executed when visibility of window changes.</param>
        internal void ShowComponentInfoPad(BasicNodeControl component,
                                           int defaultLocationX, int defaultLocationY, System.Action <Boolean> onVisibleChanged)
        {
            DockItem infoDockItem = m_mainWindowDockFrame.GetItem(component.ExperimentNode.ID);

            if (infoDockItem == null)
            {
                infoDockItem         = m_mainWindowDockFrame.AddItem(component.ExperimentNode.ID);
                infoDockItem.Content = CreateInfoWidget(component);

                if (component is DecisionNodeControl)
                {
                    //    string m = component.ExperimentNode.ID;
                    //  if (m. ID.Equals (DecisionMetadataDefinition.GotoDecisionGuid)) {
                    if (component.ExperimentNode.Data.Metadata.Label.Equals("Goto Decision"))
                    {
                        infoDockItem.Label = GOTO_INFO_PANEL_TITLE_LABEL;
                    }
                    else
                    {
                        infoDockItem.Label = DECISION_INFO_PANEL_TITLE_LABEL;
                    }
                }
                else if (component is LoopNodeControl)
                {
                    infoDockItem.Label = LOOP_INFO_PANEL_TITLE_LABEL;
                }
                else
                {
                    infoDockItem.Label = component.ExperimentNode.Data.Metadata.Label;
                }

                infoDockItem.DefaultHeight = 150;
                //infoDockItem.DefaultWidth = 200;
                // HERZUM SPRINT 4.2: TLAB-226
                infoDockItem.DefaultHeight = 100;
                if (component is ScopeNodeControl || component is CommentNodeControl)
                {
                    infoDockItem.DefaultHeight = 50;
                }
                // END HERZUM SPRINT 4.2: TLAB-226

                infoDockItem.DefaultLocation = GetLocation();

                infoDockItem.Visible = true;

                //attach action on visible changed, so that if window is closed then it toggles off the info icon
                infoDockItem.VisibleChanged += (object sender, EventArgs e) =>
                {
                    bool isVisible = ((DockItem)sender).Visible;
                    onVisibleChanged(isVisible);
                };

                AttachMouseOverHighlightHandlers(component, infoDockItem);

                infoPads.AddLast(infoDockItem);

                //Float window
                //this line allows setting window as floating automatically, to consider in future
                m_mainWindowDockFrame.SetStatus(infoDockItem, DockItemStatus.Floating);
                Gdk.Rectangle floatRectangle = infoDockItem.FloatingPosition;
                floatRectangle.Width = 350;
                //floatRectangle.Height = 180;
                // HERZUM SPRINT 4.2: TLAB-225
                floatRectangle.Height = 100;
                if (component is ScopeNodeControl || component is CommentNodeControl)
                {
                    floatRectangle.Height = 50;
                }
                // END HERZUM SPRINT 4.2: TLAB-225

                //location of info box next to the component node just sligthly below cursor click
                floatRectangle.X = defaultLocationX;
                floatRectangle.Y = defaultLocationY + 20;
                infoDockItem.SetFloatMode(floatRectangle);
            }
            else
            {
                //if already exists just set it visible
                infoDockItem.Visible = true;
            }
        }