Exemple #1
0
        public NppDockableDialog(EmptyForm formToCover)
        {
            // register to Npp
            FormIntegration.RegisterToNpp(Handle);

            FormBorderStyle = FormBorderStyle.None;
            ControlBox      = false;
            ShowInTaskbar   = false;
            StartPosition   = FormStartPosition.Manual;
            AutoScaleMode   = AutoScaleMode.None;
            _masterForm     = formToCover;
            Location        = _masterForm.PointToScreen(Point.Empty);
            ClientSize      = _masterForm.ClientSize;

            _masterForm.VisibleChanged += Cover_OnVisibleChanged;
            _masterForm.Closed         += MasterFormOnClosed;

            _masterForm.ClientSizeChanged += RefreshPosAndLoc;
            _masterForm.LocationChanged   += RefreshPosAndLoc;
            _masterForm.LostFocus         += RefreshPosAndLoc;
            _masterForm.GotFocus          += RefreshPosAndLoc;

            Show(_masterForm);
            // Disable Aero transitions, the plexiglass gets too visible
            if (Environment.OSVersion.Version.Major >= 6)
            {
                int value = 1;
                WinApi.DwmSetWindowAttribute(Owner.Handle, WinApi.DwmwaTransitionsForcedisabled, ref value, 4);
            }

            Plug.OnNppWindowsMove += RefreshPosAndLoc;
        }
Exemple #2
0
        public NppDockableDialog(EmptyForm formToCover)
        {
            // register to Npp
            FormIntegration.RegisterToNpp(Handle);

            FormBorderStyle = FormBorderStyle.None;
            ControlBox = false;
            ShowInTaskbar = false;
            StartPosition = FormStartPosition.Manual;
            AutoScaleMode = AutoScaleMode.None;
            _masterForm = formToCover;
            Location = _masterForm.PointToScreen(Point.Empty);
            ClientSize = _masterForm.ClientSize;

            _masterForm.VisibleChanged += Cover_OnVisibleChanged;
            _masterForm.Closed += MasterFormOnClosed;

            _masterForm.ClientSizeChanged += RefreshPosAndLoc;
            _masterForm.LocationChanged += RefreshPosAndLoc;
            _masterForm.LostFocus += RefreshPosAndLoc;
            _masterForm.GotFocus += RefreshPosAndLoc;

            Show(_masterForm);
            // Disable Aero transitions, the plexiglass gets too visible
            if (Environment.OSVersion.Version.Major >= 6) {
                int value = 1;
                WinApi.DwmSetWindowAttribute(Owner.Handle, WinApi.DwmwaTransitionsForcedisabled, ref value, 4);
            }

            Plug.OnNppWindowsMove += RefreshPosAndLoc;
        }