Board index FlightGear Development Canvas

Nasal Browser :)  Topic is solved

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: Nasal Browser :)

Postby Hooray » Thu Oct 31, 2013 8:27 am

it's supported by the canvas system, see: http://wiki.flightgear.org/Canvas_-_Eve ... vent_types
I think the airport selection dialog uses the mouse-wheel for zooming (?)
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: 11329
Joined: Tue Mar 25, 2008 8:40 am

Re: Nasal Browser :)

Postby TheTom » Thu Oct 31, 2013 9:43 am

The "old" property browser also supports the mouse-wheel...
TheTom
 
Posts: 321
Joined: Sun Oct 09, 2011 10:20 am

Re: Nasal Browser :)

Postby Gijs » Thu Oct 31, 2013 10:38 am

Not for everyone (actually, not for most people) http://code.google.com/p/flightgear-bug ... ail?id=482
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9365
Joined: Tue Jul 03, 2007 2:55 pm
Location: Amsterdam/Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: Nasal Browser :)

Postby Hooray » Thu Oct 31, 2013 11:50 am

another issue that can be "WontFixed", because the issue will be addressed by the ongoing canvas/GUI reimplementation effort, no need to keep on hacking at PLIB/PUI internals,
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: 11329
Joined: Tue Mar 25, 2008 8:40 am

Re: Nasal Browser :)

Postby Philosopher » Wed Jun 25, 2014 6:47 pm

Hey, I've already started on a revamp of this, would it count as a "new feature" (~cough~ feature freeze)? It'd be 100% optional, just a GUI binding, couldn't crash anything if it tried...

As a note on development, using the REPL as a basic start and the scroll widget instead of my hack, everything went so much smoother :D. I will need to add more of a layout with buttons etc., but it is much more feasible now. Need to also add navigation events and editing capabilities for the values.
Thanks,
Philosopher
(inactive but lurking occasionally...)
Philosopher
 
Posts: 1590
Joined: Sun Aug 12, 2012 6:29 pm
Location: Stuck in my head...
Callsign: AFTI
Version: Git
OS: Mac OS X 10.7.5

Re: Nasal Browser :)

Postby Hooray » Wed Jun 25, 2014 9:54 pm

Thinking about it, I could probably help you and turn the whole thing into a generic Canvas widget for $FG_ROOT/Nasal/canvas/gui/widgets - that would allow us to easily reuse useful stuff in other places/dialogs. Given that both, the REPL and the browser, will share certain functionality - I'd kinda prefer both becoming "widgets" that can be used in combination, possibly even in the same dialog/window.
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: 11329
Joined: Tue Mar 25, 2008 8:40 am

Re: Nasal Browser :)

Postby Philosopher » Thu Jun 26, 2014 3:55 am

link to repo: https://gitorious.org/fg/canvas-hackers ... er-rebased

Thanks Tom for the widgets and everything! I need to figure out the CheckBox though – is it complete yet?

Hooray: turning these into widgets (aka dialog parts) sounds like a good idea, but let me finish them first... Finding a way to reuse code between them sounds like a good idea as well, as it's still "spaghetti" code with copy/paste assistance there :(. (One of the mottos of FORTH is basically to eliminate copy/paste, aka calling-via-keyboard, and instead turn it into a full-fledged word :D) Tom said he's open to API improvements as well, so let's see if we can simplify things there too.
Thanks,
Philosopher
(inactive but lurking occasionally...)
Philosopher
 
Posts: 1590
Joined: Sun Aug 12, 2012 6:29 pm
Location: Stuck in my head...
Callsign: AFTI
Version: Git
OS: Mac OS X 10.7.5

Re: Nasal Browser :)

Postby Hooray » Thu Jun 26, 2014 8:39 am

http://wiki.flightgear.org/Nasal_Browser
Image
Philosopher wrote in Thu Jun 26, 2014 3:55 am:Hooray: turning these into widgets (aka dialog parts) sounds like a good idea, but let me finish them first... Finding a way to reuse code between them sounds like a good idea as well.


Yes, over time, we'll basically end up with a handful of "widgets" that could be useful to have a simple "IDE", e.g.:
  • Property Browser
  • Nasal REPL
  • Nasal Namespace Browser
  • your extended-Nasal work (profiling/debugging, GC stats)
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: 11329
Joined: Tue Mar 25, 2008 8:40 am

Re: Nasal Browser :)

Postby TheTom » Thu Jun 26, 2014 3:52 pm

Philosopher wrote in Thu Jun 26, 2014 3:55 am:I need to figure out the CheckBox though – is it complete yet?

The only thing missing in comparison to a standard checkbox (eg. in Qt) I can think of is support for a third state (partially checked).
TheTom
 
Posts: 321
Joined: Sun Oct 09, 2011 10:20 am

Re: Nasal Browser :)

Postby Hooray » Thu Jun 26, 2014 3:53 pm

Have you found some way to reuse/adapt existing widgets/artwork/code, or are you now also handling all the artwork yourself ?
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: 11329
Joined: Tue Mar 25, 2008 8:40 am

Re: Nasal Browser :)

Postby Philosopher » Thu Jun 26, 2014 3:55 pm

Yeah, I was just confused with the layouting engine because it was giving me a very small region, not the whole window. The checkbox works fine, but I haven't added a working scroll widget to that yet...
Thanks,
Philosopher
(inactive but lurking occasionally...)
Philosopher
 
Posts: 1590
Joined: Sun Aug 12, 2012 6:29 pm
Location: Stuck in my head...
Callsign: AFTI
Version: Git
OS: Mac OS X 10.7.5

Re: Nasal Browser :)

Postby Hooray » Thu Jun 26, 2014 3:59 pm

we should probably document our whole GUI/Layouting experience via the wiki ...
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: 11329
Joined: Tue Mar 25, 2008 8:40 am

Re: Nasal Browser :)

Postby TheTom » Thu Jun 26, 2014 4:14 pm

Hooray wrote in Thu Jun 26, 2014 3:53 pm:Have you found some way to reuse/adapt existing widgets/artwork/code, or are you now also handling all the artwork yourself ?

All images are from the Gnome Ambiance Classic theme (http://gnome-look.org/content/show.php/ ... ent=154887). For checkboxes I just need to show the right images, and for buttons just additionally apply the correct 9-scale offsets. Only the the ScrollArea does not use any images - it's basically just an orange bar :-) Code is all new^^

Philosopher wrote in Thu Jun 26, 2014 3:55 pm:Yeah, I was just confused with the layouting engine because it was giving me a very small region, not the whole window. The checkbox works fine, but I haven't added a working scroll widget to that yet...

I'm not completely sure what you want to tell me^^
If you set a layout for a Canvas/Window it always gets the full size. For all the other sublayouts/widgets space gets distributed according to their min/max/sizehint and stretch properties.
What does a checkbox need a scroll widget for?
TheTom
 
Posts: 321
Joined: Sun Oct 09, 2011 10:20 am

Re: Nasal Browser :)

Postby Philosopher » Thu Jun 26, 2014 4:43 pm

Aha, it works when I add a layout to the window (I guess I can't have an orphaned layout for the scroll-content), so nevermind :D.
Thanks,
Philosopher
(inactive but lurking occasionally...)
Philosopher
 
Posts: 1590
Joined: Sun Aug 12, 2012 6:29 pm
Location: Stuck in my head...
Callsign: AFTI
Version: Git
OS: Mac OS X 10.7.5

Re: Nasal Browser :)

Postby TheTom » Thu Jun 26, 2014 4:47 pm

You can use ScrollArea.setLayout to set the layout for the content. All widgets placed in the content area will need to be created with the canvas group returned by ScrollArea.getContent(). The ScrollArea tries to assign as much space as possible to the layout (limited by its size hints). Have a look at the Aircraft Center for an example.
TheTom
 
Posts: 321
Joined: Sun Oct 09, 2011 10:20 am

PreviousNext

Return to Canvas

Who is online

Users browsing this forum: No registered users and 10 guests