Fixup for this:
static typeless tree_indexes[];
void parse_project( int xml, int index, _str basic_name )
{
int idx;
int child;
int how;
_str name;
if (index < 0)
return;
idx = index;
int idx2;
do {
if ((_xmlcfg_get_name( xml, idx ) == "F") && (_xmlcfg_get_attribute( xml, idx, "N", "" ) != "")) {
name = _xmlcfg_get_attribute( xml, idx, "N", "" );
//fixup+
int idxx=_TreeAddItem( 0,
name,
TREE_ADD_AS_CHILD,
_pic_doc_w,
_pic_doc_w,
-1 );
tree_indexes[tree_indexes._length()]=idxx;
//fixup-
}
child = _xmlcfg_get_first_child( xml, idx );
if (child >= 0)
parse_project( xml, child, "" );
idx2 = idx;
idx = _xmlcfg_get_next_sibling( xml, idx );
} while (idx >= 0);
}
void opf_files.on_create()
{
int xml_id = 0;
int no_files = 0;
int i;
if (preparse_project( &xml_id )) {
_message_box( "Failed to load project file..." );
close_form();
}
no_files = project_find_files( xml_id, 0 );
//fixup+
typeless aa[];
tree_indexes=aa;
//fixup-
parse_project( xml_id, no_files, "" );
sort_tree( 0 );
forget_project( xml_id );
// Workaround for tree font issue. Credit goes to HS2!
opf_setEditFont( opf_files, opf_tree_font );
_str font_name = '';
opf_getEditFont( opf_tree_font, font_name );
opf_files.p_font_name = font_name;
}
void opf_update_tree( _str pattern ){
//fixup+
int idx = 0;
int x=0;
for (x = 0; x <= tree_indexes._length()-1; x++) {
idx=tree_indexes[x];
if (opf_files._TreeGetCaption( idx ) == "") {
continue;
}
if (!opf_string_match( pattern, opf_files._TreeGetCaption( idx ) )) {
opf_files._TreeSetInfo( idx, -1, -1, -1, TREENODE_HIDDEN );
} else {
opf_files._TreeSetInfo( idx, -1, -1, -1, 0 );
}
}
opf_files._TreeRefresh();
//fixup-
}