コード例 #1
0
        internal void ShowComponentInfoPad(BasicNodeControl component)
        {
            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();

            m_mainWindowDockFrame.SetVisible(infoDockItem, true);

            infoPads.AddLast(infoDockItem);

            //TODO: floating info panels
            //there is still problem with below solution - if user resizes the window it frequently crashes (not always though)
            //however it crashes only when running from MONO Develop with attached debugger

            //            //this line allows setting window as floating automatically, to consider in future
            //            m_dockFrame.SetStatus(infoDockItem, DockItemStatus.Floating);
            //            Gdk.Rectangle floatRectangle = infoDockItem.FloatingPosition;
            //            floatRectangle.Width = 350;
            //            floatRectangle.Height = 180;
            //
            //            // TODO set location of info box next to the component node
            //            // to do this probably some translation will be needed of componentControl.DisplayBox on experiment canvas
            //            // to absolute x and y in relation to window
            //            floatRectangle.X = 600;
            //            floatRectangle.Y = 600;
            //            infoDockItem.SetFloatMode(floatRectangle);
        }