示例#1
0
        public LoginForm(MovieDbEntities context = null)
        {
            db = context ?? new MovieDbEntities();
            InitializeComponent();

            GlassMargins = new Margins(0, 0, 48, 48);
        }
示例#2
0
            public HandleBackground(Form form, Margins m)
            {
                _margins = m;

                //Hook
                form.Paint += new PaintEventHandler(form_Paint);
            }
示例#3
0
文件: RsMini.cs 项目: 07box/07box
        public RsMini(RsBrowser rs)
        {
            parent = rs;
            mainForm = rs.parent;
            if (!Properties.Settings.Default.Resizable)
            {
                MessageBox.Show("Mini requires DWM.", "Desktop composition not enabled", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                return;
            }
            InitializeComponent();
            GlassMargins = new Margins(-3);
            GlassEnabled = false;
            Program.RestoreLocationAndSize(this, Properties.Settings.Default.MiniLocation, Properties.Settings.Default.MiniSize);
            UpdateAspectRatio();
            MaximumSize = new Size(MaximumSize.Width, (int)Math.Floor(MaximumSize.Width * AspectRatio));
            MinimumSize = new Size((int)Math.Floor(MinimumSize.Width * AspectRatio), MinimumSize.Width);
            Game = DwmManager.Register(Handle, rs.Handle);
            Inventory = DwmManager.Register(Handle, rs.Handle);
            UpdateThumbnails();

            if (Settings.Default.MiniVisible)
            {
                Show();
            }
            else
            {
                Hide();
            }
        }
示例#4
0
文件: MainForm.cs 项目: 07box/07box
        bool setForeground = true; // variable used to activate mainform without setting rs to foreground

        #endregion Fields

        #region Constructors

        public MainForm()
        {
            rs = new RsBrowser(this);
            cursor = new RsCursor(this);
            toolbox = new Toolbox(this);
            settings = new SettingsForm(this);

            InitializeComponent();
               	if (Properties.Settings.Default.Resizable)
               	{
               		InitializeThumbnailViewer();
               	}

            GlassMargins = new Margins(-3);
            GlassEnabled = false;

            AspectRatio = (double)rs.ClientSize.Width / (double)rs.ClientSize.Height;
            Program.RestoreLocationAndSize(this, Properties.Settings.Default.LastLocation, Properties.Settings.Default.LastSize);
            idleTimer.Tick += new EventHandler(idleTimer_Tick);
        }
示例#5
0
 /// <summary>
 /// Adds a handler on the Form that enables the user to move the window around
 /// by clicking on a glass margin (or the title bar, as usual).
 /// </summary>
 /// <param name="form">The form that will be controlled.</param>
 /// <param name="margins">Margins of the glass sheet.</param>
 /// <remarks>
 /// Eventual UI elements on the glass sheet will prevent the handler from receiving events
 /// (except the ThemeText control, which manually redirects mouse events to the form).
 /// </remarks>
 public static void HandleFormMovementOnGlass(Form form, Margins margins)
 {
     HandleFormMovement tmpHandler = new HandleFormMovement(form, margins);
 }
示例#6
0
 /// <summary>
 /// Adds a handler on the Form that automatically paints the glass background black
 /// </summary>
 /// <param name="form">The form that will be controlled.</param>
 /// <param name="margins">Margins of the glass sheet.</param>
 public static void HandleBackgroundPainting(Form form, Margins margins)
 {
     HandleBackground tmpHandler = new HandleBackground(form, margins);
 }
示例#7
0
 public static extern int DwmExtendFrameIntoClientArea(IntPtr hWnd, ref Margins pMarInset);
示例#8
0
 /// <summary>Extends the Aero "Glass Frame" into the client area. Background must be black.</summary>
 public static void EnableGlassFrame(Form window, Margins margins)
 {
     InternalGlassFrame(window.Handle, margins);
 }
示例#9
0
 /// <summary>Extends the Aero "Glass Frame" into the client area. Background must be black.</summary>
 public static void EnableGlassFrame(IntPtr hWnd, Margins margins)
 {
     InternalGlassFrame(hWnd, margins);
 }
示例#10
0
 /// <summary>
 /// Adds a handler on the Form that enables the user to move the window around
 /// by clicking on a glass margin (or the title bar, as usual).
 /// </summary>
 /// <param name="form">The form that will be controlled.</param>
 /// <param name="margins">Margins of the glass sheet.</param>
 /// <remarks>
 /// Eventual UI elements on the glass sheet will prevent the handler from receiving events
 /// (except the ThemeText control, which manually redirects mouse events to the form).
 /// </remarks>
 public static void HandleFormMovementOnGlass(Form form, Margins margins)
 {
     HandleFormMovement tmpHandler = new HandleFormMovement(form, margins);
 }
示例#11
0
 /// <summary>
 /// Adds a handler on the Form that automatically paints the glass background black
 /// </summary>
 /// <param name="form">The form that will be controlled.</param>
 /// <param name="margins">Margins of the glass sheet.</param>
 public static void HandleBackgroundPainting(Form form, Margins margins)
 {
     HandleBackground tmpHandler = new HandleBackground(form, margins);
 }
示例#12
0
            public HandleFormMovement(Form form, Margins margins)
            {
                _margins = margins;

                //Register handlers
                form.MouseDown += new MouseEventHandler(form_MouseDown);
                form.MouseUp += new MouseEventHandler(form_MouseUp);
                form.MouseMove += new MouseEventHandler(form_MouseMove);
            }
示例#13
0
 /// <summary>Extends the Aero "Glass Frame" into the client area. Background must be black.</summary>
 public static void EnableGlassFrame(IntPtr hWnd, Margins margins)
 {
     InternalGlassFrame(hWnd, margins);
 }
示例#14
0
        protected override void OnHandleCreated(EventArgs e)
        {
            base.OnHandleCreated(e);

            //Window init
            KeepAspectRatio = false;
            GlassEnabled = true;
            GlassMargins = new Margins(-4);
            //Opacity = 255;

            //Window handlers
            _windowSeeker.OwnerHandle = this.Handle;
            _msgPumpManager.Initialize(this);

            //Platform specific form initialization
            Program.Platform.PostHandleFormInit(this);
        }
示例#15
0
        protected override void OnHandleCreated(EventArgs e)
        {
            base.OnHandleCreated(e);

            //Window init
            KeepAspectRatio = false;
            GlassEnabled = true;
            GlassMargins = new Margins(-1);

            //Managers
            _msgPumpManager.Initialize(this);
            _windowListManager = new WindowListMenuManager(this, menuWindows);
            _windowListManager.ParentMenus = new System.Windows.Forms.ContextMenuStrip[] {
                menuContext, menuFullscreenContext
            };

            //Platform specific form initialization
            Program.Platform.PostHandleFormInit(this);
        }
示例#16
0
 /// <summary>Extends the Aero "Glass Frame" into the client area. Background must be black.</summary>
 public static void EnableGlassFrame(Form window, Margins margins)
 {
     InternalGlassFrame(window.Handle, margins);
 }
示例#17
0
 public static extern int DwmExtendFrameIntoClientArea(IntPtr hWnd, ref Margins pMarInset);
示例#18
0
        public IgnoreListForm()
        {
            InitializeComponent();

            GlassMargins = new Margins(0, 0, 0, 32);
        }
示例#19
0
        private static void InternalGlassFrame(IntPtr hWnd, Margins margins)
        {
            if (!OsSupport.IsVistaOrBetter || !OsSupport.IsCompositionEnabled)
                return;

            if (NativeMethods.DwmExtendFrameIntoClientArea(hWnd, ref margins) != 0)
                throw new DwmCompositionException(String.Format(Resources.ExceptionMessages.NativeCallFailure, "DwmExtendFrameIntoClientArea"));
        }