1
0
Fork 0

Ctrl-Click on bool entry toggles property

This commit is contained in:
mfranz 2006-05-18 12:12:10 +00:00
parent fa62bc3ec2
commit 6d24d7496e
2 changed files with 9 additions and 14 deletions

View file

@ -40,6 +40,7 @@
#include STL_STRING #include STL_STRING
#include <Main/fg_os.hxx>
#include <Main/globals.hxx> #include <Main/globals.hxx>
#include "new_gui.hxx" #include "new_gui.hxx"
#include "prop_picker.hxx" #include "prop_picker.hxx"
@ -90,19 +91,11 @@ void prop_pickerRefresh()
me -> find_props(); 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 ) void prop_editOpen( const char * name, const char * value, char * proppath )
{ {
if( PE_widget == 0 ) { if( PE_widget == 0 )
prop_editInit( name, value, proppath ); PE_widget = new fgPropEdit(name, value, proppath);
}
fgPropEdit *me = (fgPropEdit *)PE_widget -> getUserData(); fgPropEdit *me = (fgPropEdit *)PE_widget -> getUserData();
me -> propname -> setLabel (name); me -> propname -> setLabel (name);
me -> propinput -> setValue (value); me -> propinput -> setValue (value);
@ -291,7 +284,10 @@ void fgPropPicker::handle_select ( puObject* list_box )
return ; 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 else
{ {

View file

@ -13,7 +13,6 @@
void prop_pickerInit(); void prop_pickerInit();
void prop_pickerView( puObject * ); void prop_pickerView( puObject * );
void prop_pickerRefresh(); void prop_pickerRefresh();
void prop_editInit( const char * name, const char * value );
void prop_editOpen( const char * name, const char * value ); void prop_editOpen( const char * name, const char * value );
class fgPropPicker ; class fgPropPicker ;