Esempio n. 1
0
 public void topLevelResized()
 {
     if (allowSizeUpdates)
     {
         child.topLevelResized();
     }
 }
Esempio n. 2
0
 void layoutContainer_LayoutChanged()
 {
     component.topLevelResized();
     if (ViewResized != null)
     {
         ViewResized.Invoke(this);
     }
 }
Esempio n. 3
0
        public void topLevelResized()
        {
            int      width      = scrollView.ViewCoord.width;
            IntSize2 canvasSize = scrollView.CanvasSize;

            canvasSize.Width      = width;
            scrollView.CanvasSize = canvasSize;
            child.Widget.Width    = width;

            child.topLevelResized();
        }
Esempio n. 4
0
        public MDIDialogDecorator(MDILayoutManager targetLayoutManager, ViewHostComponent child, MyGUIView view)
            : base(view.Buttons.hasItem("Close") ? "Medical.GUI.AnomalousMvc.Decorators.MDIDialogDecoratorCSX.layout" : "Medical.GUI.AnomalousMvc.Decorators.MDIDialogDecoratorCS.layout")
        {
            this.MDIManager = targetLayoutManager;

            MDILayoutElementName mdiElementName = view.ElementName as MDILayoutElementName;

            if (mdiElementName != null)
            {
                this.AllowedDockLocations = mdiElementName.AllowedDockLocations;
            }

            ButtonCollection buttons = view.Buttons;

            if (buttons.Count > 0)
            {
                //Keep button decorator from being made if there is only one button and it is close
                if (buttons.Count == 1 && buttons.hasItem("Close"))
                {
                    buttons["Close"].createButton(this, 0, 0, 0, 0);
                }
                else
                {
                    child = new ButtonDecorator(child, buttons, this);
                }
            }

            fireCloseEvent = closeAction != null;

            window.Visible = true;
            window.Caption = view.DisplayTitle;

            IntCoord clientCoord      = window.ClientCoord;
            int      widthDifference  = window.Width - clientCoord.width;
            int      heightDifference = window.Height - clientCoord.height;

            Position   = new IntVector2(child.Widget.Left, child.Widget.Top);
            Size       = new IntSize2(child.Widget.Width + widthDifference, child.Widget.Height + heightDifference);
            dockedSize = Size;

            clientCoord = window.ClientCoord;
            this.child  = child;
            child.Widget.attachToWidget(window);
            child.Widget.setCoord(0, 0, clientCoord.width, clientCoord.height);
            child.Widget.Align = Align.Stretch;

            Resized += MDIDialogDecorator_Resized;
            Closing += MDIDialogDecorator_Closing;

            child.topLevelResized();
            window.Visible = false;
        }
Esempio n. 5
0
        public WindowDecorator(ViewHostComponent child, ButtonCollection buttons, MyGUIView view)
        {
            if (buttons.Count > 0)
            {
                //Keep button decorator from being made if there is only one button and it is close
                if (buttons.Count == 1 && buttons.hasItem("Close"))
                {
                    buttons["Close"].createButton(this, 0, 0, 0, 0);
                }
                else
                {
                    child = new ButtonDecorator(child, buttons, this);
                }
            }

            if (closeAction != null)
            {
                window = (Window)Gui.Instance.createWidgetT("Window", "WindowCSX", 300, 150, 260, 440, Align.Default, "Overlapped", "");
                window.WindowButtonPressed += new MyGUIEvent(window_WindowButtonPressed);
            }
            else
            {
                window = (Window)Gui.Instance.createWidgetT("Window", "WindowCS", 300, 150, 260, 440, Align.Default, "Overlapped", "");
            }

            int widthDiffernce   = window.ClientCoord.width - window.Width;
            int heightDifference = window.ClientCoord.height - window.Height;

            window.setCoord(child.Widget.Left, child.Widget.Top, child.Widget.Width + widthDiffernce, child.Widget.Height + heightDifference);

            this.child = child;
            child.Widget.attachToWidget(window);
            IntCoord clientCoord = window.ClientCoord;

            child.Widget.setCoord(0, 0, clientCoord.width, clientCoord.height);
            child.Widget.Align = Align.Stretch;

            window.WindowChangedCoord += new MyGUIEvent(window_WindowChangedCoord);
            child.topLevelResized();

            window.Caption = view.DisplayTitle;
        }
Esempio n. 6
0
        public void topLevelResized()
        {
            int variableButtonCount = variableSizeButtons.Count;

            if (variableButtonCount > 0)
            {
                int buttonWidth = (widget.Width - BUTTON_PADDING - fixedSizeArea) / variableButtonCount;
                foreach (Button button in variableSizeButtons)
                {
                    button.setSize(buttonWidth - BUTTON_PADDING, button.Height);
                }
            }
            int currentX = BUTTON_PADDING;

            foreach (Button button in buttons)
            {
                button.setPosition(currentX, button.Top);
                currentX += button.Width + BUTTON_PADDING;
            }
            child.topLevelResized();
        }
Esempio n. 7
0
 public void topLevelResized()
 {
     child.topLevelResized();
 }