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);
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();
// 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;
if (!_curr->getParent()) {
_entries = new char*[_num_entries + 1];
pi = 0;
- dotFiles = false;
+ _dot_files = false;
} else {
_num_entries += 2; // for . and ..
strcpy(_entries[1], "..");
pi = 2;
- dotFiles = true;
+ _dot_files = true;
}
int i;
stdString line = name + " = '" + value + "' (" + type;
- if (_flags->getBoolValue()) {
+ if (_flags) {
stdString ext;
if (!node->getAttribute(SGPropertyNode::READ))
ext += 'r';
if (line.size() >= PUSTRING_MAX)
line.resize(PUSTRING_MAX - 1);
- if (dotFiles)
+ if (_dot_files)
index += 2;
delete[] _entries[index];
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) : ""); }
static int nodeNameCompare(const void *, const void *);
SGPropertyNode_ptr _curr;
- SGPropertyNode_ptr _flags;
SGPropertyNode_ptr _return;
char **_entries;
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
};