C# GTK Drag and Drop - c#

I'm trying to make application in GTK and I need to make make my application able to drag item from one listview to another. Is it possible? If yes, please place me here example or tutorial website.
Note: I'm using C# in MonoDevelop 2.4

Is it Possible?
Yes! It is possible and not that difficult to implement. (Especially if you are using a high level language like C#.)
Example or Tutorial Website?
If you want Drag And Drop in Gtk, then I think what you are looking for is the Gtk.Drag Class. You can see it's usage in the Mono-Project Docs. There is also a tutorial available at Gnome.org . Although the tutorial is for GTK+ , it shouldn't be too hard to port it for use with GTK#. I am not sure if I can find valid tutorials for Drag and Drop in Gtk.ListView, but you can get the general idea by seeing this PyGTK tutorial on Drag and Drop with Gtk.Treeview : Tutorial Link. and this Gtkmm one : Tutorial Link .
There is another GTK+ DND tutorial over here: Tutorial Link . You may also look at the Pyjama Project sources.

Related

Pull to Refresh UWP - Grid view?

Could someone please advise me on the "correct" way of implementing Pull to refresh on UWP?
Below are some examples I've found however I'm not sure which one is using the best approach:
Microsoft sample which is for a ListView - This works however it is specific to the ListView Control
AmazingPullToRefresh is a NuGet package that also works however it is somewhat limited in terms of styling
PullToRefreshUWP_WindowsComposition is another example however it works differently to the other two as it does not use an extension class
Any advice is much appreciated
There is no standard answer for this question, basically, there are two points we need to implement:
Get the offset changes when user pull something on the control
Generate some indicator to notify user
Both XamlPullToRefresh and PullToRefreshUWP_WindowsComposition use the new Windows Composition API: Windows.UI.Composition namespace
Ref Windows.UI.Composition Overview
The API is a powerful supplement to existing frameworks such as XAML
to give developers of UWP applications a familiar C# surface to add to
their application. These APIs can also be used to create DX style
framework-less applications.
Please notice that this API works only on Windows 10.
While AmazingPullToRefresh uses Manipulation API and implement all things by calculating offset changes. A similar implementation can be found here
If you want to implement a cool pull-to-refresh control, I would recommend using the Windows.UI.Composition API. You can get start from here
The functionality of pulling to refresh is not used by microsoft.
Reloading a page / data is something we have still in our mind from thinking apps like a website.
Why not have a synced database and alway update your UI with the data which got changed in your local db? For eg. see firebase.google.com
If you want to implement this feature anyway there is not really a way to go.
I have used the PullToRefresh.UWP library from NuGet. For a tutorial see:
codeproject.com
With some tweaking it works but sometimes when I lift my finger of the screen after pulling down the bar won't go up again.
So the answer is: Sorry, but nobody can give you an answer on how to do this the "correct" way. But is there a correct way anywhere? Like almost always in programming. It depends on the case you will use it.
Hope this will help you.

implement draggable ui like blockly

I'm currently developing an application that allow the user to program some scripts. I've developed a "compiler" to analyse the script made by the user, but now i want create a visual editor with all the possibilities that the user have, something similar to this: Blockly - A visual programming editor .
I am currently using C# and I have no idea how to develop something like the above. I thought about doing my own draggable UI on top of my DSL, but not sure how to start.
Thanks
For other Wpf developers trying to do something similar, I would not recommend doing this yourself but actually use a webpage within Wpf and then communicate with Blockly through that. I promise you that this will be a lot easier than actually trying to do this yourself.
Use Blockly inside a WebBrowser
If you don't feel like recreating all your script generation code you could also create a custom xml generator for Blockly and then just print out which blocks are connected so like :
<block>
<whileblock repeat="20"/>
<block/>
Then decipher this and generate your script from c# depending on the connected blocks.
Blockly is open source, so feel free to use it for your editor. You don't really need to know much JavaScript in order to use the Blockly libraries, and there's a support group.
You can do it with WPF.
Using Drag and Drop you can get real closer.
Watching this video will help you get sense hou this mechanism works.
Try improving it slowly and playing with it.
2nd step will be to play with lists and drag and drop
Like shown here .
Improve it even more by using data you get from your mouse position,
a good way to do it demonstrated here.

How to create an interactive (Drag and drop stuff) GUI in C#

Need to make a custom application in which i can drag and drop (predefined) items on to a workspace and move them freely, example is of in Microsoft Office PowerPoint where a workflow diagram can be made easily ...
need a start, where can i get one ?
You may want to take a look at this CodeProject article, concerning how to create a diagram designer in WPF:
http://www.codeproject.com/KB/WPF/WPFDiagramDesigner_Part1.aspx
Sounds like a fun, but big project.
I'd start here: Creating Your Own Drawing Application with Visual Basic .NET, Part 1. It's VB.NET, but it's a good start, and it';s all about the framework. Hopefully, you can translate VB.NET to C#.
I think that you need to learn how to make a simple drag and drop first. Try this tutorial or this tutorial. Hope this helps!

Good framework for a C# developer to use for visually stunning presentation layer

I am about to write a front end app, which will be used as a media center app. It will plug directly into a high definition TV. Essentially transforming my laptop into a media player. While this concept is not new, I want custom functionality, so this is why I am not reusing existing products.
I'm a C# developer, so the app should ideally be written in C#. And there is 1 other consideration, I need to accept input via the MCE Remote.
I was considering using Silverlight for this. Would you recommend this? Or any other recommendations for frameworks before I begin planning around this.
Thanks in advance.
This is the type of stuff that the Windows Presentation Foundation was meant for. You'll get a lot more access to the hardware than Silverlight would provide (I.E. that MCE remote you mentioned). You mark up your UI with vector graphics/XAML, and then perform the logic with C#.
EDIT: WPF also has support out of the box for animations which can make your UI a lot more interactive.
EDIT 2: Scott Hanselman has written a really cool application called BabySmash and posted the source online. It basically intercepts keyboard input and shows shapes and sounds on the computer. It's a good "child-proofing" method for your PC. The code could provide you with some insight into WPF and how to do the animations and interactivity that you're looking for.
Is this a desktop app? If so I would use WPF. Silverlight is a subset of WPF, so using WPF you could potentially do more.
Silverlight or WPF, if you want some extra power. Both have a similar programming model (with XAML and code-behind) so you might be able to start with Silverlight and move up to WPF if you need.
The VLC api might be useful for playing your media, someone has created a C# wrapper for it:
http://wiki.videolan.org/.Net_Interface_to_VLC
WPF is certainly the way to go, and for playing media check out the excellent WPF MediaKit: http://wpfmediakit.codeplex.com/ I've used it successfully in many projects.

Map Navigation Control Approach - .NET

I'd like to know what could be the best approach to develop a Windows desktop application that has a map navigability control - very similar to those in Google Maps and Live Maps, with drag and drop support and so on.
Initially, due to time restrictions, I was thinking about a WinForms solution - I think one future solution using WPF would be better, but I'd have to learn all that WPF stuff first.
With that in mind, what approach should I take to develop that? It could be a third part tool, or some simple implementation/algorithm that I could take some ideas from. To be honest, I'm kinda lost, so any idea would be helpful.
Thanks, have a great day
take a look at this codeplex project. Reviewing the Source and downloading the sample project should be a good start.
GMap.Net # Codeplex
There is open-source application Kosmos for browsing OpenStreetMap maps
http://wiki.openstreetmap.org/wiki/Kosmos
However it reads OSM data and renders it on the fly.
I guess you need some example which loads map tiles and put them in the right order. There is such an example for OpenStreetMap: project osmclient on the sourceforge (sorry cannot post a link, i am a newbie)
It can be simply redone to load other sources, even ArcGIS, but be sure if it is compatible with the Map Provider licence. E.g. you cannot choose Google Maps, because you must use Google Maps within their API.

Categories

Resources