-
Posts
-
By Stup0t · Posted
Can we not have paperless office, like we was promised in the 80's -
By Stup0t · Posted
I actually laughed out loud in real life at the heading on this—whatever Microsoft is drinking, I want some of it. -
By notta · Posted
Yea I don't think so. -
By David Uzondu · Posted
Euro-Office must default to ODF to be considered "genuinely European", LibreOffice argues by David Uzondu Euro-Office is a web-based collaborative office suite that positions itself as a "European sovereign alternative" to American tech companies, backed by a coalition of developers including Nextcloud, IONOS, Abilian, BTactic, OpenProject, and, more recently, Tuta. The project officially went live a couple of days ago, but not before drawing heavy fire from LibreOffice developers, who called the marketing claim that Euro-Office represents the "first open-source office suite developed in Europe" a deceptive historical inaccuracy because projects like OpenOffice and LibreOffice existed decades earlier. Now that the project has launched, LibreOffice is back with another complaint, arguing that Euro-Office cannot consider itself "genuinely European" while it pushes proprietary Microsoft defaults on users. Euro-Office had promised to improve the OpenDocument Format (ODF) back in April, but the current release still plagues users with several technical failures. For instance, the suite lacks an admin setting to enforce ODF, and mobile editors completely block ODF saves, forcing files into Microsoft's OOXML formats. Some configurations force files into read-only mode, while editing frequently corrupts document formatting or erases data. LibreOffice thinks that merely supporting a format as an afterthought does not make you a sovereign alternative, as file formats are the battleground where" digital sovereignty is won or lost." The road to the first stable release of Euro-Office has been quite bumpy due to an aggressive public fallout with OnlyOffice, from which the coalition originally forked the project. OnlyOffice struck back by accusing the coalition of violating copyright terms under its AGPLv3 branding requirements by stripping the original branding anyway and forking the code. Getting Euro-Office up and running is a bit wonky (at least for non-technical users), as there is no direct installer to grab off the web. The easiest way we learnt is by using Docker. First, pull the official Euro-Office image from the GitHub Container Registry: docker pull ghcr.io/euro-office/documentserver:latest Then, run the container with active ports and a secure JWT token, enabling the test environment: docker run -i -t -d -p 8080:80 --restart=always -e EXAMPLE_ENABLED=true -e JWT_SECRET=my_secure_jwt_secret ghcr.io/euro-office/documentserver:latest And finally, open a web browser and go to the following address: http://localhost:8080 If you are running this on a remote server, replace localhost with your server's IP address. You will see the Euro-Office test page, where you can create new text documents, spreadsheets, or presentations directly in the browser. Image via Euro-Office Nextcloud promises that proper standalone desktop versions and mobile apps will arrive in a future release. -
By MacDaddyAz · Posted
It’s any of their products not just windows.
-
-
Recent Achievements
-
FBSPL earned a badge
Week One Done
-
Jim Dugan earned a badge
One Year In
-
Tommi118 earned a badge
One Month Later
-
sjbousquet earned a badge
One Month Later
-
sjbousquet earned a badge
Week One Done
-
-
Popular Contributors
-
Tell a friend
Question
Eric Veteran
Here's a little 5-minute glob of code I hacked together to handle dragging ScrollViewer content around with the mouse (or your finger).
It can also reverse the axes for "natural scrolling." There is also a Tolerance setting that is supposed to prevent it from scrolling if you only drag it a little bit. I did this because my crappy touchscreen driver has a lot of jitter.
I claim no responsibility if it explodes or otherwise has undesired effects. :)
using System; using System.Windows; using System.Windows.Input; using System.Windows.Controls; namespace MouseExtensions { public class MouseDragBehavior { public static readonly DependencyProperty ToleranceProperty = DependencyProperty.RegisterAttached("Tolerance", typeof(double), typeof(MouseDragBehavior), new FrameworkPropertyMetadata((double)10)); public static double GetTolerance(DependencyObject d) { return (double)d.GetValue(ToleranceProperty); } public static void SetTolerance(DependencyObject d, double value) { d.SetValue(ToleranceProperty, value); } public static readonly DependencyProperty ReverseAxisProperty = DependencyProperty.RegisterAttached("ReverseAxis", typeof(bool), typeof(MouseDragBehavior), new FrameworkPropertyMetadata((bool)false)); public static bool GetReverseAxis(DependencyObject d) { return (bool)d.GetValue(ReverseAxisProperty); } public static void SetReverseAxis(DependencyObject d, bool value) { d.SetValue(ReverseAxisProperty, value); } private static readonly DependencyProperty DragStartPointProperty = DependencyProperty.RegisterAttached("DragStartPoint", typeof(Point), typeof(MouseDragBehavior), new FrameworkPropertyMetadata((Point)new Point())); private static Point GetDragStartPoint(DependencyObject d) { return (Point)d.GetValue(DragStartPointProperty); } private static void SetDragStartPoint(DependencyObject d, Point value) { d.SetValue(DragStartPointProperty, value); } private static readonly DependencyProperty DragLastPointProperty = DependencyProperty.RegisterAttached("DragLastPoint", typeof(Point), typeof(MouseDragBehavior), new FrameworkPropertyMetadata((Point)new Point())); private static Point GetDragLastPoint(DependencyObject d) { return (Point)d.GetValue(DragLastPointProperty); } private static void SetDragLastPoint(DependencyObject d, Point value) { d.SetValue(DragLastPointProperty, value); } public static readonly DependencyProperty HandleDragProperty = DependencyProperty.RegisterAttached("HandleDrag", typeof(bool), typeof(MouseDragBehavior), new FrameworkPropertyMetadata((bool)false, new PropertyChangedCallback(OnHandleDragChanged))); public static bool GetHandleDrag(DependencyObject d) { return (bool)d.GetValue(HandleDragProperty); } public static void SetHandleDrag(DependencyObject d, bool value) { d.SetValue(HandleDragProperty, value); } private static void OnHandleDragChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { ScrollViewer scrollViewer = d as ScrollViewer; if ((bool)e.NewValue) { scrollViewer.PreviewMouseDown += new MouseButtonEventHandler(target_PreviewMouseDown); scrollViewer.PreviewMouseMove += new MouseEventHandler(target_PreviewMouseMove); scrollViewer.PreviewMouseUp += new MouseButtonEventHandler(target_PreviewMouseUp); scrollViewer.MouseLeave += new MouseEventHandler(target_MouseLeave); } else { scrollViewer.PreviewMouseDown -= new MouseButtonEventHandler(target_PreviewMouseDown); scrollViewer.PreviewMouseMove -= new MouseEventHandler(target_PreviewMouseMove); scrollViewer.PreviewMouseUp -= new MouseButtonEventHandler(target_PreviewMouseUp); scrollViewer.MouseLeave -= new MouseEventHandler(target_MouseLeave); } } private static bool IsDragging(ScrollViewer scrollViewer) { Point posNow = Mouse.GetPosition(scrollViewer); return ((Math.Abs(GetDragStartPoint(scrollViewer).X - posNow.X) > GetTolerance(scrollViewer)) || (Math.Abs(GetDragStartPoint(scrollViewer).Y - posNow.Y) > GetTolerance(scrollViewer))); } private static void target_PreviewMouseDown(object sender, MouseButtonEventArgs e) { var scrollViewer = (ScrollViewer)sender; var mousePos = e.GetPosition(scrollViewer); scrollViewer.CaptureMouse(); if (GetDragLastPoint(scrollViewer) == new Point()) { SetDragStartPoint(scrollViewer, mousePos); SetDragLastPoint(scrollViewer, mousePos); } if (IsDragging(scrollViewer)) { e.Handled = true; return; } else scrollViewer.ReleaseMouseCapture(); } private static void target_PreviewMouseMove(object sender, MouseEventArgs e) { var scrollViewer = (ScrollViewer)sender; if (GetDragLastPoint(scrollViewer) != new Point()) { Point posNow = e.GetPosition(scrollViewer); double dX = posNow.X - GetDragLastPoint(scrollViewer).X; double dY = posNow.Y - GetDragLastPoint(scrollViewer).Y; SetDragLastPoint(scrollViewer, posNow); if (!IsDragging(scrollViewer)) return; if (GetReverseAxis(scrollViewer)) { scrollViewer.ScrollToHorizontalOffset(scrollViewer.HorizontalOffset + dX); scrollViewer.ScrollToVerticalOffset(scrollViewer.VerticalOffset + dY); } else { scrollViewer.ScrollToHorizontalOffset(scrollViewer.HorizontalOffset - dX); scrollViewer.ScrollToVerticalOffset(scrollViewer.VerticalOffset - dY); } } e.Handled = true; } private static void target_PreviewMouseUp(object sender, MouseButtonEventArgs e) { var scrollViewer = (ScrollViewer)sender; if (GetDragLastPoint(scrollViewer) != new Point() && IsDragging(scrollViewer)) { e.Handled = true; scrollViewer.ReleaseMouseCapture(); } Reset(scrollViewer); } private static void target_MouseLeave(object sender, MouseEventArgs e) { var scrollViewer = (ScrollViewer)sender; Reset(scrollViewer); } private static void Reset(ScrollViewer scrollViewer) { SetDragLastPoint(scrollViewer, new Point()); SetDragStartPoint(scrollViewer, new Point()); } } }To use it simply reference the namespace and set MouseDragBehavior.HandleDrag to true in your
ScrollViewer declaration:
<ScrollViewer xmlns:my="clr-namespace:MouseExtensions" my:MouseDragBehavior.HandleDrag="True" my:MouseDragBehavior.ReverseAxis="True" />Link to comment
https://www.neowin.net/forum/topic/1022710-cwpf-mouse-drag-behavior/Share on other sites
3 answers to this question
Recommended Posts