Exemplo n.º 1
0
        /// <summary>
        /// Right color used for drawing image column.
        /// </summary>
        /// <param name="style">Visual Style to be applied.</param>
        /// <returns>Color.</returns>
        public Color ColumnBaseColor2(VisualStyle style)
        {
            // Ensure theme details are uptodate
            UpdateThemeDetails();

            if (_currentTheme == THEME_CLASSIC)
            {
                if (style == VisualStyle.IDE2005)
                {
                    return(ColorHelper.MergeColors(SystemColors.ControlDarkDark, 0.32f, SystemColors.Control, 0.68f));
                }
                else
                {
                    return(ColorHelper.MergeColors(SystemColors.Window, 0.075f, SystemColors.Control, 0.925f));
                }
            }
            else if (style == VisualStyle.IDE2005)
            {
                return(_ide2005ColumnBaseColor2[_currentTheme]);
            }
            else
            {
                return(_themeColumnBaseColor2[_currentTheme]);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the space needed to draw the image in different styles.
        /// </summary>
        /// <param name="style">Visual style required.</param>
        /// <returns>Space image needs.</returns>
        public virtual Size ImageSpace(VisualStyle style)
        {
            // Calculate the raw space of the image
            Size size = ImageSize;

            // Add extra spacing needed for when drawing in different states
            switch (style)
            {
            case VisualStyle.IDE:
                size.Width  += EXTRA_IDE_WIDTH;
                size.Height += EXTRA_IDE_HEIGHT;
                break;

            case VisualStyle.Office2003:
            case VisualStyle.IDE2005:
                size.Width  += EXTRA_OFFICE2003_WIDTH;
                size.Height += EXTRA_OFFICE2003_HEIGHT;
                break;

            case VisualStyle.Plain:
            default:
                size.Width  += EXTRA_PLAIN_WIDTH;
                size.Height += EXTRA_PLAIN_HEIGHT;
                break;
            }

            return(size);
        }
Exemplo n.º 3
0
        public PlaybackAddForm(VisualStyle style)
        {
            InitializeComponent();

            _style = style;
            if (_style == VisualStyle.Dark)
            {
                BackColor         = Color.FromArgb(38, 38, 38);
                ForeColor         = Color.WhiteSmoke;
                _url.BackColor    = _playlist.BackColor = Color.FromArgb(42, 42, 42);
                _url.ForeColor    = _playlist.ForeColor = Color.WhiteSmoke;
                button1.BackColor = button2.BackColor = Color.FromArgb(56, 56, 56);
                button1.FlatAppearance.BorderColor = button2.FlatAppearance.BorderColor = Color.FromArgb(100, 100, 100);
            }

            OnCheckedChanged(this, EventArgs.Empty);
            if (Clipboard.ContainsText())
            {
                var text = Clipboard.GetText();
                if (text.StartsWith("http"))
                {
                    _url.Text = text;
                }
            }
        }
Exemplo n.º 4
0
 private void SetTitleStyle(VisualStyle style)
 {
     if (ViewClassic == ScoreItemClassic.Table)
     {
         PanelTitle.HorizontalAlignment = HorizontalAlignment.Center;
     }
     else
     {
         ScoreSheet scoreSheet = ScoreItem as ScoreSheet;
         if (scoreSheet != null)
         {
             PanelTitle.HorizontalAlignment = HorizontalAlignment.Center;
         }
         else
         {
             PanelTitle.HorizontalAlignment = HorizontalAlignment.Left;
         }
     }
     if (style != null)
     {
         LbTitle.Foreground     = new SolidColorBrush(style.ForeColor);
         BorderPanel.Background = new SolidColorBrush(style.BackColor);
         if (style.FontFamily != null)
         {
             LbTitle.FontFamily = style.FontFamily;
         }
         if (style.FontSize != 0)
         {
             LbTitle.FontSize = style.FontSize;
         }
         LbTitle.FontWeight = style.FontWeight;
     }
 }
Exemplo n.º 5
0
 private void SetPanelStyle()
 {
     if (Standard != null)
     {
         VisualStyle style = Standard.PanelStyle;
         if (style != null && mBorderPanel != null)
         {
             if (style.Width != 0)
             {
                 mBorderPanel.Width = style.Width;
             }
             else
             {
                 mBorderPanel.ClearValue(WidthProperty);
             }
             if (style.Height != 0)
             {
                 mBorderPanel.Height = style.Height;
             }
             else
             {
                 mBorderPanel.ClearValue(HeightProperty);
             }
             mBorderPanel.Background = new SolidColorBrush(style.BackColor);
         }
     }
 }
Exemplo n.º 6
0
        public TabStub(VisualStyle style)
        {
            // Default state
            _wct = null;
            _style = style;
            _hoverOver = -1;
            _hoverItem = -1;
            _selectedIndex = -1;
            _defaultFont = true;
            _defaultColor = true;
            _edge = Edge.None;
            _drawTabs = new ArrayList();
            _tabPages = new TabPageCollection();
            base.Font = SystemInformation.MenuFont;

            // Hookup to collection events
            _tabPages.Cleared += new CollectionClear(OnClearedPages);
            _tabPages.Inserted += new CollectionChange(OnInsertedPage);
            _tabPages.Removing += new CollectionChange(OnRemovingPage);
            _tabPages.Removed += new CollectionChange(OnRemovedPage);

            // Need notification when the MenuFont is changed
            Microsoft.Win32.SystemEvents.UserPreferenceChanged += new
                UserPreferenceChangedEventHandler(OnPreferenceChanged);

            // Default default colors
            DefineBackColor(SystemColors.Control);

            // Create the Timer for handling hovering over items
            _hoverTimer = new Timer();
            _hoverTimer.Interval = _hoverInterval;
            _hoverTimer.Tick += new EventHandler(OnTimerExpire);
        }
Exemplo n.º 7
0
        private void UpdateRibbonStyleMenuCheckMark()
        {
            //modificar el el app.config el usuario mas reciente
            Configuration      config      = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
            AppSettingsSection appSettings = config.AppSettings;

            KeyValueConfigurationElement setting = appSettings.Settings["RibbonStyle"];

            setting.Value = VisualStyle.ToString();
            config.Save(ConfigurationSaveMode.Modified);
            ConfigurationManager.RefreshSection("appSettings");
            //VisualStyle = vStyle;
            //switch (this.vStyle)
            switch (this.VisualStyle)
            {
            case VisualStyle.Office2007Blue:
                this.Office2007BlueStyleButton.Pressed = true;
                break;

            case VisualStyle.Office2007Black:
                this.Office2007BlackStyleButton.Pressed = true;
                break;

            case VisualStyle.Office2007Silver:
                this.Office2007SilverStyleButton.Pressed = true;
                break;
            }
        }
Exemplo n.º 8
0
 private void SetPanelStyle()
 {
     if (ScoreItem != null)
     {
         VisualStyle style = ScoreItem.TitleStyle;
         if (style != null && mBorderPanel != null)
         {
             if (style.Width > 0)
             {
                 mBorderPanel.Width = style.Width;
             }
             else
             {
                 mBorderPanel.ClearValue(WidthProperty);
             }
             if (style.Height > 0)
             {
                 mBorderPanel.Height = style.Height;
             }
             else
             {
                 mBorderPanel.ClearValue(HeightProperty);
             }
             mBorderPanel.Background = new SolidColorBrush(style.BackColor);
         }
     }
 }
Exemplo n.º 9
0
        /// <summary>
        /// Gets the dark base color for the current theme
        /// </summary>
        /// <param name="style">Visual Style to be applied.</param>
        /// <returns>Color.</returns>
        public Color BaseColor2(VisualStyle style)
        {
            // Ensure theme details are uptodate
            UpdateThemeDetails();

            if (_currentTheme == THEME_CLASSIC)
            {
                if (style == VisualStyle.IDE2005)
                {
                    return(SystemColors.Control);
                }
                else
                {
                    return(ColorHelper.MergeColors(SystemColors.Window, 0.16f, SystemColors.Control, 0.84f));
                }
            }
            else if (style == VisualStyle.IDE2005)
            {
                return(_ide2005Base2Color[_currentTheme]);
            }
            else
            {
                return(_themeBase2Color[_currentTheme]);
            }
        }
Exemplo n.º 10
0
        /// <summary>
        /// Getting Started with Shader Effects in WPF:http://www.codeproject.com/KB/WPF/WPF_shader_effects.aspx
        /// gpu enabled
        /// </summary>
        /// <param name="tileBytes"></param>
        /// <param name="style"></param>
        /// <returns></returns>
        public static byte[] MakeShaderEffect(byte[] tileBytes, VisualStyle style)
        {
            if (tileBytes == null)
            {
                return(null);
            }
            using (MemoryStream ms = new MemoryStream(tileBytes))
            {
                BitmapImage bitmap = new BitmapImage();
                bitmap.BeginInit();
                bitmap.StreamSource = ms;
                //bitmap.DecodePixelWidth = 200;
                bitmap.CacheOption = BitmapCacheOption.OnLoad;
                bitmap.EndInit();

                DrawingVisual drawingVisual = new DrawingVisual();
                using (DrawingContext drawingContext = drawingVisual.RenderOpen())
                {
                    drawingContext.DrawImage(bitmap, new Rect(new System.Windows.Size(bitmap.PixelWidth, bitmap.PixelHeight)));
                }
                switch (style)
                {
                case VisualStyle.None:
                    break;

                case VisualStyle.Gray:
                    drawingVisual.Effect = new sara.gisserver.console.gis.shaders.MonochromeEffect();
                    break;

                case VisualStyle.Invert:
                    drawingVisual.Effect = new sara.gisserver.console.gis.shaders.InvertColorEffect();
                    break;

                case VisualStyle.Tint:
                    drawingVisual.Effect = new sara.gisserver.console.gis.shaders.TintShaderEffect();
                    break;

                //case VisualStyle.Saturation:
                //    drawingVisual.Effect = new sara.gisserver.console.gis.shaders.SaturationEffect();
                //    break;
                case VisualStyle.Embossed:
                    drawingVisual.Effect = new sara.gisserver.console.gis.shaders.EmbossedEffect(3.5);
                    break;

                default:
                    break;
                }

                RenderTargetBitmap rtb = new RenderTargetBitmap(bitmap.PixelWidth, bitmap.PixelHeight, 96, 96, System.Windows.Media.PixelFormats.Default);
                rtb.Render(drawingVisual);
                PngBitmapEncoder encoder = new PngBitmapEncoder();
                BitmapFrame      frame   = BitmapFrame.Create(rtb);
                encoder.Frames.Add(frame);
                using (MemoryStream stream = new MemoryStream())
                {
                    encoder.Save(stream);
                    return(stream.ToArray());
                }
            }
        }
Exemplo n.º 11
0
        private void ApplyVisualStyle()
        {
            if (StyleClass == VisualStyle.Empty)
            {
                return;
            }

            if (!Overlay.Theme.ContainsResource(StyleClass))
            {
                LogEvent.UserInterface.Warning("Style '{0}' not found", StyleClass);
                return;
            }
            var controlStyle = Overlay.Theme.GetResource <VisualStyle>(StyleClass);

            if (float.IsNaN(Width) && controlStyle.Width > 0)
            {
                Width = controlStyle.Width;
            }

            if (float.IsNaN(Height) && controlStyle.Height > 0)
            {
                Height = controlStyle.Height;
            }

            RemoveAndDispose(ref visualState);
            visualState = ToDispose(controlStyle.CreateVisualState(this));
            visualState.Initialize();

            foreach (var s in visualState)
            {
                Children.Add(s);
            }
            Style = controlStyle;
        }
Exemplo n.º 12
0
        public TabStub(VisualStyle style)
        {
            // Default state
            _wct           = null;
            _style         = style;
            _hoverOver     = -1;
            _hoverItem     = -1;
            _selectedIndex = -1;
            _defaultFont   = true;
            _defaultColor  = true;
            _edge          = Edge.None;
            _drawTabs      = new ArrayList();
            _tabPages      = new TabPageCollection();
            base.Font      = SystemInformation.MenuFont;

            // Hookup to collection events
            _tabPages.Cleared  += new CollectionClear(OnClearedPages);
            _tabPages.Inserted += new CollectionChange(OnInsertedPage);
            _tabPages.Removing += new CollectionChange(OnRemovingPage);
            _tabPages.Removed  += new CollectionChange(OnRemovedPage);

            // Need notification when the MenuFont is changed
            Microsoft.Win32.SystemEvents.UserPreferenceChanged += new
                                                                  UserPreferenceChangedEventHandler(OnPreferenceChanged);

            // Default default colors
            DefineBackColor(SystemColors.Control);

            // Create the Timer for handling hovering over items
            _hoverTimer          = new Timer();
            _hoverTimer.Interval = _hoverInterval;
            _hoverTimer.Tick    += new EventHandler(OnTimerExpire);
        }
Exemplo n.º 13
0
		protected void InternalConstruct(VisualStyle style) {
			// Prevent flicker with double buffering and all painting inside WM_PAINT
			SetStyle(ControlStyles.DoubleBuffer | 
				ControlStyles.AllPaintingInWmPaint |
				ControlStyles.UserPaint, true);
		
			// We want to act as a drop target
			this.AllowDrop = true;
		
			// Remember parameters
			_style = style;
		    
			// Define initial state
			_numLeafs = 0;
			_compacting = false;
			_initializing = false;
			_suspendLeafCount = 0;
		    
			// Create the root sequence that always exists
			_root = new TabGroupSequence(this);
		    
			// Define default settings
			ResetProminentLeaf();
			ResetResizeBarVector();
			ResetResizeBarColor();
			ResetResizeBarLock();
			ResetLayoutLock();
			ResetCompactOptions();
			ResetDefaultGroupMinimumWidth();
			ResetDefaultGroupMinimumHeight();
			ResetActiveLeaf();
			ResetAutoCompact();
			ResetAtLeastOneLeaf();
			ResetCloseMenuText();
			ResetProminentMenuText();
			ResetRebalanceMenuText();
			ResetMovePreviousMenuText();
			ResetMoveNextMenuText();
			ResetNewVerticalMenuText();
			ResetNewHorizontalMenuText();
			ResetCloseShortcut();
			ResetProminentShortcut();
			ResetRebalanceShortcut();
			ResetMovePreviousShortcut();
			ResetMoveNextShortcut();
			ResetSplitVerticalShortcut();
			ResetSplitHorizontalShortcut();
			ResetImageList();
			ResetDisplayTabMode();
			ResetSaveControls();
			ResetAutoCalculateDirty();
			ResetDirty();
			ResetPageCloseWhenEmpty();
            
			// Add ourself to the application filtering list 
			// (to snoop for shortcut combinations)
			Application.AddMessageFilter(this);
            
		}
Exemplo n.º 14
0
        public static void DrawButtonCommand(Graphics g,
                                             VisualStyle style,
                                             Direction direction,
                                             Rectangle drawRect,
                                             CommandState state,
                                             Color baseColor,
                                             Color trackLight,
                                             Color trackBorder)
        {
            Rectangle rect = new Rectangle(drawRect.Left, drawRect.Top, drawRect.Width - 1, drawRect.Height - 1);

            // Draw background according to style
            switch (style)
            {
            case VisualStyle.Plain:
                // Draw background with back color
                using (SolidBrush backBrush = new SolidBrush(baseColor))
                    g.FillRectangle(backBrush, rect);

                // Modify according to state
                switch (state)
                {
                case CommandState.HotTrack:
                    DrawPlainRaised(g, rect, baseColor);
                    break;

                case CommandState.Pushed:
                    DrawPlainSunken(g, rect, baseColor);
                    break;
                }
                break;

            case VisualStyle.IDE:
                // Draw according to state
                switch (state)
                {
                case CommandState.Normal:
                    // Draw background with back color
                    using (SolidBrush backBrush = new SolidBrush(baseColor))
                        g.FillRectangle(backBrush, rect);
                    break;

                case CommandState.HotTrack:
                    g.FillRectangle(Brushes.White, rect);

                    using (SolidBrush trackBrush = new SolidBrush(trackLight))
                        g.FillRectangle(trackBrush, rect);

                    using (Pen trackPen = new Pen(trackBorder))
                        g.DrawRectangle(trackPen, rect);
                    break;

                case CommandState.Pushed:
                    //TODO: draw in a darker background color
                    break;
                }
                break;
            }
        }
Exemplo n.º 15
0
        // 供GetBackColor(region)、GetTextColor(region)、GetBorderColor(region)调的私有函数
        // parameters:
        //      region        枚举值,取哪个区域
        //      valueStyle    枚举值,取哪种类型的值
        // return:
        //      Color对象
        Color GetColor(ItemRegion region, ValueStyle valueStyle)
        {
            XmlEditor editor = this.m_document;

            if (editor.VisualCfg == null)
            {
                goto END1;
            }

            VisualStyle style = editor.VisualCfg.GetVisualStyle(this, region);

            if (style == null)
            {
                goto END1;
            }

            if (valueStyle == ValueStyle.BackColor)
            {
                return(style.BackColor);
            }
            else if (valueStyle == ValueStyle.TextColor)
            {
                return(style.TextColor);
            }
            else if (valueStyle == ValueStyle.BorderColor)
            {
                return(style.BorderColor);
            }

END1:
            //缺省值
            if (valueStyle == ValueStyle.BackColor)
            {
                if (region == ItemRegion.Text)
                {
                    return(editor.BackColorDefaultForEditable);
                }
                else if (this is AttrItem)
                {
                    return(editor.AttrBackColorDefault);
                }
                else
                {
                    return(editor.BackColorDefault);
                }
            }
            else if (valueStyle == ValueStyle.TextColor)
            {
                return(editor.TextColorDefault);
            }
            else if (valueStyle == ValueStyle.BorderColor)
            {
                return(editor.BorderColorDefault);
            }
            else
            {
                return(Color.Red);
            }
        }
Exemplo n.º 16
0
 public Connector(Control source, Connected target, VisualDirection direction,
                  HAlign horizAlign, VAlign vertAlign, ConnectorKind kind, VisualStyle style)
     : base(source, horizAlign, vertAlign)
 {
     Target         = target;
     Kind           = kind;
     ConnectorStyle = style;
 }
Exemplo n.º 17
0
        public MediaPortalEditor()
        {
            InitializeComponent();
            Text = "MediaPortalEditor";

            // Initialize style options
            style = VisualStyle.IDE;
            SetStyle(ControlStyles.DoubleBuffer, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);

            // Create the docking and tab manager
            tabManager                   = new TabControl();
            tabManager.Appearance        = TabControl.VisualAppearance.MultiDocument;
            tabManager.ClosePressed     += new EventHandler(OnDesignerClosed);
            tabManager.SelectionChanged += new EventHandler(OnDesignerIndexChanged);
            tabManager.Dock              = DockStyle.Fill;
            tabManager.Style             = style;
            tabManager.IDEPixelBorder    = true;
            tabManager.ShowClose         = false;
            tabManager.ImageList         = tabImageList;
            Controls.Add(tabManager);

            dockManager = new DockingManager(this, style);
            dockManager.InnerControl       = tabManager;
            dockManager.TabControlCreated += new DockingManager.TabControlCreatedHandler(OnTabControlCreated);
            dockManager.ContentHidden     += new DockingManager.ContentHandler(OnContentHidden);
            dockManager.ContentShown      += new DockingManager.ContentHandler(OnContentShown);

            // Create Status Bar
            statusBar = CreateStatusBar();
            dockManager.OuterControl = statusBar;

            // Create Menu and Toolbar
            topMenu = CreateTopMenu();

            // Create Skin Tree
            skinExplorer = new MpeExplorer(this);
            Content c = dockManager.Contents.Add(skinExplorer, "Explorer", serviceImageList, 0);

            dockManager.AddContentWithState(c, State.DockLeft);

            // Create Properties
            propertyManager = new MpePropertyManager(this);
            c = dockManager.Contents.Add(propertyManager, "Properties", serviceImageList, 1);
            dockManager.AddContentWithState(c, State.DockRight);

            // Create Help Manager and Browser
            helpManager = new MpeHelpManager(this);
            c           = dockManager.Contents.Add(helpManager, "Help", serviceImageList, 2);
            dockManager.AddContentWithState(c, State.DockBottom);
            helpBrowser = new MpeHelpBrowser(this);

            // Setup Tab Designers
            selectedDesignerIndex = -1;

            // Static Self Reference
            self = this;
        }
Exemplo n.º 18
0
 private void c1SplitButtonVisualStyle_DropDownItemClicked(object sender, C1.Win.C1Input.DropDownItemClickedEventArgs e)
 {
     if (_lastVisualStyleItem != null)
     {
         _lastVisualStyleItem.Checked = false;
     }
     this.VisualStyle     = (VisualStyle)e.ClickedItem.Tag;
     _lastVisualStyleItem = e.ClickedItem;
 }
Exemplo n.º 19
0
 private void InternalConstruct(VisualStyle style)
 {
     // We only need a shadow in IDE or Office styles
     if ((style == VisualStyle.IDE) ||
         (style == VisualStyle.IDE2005) ||
         (style == VisualStyle.Office2003))
     {
         _shadow = new PopupShadow();
     }
 }
Exemplo n.º 20
0
        public static void DrawButtonCommand(Graphics g, 
                                             VisualStyle style, 
                                             Direction direction, 
                                             Rectangle drawRect,
                                             CommandState state,
                                             Color baseColor,
                                             Color trackLight,
                                             Color trackBorder)
        {
            Rectangle rect = new Rectangle(drawRect.Left, drawRect.Top, drawRect.Width - 1, drawRect.Height - 1);

            // Draw background according to style
            switch(style)
            {
                case VisualStyle.Plain:
                    // Draw background with back color
                    using(SolidBrush backBrush = new SolidBrush(baseColor))
                        g.FillRectangle(backBrush, rect);

                    // Modify according to state
                    switch(state)
                    {
                        case CommandState.HotTrack:
                            DrawPlainRaised(g, rect, baseColor);
                            break;
                        case CommandState.Pushed:
                            DrawPlainSunken(g, rect, baseColor);
                            break;
                    }
                    break;
                case VisualStyle.IDE:
                    // Draw according to state
                    switch(state)
                    {
                        case CommandState.Normal:
                            // Draw background with back color
                            using(SolidBrush backBrush = new SolidBrush(baseColor))
                                g.FillRectangle(backBrush, rect);
                            break;
                        case CommandState.HotTrack:
                            g.FillRectangle(Brushes.White, rect);

                            using(SolidBrush trackBrush = new SolidBrush(trackLight))
                                g.FillRectangle(trackBrush, rect);

                            using(Pen trackPen = new Pen(trackBorder))
                                g.DrawRectangle(trackPen, rect);
                            break;
                        case CommandState.Pushed:
                            //TODO: draw in a darker background color
                            break;
                    }
                    break;
            }
        }
Exemplo n.º 21
0
        // pass a view style you want, the gs view will update to it
        public void ChangeViewStyleTo(VisualStyleType vs)
        {
            VisualStyle oldVs = mPreviewCtrl.mpView.VisualStyle;

            mPreviewCtrl.mpView.VisualStyle = new VisualStyle(vs);
            if (oldVs != null)
            {
                oldVs.Dispose();
            }
            EnumToolStripMenuItem.UpdateCheckedState(viewStyleToolStripMenuItem.DropDown.Items, vs);
            refreshView();
        }
Exemplo n.º 22
0
        /// <summary>
        /// Dark color used for separators.
        /// </summary>
        /// <param name="style">Visual Style to be applied.</param>
        /// <returns>Color.</returns>
        public Color SepDarkColor(VisualStyle style)
        {
            // Ensure theme details are uptodate
            UpdateThemeDetails();

            if ((style == VisualStyle.IDE2005) || (_currentTheme == THEME_CLASSIC))
            {
                return(ColorHelper.MergeColors(SystemColors.ControlDark, 0.7f, SystemColors.Window, 0.3f));
            }
            else
            {
                return(_themeSepDarkColor[_currentTheme]);
            }
        }
Exemplo n.º 23
0
        /// <summary>
        /// Gets the menu item border color.
        /// </summary>
        /// <param name="style">Visual Style to be applied.</param>
        /// <returns>Color.</returns>
        public Color MenuItemBorderColor(VisualStyle style)
        {
            // Ensure theme details are uptodate
            UpdateThemeDetails();

            if ((style == VisualStyle.IDE2005) || (_currentTheme == THEME_CLASSIC))
            {
                return(ColorHelper.MergeColors(SystemColors.Highlight, 0.7f, SystemColors.Window, 0.3f));
            }
            else
            {
                return(_themeMenuItemBorderColor[_currentTheme]);
            }
        }
Exemplo n.º 24
0
        /// <summary>
        /// Gets the tracking inside colour for a checkmark/radio button
        /// </summary>
        /// <param name="style">Visual Style to be applied.</param>
        /// <returns>Color.</returns>
        public Color TrackMenuCheckInsideColor(VisualStyle style)
        {
            // Ensure theme details are uptodate
            UpdateThemeDetails();

            if ((style == VisualStyle.IDE2005) || (_currentTheme == THEME_CLASSIC))
            {
                return(ColorHelper.MergeColors(SystemColors.Highlight, 0.3f, SystemColors.Control, 0.7f));
            }
            else
            {
                return(_themeTrackMenuCheckInsideColor[_currentTheme]);
            }
        }
Exemplo n.º 25
0
        /// <summary>
        /// Light color used for drawing spots
        /// </summary>
        /// <param name="style">Visual Style to be applied.</param>
        /// <returns>Color.</returns>
        public Color SpotColor2(VisualStyle style)
        {
            // Ensure theme details are uptodate
            UpdateThemeDetails();

            if ((style == VisualStyle.IDE2005) || (_currentTheme == THEME_CLASSIC))
            {
                return(SystemColors.ControlLightLight);
            }
            else
            {
                return(_themeSpotColor2[_currentTheme]);
            }
        }
Exemplo n.º 26
0
        /// <summary>
        /// Gets the tracking light light colour for the bottom.
        /// </summary>
        /// <param name="style">Visual Style to be applied.</param>
        /// <returns>Color.</returns>
        public Color TrackLightLightColor2(VisualStyle style)
        {
            // Ensure theme details are uptodate
            UpdateThemeDetails();

            if ((style == VisualStyle.IDE2005) || (_currentTheme == THEME_CLASSIC))
            {
                return(ColorHelper.MergeColors(SystemColors.Highlight, 0.1f, SystemColors.Control, 0.4f, SystemColors.Window, 0.5f));
            }
            else
            {
                return(_themeTrackLightLightColor2[_currentTheme]);
            }
        }
Exemplo n.º 27
0
        /// <summary>
        /// Color used for border in docking and tabcontrol.
        /// </summary>
        /// <param name="style">Visual Style to be applied.</param>
        /// <returns>Color.</returns>
        public Color ActiveBorderColor(VisualStyle style)
        {
            // Ensure theme details are uptodate
            UpdateThemeDetails();

            if ((style == VisualStyle.IDE2005) || (_currentTheme == THEME_CLASSIC))
            {
                return(SystemColors.ControlDark);
            }
            else
            {
                return(_themeActiveBorderColor[_currentTheme]);
            }
        }
Exemplo n.º 28
0
        /// <summary>
        /// Light color used for separators.
        /// </summary>
        /// <param name="style">Visual Style to be applied.</param>
        /// <returns>Color.</returns>
        public Color SepLightColor(VisualStyle style)
        {
            // Ensure theme details are uptodate
            UpdateThemeDetails();

            if ((style == VisualStyle.IDE2005) || (_currentTheme == THEME_CLASSIC))
            {
                return(Color.White);
            }
            else
            {
                return(_themeSepLightColor[_currentTheme]);
            }
        }
Exemplo n.º 29
0
        public WindowContent(DockingManager manager, VisualStyle vs)
            : base(manager)
        {
            // Remember state
            _style = vs;

            // Create collection of window details
            _contents = new ContentCollection();

            // We want notification when contents are added/removed/cleared
            _contents.Clearing += new CollectionClear(OnContentsClearing);
            _contents.Inserted += new CollectionChange(OnContentInserted);
            _contents.Removing += new CollectionChange(OnContentRemoving);
            _contents.Removed  += new CollectionChange(OnContentRemoved);
        }
Exemplo n.º 30
0
        //--------------------------------------------------------------------------------------------------

        #endregion

        #region C'tor, Remove

        public VisualShape(WorkspaceController workspaceController, InteractiveEntity shapeSource, Options options = Options.None)
            : base(workspaceController)
        {
            _Options     = options;
            _ShapeSource = shapeSource;
            if (_ShapeSource != null)
            {
                _VisualStyle = _ShapeSource.GetVisualStyleComponent();
                if (_VisualStyle != null)
                {
                    _VisualStyle.VisualStyleChanged += _VisualStyle_VisualStyleChanged;
                }
            }
            UpdateShape();
        }
Exemplo n.º 31
0
        public WindowContent(DockingManager manager, VisualStyle vs)
            : base(manager)
        {
            // Remember state
            _style = vs;
        
            // Create collection of window details
            _contents = new ContentCollection();

            // We want notification when contents are added/removed/cleared
            _contents.Clearing += new CollectionClear(OnContentsClearing);
            _contents.Inserted += new CollectionChange(OnContentInserted);
            _contents.Removing += new CollectionChange(OnContentRemoving);
            _contents.Removed += new CollectionChange(OnContentRemoved);
        }
Exemplo n.º 32
0
        //--------------------------------------------------------------------------------------------------

        #endregion

        #region Visual Style

        public void SetVisualStyle(VisualStyle visualStyle)
        {
            if (_VisualStyle != null)
            {
                _VisualStyle.VisualStyleChanged -= _VisualStyle_VisualStyleChanged;
            }

            _VisualStyle = visualStyle;

            if (_VisualStyle != null)
            {
                _VisualStyle.VisualStyleChanged += _VisualStyle_VisualStyleChanged;
            }

            _UpdatePresentation();
        }
Exemplo n.º 33
0
        protected void UpdateStyle(VisualStyle newStyle)
        {
            _style = newStyle;

            int vector = this.Length;

            if (_direction == Direction.Vertical)
            {
                this.Height = vector;
            }
            else
            {
                this.Width = vector;
            }

            Invalidate();
        }
Exemplo n.º 34
0
        protected void InternalConstruct(VisualStyle style, Direction direction, bool zoneMinMax)
        {
            // Remember initial state
            _style = style;
            _direction = direction;
            _maximizedWindow = null;
			_suppressReposition = false;
			_zoneMinMax = zoneMinMax;

            // Create the control used to resize the whole Zone
            _resizeBar = new ResizeBar(_direction, this);

            // Place last in the list of child Controls
            Controls.Add(_resizeBar);

            // Start of very small and let first content determine new size
            this.Size = new Size(0,0);		

			// Do not inherit the parent BackColor, we want the .Control color as 
			// this blends in with the way all the docking windows are drawn
			this.BackColor = SystemColors.Control;
			this.ForeColor = SystemColors.ControlText;
        }
Exemplo n.º 35
0
        public WindowContentTabbed(DockingManager manager, VisualStyle vs)
            : base(manager, vs)
        {
            _redocker = null;
            _activeContent = null;
            
            // Create the TabControl used for viewing the Content windows
            _tabControl = new SharpClient.UI.Controls.TabControl();

            // It should always occupy the remaining space after all details
            _tabControl.Dock = DockStyle.Fill;

            // Show tabs only if two or more tab pages exist
            _tabControl.HideTabsMode = SharpClient.UI.Controls.TabControl.HideTabsModes.HideUsingLogic;
            
            // Hook into the TabControl notifications
            _tabControl.GotFocus += new EventHandler(OnTabControlGotFocus);
            _tabControl.LostFocus += new EventHandler(OnTabControlLostFocus);
            _tabControl.PageGotFocus += new EventHandler(OnTabControlGotFocus);
            _tabControl.PageLostFocus += new EventHandler(OnTabControlLostFocus);
            _tabControl.SelectionChanged += new EventHandler(OnSelectionChanged);
            _tabControl.PageDragStart += new MouseEventHandler(OnPageDragStart);
            _tabControl.PageDragMove += new MouseEventHandler(OnPageDragMove);
            _tabControl.PageDragEnd += new MouseEventHandler(OnPageDragEnd);
            _tabControl.PageDragQuit += new MouseEventHandler(OnPageDragQuit);
            _tabControl.DoubleClickTab += new SharpClient.UI.Controls.TabControl.DoubleClickTabHandler(OnDoubleClickTab);
			//_tabControl.Font = manager.TabControlFont;
            _tabControl.BackColor = manager.BackColor;
            _tabControl.ForeColor = manager.InactiveTextColor;

            // Define the visual style required
            _tabControl.Style = vs;

			// Allow developers a chance to override default settings
			//manager.OnTabControlCreated(_tabControl);

            switch(vs)
            {
                case VisualStyle.IDE:
                    Controls.Add(_tabControl);
                    break;
                case VisualStyle.Plain:
                    // Only the border at the pages edge and not around the whole control
                    _tabControl.InsetBorderPagesOnly = !_manager.PlainTabBorder;

                    // We want a border around the TabControl so it is indented and looks consistent
                    // with the Plain look and feel, so use the helper Control 'BorderForControl'
                    BorderForControl bfc = new BorderForControl(_tabControl, _plainBorder);

                    // It should always occupy the remaining space after all details
                    bfc.Dock = DockStyle.Fill;

                    // Define the default border border
                    bfc.BackColor = _manager.BackColor;

                    // When in 'VisualStyle.Plain' we need to 
                    Controls.Add(bfc);
                    break;
            }

            // Need to hook into message pump so that the ESCAPE key can be 
            // intercepted when in redocking mode
            Application.AddMessageFilter(this);
        }
Exemplo n.º 36
0
 public void ResetStyle()
 {
     Style = VisualStyle.IDE;
 }
Exemplo n.º 37
0
        protected void InternalConstruct(VisualStyle style)
		{
            // Prevent flicker with double buffering and all painting inside WM_PAINT
			SetStyle(ControlStyles.DoubleBuffer | 
					 ControlStyles.AllPaintingInWmPaint |
					 ControlStyles.UserPaint, true);
		
		    // We want to act as a drop target
		    this.AllowDrop = true;
		
		    // Remember parameters
		    _style = style;
		    
		    // Define initial state
		    _numLeafs = 0;
		    _compacting = false;
		    _initializing = false;
			_suspendLeafCount = 0;
		    
            // Create the root sequence that always exists
            _root = new TabGroupSequence(this);
		    
            // Define default settings
		    ResetProminentLeaf();
		    ResetResizeBarVector();
		    ResetResizeBarColor();
		    ResetResizeBarLock();
			ResetLayoutLock();
			ResetCompactOptions();
		    ResetDefaultGroupMinimumWidth();
            ResetDefaultGroupMinimumHeight();
            ResetActiveLeaf();
            ResetAutoCompact();
            ResetAtLeastOneLeaf();
            ResetCloseMenuText();
            ResetProminentMenuText();
            ResetRebalanceMenuText();
            ResetMovePreviousMenuText();
            ResetMoveNextMenuText();
            ResetNewVerticalMenuText();
            ResetNewHorizontalMenuText();
            ResetCloseShortcut();
            ResetProminentShortcut();
            ResetRebalanceShortcut();
            ResetMovePreviousShortcut();
            ResetMoveNextShortcut();
            ResetSplitVerticalShortcut();
            ResetSplitHorizontalShortcut();
            ResetImageList();
            ResetDisplayTabMode();
            ResetSaveControls();
            ResetAutoCalculateDirty();
            ResetDirty();
			ResetPageCloseWhenEmpty();
            
            // Add ourself to the application filtering list 
            // (to snoop for shortcut combinations)
            Application.AddMessageFilter(this);
            
        }
Exemplo n.º 38
0
        public TabbedGroups(VisualStyle style)
		{
		    InternalConstruct(style);
        }
Exemplo n.º 39
0
        public DockingManager(ContainerControl container, VisualStyle vs)
        {
            // Must provide a valid container instance
            if (container == null)
                throw new ArgumentNullException("Container");

            // Default state
            _container = container;
            _visualStyle = vs;
            _innerControl = null;
            _zoneMinMax = true;
            _insideFill = false;
            _autoResize = true;
            _firstHalfWidth = true;
            _firstHalfHeight = true;
            _plainTabBorder = false;
            _surpressVisibleEvents = 0;
            _innerMinimum = new Size(20, 20);

            // Default font/resize
            _resizeBarVector = -1;
            _captionFont = SystemInformation.MenuFont;
            _tabControlFont = SystemInformation.MenuFont;
            _defaultCaptionFont = true;
            _defaultTabControlFont = true;

            // Create and add hidden auto hide panels
            AddAutoHidePanels();

            // Define initial colors
            ResetColors();

            // Create an object to manage the collection of Content
            _contents = new ManagerContentCollection(this);

            // We want notification when contents are removed/cleared
            _contents.Clearing += new CollectionClear(OnContentsClearing);
            _contents.Removed += new CollectionChange(OnContentRemoved);

            // We want to perform special action when container is resized
            _container.Resize += new EventHandler(OnContainerResized);

            // A Form can cause the child controls to be reordered after the initialisation
            // but before the Form.Load event. To handle this we hook into the event and force
            // the auto hide panels to be ordered back into their proper place.
            if (_container is Form)
            {
                Form formContainer = _container as Form;
                formContainer.Load += new EventHandler(OnFormLoaded);
            }

            // Need notification when colors change
            Microsoft.Win32.SystemEvents.UserPreferenceChanged += new UserPreferenceChangedEventHandler(OnPreferenceChanged);
        }
 /// Sets the visual style, line or arrow (default = line)
 public ShowNormalsGenerator setVisualStyle(VisualStyle visualStyle) {
     mVisualStyle = visualStyle;
     return this;
 }
Exemplo n.º 41
0
        protected void UpdateStyle(VisualStyle newStyle)
        {
            _style = newStyle;

            int vector = this.Length;

            if (_direction == Direction.Vertical)
                this.Height = vector;
            else
                this.Width = vector;

            Invalidate();
        }
Exemplo n.º 42
0
		public PopupMenu()
		{
			// Create collection objects
			_drawCommands = new ArrayList();
			_menuCommands = new MenuCommandCollection();

			// Default the properties
			_returnDir = 0;
			_extraSize = 0;
			_popupItem = -1;
			_trackItem = -1;
			_childMenu = null;
			_exitLoop = false;
			_popupDown = true;
			_mouseOver = false;
			_grabFocus = false;
			_excludeTop = true;
			_popupRight = true;
			_parentMenu = null;
			_excludeOffset = 0;
			_focusCatcher = null;
			_parentControl = null;
			_returnCommand = null;
			_oldFocus = IntPtr.Zero;
			_showInfrequent = false;
			_style = VisualStyle.IDE;
			_lastMousePos = new Point(-1,-1);
			_direction = Direction.Horizontal;
			_textFont = SystemInformation.MenuFont;

			// Create and initialise the timer object (but do not start it running!)
			_timer = new Timer();
			_timer.Interval = _selectionDelay;
			_timer.Tick += new EventHandler(OnTimerExpire);
		}
Exemplo n.º 43
0
 public ZoneSequence(DockingManager manager, State state, VisualStyle style, Direction direction, bool zoneMinMax)
     : base(manager, state)
 {
     InternalConstruct(style, direction, zoneMinMax);
 }
Exemplo n.º 44
0
        public MenuControl()
        {
            // Set default values
            lastX = -1;
            lastY = -1;
            _trackItem = -1;
            _oldFocus = IntPtr.Zero;
            _minButton = null;
            _popupMenu = null;
            _activeChild = null;
            _closeButton = null;
            _controlLPen = null;
            _mdiContainer = null;
            _restoreButton = null;
            _controlLBrush = null;
            _chevronStartCommand = null;
            _animateFirst = true;
            _exitLoop = false;
            _selected = false;
            _multiLine = false;
            _mouseOver = false;
            _defaultFont = true;
            _manualFocus = false;
            _drawUpwards = false;
            _plainAsBlock = false;
            _clientSubclass = null;
            _ignoreMouseMove = false;
            _deselectReset = true;
            _expandAllTogether = true;
            _rememberExpansion = true;
            _highlightInfrequent = true;
            _dismissTransfer = false;
            _style = VisualStyle.IDE;
            _direction = Direction.Horizontal;
            _menuCommands = new MenuCommandCollection();
            _glyphFading = GlyphFading.Default;
            this.Dock = DockStyle.Top;
            this.Cursor = System.Windows.Forms.Cursors.Arrow;

            // Animation details
            _animateTime = 100;
            _animate = Animate.System;
            _animateStyle = Animation.System;

            // Prevent flicker with double buffering and all painting inside WM_PAINT
            SetStyle(ControlStyles.DoubleBuffer |
                     ControlStyles.AllPaintingInWmPaint |
                     ControlStyles.UserPaint, true);

            // Should not be allowed to select this control
            SetStyle(ControlStyles.Selectable, false);

            // Hookup to collection events
            _menuCommands.Cleared += new CollectionClear(OnCollectionCleared);
            _menuCommands.Inserted += new CollectionChange(OnCollectionInserted);
            _menuCommands.Removed += new CollectionChange(OnCollectionRemoved);

            // Need notification when the MenuFont is changed
            Microsoft.Win32.SystemEvents.UserPreferenceChanged +=
                new UserPreferenceChangedEventHandler(OnPreferenceChanged);

            DefineColors();

            // Set the starting Font
            DefineFont(SystemInformation.MenuFont);

            // Do not allow tab key to select this control
            this.TabStop = false;

            // Default to one line of items
            this.Height = _rowHeight;

            // Add ourself to the application filtering list
            Application.AddMessageFilter(this);
        }
Exemplo n.º 45
0
 public static void DrawSeparatorCommand(Graphics g, 
                                         VisualStyle style, 
                                         Direction direction, 
                                         Rectangle drawRect,
                                         Color baseColor)
 {
     // Drawing depends on the visual style required
     if (style == VisualStyle.IDE)
     {
         // Draw a single separating line
         using(Pen dPen = new Pen(ControlPaint.Dark(baseColor)))
         {
             if (direction == Direction.Horizontal)
                 g.DrawLine(dPen, drawRect.Left, drawRect.Top,
                                  drawRect.Left, drawRect.Bottom - 1);
             else
                 g.DrawLine(dPen, drawRect.Left, drawRect.Top,
                                  drawRect.Right - 1, drawRect.Top);
         }
     }
     else
     {
         // Draw a dark/light combination of lines to give an indent
         using(Pen lPen = new Pen(ControlPaint.Dark(baseColor)),
                   llPen = new Pen(ControlPaint.LightLight(baseColor)))
         {
             if (direction == Direction.Horizontal)
             {
                 g.DrawLine(lPen, drawRect.Left, drawRect.Top, drawRect.Left, drawRect.Bottom - 1);
                 g.DrawLine(llPen, drawRect.Left + 1, drawRect.Top, drawRect.Left + 1, drawRect.Bottom - 1);
             }
             else
             {
                 g.DrawLine(lPen, drawRect.Left, drawRect.Top, drawRect.Right - 1, drawRect.Top);
                 g.DrawLine(llPen, drawRect.Left, drawRect.Top + 1, drawRect.Right - 1, drawRect.Top + 1);
             }
         }
     }
 }
        public void SetStyle(int valueIdx, VisualStyle type)
        {
            if (valueIdx < 0 || valueIdx >= visualStyles.Length)
                return;

            VisualStyle current = visualStyles[valueIdx];
            if (current == type)
                return;

            if ((current == VisualStyle.normal && type == VisualStyle.hidden) || (current == VisualStyle.hidden && type == VisualStyle.normal))
                highestVisibleValue = -1;

            canvasDirty = true;
            visualStyles[valueIdx] = type;
        }
Exemplo n.º 47
0
        public TabControl()
        {
            // Prevent flicker with double buffering and all painting inside WM_PAINT
            SetStyle(ControlStyles.DoubleBuffer, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.UserPaint, true);

            // Create collections
            _tabRects = new ArrayList();
            _tabPages = new TabPageCollection();

            // Hookup to collection events
            _tabPages.Clearing += new CollectionClear(OnClearingPages);
            _tabPages.Cleared += new CollectionClear(OnClearedPages);
            _tabPages.Inserting += new CollectionChange(OnInsertingPage);
            _tabPages.Inserted += new CollectionChange(OnInsertedPage);
            _tabPages.Removing += new CollectionChange(OnRemovingPage);
            _tabPages.Removed += new CollectionChange(OnRemovedPage);

            // Define the default state of the control
            _startPage = -1;
            _pageSelected = -1;
            _hotTrackPage = -1;
            _imageList = null;
            _insetPlain = true;
            _multiline = false;
            _multilineFullWidth = false;
            _dragFromControl = true;
            _mouseOver = false;
            _leftScroll = false;
            _defaultFont = true;
            _defaultColor = true;
            _rightScroll = false;
            _hoverSelect = false;
            _leftMouseDown = false;
            _ignoreDownDrag = true;
            _selectedTextOnly = false;
            _leftMouseDownDrag = false;
            _insetBorderPagesOnly = false;
            _hideTabsMode = HideTabsModes.ShowAlways;
            _recordFocus = true;
            _styleIndex = 1;
            _leaveTimeout = 200;
            _ctrlTopOffset = 0;
            _ctrlLeftOffset = 0;
            _ctrlRightOffset = 0;
            _ctrlBottomOffset = 0;
            _style = VisualStyle.IDE;
            _buttonActiveColor = Color.FromArgb(128, this.ForeColor);
            _buttonInactiveColor = _buttonActiveColor;
            _textColor = TabControl.DefaultForeColor;
            _textInactiveColor = Color.FromArgb(128, _textColor);
            _hotTextColor = SystemColors.ActiveCaption;

            // Create the panel that hosts each page control. This is done to prevent the problem where a
            // hosted Control/Form has 'AutoScaleBaseSize' defined. In which case our attempt to size it the
            // first time is ignored and the control sizes itself to big and would overlap the tabs area.
            _hostPanel = new HostPanel();
            _hostPanel.Location = new Point(-1,-1);
            _hostPanel.Size = new Size(0,0);
            _hostPanel.MouseEnter += new EventHandler(OnPageMouseEnter);
            _hostPanel.MouseLeave += new EventHandler(OnPageMouseLeave);

            // Create hover buttons
            _closeButton = new InertButton(_internalImages, (int)ImageStrip.Close);
            _leftArrow = new InertButton(_internalImages, (int)ImageStrip.LeftEnabled, (int)ImageStrip.LeftDisabled);
            _rightArrow = new InertButton(_internalImages, (int)ImageStrip.RightEnabled, (int)ImageStrip.RightDisabled);

            // We want our buttons to have very thin borders
            _closeButton.BorderWidth = _leftArrow.BorderWidth = _rightArrow.BorderWidth = 1;

            // Hookup to the button events
            _closeButton.Click += new EventHandler(OnCloseButton);
            _leftArrow.Click += new EventHandler(OnLeftArrow);
            _rightArrow.Click += new EventHandler(OnRightArrow);

            // Set their fixed sizes
            _leftArrow.Size = _rightArrow.Size = _closeButton.Size = new Size(_buttonWidth, _buttonHeight);

            // Add child controls
            Controls.AddRange(new Control[]{_closeButton, _leftArrow, _rightArrow, _hostPanel});

            // Grab some contant values
            _imageWidth = 16;
            _imageHeight = 16;

            // Default to having a MultiForm usage
            SetAppearance(VisualAppearance.MultiForm);

            // Need a timer so that when the mouse leaves, a fractionaly delay occurs before
            // noticing and hiding the tabs area when the appropriate style is set
            _overTimer = new Timer();
            _overTimer.Interval = _leaveTimeout;
            _overTimer.Tick += new EventHandler(OnMouseTick);

            // Need notification when the MenuFont is changed
            Microsoft.Win32.SystemEvents.UserPreferenceChanged +=
                new UserPreferenceChangedEventHandler(OnPreferenceChanged);

            // Define the default Font, BackColor and Button images
            DefineFont(SystemInformation.MenuFont);
            DefineBackColor(SystemColors.Control);
            DefineButtonImages();

            Recalculate();
        }
Exemplo n.º 48
0
    public MediaPortalEditor()
    {
      InitializeComponent();
      Text = "MediaPortalEditor";

      // Initialize style options
      style = VisualStyle.IDE;
      SetStyle(ControlStyles.DoubleBuffer, true);
      SetStyle(ControlStyles.AllPaintingInWmPaint, true);

      // Create the docking and tab manager
      tabManager = new TabControl();
      tabManager.Appearance = TabControl.VisualAppearance.MultiDocument;
      tabManager.ClosePressed += new EventHandler(OnDesignerClosed);
      tabManager.SelectionChanged += new EventHandler(OnDesignerIndexChanged);
      tabManager.Dock = DockStyle.Fill;
      tabManager.Style = style;
      tabManager.IDEPixelBorder = true;
      tabManager.ShowClose = false;
      tabManager.ImageList = tabImageList;
      Controls.Add(tabManager);

      dockManager = new DockingManager(this, style);
      dockManager.InnerControl = tabManager;
      dockManager.TabControlCreated += new DockingManager.TabControlCreatedHandler(OnTabControlCreated);
      dockManager.ContentHidden += new DockingManager.ContentHandler(OnContentHidden);
      dockManager.ContentShown += new DockingManager.ContentHandler(OnContentShown);

      // Create Status Bar
      statusBar = CreateStatusBar();
      dockManager.OuterControl = statusBar;

      // Create Menu and Toolbar
      topMenu = CreateTopMenu();

      // Create Skin Tree
      skinExplorer = new MpeExplorer(this);
      Content c = dockManager.Contents.Add(skinExplorer, "Explorer", serviceImageList, 0);
      dockManager.AddContentWithState(c, State.DockLeft);

      // Create Properties
      propertyManager = new MpePropertyManager(this);
      c = dockManager.Contents.Add(propertyManager, "Properties", serviceImageList, 1);
      dockManager.AddContentWithState(c, State.DockRight);

      // Create Help Manager and Browser
      helpManager = new MpeHelpManager(this);
      c = dockManager.Contents.Add(helpManager, "Help", serviceImageList, 2);
      dockManager.AddContentWithState(c, State.DockBottom);
      helpBrowser = new MpeHelpBrowser(this);

      // Setup Tab Designers
      selectedDesignerIndex = -1;

      // Static Self Reference
      self = this;
    }
Exemplo n.º 49
0
        public PopupMenu()
        {
            // Create collection objects
            _drawCommands = new ArrayList();
            _menuCommands = new MenuCommandCollection();

            // Default the properties
            _returnDir = 0;
            _extraSize = 0;
            _popupItem = -1;
            _trackItem = -1;
            _childMenu = null;
            _exitLoop = false;
            _popupDown = true;
            _mouseOver = false;
            _excludeTop = true;
            _popupRight = true;
            _parentMenu = null;
            _excludeOffset = 0;
            _parentControl = null;
            _returnCommand = null;
            _controlLBrush = null;
            _controlEBrush = null;
            _controlLLBrush = null;
            _highlightInfrequent = false;
            _showInfrequent = false;
            _style = VisualStyle.IDE;
            _rememberExpansion = true;
            _lastMousePos = new Point(-1,-1);
            _direction = Direction.Horizontal;
            _textFont = SystemInformation.MenuFont;

            // Animation details
            _animateTime = 100;
            _animate = Animate.System;
            _animateStyle = Animation.System;
            _animateFirst = true;
            _animateIn = true;

            // Create and initialise the timer object (but do not start it running!)
            _timer = new Timer();
            _timer.Interval = _selectionDelay;
            _timer.Tick += new EventHandler(OnTimerExpire);

            // Define default colors
            _textColor = SystemColors.MenuText;
            _highlightTextColor = SystemColors.HighlightText;
            DefineHighlightColors(SystemColors.Highlight);
            DefineColors(SystemColors.Control);
        }
Exemplo n.º 50
0
		public MenuControl()
		{
			// Set default values
			this.Dock = DockStyle.Top;
			_trackItem = -1;
			_selected = false;
			_multiLine = false;
			_popupMenu = null;
			_mouseOver = false;
			_manualFocus = false;
			_drawUpwards = false;
			_plainAsBlock = false;
			_oldFocus = IntPtr.Zero;
			_ignoreEscapeUp = false;
			_ignoreMouseMove = false;
			_dismissTransfer = false;
			_style = VisualStyle.IDE;
			_chevronStartCommand = null;
			_direction = Direction.Horizontal;
			_menuCommands = new MenuCommandCollection();

			// Prevent flicker with double buffering and all painting inside WM_PAINT
			SetStyle(ControlStyles.DoubleBuffer, true);
			SetStyle(ControlStyles.AllPaintingInWmPaint, true);

			// Should not be allowed to select this control
			SetStyle(ControlStyles.Selectable, false);

			// Hookup to collection events
			_menuCommands.Cleared += new CollectionWithEvents.CollectionClear(OnCollectionCleared);
			_menuCommands.Inserted += new CollectionWithEvents.CollectionChange(OnCollectionInserted);
			_menuCommands.Removed += new CollectionWithEvents.CollectionChange(OnCollectionRemoved);

			// Set the default menu color as background
			this.BackColor = SystemColors.Control;

			// Do not allow tab key to select this control
			this.TabStop = false;

			// Default the Font we use
			this.Font = SystemInformation.MenuFont;

			// Calculate the initial height/width of the control
			_rowWidth = _rowHeight = this.Font.Height + _breadthGap * 2 + 1;

			// Default to one line of items
			this.Height = _rowHeight;

			// Add ourself to the application filtering list
			Application.AddMessageFilter(this);
		}
 public ShowNormalsGenerator() {
     mTriangleBuffer = null;
     mSize = 1.0f;
     mVisualStyle = VisualStyle.VS_LINE;
 }