From 18d09b569f0d45b7c465e4b98879bf3793de7ce9 Mon Sep 17 00:00:00 2001 From: mfranz Date: Sat, 3 Jun 2006 11:20:19 +0000 Subject: [PATCH] - display of SGPropertyNode flags can now be toggled per widget (Ctrl-click on "." entry), so we don't need a global property for this - s/dotFiles/_dot_files/ for consistency reasons --- src/GUI/property_list.cxx | 16 ++++++++-------- src/GUI/property_list.hxx | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/GUI/property_list.cxx b/src/GUI/property_list.cxx index cce541598..c1f7d29b0 100644 --- a/src/GUI/property_list.cxx +++ b/src/GUI/property_list.cxx @@ -104,10 +104,10 @@ PropertyList::PropertyList(int minx, int miny, int maxx, int maxy, SGPropertyNod puList(minx, miny, maxx, maxy, short(0), 20), GUI_ID(FGCLASS_PROPERTYLIST), _curr(start), - _flags(fgGetNode("/sim/gui/dialogs/property-browser/show-flags", true)), _return(0), _entries(0), - _num_entries(0) + _num_entries(0), + _flags(false) { _list_box->setUserData(this); @@ -147,7 +147,7 @@ void PropertyList::handle_select(puObject *list_box) if (selected >= 0 && selected < prop_list->_num_entries) { const char *src = prop_list->_entries[selected]; - if (prop_list->dotFiles && (selected < 2)) { + if (prop_list->_dot_files && (selected < 2)) { if (!strcmp(src, ".")) { if (mod_ctrl) prop_list->toggleFlags(); @@ -169,7 +169,7 @@ void PropertyList::handle_select(puObject *list_box) // we know we're dealing with a regular entry, so convert // it to an index into children[] - if (prop_list->dotFiles) + if (prop_list->_dot_files) selected -= 2; SGPropertyNode_ptr child = prop_list->_children[selected].node; @@ -207,7 +207,7 @@ void PropertyList::update(bool restore_pos) if (!_curr->getParent()) { _entries = new char*[_num_entries + 1]; pi = 0; - dotFiles = false; + _dot_files = false; } else { _num_entries += 2; // for . and .. @@ -220,7 +220,7 @@ void PropertyList::update(bool restore_pos) strcpy(_entries[1], ".."); pi = 2; - dotFiles = true; + _dot_files = true; } int i; @@ -271,7 +271,7 @@ void PropertyList::updateTextForEntry(int index) stdString line = name + " = '" + value + "' (" + type; - if (_flags->getBoolValue()) { + if (_flags) { stdString ext; if (!node->getAttribute(SGPropertyNode::READ)) ext += 'r'; @@ -296,7 +296,7 @@ void PropertyList::updateTextForEntry(int index) if (line.size() >= PUSTRING_MAX) line.resize(PUSTRING_MAX - 1); - if (dotFiles) + if (_dot_files) index += 2; delete[] _entries[index]; diff --git a/src/GUI/property_list.hxx b/src/GUI/property_list.hxx index 56c61881e..b7b522deb 100644 --- a/src/GUI/property_list.hxx +++ b/src/GUI/property_list.hxx @@ -39,7 +39,7 @@ public: void setCurrent(SGPropertyNode *p); SGPropertyNode *getCurrent() const { return _curr; } void publish(SGPropertyNode *p) { _return = p; invokeCallback(); } - void toggleFlags() { _flags->setBoolValue(!_flags->getBoolValue()); } + void toggleFlags() { _flags = !_flags; } // overridden plib pui methods virtual char *getListStringValue() { return (char *)(_return ? _return->getPath(true) : ""); } @@ -60,7 +60,6 @@ private: static int nodeNameCompare(const void *, const void *); SGPropertyNode_ptr _curr; - SGPropertyNode_ptr _flags; SGPropertyNode_ptr _return; char **_entries; @@ -81,7 +80,8 @@ private: NodeData *_children; int _num_children; - bool dotFiles; // . and .. pseudo-dirs currently shown? + bool _dot_files; // . and .. pseudo-dirs currently shown? + bool _flags; // show SGPropertyNode flags }; -- 2.39.5