Board index FlightGear Development Canvas

Canvas GUI & Michat's GUI mockups

Canvas is FlightGear's new fully scriptable 2D drawing system that will allow you to easily create new instruments, HUDs and even GUI dialogs and custom GUI widgets, without having to write C++ code and without having to rebuild FlightGear.

Re: Canvas GUI & Michat's GUI mockups

Postby Hooray » Thu May 09, 2013 3:37 pm

That sounds promising, how do you want to handle event propagation for nested canvases, e.g. canvas GUI elements shown in a canvas MFD/cockpit instrument or a cockpit instrument rendered in a dialog for better usability ?

Do you also intend to support handling events for elements placed in the scenery eventually ?

Michat wrote:What do yo think if we use a sound when rally Timer is activated. What about the classic casio watch chrono sound. Or maybe a voice saying "Rally Timer Activated.

That is up to you because I'm not programmer, but I can read your code so well, it is clear, and it seems easy to me as a code reader to understand a little bit more about canvas and Nasal.

Michat, sound is just property-driven - so it would work exactly like with aircraft, see $FG_ROOT/Docs/README.sound
Personally, I don't think that sound should be a concern for the GUI library - everything being property tree based, it's simple to add this on your own, no programming skills needed.

Next gadget could be an smart wind socket. Well I don't like to plan the route, but I think is better to use the designs are ready. Anyway if you have a suggestion for a custom idea I'll be happy to help.

I don't know about Tom, but looking at all the widgets that you have sketched already, my suggestion would be to focus on re-implementing the current FG widgets using your own style, i.e. simple widgets - Such as buttons, edit boxes, labels, combo boxes. You just need to look at existing FG dialogs and come up with a list of widgets of widgets that we need (also see $FG_ROOT/Docs/README.gui).

Basically, if you can help provide the reqiured artwork, others can provide the Nasal code to make them "live". To be honest, I'd rather help with coding than using GIMP or Inkscape - so any artwork help would be appreciated. And Tom has demonstrated how easy things can be. Obviously more complex widgets are more difficult (imagine a treeview), but simple widgets can be implemented by using copy/paste and customizing things as necessary.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Canvas GUI & Michat's GUI mockups

Postby TheTom » Thu May 09, 2013 4:21 pm

Hooray wrote in Thu May 09, 2013 3:37 pm:That sounds promising, how do you want to handle event propagation for nested canvases, e.g. canvas GUI elements shown in a canvas MFD/cockpit instrument or a cockpit instrument rendered in a dialog for better usability ?

That is already in git since a while. The events are simply transformed and forwarded to the nested canvas.

Hooray wrote in Thu May 09, 2013 3:37 pm:Do you also intend to support handling events for elements placed in the scenery eventually ?

There is no difference in event handling between canvasses placed on the aircraft and in the scenery. So if you want you can will be able to place a touchscreen in the airport tower, move the camera there and be ATC and just switch back to your aircraft after giving yourself a takeoff clearance ;)
TheTom
 
Posts: 322
Joined: Sun Oct 09, 2011 11:20 am

Re: Canvas GUI & Michat's GUI mockups

Postby jam007 » Thu May 09, 2013 4:31 pm

TheTom wrote in Thu May 09, 2013 1:15 pm:I'm currently working on passing events to canvasses placed on 3d objects. I'm nearly done and should commit something within the next hours.

OK, fantastic work
jam007
 
Posts: 576
Joined: Sun Dec 16, 2012 11:04 am
Location: Uppsala, Sweden
Version: 2020.4.0
OS: Ubuntu 22.04

Re: Canvas GUI & Michat's GUI mockups

Postby Hooray » Thu May 09, 2013 4:36 pm

TheTom wrote in Thu May 09, 2013 4:21 pm:There is no difference in event handling between canvasses placed on the aircraft and in the scenery. So if you want you can will be able to place a touchscreen in the airport tower, move the camera there and be ATC and just switch back to your aircraft after giving yourself a takeoff clearance ;)


LOL
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Canvas GUI & Michat's GUI mockups

Postby Michat » Thu May 09, 2013 4:58 pm

WOW. Beautiful METAVERSO. So can we even implement some Airport/ATC/Hangar/wind tunnel/services within Canvas on FG's run time?

Any idea if we can use some sounds with the rally timer..?

I'm working on a pending problem with the OpenRadar radio operator model, getting headaches to find a good idea for an icon. However the job is done. Soon I'll released it.

Hope you'll find some good ideas for FGCanvas.

Canvas is awesome.
User avatar
Michat
 
Posts: 1226
Joined: Mon Jan 25, 2010 7:24 pm
Location: Spain
Version: 191b
OS: MX 21 Fluxbox oniMac

Re: Canvas GUI & Michat's GUI mockups

Postby Hooray » Thu May 09, 2013 5:01 pm

Michat, see my previous response: Sound is not a GUI thing, it can be triggered through the property tree - which is well documented, see $FG_ROOT/Docs/README.sound

So, YES: you *can* play sounds
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Canvas GUI & Michat's GUI mockups

Postby Michat » Thu May 09, 2013 8:36 pm

Oh thank you hooray I was not aware of your reply, sorry.
User avatar
Michat
 
Posts: 1226
Joined: Mon Jan 25, 2010 7:24 pm
Location: Spain
Version: 191b
OS: MX 21 Fluxbox oniMac

Re: Canvas GUI & Michat's GUI mockups

Postby TheTom » Thu May 09, 2013 10:37 pm

Canvas events on aircraft and scenery objects are now implemented. Just set capture-events to 1 inside the placement (see http://wiki.flightgear.org/Canvas_-_Event_Handling for details).

Hooray wrote in Thu May 09, 2013 4:36 pm:
TheTom wrote in Thu May 09, 2013 4:21 pm:There is no difference in event handling between canvasses placed on the aircraft and in the scenery. So if you want you can will be able to place a touchscreen in the airport tower, move the camera there and be ATC and just switch back to your aircraft after giving yourself a takeoff clearance ;)

LOL

Who would otherwise for example disable the stop bars to allow entering the runway. I don't want to wait forever^^
TheTom
 
Posts: 322
Joined: Sun Oct 09, 2011 11:20 am

Re: Canvas GUI & Michat's GUI mockups

Postby jam007 » Fri May 10, 2013 9:29 am

I think I have updated (via the download-compile script) and changed the code above to
Code: Select all
    # ... and place it on the object called Screen
    m.canvas.addPlacement({"node": "Screen", "capture-events": 1});
    m.canvas.setColorBackground(0.20,0.27,0.16);
    m.canvas.addEventListener("click", func(e) { print("Test " ~ e.clientX ~" " ~ e.clientY); });
    var g = m.canvas.createGroup();
    var g_tf = g.createTransform();


No difference.
Probably I still have an older version.
How to check if I have the new version?
jam007
 
Posts: 576
Joined: Sun Dec 16, 2012 11:04 am
Location: Uppsala, Sweden
Version: 2020.4.0
OS: Ubuntu 22.04

Re: Canvas GUI & Michat's GUI mockups

Postby TheTom » Fri May 10, 2013 9:49 am

jam007 wrote in Fri May 10, 2013 9:29 am:How to check if I have the new version?

What's the revision in the about dialog? It should be d9881aecf89c339acc0a198a4d519f36da64f814 or 64ab1e96ee829189b89200f84b1534b32e45c6ea.
TheTom
 
Posts: 322
Joined: Sun Oct 09, 2011 11:20 am

Re: Canvas GUI & Michat's GUI mockups

Postby jam007 » Fri May 10, 2013 10:35 am

Thanks!
As suspected it's not. It's: 2013f7149d239ad6dccd2fc53fb77c4a0c85e484
I think I leave this for now.
jam007
 
Posts: 576
Joined: Sun Dec 16, 2012 11:04 am
Location: Uppsala, Sweden
Version: 2020.4.0
OS: Ubuntu 22.04

Re: Canvas GUI & Michat's GUI mockups

Postby Hooray » Fri May 10, 2013 12:51 pm

delete the fgfs binary and run "make" again - if that doesn't solve the problem, you either have a different fgfs version somewhere, or your d&c script does not build HEAD.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Canvas GUI & Michat's GUI mockups

Postby TheTom » Fri May 10, 2013 5:38 pm

The commit is from Feb 7th. There is no tag/branch etc with this commit as the latest commit. Seems like the script is either not able to update the sources correctly or it wasn't able to build and install. You could try manually updating all repositories. Just change to the according folder and type "git pull".
TheTom
 
Posts: 322
Joined: Sun Oct 09, 2011 11:20 am

Re: Canvas GUI & Michat's GUI mockups

Postby Hooray » Fri May 10, 2013 5:45 pm

probably an issue with the d&c script - a bunch of people reported similar issues a while ago, e.g. see:

Subject: download_and_compile - can't find osg libs
daveculp wrote:When fgfs tried to start, it quit with a warning that data version 2.8.0 was needed, whereas I only had 2.10.0. I did the simple fix of changing the version number in data to 2.8.0, so fgfs is happy now, however I get a console message that fgfs is operating in a 2.8.0 backward compatibility mode. That doesn't sound good. Any idea what the proper solution is?


Should probably be checked by someone who has access to fgmeta...
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Canvas GUI & Michat's GUI mockups

Postby jam007 » Fri May 10, 2013 6:26 pm

Hooray wrote in Fri May 10, 2013 12:51 pm:delete the fgfs binary and run "make" again - if that doesn't solve the problem, you either have a different fgfs version somewhere, or your d&c script does not build HEAD.

I ran the script after deleting fgfs. It worked. Thanks!

The click event works :)
Now. Just a matter of finding out a bunch of nice uses.
A doodle-pad for bored pilots?
jam007
 
Posts: 576
Joined: Sun Dec 16, 2012 11:04 am
Location: Uppsala, Sweden
Version: 2020.4.0
OS: Ubuntu 22.04

PreviousNext

Return to Canvas

Who is online

Users browsing this forum: No registered users and 0 guests