Commit c604ee59 authored by claes's avatar claes

Postscript print added

parent c269f138
......@@ -301,15 +301,56 @@ static void tra_activate_print( Widget w, tra_tCtx tractx, XmAnyCallbackStruct *
flow_tObject *list;
int cnt;
double ll_x, ll_y, ur_x, ur_y;
flow_tNode n;
flow_tNode *np;
int j;
int i = 0;
char filename[200];
char cmd[200];
/* Get selected object */
flow_GetObjectList( ctx, &list, &cnt);
np = list;
for ( j = 0; j < cnt; j++) {
if ( cnt > 0 && flow_GetObjectType( *np) == flow_eObjectType_Node &&
flow_GetNodeGroup( *np) == flow_eNodeGroup_Document) {
sprintf( filename, "$pwrp_tmp/trace%d.ps", ++i);
dcli_translate_filename( filename, filename);
flow_MeasureNode( *np, &ll_x, &ll_y, &ur_x, &ur_y);
flow_PrintRegion( ctx, ll_x, ll_y, ur_x, ur_y, filename);
sprintf( cmd, "$pwr_exe/rt_print.sh %s 1", filename);
system( cmd);
}
np++;
}
}
static void tra_activate_printselect( Widget w, tra_tCtx tractx, XmAnyCallbackStruct *data)
{
flow_tCtx ctx = (flow_tCtx)tractx->flow_ctx;
flow_tObject *list;
int cnt;
double ll_x, ll_y, ur_x, ur_y;
flow_tNode n;
char filename[200];
int i = 0;
char cmd[200];
/* Get selected object */
flow_GetSelectList( ctx, &list, &cnt);
if ( cnt > 0 && flow_GetObjectType( *list) == flow_eObjectType_Node)
if ( cnt > 0 && flow_GetObjectType( *list) == flow_eObjectType_Node &&
flow_GetNodeGroup( *list) == flow_eNodeGroup_Document)
{
sprintf( filename, "$pwrp_tmp/trace%d.ps", ++i);
dcli_translate_filename( filename, filename);
n = *list;
flow_MeasureNode( n, &ll_x, &ll_y, &ur_x, &ur_y);
flow_PrintRegion( ctx, ll_x, ll_y, ur_x, ur_y, "test.ps");
flow_PrintRegion( ctx, ll_x, ll_y, ur_x, ur_y, filename);
sprintf( cmd, "$pwr_exe/rt_print.sh %s 1", filename);
system( cmd);
}
else
printf("No such node\n");
......@@ -662,8 +703,8 @@ static int trace_flow_cb( FlowCtx *ctx, flow_tEvent event)
}
else
{
if ( flow_GetNodeGroup( event->object.object) == flow_eNodeGroup_Document)
break;
// if ( flow_GetNodeGroup( event->object.object) == flow_eNodeGroup_Document)
// break;
flow_SelectClear( ctx);
flow_SetInverse( event->object.object, 1);
flow_SelectInsert( ctx, event->object.object);
......@@ -1351,6 +1392,7 @@ tra_tCtx trace_new( void *parent_ctx,
{ "tra_ctx", 0 },
{"tra_activate_close",(caddr_t)tra_activate_close },
{"tra_activate_print",(caddr_t)tra_activate_print },
{"tra_activate_printselect",(caddr_t)tra_activate_printselect },
{"tra_activate_savetrace",(caddr_t)tra_activate_savetrace },
{"tra_activate_restoretrace",(caddr_t)tra_activate_restoretrace },
{"tra_activate_cleartrace",(caddr_t)tra_activate_cleartrace },
......
......@@ -80,6 +80,7 @@ c_Help_on_selected_msg : compound_string("Help on selected message");
! module xtt_trace.uil
c_PrintSelect : compound_string("PrintSelected");
c_SaveTrace : compound_string("SaveTrace");
c_RestoreTrace : compound_string("RestoreTrace");
c_ClearTrace : compound_string("ClearTrace");
......
......@@ -19,6 +19,7 @@ identifier
procedure
gec_activate_exit(integer);
gec_activate_configure(integer);
gec_activate_print(integer);
gec_activate_zoomin(integer);
gec_activate_zoomout(integer);
gec_activate_zoomreset(integer);
......@@ -164,6 +165,21 @@ object file_entry : XmCascadeButton
};
};
XmPushButton
{
arguments
{
XmNlabelString = c_Print;
XmNmnemonic = keysym('P');
XmNaccelerator = "Ctrl<Key>P";
XmNacceleratorText = compound_string('Ctrl+P');
XmNfontList = menu_font;
};
callbacks
{
XmNactivateCallback = procedure gec_activate_print(gec_ctx);
};
};
XmPushButton
{
arguments
{
......
......@@ -18,6 +18,7 @@ identifier
ev_ctx;
procedure
ev_eve_activate_exit(integer);
ev_eve_activate_print(integer);
ev_eve_activate_ack_last(integer);
ev_eve_activate_zoom_in(integer);
ev_eve_activate_zoom_out(integer);
......@@ -31,6 +32,7 @@ procedure
ev_eve_activate_helpevent(integer);
ev_eve_create_form(integer);
ev_ala_activate_exit(integer);
ev_ala_activate_print(integer);
ev_ala_activate_ack_last(integer);
ev_ala_activate_zoom_in(integer);
ev_ala_activate_zoom_out(integer);
......@@ -44,6 +46,7 @@ procedure
ev_ala_activate_helpevent(integer);
ev_ala_create_form(integer);
ev_blk_activate_exit(integer);
ev_blk_activate_print(integer);
ev_blk_activate_zoom_in(integer);
ev_blk_activate_zoom_out(integer);
ev_blk_activate_zoom_reset(integer);
......@@ -120,6 +123,18 @@ object eve_file_entry : XmCascadeButton
{
controls
{
XmPushButton
{
arguments
{
XmNlabelString = c_Print;
XmNfontList = menu_font;
};
callbacks
{
XmNactivateCallback = procedure ev_eve_activate_print(ev_ctx);
};
};
XmPushButton
{
arguments
......@@ -416,6 +431,18 @@ object ala_file_entry : XmCascadeButton
{
controls
{
XmPushButton
{
arguments
{
XmNlabelString = c_Print;
XmNfontList = menu_font;
};
callbacks
{
XmNactivateCallback = procedure ev_ala_activate_print(ev_ctx);
};
};
XmPushButton
{
arguments
......@@ -711,6 +738,18 @@ object blk_file_entry : XmCascadeButton
{
controls
{
XmPushButton
{
arguments
{
XmNlabelString = c_Print;
XmNfontList = menu_font;
};
callbacks
{
XmNactivateCallback = procedure ev_blk_activate_print(ev_ctx);
};
};
XmPushButton
{
arguments
......
......@@ -18,6 +18,7 @@ identifier
hist_ctx;
procedure
hist_activate_exit(integer);
hist_activate_print(integer);
hist_activate_zoom_in(integer);
hist_activate_zoom_out(integer);
hist_activate_zoom_reset(integer);
......@@ -254,6 +255,18 @@ object hist_file_entry : XmCascadeButton
{
controls
{
XmPushButton
{
arguments
{
XmNlabelString = c_Print;
XmNfontList = menu_font;
};
callbacks
{
XmNactivateCallback = procedure hist_activate_print(hist_ctx);
};
};
XmPushButton
{
arguments
......
......@@ -22,6 +22,7 @@ identifier
procedure
tra_activate_close(integer);
tra_activate_print(integer);
tra_activate_printselect(integer);
tra_activate_savetrace(integer);
tra_activate_restoretrace(integer);
tra_activate_cleartrace(integer);
......@@ -143,6 +144,18 @@ object file_entry : XmCascadeButton
};
};
XmPushButton
{
arguments
{
XmNlabelString = c_PrintSelect;
XmNfontList = menu_font;
};
callbacks
{
XmNactivateCallback = procedure tra_activate_printselect(tra_ctx);
};
};
XmPushButton
{
arguments
{
......
......@@ -80,6 +80,7 @@ c_Help_on_selected_msg : compound_string("Hj
! module xtt_trace.uil
c_PrintSelect : compound_string("Skriv Utvald");
c_SaveTrace : compound_string("Spara Trace");
c_RestoreTrace : compound_string("terskapa Trace");
c_ClearTrace : compound_string("Rensa Trace");
......
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