home *** CD-ROM | disk | FTP | other *** search
/ PC-Online 1998 February / PCOnline_02_1998.iso / filesbbs / dos / listz21s.exe / LZSET10S.RAR / LZS_DROP.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1997-02-25  |  2.6 KB  |  98 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. #include <opdefine.h>
  16. #include <string.h>
  17. #include <opcolor.h>
  18. #include <opentry.h>
  19. #include <opstring.h>
  20. #include "../lzconfig.h"
  21. #include "lzs_cmds.h"
  22.  
  23. typedef struct
  24. {
  25.     boolean UserDoes;
  26.     boolean Doing;
  27.     char    text[37];
  28. } DropFileRecord;
  29.  
  30. extern FrameArray lz_FrameType;
  31. extern ColorSet   lz_Colors;
  32. extern LZCONFIG   lz_Config;
  33. extern boolean    lz_Dirty;
  34.  
  35. static word
  36. InitDropFile(EntryScreen &ES, ColorSet &EsColors, DropFileRecord &UR)
  37. {
  38.     char pic[255];
  39.     long options = wBordered|wClear|wUserContents;
  40.  
  41.     if( !ES.InitCustom(16, 10, 72, 14, EsColors, options) )
  42.         return ES.InitStatus;
  43.  
  44.     ES.wFrame.SetFrameType(lz_FrameType);
  45.     ES.EnableExplosions(15);
  46.     ES.wFrame.AddShadow(shBR, shSeeThru);
  47.     ES.wFrame.AddHeader(" Useron Support ", heTR);
  48.     ES.esFieldOptionsOn(efClearFirstChar|efAutoAdvance);
  49.     ES.esFieldOptionsOff(efTrimBlanks|efShowReadChar|efDefaultAccepted);
  50.     ES.SetWrapMode(WrapAtEdges);
  51.  
  52.     ES.AddYesNoField("UserDoes      ", 2, 3, "Y", 2, 23,
  53.         hi_UserDoes, UR.UserDoes);
  54.     ES.AddYesNoField("Doing (Fe-line)", 3, 3, "Y", 3, 23,
  55.         hi_Doing, UR.Doing);
  56.     CharStr('X', 36, pic);
  57.     ES.AddStringField("Text to write", 4, 3, pic, 4, 23, 33,
  58.         hi_UseronText, UR.text);
  59.  
  60.     if( ES.RawError() ) ES.Done();
  61.     return ES.RawError();
  62. }
  63.  
  64. void
  65. DropFile()
  66. {
  67.     DropFileRecord record;
  68.     EntryScreen    dialog;
  69.  
  70.     record.UserDoes = lz_Config.drop_UserDoes;
  71.     record.Doing = lz_Config.drop_Doing;
  72.     strcpy(record.text, lz_Config.drop_Text);
  73.  
  74.     if( 0 == InitDropFile(dialog, lz_Colors, record) )
  75.     {
  76.         dialog.Draw();
  77.         dialog.Process();
  78.         dialog.Erase();
  79.         dialog.Done();
  80.  
  81.         if( record.UserDoes != lz_Config.drop_UserDoes )
  82.         {
  83.             lz_Config.drop_UserDoes = Boolean(record.UserDoes);
  84.             lz_Dirty = TRUE;
  85.         }
  86.         if( record.Doing != lz_Config.drop_Doing )
  87.         {
  88.             lz_Config.drop_Doing = Boolean(record.Doing);
  89.             lz_Dirty = TRUE;
  90.         }
  91.         if( 0 != strcmp(record.text, lz_Config.drop_Text) )
  92.         {
  93.             strcpy(lz_Config.drop_Text, record.text);
  94.             lz_Dirty = TRUE;
  95.         }
  96.     }
  97. }
  98.