/// <summary> /// Create & display splash form /// </summary> /// <returns></returns> public static Splash ShowForm() { Splash splash; splash = new Splash(); splash.IniFile = // common client settings IniFile.OpenClientIniFile("MobiusClient.ini"); splash.UserIniFile = // user specific settings IniFile.OpenClientIniFile("MobiusClientUser.ini", "Mobius"); LogWindow.Display = splash.UserIniFile.ReadBool("DisplayLogWindow", false); // if (!Unattended) { try // set the skin to display { string lookAndFeelName = splash.UserIniFile.Read("LookAndFeel", "Blue"); LookAndFeelMx.SetLookAndFeel(lookAndFeelName, splash.LookAndFeel); } catch (Exception ex) { ex = ex; } splash.Show(); splash.SetSplashImage(); } return(splash); }
private void Setup() { InSetup = true; // Setup preferred project MetaTreeNode mtn = MetaTree.GetNode(SS.I.PreferredProjectId); // If not found create folder node // The following default folder node should exist in the MetaTree root node: // <child name = "default_folder" l = "Private Queries, Lists..." type = "project" item = "default_folder" /> if (mtn == null) { mtn = new MetaTreeNode(MetaTreeNodeType.Project); mtn.Name = mtn.Target = "DEFAULT_FOLDER"; mtn.Label = "Private Queries, Lists..."; } PreferredProject.Text = mtn.Label; PreferredProjectId = SS.I.PreferredProjectId; PreferredProjectChanged = false; // Setup default directory DefaultFolder.Text = ClientDirs.DefaultMobiusUserDocumentsFolder; // Setup zoom TableColumnZoom.ZoomPct = SS.I.TableColumnZoom; // Setup zoom controls GraphicsColumnZoom.ZoomPct = SS.I.GraphicsColumnZoom; ZoomChanged = false; ScrollGridByRow.Checked = !SS.I.ScrollGridByPixel; ScrollGridByPixel.Checked = SS.I.ScrollGridByPixel; InitialScrollGridByPixel = SS.I.ScrollGridByPixel; // Setup look and feel LookAndFeelOption.Properties.Items.Clear(); List <SkinInfoMx> skins = LookAndFeelMx.GetSkins(); foreach (SkinInfoMx si in skins) { LookAndFeelOption.Properties.Items.Add(new ImageComboBoxItem(si.ExternalName, si.ImageIndex)); } // Basic old styles (these cause dialog box to close for some reason) CurrentLookAndFeel = SS.I.UserIniFile.Read("LookAndFeel", "Blue"); LookAndFeelOption.Text = LookAndFeelMx.GetExternalSkinName(CurrentLookAndFeel); ChangingLookAndFeelModes = false; InSetup = false; FindRelatedCpdsInQuickSearch.Checked = SS.I.FindRelatedCpdsInQuickSearch; RestoreWindowsAtStartup.Checked = SS.I.RestoreWindowsAtStartup; return; }
private void LookAndFeelOption_SelectedIndexChanged(object sender, EventArgs e) { if (InSetup) { return; } bool newStyleIsSkin, currentStyleIsSkin; string newLf = LookAndFeelOption.SelectedItem.ToString(); newLf = LookAndFeelMx.GetInternalSkinName(newLf); if (newLf == "Flat" || newLf == "UltraFlat" || newLf == "Classic Windows 3D Style") { newStyleIsSkin = false; } else { newStyleIsSkin = true; } if (GetDefaultLookAndFeelStyle() == LookAndFeelStyle.Skin) { currentStyleIsSkin = true; } else { currentStyleIsSkin = false; } if (newStyleIsSkin != currentStyleIsSkin) { // changing between a skin and non-skin look and feel causes the dialog to close & reopen so make change permanent now SaveLookAndFeel(); CurrentLookAndFeel = newLf; ChangingLookAndFeelModes = true; } SetLookAndFeel(newLf); SessionManager sm = SessionManager.Instance; if (sm != null) { //if (sm.MainMenuControl != null) // sm.MainMenuControl.SetMatchingBackgroundColor(); if (sm.StatusBarManager != null) { sm.StatusBarManager.AdjustRetrievalProgressBarLocation(); } } return; }
/// <summary> /// Save Look and Feel setting in local preferences /// </summary> void SaveLookAndFeel() { string internalName = LookAndFeelMx.GetInternalSkinName(LookAndFeelOption.Text); SS.I.UserIniFile.Write("LookAndFeel", internalName); //if (SessionManager.Instance != null && SessionManager.Instance.MainMenuControl != null) //{ // also save any main menu background color // Color c = SessionManager.Instance.MainMenuControl.BackColor; // string txt = c.R.ToString() + ", " + c.G.ToString() + ", " + c.B.ToString(); // SS.I.UserIniFile.Write("MainMenuBackgroundColor", txt); //} }
private void Cancel_Click(object sender, EventArgs e) { if (ZoomChanged) // restore grid options if changed { SS.I.TableColumnZoom = Preferences.GetInt("TableColumnZoom"); SS.I.GraphicsColumnZoom = Preferences.GetInt("GraphicsColumnZoom"); ScaleView(); // restore view } SS.I.ScrollGridByPixel = InitialScrollGridByPixel; if (CurrentLookAndFeel != LookAndFeelMx.GetInternalSkinName(LookAndFeelOption.Text)) { // restore previous look and feel SetLookAndFeel(CurrentLookAndFeel); } Hide(); // must explicitly hide since closing event is cancelled }
/// <summary> /// Set the default look and feel /// </summary> /// <param name="lookAndFeelName"></param> public static void SetLookAndFeel( string lookAndFeelName) { if (Instance == null) { Instance = new PreferencesDialog(); } Color mainMenuFontColor = LookAndFeelMx.SetLookAndFeel(lookAndFeelName, Instance.DefaultLookAndFeel.LookAndFeel); int mainMenuLeft = 45; SessionManager sm = SessionManager.Instance; if (sm != null && sm.RibbonCtl != null) { RibbonControl ribbon = sm.RibbonCtl; RibbonViewInfo vi = ribbon.ViewInfo; ribbon.Minimized = true; // be sure minimized if (MobiusIcon == null) { MobiusIcon = ribbon.ApplicationIcon; } if (QuickSearchImageIndex < 0) { QuickSearchImageIndex = sm.QuickSearchControl.ImageIndex; } if (Lex.Contains(lookAndFeelName, "Office 2010")) // || Lex.Contains(lookAndFeelName, "Windows 7")) { // use new style ribbon ribbon.RibbonStyle = RibbonControlStyle.Office2010; ribbon.ShowPageHeadersMode = ShowPageHeadersMode.Hide; ribbon.ApplicationIcon = null; // don't show Mobius icon on application button ribbon.ApplicationButtonText = ""; sm.QuickSearchControl.ImageIndex = -1; } else // Office 2007 ribbon { ribbon.RibbonStyle = RibbonControlStyle.Office2007; ribbon.ApplicationIcon = MobiusIcon; sm.QuickSearchControl.ImageIndex = QuickSearchImageIndex; } // Obsolete //if (sm != null && sm.MainMenuControl != null && sm.ShellForm != null) //{ // MainMenuControl menu = sm.MainMenuControl; // if (ribbon.RibbonStyle == RibbonControlStyle.Office2010) // mainMenuLeft += 14; // menu.Left = mainMenuLeft; // SetMainMenuTopPosition(); // menu.SetFontColor(mainMenuFontColor); //} } DevExpress.LookAndFeel.LookAndFeelHelper.ForceDefaultLookAndFeelChanged(); Application.DoEvents(); // repaint return; /// Get skin element color //DevExpress.Skins.Skin currentSkin = DevExpress.Skins.CommonSkins.GetSkin(PreferencesDialog.Instance.DefaultLookAndFeel.LookAndFeel); //string elementName = DevExpress.Skins.CommonSkins.SkinTextBorder; //DevExpress.Skins.SkinElement element = currentSkin[elementName]; //QueryDescDivider.BackColor = element.Border.All; }