]> git.mxchange.org Git - flightgear.git/commitdiff
Ctrl-Click on bool entry toggles property
authormfranz <mfranz>
Thu, 18 May 2006 12:12:10 +0000 (12:12 +0000)
committermfranz <mfranz>
Thu, 18 May 2006 12:12:10 +0000 (12:12 +0000)
src/GUI/prop_picker.cxx
src/GUI/prop_picker.hxx

index 2255e8e0d13814af819d417a379165fbebc57f98..dd6e6b23ad2420713aaa4397e1e8fa0357a7506f 100755 (executable)
@@ -40,6 +40,7 @@
 
 #include STL_STRING
 
+#include <Main/fg_os.hxx>
 #include <Main/globals.hxx>
 #include "new_gui.hxx"
 #include "prop_picker.hxx"
@@ -90,19 +91,11 @@ void prop_pickerRefresh()
        me -> find_props();
 }
 
-void prop_editInit( const char * name, const char * value, char * proppath )
-{
-       if( PE_widget == 0 ) {
-            fgPropEdit *PP = new fgPropEdit ( name, value, proppath );
-           PE_widget = PP;
-       }
-}
-
 void prop_editOpen( const char * name, const char * value, char * proppath )
 {
-       if( PE_widget == 0 ) {
-               prop_editInit( name, value, proppath );
-       }
+       if( PE_widget == 0 )
+               PE_widget = new fgPropEdit(name, value, proppath);
+
        fgPropEdit *me = (fgPropEdit *)PE_widget -> getUserData();
         me -> propname ->    setLabel          (name);
         me -> propinput ->   setValue          (value);
@@ -290,8 +283,11 @@ void fgPropPicker::handle_select ( puObject* list_box )
         "PUI: fgPropPicker - path is too long, max is %d.", PUSTRING_MAX ) ;
       return ;
     }
-       
-    prop_editOpen(child->getName(), child->getStringValue(), dst);
+
+    if (child->getType() == SGPropertyNode::BOOL && (fgGetKeyModifiers() & KEYMOD_CTRL))
+        child->setBoolValue(!child->getBoolValue());
+    else
+        prop_editOpen(child->getName(), child->getStringValue(), dst);
   }
   else
   {
index fbbeabd346c379595acd3ec561f7de0b17c1c64b..1741f105a26d5c05b5d4484ffc9f5d2144578616 100755 (executable)
@@ -13,7 +13,6 @@
 void prop_pickerInit();
 void prop_pickerView( puObject * );
 void prop_pickerRefresh();
-void prop_editInit( const char * name, const char * value );
 void prop_editOpen( const char * name, const char * value );
 
 class fgPropPicker       ;