Exemplo n.º 1
0
        private void button_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                if (fvmw == null)
                {
                    fvmw = new FolderViewModeWindow(ResStrs);
                    fvmw.ViewModeChanged += fvmw_ViewModeChanged;
                }

                fvmw.ShowWindow(Control.MousePosition, GetCurrentViewMode());
            }
        }
Exemplo n.º 2
0
        private void button_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Left)
            {
                if (this.fvmw == null)
                {
                    this.fvmw = new FolderViewModeWindow(this.ResStrs);
                    this.fvmw.ViewModeChanged += new EventHandler(this.fvmw_ViewModeChanged);
                }

                this.fvmw.ShowWindow(Control.MousePosition, this.GetCurrentViewMode());
            }
        }
Exemplo n.º 3
0
        public void ShowWindow(Point pnt, FOLDERVIEWMODE fvmCurrentMode)
        {
            const uint SWP_NOACTIVATE    = 0x0010;
            const int  SW_SHOWNOACTIVATE = 4;

            this.trackBar1.Value = FolderViewModeWindow.ModeToInt(fvmCurrentMode);

            // set the slider of trackbar under mouse position
            RECT      rct       = this.GetThumbRect();
            Point     pntCenter = new Point(rct.left + rct.Width / 2, rct.top + rct.Height / 2);
            Rectangle rctScreen = Screen.FromPoint(pnt).Bounds;

            pnt.X = pnt.X - pntCenter.X;
            pnt.Y = pnt.Y - pntCenter.Y;

            // ensure visible in the screen
            if (pnt.X < rctScreen.Left)
            {
                pnt.X = rctScreen.Left;
            }
            else if (pnt.X + this.Width > rctScreen.Right)
            {
                pnt.X = rctScreen.Right - this.Width;
            }

            if (pnt.Y < rctScreen.Top)
            {
                pnt.Y = rctScreen.Top;
            }
            else if (pnt.Y + this.Height > rctScreen.Bottom)
            {
                pnt.Y = rctScreen.Bottom - this.Height;
            }

            PInvoke.SetWindowPos(this.Handle, (IntPtr)(-1), pnt.X, pnt.Y, this.Width, this.Height, SWP_NOACTIVATE);
            PInvoke.ShowWindow(this.Handle, SW_SHOWNOACTIVATE);

            this.trackBar1.Focus();
        }
Exemplo n.º 4
0
        private void button_MouseDown(object sender, MouseEventArgs e) {
            if(e.Button == MouseButtons.Left) {
                if(this.fvmw == null) {
                    this.fvmw = new FolderViewModeWindow(this.ResStrs);
                    this.fvmw.ViewModeChanged += new EventHandler(this.fvmw_ViewModeChanged);
                }

                this.fvmw.ShowWindow(Control.MousePosition, this.GetCurrentViewMode());
            }
        }
Exemplo n.º 5
0
        private void labelButtons_Click(object sender, EventArgs e)
        {
            FOLDERVIEWMODE mode = (FOLDERVIEWMODE)((LabelEx)sender).Tag;

            this.trackBar1.Value = FolderViewModeWindow.ModeToInt(mode);
        }
Exemplo n.º 6
0
        private void button_MouseDown(object sender, MouseEventArgs e) {
            if(e.Button == MouseButtons.Left) {
                if(fvmw == null) {
                    fvmw = new FolderViewModeWindow(ResStrs);
                    fvmw.ViewModeChanged += fvmw_ViewModeChanged;
                }

                fvmw.ShowWindow(Control.MousePosition, GetCurrentViewMode());
            }
        }