/* * Concordance Programming Language * Opticon Image Path change * IMAGEPATH.CPL * * Copyright (c) 2000 Dataflight Software. * All Rights Reserved. * 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. * * Note: This program can only be used with version 7 or * greater (or for special version 6 programs which * have the CPL profile functions installed). */ /*****************************************************/ /* Function: main */ /* Purpose : Entry point for all CPL's */ /*****************************************************/ main() { int db, element, key; char szImagePath[512]; /* Get the current setting */ getPrivateProfileString("Settings", "Imagepath", "", szImagePath, sizeof(szImagePath), db.database+".INI"); /* Draw the 3D box */ box(12, 18, 17, 52, "3D", RGB(128, 128, 128), RGB(192, 192, 192)); puts(11, 18, " Change Opticon image path ", RGB(255,255,255), RGB(0, 0, 255)); /* Prompt the user to change it */ key = edit( szImagePath, 13,19,13,51, "ET", "Ok", 15,29,16,39, "Button", "Cancel",15,41,16,51,"Button", element, "", 1,1,1); /* If the user didn't cancel... */ if (element <> 3) { /* Concatenate a trailing backslash if necessary */ if (szImagePath[len(szImagePath) - 1] <> '\') szImagePath = szImagePath + "\"; /* Write the string to the INI file */ writePrivateProfileString("Settings", "Imagepath", szImagePath, db.database + ".INI"); } } /**************************************************************** * Name: RGB * * Synopsis: Helper routine for Windows color creation. * ****************************************************************/ RGB(int red, grn, blu) { return(((blu & 255) * 65536) | ((grn & 255) * 256) | (red & 255)); }