/* * stddbox * Some standard Straylight dboxes. * * v. 1.00 (9 August 1991) * * © 1991-1998 Straylight */ /*----- Licensing note ----------------------------------------------------* * * This file is part of Straylight's Steel library. * * Steel is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * Steel is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Steel. If not, write to the Free Software Foundation, * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __stddbox_h #define __stddbox_h #ifndef __xfersend_h #include "xfersend.h" #endif #ifndef __dbox_h #include "dbox.h" #endif typedef BOOL (*stddbox_writableHandler)(char *result,void *handle); /* * BOOL warning(char *okMsg,char *warn,...) * * Use * Pops up a warning box, with a Cancel button and a default action button * with your own text in it. * * Parameters * char *okMsg == what to put in the default action button. * char *warn == the warning message (printf()-style format string) * * Returns * TRUE if the user chose the OK button. */ BOOL warning(char *okMsg,char *warn,...); /* * void note(char *notemsg,...) * * Use * Displays a small note on the screen, so you can tell the user that he * has done something silly, etc. A lot nicer than old werr(). * * Parameters * char *notemsg == the note (printf()-style format string) */ void note(char *notemsg,...); /* * BOOL writable * ( * char *title, * char *deflt, * char *result, * stddbox_writableHandler proc, * void *handle * ) * * Use * Opens a dialogue box for the user to input a string. Needs * the 'writable' template. * * Parameters * char *title == the title for the dialogue box. * char *default == the default string to put in the writable area. * char *result == a buffer to contain the result string. May be 0. * stddbox_writableHandler proc == proc to call when OK is clicked. May * be 0. Return TRUE if successful (i.e. we may close the dbox). * void *handle == passed to proc. * * Returns * TRUE if the string has been updated. */ BOOL writable ( char *title, char *deflt, char *result, stddbox_writableHandler proc, void *handle ); /* * void saveWarn * ( * BOOL useName, * void (*dispose)(void *handle), * char *title, * char *name, * int filetype, * int estsize, * xfersend_saveproc saveproc, * xfersend_sendproc sendproc, * xfersend_printproc printproc, * void *handle * ) * * Use * Pops up a save warning box allowing the use the luxury of saving his * data before closing the file. The file is only removed if the data is * 'safe'. * * Parameters * BOOL useName == whether to use the given name in the warning message * void (*dispose)(void *handle) == function to dispose the user's data * the others == as for saveas() */ void saveWarn ( BOOL useName, void (*dispose)(void *handle), char *title, char *name, int filetype, int estsize, xfersend_saveproc saveproc, xfersend_sendproc sendproc, xfersend_printproc printproc, void *handle ); /* * void progInfo * ( * char *name, * char *purpose, * char *author, * int version, * char *date * ) * * Use * Presents a standard progInfo window giving information about an * application. * * Parameters * char *name == the name of the program * char *purpose == what it does * char *author == author/copyright string (usually something like * '© 1992-1998 Straylight') * int version == the version number*100 (e.g. 374 for 3.74 etc.) * char *date == the date of compilation (use _TIME_NOW) */ void progInfo(char *name,char *purpose,char *author,int version,char *date); /* * void mbox(dbox d) * * Use * Handles a monologue box (like info windows) where no input is required. * You should create the dbox, fill in any fields required. This routine * then handles the rest. It deletes the dbox when it's finished - it's of * no use to the caller anyway - who wants a used dialogue box with no * input? Yuk... * * You can specify a help message tag to be displayed before any messages * embedded in the icons. This is passed through msgs_lookup before * sending to help_addLine. Specify zero for this to send no message. * * Parameters * dbox d == the box to handle * char *help == the help message tag to stick on the top */ void mbox(dbox d,char *help); #endif