Exemple #1
0
        //private void b_Extract_Click(object sender, EventArgs e) {
        //  SevenZipExtractor.SetLibraryPath(@"C:\Program Files\7-Zip\7z.dll");
        //  string fileName = tb_ExtractArchive.Text;
        //  string directory = tb_ExtractDirectory.Text;
        //  var extr = new SevenZipExtractor(fileName);
        //  pb_ExtractWork.Maximum = (int)extr.FilesCount;
        //  extr.Extracting += new EventHandler<ProgressEventArgs>(extr_Extracting);
        //  extr.FileExtractionStarted += new EventHandler<FileInfoEventArgs>(extr_FileExtractionStarted);
        //  extr.FileExists += new EventHandler<FileOverwriteEventArgs>(extr_FileExists);
        //  extr.ExtractionFinished += new EventHandler<EventArgs>(extr_ExtractionFinished);
        //  extr.BeginExtractArchive(directory);
        //}
        //void extr_ExtractionFinished(object sender, EventArgs e) {
        //  pb_ExtractWork.Style = ProgressBarStyle.Blocks;
        //  pb_ExtractProgress.Value = 0;
        //  pb_ExtractWork.Value = 0;
        //  l_ExtractProgress.Text = "Finished";
        //  (sender as SevenZipExtractor).Dispose();
        //}
        public static Size CalculateSize(String windowText, WindowEdge edge)
        {
            Size size = new Size();
            ThemeImageLayout layout = null;
            SizeF textSize = new SizeF();

            using (Graphics g = Graphics.FromHwnd(IntPtr.Zero)) {
                // add an extra wide character to make sure there is room enough.
                textSize = g.MeasureString(String.Concat(windowText, "W"), Theme.Current.Font);
            }

            if(edge == WindowEdge.Left || edge == WindowEdge.Right){
                layout = Theme.Current.Vertical;

                size.Width = layout.Middle.Width;
                size.Height = layout.Top.Height + (int)textSize.Width + layout.Bottom.Height;
            }
            else{
                layout = Theme.Current.Horizontal;

                size.Height = layout.Middle.Height;
                size.Width = layout.Top.Width + (int)textSize.Width + layout.Bottom.Width;
            }

            return size;
        }
Exemple #2
0
 public void BeginResizeDrag(WindowEdge edge)
 {
     //Not supported
 }
Exemple #3
0
 public void BeginResizeDrag(WindowEdge edge)
 {
     UnmanagedMethods.DefWindowProc(_hwnd, (int) UnmanagedMethods.WindowsMessage.WM_NCLBUTTONDOWN,
         new IntPtr((int) EdgeDic[edge]), IntPtr.Zero);
 }
 public void BeginResizeDrag(WindowEdge edge) => _tl.BeginResizeDrag(edge);
Exemple #5
0
 public void BeginResizeDrag(WindowEdge edge)
 {
     //Not supported
 }
Exemple #6
0
 /// <summary>
 /// Starts resizing a window. This function is used if an application has window resizing controls.
 /// Should be called from left mouse button press event handler
 /// </summary>
 public void BeginResizeDrag(WindowEdge edge) => PlatformImpl?.BeginResizeDrag(edge);
Exemple #7
0
 public void BeginResizeDrag(WindowEdge edge)
 {
 }
Exemple #8
0
 public void BeginResizeDrag(WindowEdge edge)
 {
     UnmanagedMethods.DefWindowProc(_hwnd, (int)UnmanagedMethods.WindowsMessage.WM_NCLBUTTONDOWN,
                                    new IntPtr((int)EdgeDic[edge]), IntPtr.Zero);
 }
Exemple #9
0
 public void BeginResizeDrag(WindowEdge edge) => _tl.BeginResizeDrag(edge);
        private void UpdateCursor(double x, double y, bool updateResize)
        {
            if (updateResize) {
                resizing = true;
            }

            if (InTop (y) && InLeft (x)) {
                last_edge = WindowEdge.NorthWest;
                SetCursor (CursorType.TopLeftCorner);
            } else if (InTop (y) && InRight (x)) {
                last_edge = WindowEdge.NorthEast;
                SetCursor (CursorType.TopRightCorner);
            } else if (InBottom (y) && InLeft (x)) {
                last_edge = WindowEdge.SouthWest;
                SetCursor (CursorType.BottomLeftCorner);
            } else if (InBottom (y) && InRight (x)) {
                last_edge = WindowEdge.SouthEast;
                SetCursor (CursorType.BottomRightCorner);
            } else if (InTop (y)) {
                last_edge = WindowEdge.North;
                SetCursor (CursorType.TopSide);
            } else if (InLeft (x)) {
                last_edge = WindowEdge.West;
                SetCursor (CursorType.LeftSide);
            } else if (InBottom (y)) {
                last_edge = WindowEdge.South;
                SetCursor (CursorType.BottomSide);
            } else if (InRight (x)) {
                last_edge = WindowEdge.East;
                SetCursor (CursorType.RightSide);
            } else {
                if (updateResize) {
                    resizing = false;
                }

                ResetCursor ();
            }
        }
 public void BeginResizeDrag(WindowEdge edge, PointerPressedEventArgs e)
 {
 }
Exemple #12
0
 /// <summary>
 /// Starts resizing a window. This function is used if an application has window resizing controls.
 /// Should be called from left mouse button press event handler
 /// </summary>
 public void BeginResizeDrag(WindowEdge edge, PointerPressedEventArgs e) => PlatformImpl?.BeginResizeDrag(edge, e);
 public void BeginResizeDrag(WindowEdge edge, Point currentMousePosition)
 {
     _captureMouse(true);
     _prevPoint = currentMousePosition;
     _edge      = edge;
 }
Exemple #14
0
 public WindowScaler(MovableWindow window, WindowEdge edge)
     : base(window)
 {
     this.edge = edge;
 }
Exemple #15
0
 public static extern void gtk_window_begin_resize_drag(IntPtr self, WindowEdge edge,
                                                        int button, int rootX, int rootY, uint timestamp);