OK, I appear to have the Select Airport from List
option working properly (as far as I can tell). I'm
not completely happy with the solution, as I have had
to declare a constant for PUCLASS_LIST that could be
reassigned within plib. I have used a value at the top
end of the scale to try to reduce the risk, but it is
still possible that this could be broken by changes to
plib.

I'll include the diffs here in case this is worth
using, or in case anyone would like to offer any
advice or suggestions.

regards

Andrew

Index: GUI/AirportList.cxx
===================================================================
RCS file:
/var/cvs/FlightGear-0.9/source/src/GUI/AirportList.cxx,v
retrieving revision 1.8
diff -r1.8 AirportList.cxx
25c25
<
---
>
44c44
< AirportList::getStringValue ()
---
> AirportList::getListStringValue ()
46c46
<     return (char
*)_airports->getAirport(getIntegerValue())->_id.c_str();
---
>     return (char
*)_airports->getAirport(getListIntegerValue())->_id.c_str();
Index: GUI/AirportList.hxx
===================================================================
RCS file:
/var/cvs/FlightGear-0.9/source/src/GUI/AirportList.hxx,v
retrieving revision 1.1
diff -r1.1 AirportList.hxx
18c18
<     virtual char * getStringValue ();
---
>     virtual char * getListStringValue ();
Index: GUI/dialog.cxx
===================================================================
RCS file:
/var/cvs/FlightGear-0.9/source/src/GUI/dialog.cxx,v
retrieving revision 1.17
diff -r1.17 dialog.cxx
138c138,147
<        
node->setStringValue(object->getStringValue());
---
>         // Special case to handle lists, as
getStringValue cannot be overridden
>         if(object->getType() & PUCLASS_LIST)
>         {
>             node->setStringValue(((puList *)
object)->getListStringValue());
>         }
>         else
>         {
>            
node->setStringValue(object->getStringValue());
>         }
>
401c410
<        return puTextBox;
---
>        return puTextBox;
Index: GUI/puList.cxx
===================================================================
RCS file:
/var/cvs/FlightGear-0.9/source/src/GUI/puList.cxx,v
retrieving revision 1.1
diff -r1.1 puList.cxx
55a56
>     type |= PUCLASS_LIST;
61a63
>     type |= PUCLASS_LIST;
78c80
< puList::getStringValue ()
---
> puList::getListStringValue ()
82a85,90
> int
> puList::getListIntegerValue()
> {
>   return _list_box->getIntegerValue();
> }
>
Index: GUI/puList.hxx
===================================================================
RCS file:
/var/cvs/FlightGear-0.9/source/src/GUI/puList.hxx,v
retrieving revision 1.4
diff -r1.4 puList.hxx
11a12,13
> # define PUCLASS_LIST   0x80000000  // Hopefully
this value will never be used by plib
>
27c29,30
<     virtual char * getStringValue ();
---
>     virtual char * getListStringValue ();
>     virtual int getListIntegerValue();

Index: gui/dialogs/airports.xml
===================================================================
RCS file:
/var/cvs/FlightGear-0.9/data/gui/dialogs/airports.xml,v
retrieving revision 1.3
diff -r1.3 airports.xml
1c1
< <?xml version="1.0"?>
---
> <?xml version = '1.0'?>
5d4
<
9,12c8,9
<
<   <!-- The airport list widget appears to have a bug
with layout; it
<        fails to draw within the x/y/width/height it
is given. -->
<   <airport-list>
---
> <!-- The airport list widget appears to have a bug
with layout; it
>        fails to draw within the x/y/width/height it
is given. -->  <airport-list>
17d13
<
21,22c17,19
<     <empty><stretch>true</stretch></empty>
<
---
>     <empty>
>       <stretch>true</stretch>
>     </empty>
28,30c25,36
<       <command>property-assign</command>
<      
<property>/sim/presets/longitude-deg</property>
<       <value type="double">-9999</value>
---
>         <command>nasal</command>
>         <script>
>      
setprop(&quot;/sim/presets/longitude-deg&quot;,
-9999);
>       setprop(&quot;/sim/presets/latitude-deg&quot;,
-9999);
>       setprop(&quot;/sim/presets/altitude-ft&quot;,
-9999);
>       setprop(&quot;/sim/presets/airspeed-kt&quot;,
0);
>      
setprop(&quot;/sim/presets/offset-distance&quot;, 0);
>      
setprop(&quot;/sim/presets/offset-azimuth&quot;, 0);
>      
setprop(&quot;/sim/presets/glideslope-deg&quot;, 0);
>       setprop(&quot;/sim/presets/heading-deg&quot;,
0);
>              
setprop(&quot;/sim/presets/runway&quot;,
&quot;&quot;);
> </script>
33,35c39
<       <command>property-assign</command>
<       <property>/sim/presets/latitude-deg</property>
<       <value type="double">-9999</value>
---
>         <command>dialog-apply</command>
38,40c42
<       <command>property-assign</command>
<       <property>/sim/presets/altitude-ft</property>
<       <value type="double">-9999</value>
---
>         <command>presets-commit</command>
43,46c45
<       <command>dialog-apply</command>
<       </binding>
<       <binding>
<       <command>presets-commit</command>
---
>         <command>dialog-close</command>
49,51c48,50
<
<     <empty><stretch>true</stretch></empty>
<
---
>     <empty>
>       <stretch>true</stretch>
>     </empty>
56c55
<       <command>dialog-close</command>
---
>         <command>dialog-close</command>
59,60c58,60
<
<     <empty><stretch>true</stretch></empty>
---
>     <empty>
>       <stretch>true</stretch>
>     </empty>



        
        
                
___________________________________________________________ 
ALL-NEW Yahoo! Messenger - all new features - even more fun! 
http://uk.messenger.yahoo.com

_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to