home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / vos2-121.zip / v / srcos2 / vfinddlg.cpp < prev    next >
C/C++ Source or Header  |  1999-02-17  |  2KB  |  76 lines

  1. //===============================================================
  2. // vFind.cxx - vFindDialog class functions - X11R5
  3. //
  4. // Copyright (C) 1995,1996,1997,1998  Bruce E. Wampler
  5. //
  6. // This file is part of the V C++ GUI Framework, and is covered
  7. // under the terms of the GNU Library General Public License,
  8. // Version 2. This library has NO WARRANTY. See the source file
  9. // vapp.cxx for more complete information about license terms.
  10. //===============================================================
  11.  
  12. #include <v/vos2.h>
  13. #include <v/vfinddlg.h>           // our header
  14. #include <v/vicon.h>           // for icon
  15.  
  16. // Define static data of the class
  17.  
  18.   static CommandObject FindDialog[] =
  19.   {
  20.     {C_Label, 91, 1, "Find?",NoList,
  21.       CA_None,isSens,NoFrame, 0,0},
  22.     {C_TextIn, 92, 2, "", NoList,
  23.       CA_Large,isSens,NoFrame,91,0},
  24.     {C_Button, M_OK, M_OK, "  Find  ", NoList,CA_DefaultButton,
  25.       isSens,NoFrame,92,0},
  26.     {C_CheckBox, 93, 0,"Case Sensitive",NoList,CA_None,
  27.       isSens,NoFrame,91,92},
  28.     {C_Button, M_Cancel, M_Cancel, " Cancel ", NoList,CA_None,
  29.       isSens,NoFrame,92,92},
  30.     {C_EndOfList,0,0,0,0,CA_None,0,0,0}
  31.   };
  32.  
  33. //======================>>> vFindDialog::AskFindPat <<<=======================
  34.   int vFindDialog::AskFindPat(char* reply, const int maxlen, int& caseSens)
  35.   {
  36.     //    Show a message, wait for a reply
  37.     //    no important return
  38.  
  39.     int ans;
  40.  
  41.     if (!reply)
  42.       return 0;
  43.  
  44.     if (!added)
  45.     {
  46.       FindDialog[1].title = reply;
  47.       FindDialog[3].retVal = caseSens;
  48.       AddDialogCmds(FindDialog);        // Set up standard dialog
  49.       added = 1;
  50.     }
  51.  
  52.     if (*reply)
  53.       SetString(92,reply);
  54.     SetValue(93,caseSens,Value);
  55.     (void) ShowModalDialog("", ans);    // show and WAIT
  56.  
  57.     reply[0] = 0;
  58.  
  59.     if (ans != M_Cancel)
  60.     {
  61.       (void) GetTextIn(92, reply, maxlen);
  62.       caseSens = GetValue(93);
  63.     }
  64.  
  65.     return ans == M_OK;
  66.   }
  67.  
  68. //====================>>> vFindDialog::DialogCommand <<<=======================
  69.   void vFindDialog::DialogCommand(ItemVal id, ItemVal val, CmdType ctype)
  70.   {
  71.     vModalDialog::DialogCommand(id,val,ctype);
  72. //    if (id == M_OK || id == M_Cancel)
  73. //    CloseDialog();
  74.   }
  75. // ---------------------------------------------------------------------
  76.