void UninstallTranslationsCallback( Widget w, XtPointer client_data, XtPointer call_data) { Widget widget = (Widget) client_data; if( call_data ) { /* to satisfy IRIX646 compiler */ } if( widget != NULL ) XtUninstallTranslations( widget ); else XtUninstallTranslations( w ); return; }
void moviemen_buts(Widget iw_t, void * data, void * call_data) { /* remove the movie menu widget */ XtUnmanageChild(iw_moviemen); showbutx(NULL, NULL, NULL, TRUE); /* destroy the pixmap iglassav. */ glass(imagsav, iwin,0,0,FALSE, TRUE,(int *) 0,(int *) 0,FALSE); /* remove all translations from iw_win */ XtUninstallTranslations(iw_win); } /* end of moviemen_buts */
void bar_pop(Widget iw_t, XEvent *event, String *params, Cardinal *num_params) { int ix1, iy1, ix2, iy2; /* Get mouse position ix1,iy1 */ getloc(event,'M',&ix1,&iy1); ix2 = ix1 + idx; iy2 = iy1 + idy; /* Bar length */ if (!(strcmp(*params,"M"))) /* Cursor moved */ { /* Copy backing store to image window & draw new bar on screen */ wirubberline(iwin,icontx,TRUE,FALSE,ix1,iy1,ix2,iy2); } else if (!(strcmp(*params,"1"))) /* Button 1 pushed */ { /* Draw permanent bar to backing store and copy to screen */ wirubberline(iwin,icontx,TRUE,TRUE,ix1,iy1,ix2,iy2); } else if (!(strcmp(*params,"2"))) /* Button 2 pushed */ { /* Erase current bar from screen */ wirubberline(iwin,icontx,FALSE,FALSE,ix1,iy1,ix2,iy2); /* Put up menu */ barmen(NULL, NULL, NULL); } else if (!(strcmp(*params,"3"))) /* Button 3 pushed */ { /* Erase current bar from screen */ wirubberline(iwin,icontx,FALSE,FALSE,ix1,iy1,ix2,iy2); /* Uninstall translations */ XtUninstallTranslations(iw_t); /* Unmanage information box */ showbutx("","","",TRUE); XtUnmanageChild(iw_barmen); } }
void WFoeMotif::create_subpane( Widget w, WFoe *foe, XmAnyCallbackStruct *data) { ((WFoeMotif *)foe)->widgets.subpane = w ; XtUninstallTranslations( w); }
void dist_pop(Widget iw_t, XEvent *event, String *params, Cardinal *num_params) { int dx, dy; /* the distance for x-y axis */ int ixi, iyi; char outstr[80]; /* print out string */ if (!(strcmp(*params, "M"))) { /* List location ---- mouse moved */ getloc(event,'m',&ix1,&iy1); if (dist_inimag) { /* find location relative to last image */ ixi = ix1 - ixul + 1; iyi = iy1 - iyul + 1; } if (ndist < 0) /* the starting point flag */ /* haven't got the starting point yet */ return; else if (dist_inimag && (ixi < 1 || ixi > nsam || iyi < 1 || iyi > nrow)) { /* cursor is outside of image, only want inside */ sprintf(outstr,"*** Outside: (%d,%d)$", ixi,iyi); spout(outstr); /* draw line */ xorline(iwin, icontxx, FALSE, ix0, iy0, ix1, iy1); } else { /* report the distance, don't save it */ dx = ix1 - ix0; dy = iy1 - iy0; distance = sqrt((float)(dx*dx + dy*dy)); sprintf(outstr,"*** Distance: %f ****$", distance); spout(outstr); xorline(iwin, icontxx, FALSE, ix0, iy0, ix1, iy1); } } else if (!(strcmp(*params, "1"))) { /* List location -------- button 1 pushed */ getloc(event,'B',&ix1,&iy1); if (dist_inimag) { /* find location relative to last image */ ixi = ix1 - ixul + 1; iyi = iy1 - iyul + 1; } if (ndist < 0) { /* set starting point for distance listing */ ndist = 0; ix0 = ix1; iy0 = iy1; return; } else if (dist_inimag && ( ixi < 1 || ixi > nsam || iyi < 1 || iyi > nrow)) { /* cursor is outside of image, only want inside */ sprintf(outstr,"*** Outside image: (%d,%d)", ixi,iyi); spout(outstr); } else { /* record the distance */ if (dist_leavit) { /* draw a permanent line along the distance */ xorline(iwin, icontxx, TRUE, ix0, iy0, ix1, iy1); xorline(iwin, icontxx, TRUE, ix0, iy0, ix1, iy1); xorline(imagsav, icontxx, TRUE, ix0, iy0, ix1, iy1); } ndist++; if (dist_docit) { /* want to save this distance for doc file */ if (ndist > MAXREG ) { /* too many distances from this starting point for doc file */ spout("*** Document key is full, maximum line # is 7"); ndist = MAXREG; } else { /* save the location for entry in doc file */ dlist[ndist] = distance; sprintf(outstr,"*** Selected: #%d: %d %f", ikey, ndist - 1, distance); spout(outstr); if (singledist) { /* only want one distance from this start */ if (dist_docit > 0) { /* save the current distance line */ dlist[0] = ikey++; dlist[2] = ix0; dlist[3] = iy0; dlist[4] = ix1; dlist[5] = iy1; fpdocpix = savdn1(docnam, datexc, &fpdocpix, dlist, 6, &opendistdoc, TRUE, TRUE); } ndist = 0; ix0 = ix1; iy0 = iy1; distance = 0; } } } } } else if (!(strcmp(*params, "2"))) { /* display the dist_menu */ /* remove current actions */ XtUninstallTranslations(iw_win); xorline(iwin, icontxx, TRUE, ix0, iy0, ix1, iy1); /* show menu */ showbutx(NULL, NULL, NULL, TRUE); distmen(NULL, NULL, NULL); } else if (!(strcmp(*params, "3"))) { /* set a new starting point */ if (ndist > 0) /* remove the current line */ xorline(iwin, icontxx, TRUE, ix0, iy0, ix1, iy1); if ( !singledist) { if (dist_docit > 0 && ndist > 0) { /* first save the current distance line */ dlist[0] = ikey; fpdocpix = savdn1(docnam, datexc, &fpdocpix, dlist, ndist+1, &opendistdoc, TRUE, TRUE); ikey++; } } ndist = -1; } }
/*************************** powerbut_pop ********************************/ void powerbut_pop(Widget iw_t, XEvent *event, String *params, Cardinal *num_params) { static int ixp, iyp, ixb, iyb; int ixs, iys; if (!(strcmp(*params, "M"))) { /**************************************** Mouse movement only */ getloc(event,'M',&ixs,&iys); if (!showing) { /* Box moved, erase old box (if necessary) */ xorbox(iwin,icontxxt, FALSE, ixs, iys, nsamw, nroww); } } else if (!(strcmp(*params, "1"))) { /****************** Button 1 pushed */ getloc(event,'B',&ixs,&iys); /* Show temporary power spectrum */ /* Erase old box first and put a new one */ xorbox(iwin,icontxxt, TRUE, ixs, iys, nsamw, nroww); /* Replace last spectrum area before continuing */ if (erase) XCopyArea(idispl,imagsav,iwin,icontx, ixp,iyp,nsamw,nroww,ixp,iyp); /* Show power spectrum */ ixulw = ixs; iyulw = iys; wid_power(FALSE,&chksiz); /* Remember last spectrum position */ ixp = ixulw; iyp = iyulw; erase = TRUE; showing = TRUE; } else if (!(strcmp(*params, "L"))) { /****************** Button 1 up */ showing = FALSE; /* Erase old box (if necessary) */ xorbox(iwin,icontxxt, FALSE, ixs, iys, nsamw, nroww); } else if (!(strcmp(*params, "2"))) { /*** Make a permanent power spectrum. Button 2 pushed */ getloc(event,'B',&ixs,&iys); /* Show temporary power spectrum */ /* Erase old box first and put a new one */ xorbox(iwin,icontxxt, TRUE, ixs, iys, nsamw, nroww); /* Replace last spectrum area before continuing */ if (erase) XCopyArea(idispl,imagsav,iwin,icontx, ixp,iyp,nsamw,nroww,ixp,iyp); /* show power spectrum */ ixulw = ixs; iyulw = iys; wid_power(TRUE,&chksiz); /* Remember last spectrum position */ ixp = ixulw; iyp = iyulw; erase = FALSE; showing = FALSE; } else if (!(strcmp(*params, "3"))) { /*** Stop this routine. Button 3 pushed */ /* Erase old box first */ xorbox(iwin,icontxxt, TRUE, ixb, iyb, nsamw, nroww); /* Replace last spectrum area before continuing */ if (erase) XCopyArea(idispl,imagsav,iwin,icontx, ixp,iyp,nsamw,nroww,ixp,iyp); XFlush(idispl); showing = FALSE; /* Uninstall translations and free GC */ XtUninstallTranslations(iw_t); XFreeGC(idispl,icontxxt); /* Unmanage information box */ showbutx("","","",TRUE); } }
void mag_pop(Widget iw_t, XEvent *event, String *params, Cardinal *num_params) { /* Get mouse position ix1,iy1. */ getloc( event, 'M', &ix1, &iy1 ); if ( !(strcmp(*params,"M")) && !leftdown ) /* Cursor moved. Erase and draw a new box */ { xorbox(iwin, icontxx, FALSE, ix1, iy1, magsizx, magsizy); } else if (!(strcmp(*params, "1"))) /* Left button pushed. */ /* Erase the old box first, draw a new one */ { xorbox(iwin, icontxx, 1, ix1, iy1,magsizx, magsizy); if (erase) XCopyArea(idispl, imagsav, iwin, icontx, ix3,iy3, lasmagx, lasmagy, ix3, iy3); /* Show magnified area */ glass(iwin, iwin, ix1, iy1, FALSE, FALSE, &ix2, &iy2, TRUE); leftdown = TRUE; } else if (!(strcmp(*params,"L"))) /* Left button up */ { /* Redraw the box */ xorbox(iwin, icontxx, 1, ix1, iy1, magsizx, magsizy); #ifndef WEB_TRUE xorbox(iwin, icontxx, 1, ix1, iy1, magsizx, magsizy); #endif /* Remember the last magnification varibles */ erase = 1; first = 0; lasmagx = magsizx * magfac; lasmagy = magsizy * magfac; ix3 = ix2; iy3 = iy2; leftdown = FALSE; } else if (!(strcmp(*params, "2"))) /* Center button pushed */ /* Make permanent magnification */ { xorbox(iwin, icontxx, 1, ix1, iy1, magsizx, magsizy); if (erase) XCopyArea(idispl, imagsav, iwin, icontx, ix3,iy3, lasmagx, lasmagy, ix3, iy3); /* Show magnified area */ glass(iwin, iwin, ix1, iy1, 1, FALSE, &ix2, &iy2, TRUE); /* Redraw the box */ xorbox(iwin, icontxx, 1, ix1, iy1,magsizx, magsizy); xorbox(iwin, icontxx, 1, ix1, iy1,magsizx, magsizy); /* Remember the last magnification varibles */ erase = 0; first = FALSE; leftdown = FALSE; } else if (!(strcmp(*params, "3"))) /* Right button pushed */ /* Stop this function call */ { if (erase) /* Replace the last temporary magnified area */ XCopyArea(idispl, imagsav, iwin, icontx, ix3,iy3, lasmagx, lasmagy,ix3, iy3); if (!first) /* Erase old box */ xorbox(iwin, icontxx, 1, ix1, iy1, magsizx, magsizy ); neednewmap = TRUE; leftdown = FALSE; XFlush( idispl ); XtUninstallTranslations(iw_win); glass(iwin, iwin, ix1, iy1, TRUE, 1, &ix2, &iy2, TRUE); /* Release GC */ XFreeGC(idispl, icontxx ); showbutx(NULL, NULL, NULL, 1); } }