Beispiel #1
0
        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;
        }
Beispiel #2
0
        /// <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);
            //}
        }
Beispiel #3
0
        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
        }