Jump to content

[SOLVED] Properties List Items collapsed


photo

Recommended Posts

Hello.

 

We have a property file with a lot of subproperties.

 

Everytime we open the file in the editor, ALL of the subproperties are expanded, which makes it very hard to handle, folding all of them.

 

Is there a way to open the properties, with all of them collapsed (closed)?

 

Cheers

 

Werner

 

 

post-767-0-57863500-1392113616_thumb.jpg

Link to comment

Most probably this can be done by modifying Unigine Editor script code in data directory (though this means that you have to reapply your modifications for new sdk releases...)

Link to comment

Werner, relevant code for editor properties tree view folding is in <../data/core/editor/editor_properties.h>. Changing  function void update_properties() in line 251ff with something like the following code (fully untested) should supress folder expansion.

void update_properties() {
		
.....
		properties.sort();
		
/* disable
		int hidden[];
		saveTreeBoxFolded(properties_tb,hidden);
*/		
		string items[];
		properties_tb.setCallbackEnabled(GUI_CHANGED,0);
		properties_tb.clear();
		foreach(string name; properties) {
			items.append(name,properties_tb.addItem(name));
		}
		properties_tb.setCallbackEnabled(GUI_CHANGED,1);
		
		properties_tb.setCurrentItem(-1);
		foreach(string name; properties) {
			Property property = engine.properties.findProperty(name);
			if(property == old_property) properties_tb.setCurrentItem(items[name]);
			
			Property parent = property.getParent();
			if(parent == NULL) properties_tb.setItemColor(items[name],color_green);
			else if(property.getNumChilds()) properties_tb.setItemColor(items[name],color_orange);
			if(parent == NULL || properties.find(parent.getName()) == -1) continue;
			
			properties_tb.setItemParent(items[name],items[parent.getName()]);
		}
		if(properties_tb.getCurrentItem() == -1) update_view();

/* disable		
		restoreTreeBoxFolded(properties_tb,hidden);
*/

                // fold all tree items
                int items[0];

                treebox.getItems(items);
                foreach(int item; items) {
                     treebox.setItemFolded(item,1);
	        }

	}
Link to comment

Hi.

Nice.

Thank you, will give it a try. 

(Wouldnt this be good to have it in the properties file as a parameter? like folded='1')

 

All best. Werner

Link to comment
×
×
  • Create New...