/* * Concordance Watermark Communication program. * * Copyright (c) 1994 Dataflight Software, Inc. * 2337 Roscomare Road, Suite 11 * Los Angeles, CA 90077 * * ALL RIGHTS RESERVED. * * Unauthorized distribution, adaptation or use may be * subject to civil and criminal penalties. * * You may incorporate this program into your own programs * ONLY if you incorporate the following copyright notice: * * Copyright (c) 1998 Dataflight Software ALL RIGHTS RESERVED. */ /************************************************************************ * name: Watermrk * * synopsis: Sends a DDE message to the Watermark viewer to display * * an image. Executes the image viewer if it isn't running.* * returns: Returns NULL if not successful, non-zero if successful. * ************************************************************************/ main() { int db, i; /* Make sure the database is open. */ if (db.documents >= 0) { /* Cycle through the fields, send the image field to Watermark. */ /* Use the str() function on the field, it will leave text fields */ /* alone and convert numeric fields to text */ for(i = 1; i <= db.fields; i = i + 1) { if (db.image[i]) spawn("\windows\watermrk\watermrk.exe", str(db->i)); } } } /* main() */ /**************************************************************** * Name: RGB * * Synopsis: Convert red, green, blue values to a color. * ****************************************************************/ RGB(int red, grn, blu) { return(((blu & 255) * 65536) | ((grn & 255) * 256) | (red & 255)); } /**************************************************************** * Name: Message * * Synopsis: Displays error message and waits for key. * ****************************************************************/ Message(text message; int wait ) { text screen; int key; cursoroff(); /* If this isn't the windows version of Concordance, */ /* the box() function will produce a drop shadowed box */ /* ignoring the background color parameters. */ /* Draw a large dropped box with a raised box */ /* displayed in its center. */ if (wait) { screen = save(4,12,9,70); box( 5,13,9,69,"3U", RGB(128,0, 128), RGB(255,0,255)); box( 5,13,9,69,"3U", RGB(190,190,190), RGB(128,128,128)); puts(7,14,pad(message,'C',53), 0, RGB(255,0,255)); puts(7,14,pad(message,'C',53), 0, RGB(128,128,128)); key = edit("Ok" ,6, 61, 8, 67,"Button" ,1,"" ,0,0,MenuColor_); restore(4,12,screen); } else { box( 5,13,9,69,"3U", RGB(128,0, 128), RGB(255,0,255)); puts(6,14,pad(message,'C',53),0, RGB(255,0,255)); } return(asc(upper(chr(key)))); } /* Message() */