Commit 9a7b8129 authored by Claes Sjofors's avatar Claes Sjofors

Xtt command, for source in 'set subwindow' to specify the current graph

parent 10b80e3e
......@@ -65,6 +65,7 @@ public class JopSpider {
static PwrtAttrRef methAref;
static int methClassId;
static JopSpider spider;
static JopGrowFrame currentGrowFrame;
private static class GrowFrameCb implements GrowFrameApplIfc {
JopSession session;
......@@ -73,9 +74,13 @@ public class JopSpider {
this.session = session;
}
public int command( String cmd) {
public int command( String cmd, Object caller) {
System.out.println("JopSpider command callback : " + cmd);
return JopSpider.command( session, cmd);
currentGrowFrame = (JopGrowFrame)caller;
int sts = JopSpider.command( session, cmd);
currentGrowFrame = null;
return sts;
}
public int script( String script) {
System.out.println("JopSpider script callback : " + script);
......@@ -725,7 +730,11 @@ public class JopSpider {
if ( source.indexOf('.') == -1)
source = source + ".pwg";
Object graph = session.getUtility( JopUtility.GRAPH, (PwrtObjid)null, JopUtility.fileToName(graphstr));
Object graph;
if ( graphstr.equals("$current") && currentGrowFrame != null)
graph = currentGrowFrame;
else
graph = session.getUtility( JopUtility.GRAPH, (PwrtObjid)null, JopUtility.fileToName(graphstr));
if ( graph != null) {
System.out.println("JopSpider, " + graphstr + " found");
((JopGrowFrame)graph).setSubwindowSource( name, source, object);
......
......@@ -391,7 +391,7 @@ public class GrowFrame extends JFrame implements GraphApplIfc, ActionListener {
public int command(String cmd) {
System.out.println("Ge command : " + cmd);
if ( appl != null)
return appl.command(cmd);
return appl.command(cmd, this);
return 0;
}
......
......@@ -38,7 +38,7 @@
package jpwr.jopg;
public interface GrowFrameApplIfc {
public int command(String cmd);
public int command(String cmd, Object caller);
public int script(String script);
public void frameClosed( Object utility);
public void openPopupMenu( String object, Object invoker, int x, int y);
......
......@@ -880,12 +880,16 @@ static int xnav_set_func( void *client_data,
cont = ODD( dcli_get_qualifier( "/CONTINUE", 0, 0));
if ( xnav->appl.find_graph( graph_str, 0, (void **) &gectx)) {
if ( cdh_NoCaseStrcmp(graph_str, "$current") == 0 &&
xnav->current_cmd_ctx) {
gectx = (XttGe *)xnav->current_cmd_ctx;
return gectx->set_subwindow_source( name_str, source_str, object_p);
}
else if ( xnav->appl.find_graph( graph_str, 0, (void **) &gectx)) {
if ( strcmp( source_str, "") == 0) {
xnav->message('E',"Syntax error");
return XNAV__HOLDCOMMAND;
}
return gectx->set_subwindow_source( name_str, source_str, object_p);
}
else {
......
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