Commit 0fefc27f authored by claes's avatar claes

New command 'set folder'

parent a8df17f5
...@@ -353,6 +353,10 @@ int ge_set_object_focus( ge_tCtx gectx, char *name, int empty) ...@@ -353,6 +353,10 @@ int ge_set_object_focus( ge_tCtx gectx, char *name, int empty)
return ((Graph *)gectx->graph)->set_object_focus( name, empty); return ((Graph *)gectx->graph)->set_object_focus( name, empty);
} }
int ge_set_folder_index( ge_tCtx gectx, char *name, int idx)
{
return ((Graph *)gectx->graph)->set_folder_index( name, idx);
}
extern "C" void ge_delete( ge_tCtx gectx) extern "C" void ge_delete( ge_tCtx gectx)
{ {
......
...@@ -58,6 +58,7 @@ typedef struct ge_sCtx { ...@@ -58,6 +58,7 @@ typedef struct ge_sCtx {
void ge_pop( ge_tCtx gectx); void ge_pop( ge_tCtx gectx);
int ge_set_object_focus( ge_tCtx gectx, char *name, int empty); int ge_set_object_focus( ge_tCtx gectx, char *name, int empty);
int ge_set_folder_index( ge_tCtx gectx, char *name, int idx);
void ge_swap( ge_tCtx gectx, int mode); void ge_swap( ge_tCtx gectx, int mode);
extern "C" ge_tCtx ge_new( Widget parent_wid, extern "C" ge_tCtx ge_new( Widget parent_wid,
......
...@@ -2423,9 +2423,18 @@ int XNav::display_object( pwr_sAttrRef *arp, int open) ...@@ -2423,9 +2423,18 @@ int XNav::display_object( pwr_sAttrRef *arp, int open)
sts = gdh_AttrrefToName( arp, name, sizeof(name), cdh_mName_volumeStrict); sts = gdh_AttrrefToName( arp, name, sizeof(name), cdh_mName_volumeStrict);
if ( EVEN(sts)) goto display_error; if ( EVEN(sts)) goto display_error;
pn = cdh_ParseName( &sts, &parsename, pwr_cNObjid, name, 0);
if ( pn->nAttribute == 0) {
brow_SetInverse( item->node, 1);
brow_SelectInsert( brow->ctx, item->node);
brow_ResetNodraw( brow->ctx);
brow_Redraw( brow->ctx, 0);
brow_CenterObject( brow->ctx, item->node, 0.80);
return 1;
}
item->open_attributes( brow, 0, 0); item->open_attributes( brow, 0, 0);
pn = cdh_ParseName( &sts, &parsename, pwr_cNObjid, name, 0);
strcpy( name, pn->attribute[0].name.orig); strcpy( name, pn->attribute[0].name.orig);
for ( i = 0; i < (int) pn->nAttribute; i++) { for ( i = 0; i < (int) pn->nAttribute; i++) {
sts = find( arp->Objid, name, (void **) &aitem); sts = find( arp->Objid, name, (void **) &aitem);
......
...@@ -246,7 +246,7 @@ dcli_tCmdTable xnav_command_table[] = { ...@@ -246,7 +246,7 @@ dcli_tCmdTable xnav_command_table[] = {
"SET", "SET",
&xnav_set_func, &xnav_set_func,
{ "dcli_arg1", "dcli_arg2", "/NAME", "/VALUE", { "dcli_arg1", "dcli_arg2", "/NAME", "/VALUE",
"/BYPASS", ""} "/BYPASS", "/INDEX", ""}
}, },
{ {
"SETUP", "SETUP",
...@@ -589,6 +589,42 @@ static int xnav_set_func( void *client_data, ...@@ -589,6 +589,42 @@ static int xnav_set_func( void *client_data,
else else
return sts; return sts;
} }
else if ( strncmp( arg1_str, "FOLDER", strlen( arg1_str)) == 0)
{
// Command is "SET FOLDER"
ge_tCtx gectx;
char graph_str[80];
char object_str[80];
char idx_str[20];
int nr;
int idx;
if ( EVEN( dcli_get_qualifier( "dcli_arg2", graph_str))) {
xnav->message('E', "Graph name is missing");
return XNAV__HOLDCOMMAND;
}
if ( EVEN( dcli_get_qualifier( "/NAME", object_str))) {
xnav->message('E', "Object name is missing");
return XNAV__HOLDCOMMAND;
}
if ( EVEN( dcli_get_qualifier( "/INDEX", idx_str))) {
xnav->message('E',"Syntax error");
return XNAV__HOLDCOMMAND;
}
nr = sscanf( idx_str, "%d", &idx);
if ( nr != 1) {
xnav->message('E', "Syntax error");
return XNAV__HOLDCOMMAND;
}
if ( !xnav->appl.find( applist_eType_Graph, graph_str, 0,
(void **) &gectx)) {
xnav->message('E', "Graph is not open");
return XNAV__HOLDCOMMAND;
}
ge_set_folder_index( gectx, object_str, idx);
}
else else
xnav->message('E',"Syntax error"); xnav->message('E',"Syntax error");
return 1; return 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment