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 3:39 pm

Gladly leaves this to someone who understands fg-dialogs :wink:
jam007
 
Posts: 579
Joined: Sun Dec 16, 2012 11:04 am
Location: Uppsala, Sweden
Callsign: LOOP
Version: 2020.4.0
OS: Ubuntu 22.04

Re: Live key documentation dialog

Postby Philosopher » Sun May 05, 2013 5: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"))»
Philosopher
 
Posts: 1593
Joined: Sun Aug 12, 2012 7:29 pm

Re: Live key documentation dialog

Postby Hooray » Sun May 05, 2013 5: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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Live key documentation dialog

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

Philosopher wrote in Sun May 05, 2013 5: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: 579
Joined: Sun Dec 16, 2012 11:04 am
Location: Uppsala, Sweden
Callsign: LOOP
Version: 2020.4.0
OS: Ubuntu 22.04

Re: Live key documentation dialog

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

Hooray wrote in Sun May 05, 2013 3: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: 579
Joined: Sun Dec 16, 2012 11:04 am
Location: Uppsala, Sweden
Callsign: LOOP
Version: 2020.4.0
OS: Ubuntu 22.04

Re: Live key documentation dialog

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

It looks like the pilot list is implemented in Nasal/multiplayer.nas.
Philosopher
 
Posts: 1593
Joined: Sun Aug 12, 2012 7:29 pm

Re: Live key documentation dialog

Postby Hooray » Tue May 07, 2013 7: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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: Live key documentation dialog

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

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

Re: Live key documentation dialog

Postby jam007 » Tue May 07, 2013 7: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: 579
Joined: Sun Dec 16, 2012 11:04 am
Location: Uppsala, Sweden
Callsign: LOOP
Version: 2020.4.0
OS: Ubuntu 22.04

Re: Live key documentation dialog

Postby Hooray » Tue May 07, 2013 8: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: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Previous

Return to Documentation

Who is online

Users browsing this forum: No registered users and 2 guests