Beispiel #1
0
        protected override void OnDropDownOpening(EventArgs e)
        {
            this.menuWindowTranslucent.Checked = PdnBaseForm.EnableOpacity;
            this.menuWindowTools.Checked       = AppWorkspace.Widgets.ToolsForm.Visible;
            this.menuWindowHistory.Checked     = AppWorkspace.Widgets.HistoryForm.Visible;
            this.menuWindowLayers.Checked      = AppWorkspace.Widgets.LayerForm.Visible;
            this.menuWindowColors.Checked      = AppWorkspace.Widgets.ColorsForm.Visible;

            if (UserSessions.IsRemote())
            {
                this.menuWindowTranslucent.Enabled = false;
                this.menuWindowTranslucent.Checked = false;
            }

            bool pluralDocuments = (AppWorkspace.DocumentWorkspaces.Length > 1);

            this.menuWindowOpenMdiList.Enabled = pluralDocuments;
            this.menuWindowNextTab.Enabled     = pluralDocuments;
            this.menuWindowPreviousTab.Enabled = pluralDocuments;

            base.OnDropDownOpening(e);
        }
Beispiel #2
0
        /// <summary>
        /// Decides whether or not to have opacity be enabled.
        /// </summary>
        private void DecideOpacitySetting()
        {
            if (UserSessions.IsRemote() || !PdnBaseForm.globalEnableOpacity || !this.EnableInstanceOpacity)
            {
                if (this.enableOpacity)
                {
                    try
                    {
                        UI.SetFormOpacity(this, 1.0);
                    }

                    // This fails in certain odd situations (bug #746), so we just eat the exception.
                    catch (System.ComponentModel.Win32Exception)
                    {
                    }
                }

                this.enableOpacity = false;
            }
            else
            {
                if (!this.enableOpacity)
                {
                    // This fails in certain odd situations (bug #746), so we just eat the exception.
                    try
                    {
                        UI.SetFormOpacity(this, this.ourOpacity);
                    }

                    catch (System.ComponentModel.Win32Exception)
                    {
                    }
                }

                this.enableOpacity = true;
            }
        }