home *** CD-ROM | disk | FTP | other *** search
/ PC-Online 1998 February / PCOnline_02_1998.iso / filesbbs / dos / listz21s.exe / LZSET10S.RAR / LZS_NAME.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-25  |  1.8 KB  |  60 lines

  1. /*
  2.  * This file is part of LZSETUP (Configuration program for Listerz)
  3.  *
  4.  * Copyright (c) 1997 Branislav L. Slantchev (gargoyle)
  5.  * A fine product of Silicon Creations, Inc.
  6.  *
  7.  * This file is released under the terms and conditions of the GNU
  8.  * General Public License Version 2. The full text of the license is
  9.  * supplied in the Copying.Doc file included with this archive. This
  10.  * free software comes with absolutely no warranty, as outlined in the
  11.  * licensing text. You are not allowed to remove this copyright notice.
  12.  *
  13.  * Contact: Branislav L. Slantchev at 73023.262@compuserve.com
  14. */
  15. #ifndef INCLUDED_OPENTRY_H
  16. #define INCLUDED_OPENTRY_H
  17. #include <opentry.h>
  18. #endif
  19.  
  20. #define hiFileName 0x2100
  21. extern FrameArray lz_FrameType;
  22.  
  23. boolean
  24. AskFileName(char *header, char *fileName, ColorSet &colors)
  25. {
  26.     boolean     retval = FALSE;
  27.     EntryScreen dialog;
  28.     long        options = wBordered+wClear+wUserContents;
  29.     char        pic[255];
  30.     byte        width = 50;
  31.     byte        row = ScreenHeight / 2;
  32.     byte        col = (ScreenWidth - width) / 2;
  33.  
  34.     if( dialog.InitCustom(col, row, col+width, row + 2, colors, options) )
  35.     {
  36.         dialog.wFrame.SetFrameType(lz_FrameType);
  37.         dialog.EnableExplosions(15);
  38.         dialog.wFrame.AddShadow(shBR, shSeeThru);
  39.         dialog.wFrame.AddHeader(header, heTR);
  40.         dialog.esFieldOptionsOn(efCursorToEnd+efClearFirstChar+
  41.             efForceUpper+sefNoFieldMovement);
  42.         dialog.esFieldOptionsOff(efAutoAdvance+efInsertPushes+
  43.             efShowReadChar+efDefaultAccepted);
  44.         dialog.SetWrapMode(ExitAtBot);
  45.  
  46.         CharStr('!', 79, pic);
  47.         dialog.AddStringField("", 2, 3, pic, 2, 3, 47, hiFileName, fileName);
  48.  
  49.         if( !dialog.RawError() )
  50.         {
  51.             dialog.Draw();
  52.             dialog.Process();
  53.             dialog.Erase();
  54.             dialog.Done();
  55.             retval = TRUE;
  56.         }
  57.     }
  58.     return retval;
  59. }
  60.