Comments (6)
I'm ok about adding the ContextMenu property, but we need a way to have a more control on the position where the menu will be shown. For example, if you are implementing a widget in a Canvas and you want to show a context menu when clicking on specific regions of the canvas.
from xwt.
BTW, click events are not a good way to trigger popup menus.
For instance, my keyboard has a "context menu key"(left of right ctrl, right of right windows key), so it definitively should be possible to trigger popup menus without mouse events.
As for the specific position for the menu to show up, wouldn't this sort of thing be automatic behavior? Wouldn't the popup menu just automatically appear on the mouse location? Why would we even need to worry about this on XWT?
It also has a "declarative feel" that click+popup() lacks, which means a HTML/XUL/XAML-like language for XWT would also benefit from this.
In other words, I like this proposal.
That said, I still think there should be some way to programatically trigger the popup menu.
from xwt.
I'm ok about adding the ContextMenu property, but we need a way to have a more control on the position where the menu will be shown. For example, if you are implementing a widget in a Canvas and you want to show a context menu when clicking on specific regions of the canvas.
When or where? It sounds like you're asking for two different things.
from xwt.
For instance, my keyboard has a "context menu key"(left of right ctrl, right of right windows key), so it definitively should be possible to trigger popup menus without mouse events.
Yes, we need an event specifically for showing the context menu, since it may not be triggered using the keyboard.
As for the specific position for the menu to show up, wouldn't this sort of thing be automatic behavior? Wouldn't the popup menu just automatically appear on the mouse location? Why would we even need to worry about this on XWT?
Actually, you're right. That should work in most cases (although it doesn't cover all cases, so the Popup method is still useful).
from xwt.
When the event is activated from the keyboard, it doesn't make sense to position it at the mouse cursor. It should be beside the selected item or at the widget's origin.
Wouldn't it be better to have a Func<some,args,Menu> to create the menu, so it can be created/populated when it's needed?
from xwt.
When the event is activated from the keyboard, it doesn't make sense to position it at the mouse cursor. It should be beside the selected item or at the widget's origin.
Hmm, true. For most things this is a non-issue, but for the aforementioned issue this is still a problem.
Frankly I'd just say whatever is being custom needs to be done in such a way that there's a layer of widgets so the platforms can all handle this naturally. Not sure if it's feasible, but at least worth considering.
from xwt.
Related Issues (20)
- Code review HOT 2
- Add support for keyboard scancode
- [Gkt3] CustomCellRendererComboBox don't show items
- [Request] Docking panels for Xwt
- Can I use VLC to play video in raspberry? HOT 1
- [WPF] ScrollView is broken HOT 1
- XWT + Mono [DLL Notfound Exception] Missing "libwebkitgtk-1.0-0.dll"
- .NET 5
- ToolkitType.AutoDetect
- kill the son of bitch :maui (just limit linux) HOT 1
- [Mac] VPaned resizes dockable Pad VisualStudioMac 2022
- Is there a way to preview the UI design HOT 2
- Support WinRT API - CompactOverlay aka PIP mode
- Exception thrown: 'System.IO.FileNotFoundException' in mscorlib.dll HOT 11
- DllNotFoundException: Unable to load DLL 'libgtk-win32-2.0-0.dll HOT 2
- Drag&Drop WPF
- Drag&Drop XamMac
- Drag&Drop ubuntu, GTK2
- Notify Icon
- can't compile on latest visual studio 2019.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xwt.