Board index FlightGear Development Documentation

Live key documentation dialog

Discussion of the FlightGear documentation, how it can be improved and coordination of people working on it.

Re: Live key documentation dialog

Postby jam007 » Sun May 05, 2013 2:39 pm

Gladly leaves this to someone who understands fg-dialogs :wink:
jam007
 
Posts: 477
Joined: Sun Dec 16, 2012 10:04 am
Location: Uppsala, Sweden
Version: 2017.3.1
OS: Ubuntu 16.04

Re: Live key documentation dialog

Postby Philosopher » Sun May 05, 2013 4:55 pm

I'm with you there, I personally consider them to be one of the hardest pieces of FG myself.

Hey guys, sorry to be a pedant, but every "foreach" should be using the "var" keyword for two reasons: firstly it works (code generation basically makes it into an assignment, i.e. like it was an "=" operator) and second because it ensures locality (without it, a foreach can affect outer closures just like an un-vared assignment). «foreach (var key; node.getChildren("key"))»
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: Live key documentation dialog

Postby Hooray » Sun May 05, 2013 4:59 pm

well, dialogs are difficult because of all the indirection taking place behind the scenes:

  • Nasal wrappers create a PropertyList structure in the property tree
  • events/actions/bindings are separate Nasal blocks
  • the layout manager is basically PUI preprocessor
  • then, there are the dialog handling fgcommands
  • these "compile" dialogs from a property tree

Basically, the Canvas will improve the situation a little - but we will still need a Nasal module that supports the old dialog files, porting all these files would be a lot of work, which is why you won't see the format being depreciated too soon (I'd guess for another 3-5 years at least!).

Also, keep in mind the flexibility of the design - you could even use an I/O protocol (or telnet) to load a dialog and show it.
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: 11119
Joined: Tue Mar 25, 2008 8:40 am

Re: Live key documentation dialog

Postby jam007 » Sun May 05, 2013 5:34 pm

Philosopher wrote in Sun May 05, 2013 4:55 pm:every "foreach" should be using the "var" keyword for two reasons
OK

Here is a new version with corrections including the previous noted things: http://pastebin.com/5Rcz6AU7
jam007
 
Posts: 477
Joined: Sun Dec 16, 2012 10:04 am
Location: Uppsala, Sweden
Version: 2017.3.1
OS: Ubuntu 16.04

Re: Live key documentation dialog

Postby jam007 » Tue May 07, 2013 5:52 pm

Hooray wrote in Sun May 05, 2013 2:37 pm:you can check the multiplayer pilot list/system monitor dialogs for examples on creating a simple table-driven layout.

I searched for them. Can you give a link?
jam007
 
Posts: 477
Joined: Sun Dec 16, 2012 10:04 am
Location: Uppsala, Sweden
Version: 2017.3.1
OS: Ubuntu 16.04

Re: Live key documentation dialog

Postby Philosopher » Tue May 07, 2013 6:03 pm

It looks like the pilot list is implemented in Nasal/multiplayer.nas.
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: Live key documentation dialog

Postby Hooray » Tue May 07, 2013 6:35 pm

exactly, these dialogs are procedurally created from Nasal - which is why I mentioned them, and most similar dialogs were just copied/pasted together based on the mp list.
You could probably just copy the whole folder and customize it accordingly, so that your dialog becomes a separate sub module.
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: 11119
Joined: Tue Mar 25, 2008 8:40 am

Re: Live key documentation dialog

Postby Gijs » Tue May 07, 2013 6:38 pm

Issue is that tables cannot scroll (yet)...
Airports: EHAM, EHLE, KSFO
Aircraft: 747-400
User avatar
Gijs
Moderator
 
Posts: 9295
Joined: Tue Jul 03, 2007 2:55 pm
Location: Amsterdam/Delft, the Netherlands
Callsign: PH-GYS
Version: Git
OS: Windows 10

Re: Live key documentation dialog

Postby jam007 » Tue May 07, 2013 6:46 pm

Hm..
And sprintf seems not to help much for text using variable width fonts...
Tab in Nasal would be a nice thing.
Edit: tab works with print() but seems not to work in dialogs. It becomes a *
jam007
 
Posts: 477
Joined: Sun Dec 16, 2012 10:04 am
Location: Uppsala, Sweden
Version: 2017.3.1
OS: Ubuntu 16.04

Re: Live key documentation dialog

Postby Hooray » Tue May 07, 2013 7:23 pm

well, that should be simple: just add scroll buttons and update the list by changing the vector's offset (start/end of the data to show), and then just redraw the list with a different subset of items - and there you got "scolling".

you could also adapt Tom's Canvas GUI demo to create a simple scrollable layout, the code is in his $FG_ROOT repo:

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: 11119
Joined: Tue Mar 25, 2008 8:40 am

Previous

Return to Documentation

Who is online

Users browsing this forum: No registered users and 2 guests