File: vfinddlg.cpp

package info (click to toggle)
v1 1.20-2
  • links: PTS
  • area: main
  • in suites: slink
  • size: 6,240 kB
  • ctags: 9,439
  • sloc: cpp: 48,033; ansic: 8,939; makefile: 1,369; sh: 30
file content (74 lines) | stat: -rw-r--r-- 2,175 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
//===============================================================
// vFind.cxx - vFindDialog class functions - X11R5
//
// Copyright (C) 1995,1996, 1997, 1998  Bruce E. Wampler
//
// This file is part of the V C++ GUI Framework, and is covered
// under the terms of the GNU Library General Public License,
// Version 2. This library has NO WARRANTY. See the source file
// vapp.cxx for more complete information about license terms.
//===============================================================

#include <v/vfinddlg.h>           // our header
#include <v/vicon.h>           // for icon

// Define static data of the class

    static CommandObject FindDialog[] =
      {
	{C_Label, 91, 1, "Find?",NoList,
		CA_None,isSens,NoFrame, 0,0},
        {C_TextIn, 92, 2, "", NoList,
		CA_Large,isSens,NoFrame,91,0},
	{C_Button, M_OK, M_OK, "  Find  ", NoList,CA_DefaultButton,
		isSens,NoFrame,92,0},
	{C_CheckBox, 93, 0,"Case Sensitive",NoList,CA_None,
		isSens,NoFrame,91,92},
        {C_Button, M_Cancel, M_Cancel, " Cancel ", NoList,CA_None,
		isSens,NoFrame,92,92},
        {C_EndOfList,0,0,0,0,CA_None,0,0,0}
      };

//======================>>> vFindDialog::AskFindPat <<<=======================
  int vFindDialog::AskFindPat(char* reply, const int maxlen, int& caseSens)
  {
    //	Show a message, wait for a reply
    //	no important return

    int ans;

    if (!reply)
	return 0;

    if (!added)
      {
	FindDialog[1].title = reply;
	FindDialog[3].retVal = caseSens;
	AddDialogCmds(FindDialog);		// Set up standard dialog
	added = 1;
      }

    if (*reply)
	SetString(92,reply);
    SetValue(93,caseSens,Value);
    (void) ShowModalDialog("", ans);	// show and WAIT

    reply[0] = 0;

    if (ans != M_Cancel)
      {
	(void) GetTextIn(92, reply, maxlen);
	caseSens = GetValue(93);
      }

   return ans == M_OK;
  }

//====================>>> vFindDialog::DialogCommand <<<=======================
  void vFindDialog::DialogCommand(ItemVal id, ItemVal val, CmdType ctype)
  {
    vModalDialog::DialogCommand(id,val,ctype);
//    if (id == M_OK || id == M_Cancel)
//	CloseDialog();
  }
// ---------------------------------------------------------------------