Exemple #1
0
		private void btnMenuGUICcCustom_ExpandChange( object sender, EventArgs e ) {
			if( btnMenuGUICcCustom.Expanded ) {
				mColorSelected = false;
				mBaseColorScheme = ( (Office2007Renderer)GlobalManager.Renderer ).ColorTable.InitialColorScheme;
			} else if( !mColorSelected )
				RibbonPredefinedColorSchemes.ChangeOffice2007ColorTable( mBaseColorScheme );
		}
Exemple #2
0
 private void btnMenuGUICcCustom_ExpandChange(object sender, EventArgs e)
 {
     if (btnMenuGUICcCustom.Expanded)
     {
         mColorSelected   = false;
         mBaseColorScheme = ((Office2007Renderer)GlobalManager.Renderer).ColorTable.InitialColorScheme;
     }
     else if (!mColorSelected)
     {
         RibbonPredefinedColorSchemes.ChangeOffice2007ColorTable(mBaseColorScheme);
     }
 }
Exemple #3
0
        private void command1_Executed(object sender, EventArgs e)
        {
            ICommandSource source = sender as ICommandSource;

            if (source.CommandParameter is string)
            {
                eOffice2007ColorScheme colorScheme = (eOffice2007ColorScheme)Enum.Parse(typeof(eOffice2007ColorScheme), source.CommandParameter.ToString());
                ribbonControl_main.Office2007ColorTable = colorScheme;
            }
            else if (source.CommandParameter is Color)
            {
                RibbonPredefinedColorSchemes.ChangeOffice2007ColorTable(this, m_BaseColorScheme, (Color)source.CommandParameter);
            }
            this.Invalidate();
        }
Exemple #4
0
 private void buttonStyleCustom_ExpandChange(object sender, System.EventArgs e)
 {
     if (buttonStyleCustom.Expanded)
     {
         m_ColorSelected   = false;
         m_BaseColorScheme = ((Office2007Renderer)GlobalManager.Renderer).ColorTable.InitialColorScheme;
     }
     else
     {
         if (!m_ColorSelected)
         {
             ribbonTop.Office2007ColorTable = m_BaseColorScheme;
         }
     }
 }
Exemple #5
0
        private void AppCommandTheme_Executed(object sender, EventArgs e)
        {
            ICommandSource source = sender as ICommandSource;

            if (source.CommandParameter is string)
            {
                eOffice2007ColorScheme colorScheme = (eOffice2007ColorScheme)Enum.Parse(typeof(eOffice2007ColorScheme), source.CommandParameter.ToString());
                // This is all that is needed to change the color table for all controls on the form
                ribbonControl1.Office2007ColorTable = colorScheme;
            }
            else if (source.CommandParameter is Color)
            {
                RibbonPredefinedColorSchemes.ChangeOffice2007ColorTable(this, m_BaseColorScheme, (Color)source.CommandParameter);
            }
            this.Invalidate();
        }
Exemple #6
0
 private void buttonStyleCustom_ExpandChange(object sender, System.EventArgs e)
 {
     if (buttonStyleCustom.Expanded)
     {
         // Remember the starting color scheme to apply if no color is selected during live-preview
         m_ColorSelected   = false;
         m_BaseColorScheme = ((Office2007Renderer)GlobalManager.Renderer).ColorTable.InitialColorScheme;
     }
     else
     {
         if (!m_ColorSelected)
         {
             ribbonControl1.Office2007ColorTable = m_BaseColorScheme;
         }
     }
 }
Exemple #7
0
 private void colorPickerCustomScheme_ExpandChange(object sender, System.EventArgs e)
 {
     if (colorPickerCustomScheme.Expanded)
     {
         // Remember the starting color scheme to apply if no color is selected during live-preview
         m_ColorSelected   = false;
         m_BaseColorScheme = ((Office2007Renderer)GlobalManager.Renderer).ColorTable.InitialColorScheme;
     }
     else
     {
         if (!m_ColorSelected)
         {
             RibbonPredefinedColorSchemes.ChangeOffice2007ColorTable(this, m_BaseColorScheme);
         }
     }
 }
Exemple #8
0
        /// <summary>
        /// ExpandChange
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ColorPickerDropDown1_ExpandChange(object sender, EventArgs e)
        {
            if (colorPickerDropDown1.Expanded)
            {
                // Remember the starting color scheme to apply
                // if no color is selected during live-preview

                _MColorSelected   = false;
                _MBaseColorScheme = ((Office2007Renderer)GlobalManager.Renderer).ColorTable.InitialColorScheme;
            }
            else
            {
                if (_MColorSelected == false)
                {
                    RibbonPredefinedColorSchemes.ChangeOffice2007ColorTable(_MBaseColorScheme);
                }
            }
        }
Exemple #9
0
		private bool LoadSettings() {
			string path = Properties.Settings.Default.ConfigDirectory;
			mBaseColorScheme = Properties.Settings.Default.GUITheme;
			chkSettingSaveOnExit.Checked = Properties.Settings.Default.SaveOnExit;
			chkSettingComments.Checked = Properties.Settings.Default.ShowComments;
			chkSettingBackup.Checked = Properties.Settings.Default.CreateBackup;

			do {
				// is <path> valid?
				if( path.IsNullOrEmpty() || System.IO.Directory.Exists( path ) == false ) {
					FolderBrowserDialog dlg = new FolderBrowserDialog();
					dlg.Description = "Bitte wähle deinen eAthena Config Ordner aus!\nz.B.: C:/eAthena/conf/";
					if( dlg.ShowDialog() != DialogResult.OK ) {
						path = string.Empty; // let the rest know what he did...
						break;
					}

					string[] pathParts = dlg.SelectedPath.Split( new char[] { '\\' } );
					if( pathParts.Length == 0 || pathParts[ pathParts.Length - 1 ].ToLower() != "conf" ) {
						path = string.Empty;
						Tools.Error( "Fehler im Pfad", "Dein angegebener Pfad is ungültig!\nDu musst einen eAthena Config Ordner auswählen!\n\nz.B.: C:/eAthena/conf/" );
						continue;
					}

					// he selected a Dir!
					path = dlg.SelectedPath;
				}

				// searching for Files in the dir
				if( path != string.Empty )
					mFiles = ConfParser.Load( path );

				if( mFiles != null && mFiles.Count > 0 ) // found some, break out!
					break;

				// nothing found, continue?
				if( MessageBoxEx.Show( "Es wurden keine Config Datein in dem Ordner gefunden!\nBitte wähle den richtigen Ordner aus!\n\nBeispiel: C:/eAthena/conf/\n\n\nMöchtest du es nochmal versuchen?", "Config Fehler", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error ) == DialogResult.Cancel )
					break;

				// reset if we continue so the first check show us the Dialog again
				path = string.Empty;
			} while( true );

			if( mFiles.Count == 0 ) // breaked out, no continue :/
				return false;

			// all valid, save the dir 
			if( path != Properties.Settings.Default.ConfigDirectory )
				Properties.Settings.Default.ConfigDirectory = path;

			return true;
		}
Exemple #10
0
 /// <summary>
 /// Creates new instance of the color table and initializes it with custom color scheme.
 /// </summary>
 /// <param name="scheme">Predefined color scheme to be used as starting color scheme.</param>
 /// <param name="baseSchemeColor">Color to use as basis for new color scheme</param>
 public Office2007ColorTable(eOffice2007ColorScheme scheme, Color baseSchemeColor)
 {
     if (baseSchemeColor.IsEmpty)
         m_ColorFactory = ColorFactory.Empty;
     else
         m_ColorFactory = new ColorBlendFactory(baseSchemeColor);
     if (scheme == eOffice2007ColorScheme.Black)
         Office2007ColorTableFactory.InitializeVistaBlackColorTable(this, m_ColorFactory);
     else if (scheme == eOffice2007ColorScheme.Silver)
         Office2007SilverColorTableFactory.InitializeColorTable(this, m_ColorFactory);
     else if (scheme == eOffice2007ColorScheme.VistaGlass)
         Office2007VistaBlackColorTableFactory.InitializeVistaBlackColorTable(this, m_ColorFactory);
     else
         InitializeBlueColorTable(m_ColorFactory);
     m_ColorScheme = scheme;
 }
Exemple #11
0
 /// <summary>
 /// Creates new instance of the object.
 /// </summary>
 public Office2007ColorTable(eOffice2007ColorScheme scheme, ColorFactory colorFactory)
 {
     m_ColorFactory = colorFactory;
     if (scheme == eOffice2007ColorScheme.Black)
         Office2007ColorTableFactory.InitializeVistaBlackColorTable(this, m_ColorFactory);
     else if (scheme == eOffice2007ColorScheme.Silver)
         Office2007SilverColorTableFactory.InitializeColorTable(this, m_ColorFactory);
     else if (scheme == eOffice2007ColorScheme.VistaGlass)
         Office2007VistaBlackColorTableFactory.InitializeVistaBlackColorTable(this, m_ColorFactory);
     else
         InitializeBlueColorTable(m_ColorFactory);
     m_ColorScheme = scheme;
 }
Exemple #12
0
        public static ElementStyle GetRibbonClientPanelStyle(ColorFactory f, eOffice2007ColorScheme cs)
        {
            ElementStyle style = new ElementStyle();
            style.Class = ElementStyleClassKeys.RibbonClientPanelKey;

            style.BackColorGradientAngle = 90;

            if (cs == eOffice2007ColorScheme.Blue)
            {
                style.BackColorBlend.Add(new BackgroundColorBlend(f.GetColor(0xBED4F0), 0));
                style.BackColorBlend.Add(new BackgroundColorBlend(f.GetColor(0x567DB1), .8f));
                style.BackColorBlend.Add(new BackgroundColorBlend(f.GetColor(0x6591CD), 1));
            }
            else if (cs == eOffice2007ColorScheme.Silver)
            {
                style.BackColorBlend.Add(new BackgroundColorBlend(f.GetColor(0xCCCFD8), 0));
                style.BackColorBlend.Add(new BackgroundColorBlend(f.GetColor(0xABAEB6), .8f));
                style.BackColorBlend.Add(new BackgroundColorBlend(f.GetColor(0x9B9FA6), 1));
            }
            else if (cs == eOffice2007ColorScheme.Black)
            {
                style.BackColorBlend.Add(new BackgroundColorBlend(f.GetColor(0x7E7E7E), 0));
                style.BackColorBlend.Add(new BackgroundColorBlend(f.GetColor(0x363636), .8f));
                style.BackColorBlend.Add(new BackgroundColorBlend(f.GetColor(0x0A0A0A), 1));
            }

            return style;
        }
Exemple #13
0
        /// <summary>
        /// Generates and Changes the Office 2007 color table for all DotNetBar controls on all open forms. You can use this function for example to
        /// create custom color scheme based on the base color and apply it to all DotNetBar control on given form. The new color table will be applied only to controls that
        /// have Office 2007 style. Any other style will be unchanged.
        /// </summary>
        /// <param name="colorTable">Base color table to use for creation of custom color table that will be applied.</param>
        /// <param name="baseSchemeColor">Base color used to create custom color table.</param>
        public static void ChangeOffice2007ColorTable(eOffice2007ColorScheme colorTable, Color baseSchemeColor)
        {
            // Make sure we use black color table in our global renderer
            if (GlobalManager.Renderer is Office2007Renderer)
            {
                ((Office2007Renderer)GlobalManager.Renderer).ColorTable.Dispose();
                ((Office2007Renderer)GlobalManager.Renderer).ColorTable = new Office2007ColorTable(colorTable, baseSchemeColor);
            }
            else
                throw new InvalidOperationException("GlobalManager.Renderer is not Office2007Renderer. Cannot change the color table. Make sure that renderer is set to Office2007Renderer");

            ApplyOffice2007ColorTable();
        }
Exemple #14
0
        private bool LoadSettings()
        {
            string path = Properties.Settings.Default.ConfigDirectory;

            mBaseColorScheme             = Properties.Settings.Default.GUITheme;
            chkSettingSaveOnExit.Checked = Properties.Settings.Default.SaveOnExit;
            chkSettingComments.Checked   = Properties.Settings.Default.ShowComments;
            chkSettingBackup.Checked     = Properties.Settings.Default.CreateBackup;

            do
            {
                // is <path> valid?
                if (path.IsNullOrEmpty() || System.IO.Directory.Exists(path) == false)
                {
                    FolderBrowserDialog dlg = new FolderBrowserDialog();
                    dlg.Description = "Bitte wähle deinen eAthena Config Ordner aus!\nz.B.: C:/eAthena/conf/";
                    if (dlg.ShowDialog() != DialogResult.OK)
                    {
                        path = string.Empty;                         // let the rest know what he did...
                        break;
                    }

                    string[] pathParts = dlg.SelectedPath.Split(new char[] { '\\' });
                    if (pathParts.Length == 0 || pathParts[pathParts.Length - 1].ToLower() != "conf")
                    {
                        path = string.Empty;
                        Tools.Error("Fehler im Pfad", "Dein angegebener Pfad is ungültig!\nDu musst einen eAthena Config Ordner auswählen!\n\nz.B.: C:/eAthena/conf/");
                        continue;
                    }

                    // he selected a Dir!
                    path = dlg.SelectedPath;
                }

                // searching for Files in the dir
                if (path != string.Empty)
                {
                    mFiles = ConfParser.Load(path);
                }

                if (mFiles != null && mFiles.Count > 0)                  // found some, break out!
                {
                    break;
                }

                // nothing found, continue?
                if (MessageBoxEx.Show("Es wurden keine Config Datein in dem Ordner gefunden!\nBitte wähle den richtigen Ordner aus!\n\nBeispiel: C:/eAthena/conf/\n\n\nMöchtest du es nochmal versuchen?", "Config Fehler", MessageBoxButtons.RetryCancel, MessageBoxIcon.Error) == DialogResult.Cancel)
                {
                    break;
                }

                // reset if we continue so the first check show us the Dialog again
                path = string.Empty;
            } while(true);

            if (mFiles.Count == 0)              // breaked out, no continue :/
            {
                return(false);
            }

            // all valid, save the dir
            if (path != Properties.Settings.Default.ConfigDirectory)
            {
                Properties.Settings.Default.ConfigDirectory = path;
            }

            return(true);
        }