Exemple #1
0
		internal virtual void grabWindow(IList<PopupPanelManager.PopupInfo> param1List)
		{
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final java.awt.Toolkit tk = java.awt.Toolkit.getDefaultToolkit();
		  Toolkit tk = Toolkit.DefaultToolkit;
		  AccessController.doPrivileged(new PrivilegedActionAnonymousInnerClass(this, tk));
		  JComponent jComponent = ((PopupPanelManager.PopupInfo)param1List[0]).PopupOriginator;
		  this.grabbedWindow = (jComponent is Window) ? (Window)jComponent : SwingUtilities.getWindowAncestor(jComponent);
		  if (this.grabbedWindow != null)
		  {
			this.grabbedWindow.addComponentListener(this);
			this.grabbedWindow.addWindowListener(this);
		  }
		}
 public virtual void popupHidden(PopupPanelManager.PopupEvent paramPopupEvent)
 {
     if (paramPopupEvent.Component is CostOSRibbonApplicationMenuPopupPanel)
     {
         CostOSRibbonUI.Instance.BackstageShown = false;
         CostOSRootPaneUI.Resolver.Ribbon.firePropertyChange("AppMenuHidden", false, true);
         Window window = SwingUtilities.getWindowAncestor(CostOSRootPaneUI.Resolver.Ribbon);
         window = JideSwingUtilities.getTopModalDialog(window);
         if (window != null)
         {
             window.invalidate();
             window.repaint();
         }
     }
 }
Exemple #3
0
 public virtual void addNotify()
 {
     base.addNotify();
     uninstallListeners();
     this.window = SwingUtilities.getWindowAncestor(this);
     if (this.window != null)
     {
         if (this.window is Frame)
         {
             State = ((Frame)this.window).ExtendedState;
         }
         else
         {
             State = 0;
         }
         Active = this.window.Active;
         installListeners();
         updateSystemIcon();
     }
 }
Exemple #4
0
            public virtual void layoutContainer(Container param1Container)
            {
                Insets insets = param1Container.Insets;
                int    i      = outerInstance.TabButtonGap;
                bool   bool1  = outerInstance.ribbon.ComponentOrientation.LeftToRight;
                int    j      = param1Container.Width;
                int    k      = outerInstance.TaskbarHeight;
                int    m      = insets.top;
                bool   bool2  = outerInstance.UsingTitlePane;

                if (!bool2)
                {
                    outerInstance.taskBarPanel.removeAll();
                    foreach (Component component in outerInstance.ribbon.TaskbarComponents)
                    {
                        outerInstance.taskBarPanel.add(component);
                    }
                    outerInstance.taskBarPanel.setBounds(insets.left, insets.top, j - insets.left - insets.right, k);
                    m += k;
                }
                else
                {
                    outerInstance.taskBarPanel.setBounds(0, 0, 0, 0);
                }
                Font font = outerInstance.ribbon.Font;

                if (font == null)
                {
                    font = new Font("SansSerif", 0, 12);
                    outerInstance.ribbon.Font = font;
                }
                FontMetrics fontMetrics = outerInstance.ribbon.getFontMetrics(font);
                int         n           = fontMetrics.stringWidth(CostOSRibbonApplicationMenuButtonUI.ApplicationMenuButtonText) + 24;
                int         i1;

                for (i1 = 0; i1 < outerInstance.ribbon.TaskCount; i1++)
                {
                    RibbonTask ribbonTask = outerInstance.ribbon.getTask(i1);
                    n += fontMetrics.stringWidth(ribbonTask.Title) + 32;
                }
                n += 12;
                i1 = outerInstance.TaskToggleButtonHeight;
                int i2 = bool1 ? insets.left : (j - insets.right);
                int i3 = k + i1;

                if (!bool2)
                {
                    outerInstance.applicationMenuButton.Visible = (outerInstance.ribbon.ApplicationMenu != null);
                    if (outerInstance.ribbon.ApplicationMenu != null)
                    {
                        if (bool1)
                        {
                            outerInstance.applicationMenuButton.setBounds(-5, insets.top, i3 + 24, i3);
                        }
                        else
                        {
                            outerInstance.applicationMenuButton.setBounds(i2 - i3, insets.top, i3, i3);
                        }
                    }
                }
                else
                {
                    outerInstance.applicationMenuButton.Visible = false;
                }
                i2 = bool1 ? (i2 + 2) : (i2 - 2);
                if (FlamingoUtilities.getApplicationMenuButton(SwingUtilities.getWindowAncestor(outerInstance.ribbon)) != null)
                {
                    i2 = bool1 ? (i2 + i3 + 15) : (i2 - i3);
                }
                if (outerInstance.o_trailingButton != null && outerInstance.helpButton == null)
                {
                    Dimension dimension = outerInstance.o_trailingButton.PreferredSize;
                    if (bool1)
                    {
                        outerInstance.o_trailingButton.setBounds(j - insets.right - dimension.width, m, dimension.width, dimension.height);
                    }
                    else
                    {
                        outerInstance.o_trailingButton.setBounds(insets.left, m, dimension.width, dimension.height);
                    }
                    if (outerInstance.o_searchButton != null)
                    {
                        Dimension dimension1 = outerInstance.o_searchButton.PreferredSize;
                        if (bool1)
                        {
                            outerInstance.o_searchButton.setBounds(n, m, dimension1.width, dimension1.height);
                        }
                        else
                        {
                            outerInstance.o_searchButton.setBounds(insets.left + dimension1.width, m, dimension1.width, dimension1.height);
                        }
                    }
                }
                if (outerInstance.helpButton != null)
                {
                    Dimension dimension = outerInstance.helpButton.PreferredSize;
                    if (bool1)
                    {
                        outerInstance.helpButton.setBounds(j - insets.right - dimension.width, m, dimension.width, dimension.height);
                    }
                    else
                    {
                        outerInstance.helpButton.setBounds(insets.left, m, dimension.width, dimension.height);
                    }
                    if (outerInstance.o_trailingButton != null)
                    {
                        Dimension dimension1 = outerInstance.o_trailingButton.PreferredSize;
                        if (bool1)
                        {
                            outerInstance.o_trailingButton.setBounds(j - insets.right * 2 - dimension1.width + dimension.width, m, dimension1.width, dimension1.height);
                        }
                        else
                        {
                            outerInstance.o_trailingButton.setBounds(insets.left + dimension1.width, m, dimension1.width, dimension1.height);
                        }
                    }
                }
                int i4 = 0;

                if (bool1)
                {
                    i4 = (outerInstance.o_trailingButton != null) ? (outerInstance.o_trailingButton.X - i - i2) : (param1Container.Width - insets.right - i2);
                    if (outerInstance.helpButton != null && outerInstance.o_trailingButton != null)
                    {
                        i4 = outerInstance.o_trailingButton.X - i - i2;
                    }
                    if (outerInstance.o_searchButton != null && outerInstance.o_trailingButton != null)
                    {
                        i4 = outerInstance.o_searchButton.X - i - i2;
                    }
                    outerInstance.taskToggleButtonsScrollablePanel.setBounds(i2, m, i4, i1);
                }
                else
                {
                    i4 = (outerInstance.helpButton != null) ? (i2 - i - outerInstance.helpButton.X - outerInstance.o_trailingButton.Width) : (i2 - insets.left);
                    if (outerInstance.helpButton != null && outerInstance.o_trailingButton != null)
                    {
                        i4 = i2 - i - outerInstance.o_trailingButton.X - outerInstance.o_trailingButton.Width - outerInstance.helpButton.X - outerInstance.helpButton.Width;
                    }
                    outerInstance.taskToggleButtonsScrollablePanel.setBounds(i2 - i4, m, i4, i1);
                }
                BasicRibbonUI.TaskToggleButtonsHostPanel taskToggleButtonsHostPanel = (BasicRibbonUI.TaskToggleButtonsHostPanel)outerInstance.taskToggleButtonsScrollablePanel.View;
                int i5 = (taskToggleButtonsHostPanel.MinimumSize).width;

                taskToggleButtonsHostPanel.PreferredSize = new Dimension(i5, (this.this$0.taskToggleButtonsScrollablePanel.Bounds).height);
                outerInstance.taskToggleButtonsScrollablePanel.doLayout();
                m += i1;
                int i6 = i1;

                if (!bool2)
                {
                    i6 += k;
                }
                if (outerInstance.bandScrollablePanel.Parent == outerInstance.ribbon)
                {
                    if (!outerInstance.ribbon.Minimized && outerInstance.ribbon.TaskCount > 0)
                    {
                        Insets insets1 = (outerInstance.ribbon.SelectedTask.BandCount == 0) ? new Insets(0, 0, 0, 0) : outerInstance.ribbon.SelectedTask.getBand(0).Insets;
                        outerInstance.bandScrollablePanel.setBounds(1 + insets.left, m + insets1.top, param1Container.Width - 2 * insets.left - 2 * insets.right - 1, param1Container.Height - i6 - insets.top - insets.bottom - insets1.top - insets1.bottom);
                        BasicRibbonUI.BandHostPanel bandHostPanel = (BasicRibbonUI.BandHostPanel)outerInstance.bandScrollablePanel.View;
                        int i7 = (bandHostPanel.MinimumSize).width;
                        bandHostPanel.PreferredSize = new Dimension(i7, (this.this$0.bandScrollablePanel.Bounds).height);
                        outerInstance.bandScrollablePanel.doLayout();
                        bandHostPanel.doLayout();
                    }
                    else
                    {
                        outerInstance.bandScrollablePanel.setBounds(0, 0, 0, 0);
                    }
                }
            }