Commit 3a321dad authored by Claes Sjofors's avatar Claes Sjofors

Xtt command 'set colortheme' added

parent 5e87c1f1
......@@ -1127,6 +1127,37 @@ static int xnav_set_func( void *client_data,
if ( EVEN(sts)) return sts;
return XNAV__SUCCESS;
}
else if ( cdh_NoCaseStrncmp( arg1_str, "COLORTHEME", strlen( arg1_str)) == 0)
{
// Command is "SET COLORTHEME"
char idx_str[20];
int idx;
int num;
ApplListElem *elem;
if ( EVEN( dcli_get_qualifier( "/INDEX", idx_str, sizeof(idx_str)))) {
xnav->message('E', "Type syntax error");
return XNAV__HOLDCOMMAND;
}
num = sscanf( idx_str, "%d", &idx);
if ( num != 1) {
xnav->message('E', "Type syntax error");
return XNAV__HOLDCOMMAND;
}
if ( xnav->gbl.color_theme != idx) {
xnav->gbl.color_theme = idx;
for ( elem = xnav->appl.root; elem; elem = elem->next) {
if ( elem->type == applist_eType_Graph)
((XttGe *)elem->ctx)->update_color_theme( idx);
}
}
if ( xnav->op)
xnav->op->set_color_theme( idx);
}
else
xnav->message('E',"Syntax error");
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