a99  V32.6
allegro Windows Hauptprogramm
 Alle Klassen Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Makrodefinitionen
wglob.cpp
gehe zur Dokumentation dieser Datei
1 // grep.cpp : Fenster fuer Globale Ersetzungen
2 //
3 // Copyright 2011 Universitätsbibliothek Braunschweig, more see bottom
4 
5 #include "stdafx.h"
6 #include "ca99.h"
7 #include "a99.h"
8 #include "wglob.h"
9 
10 #ifdef _DEBUG
11 #define new DEBUG_NEW
12 #undef THIS_FILE
13 static char THIS_FILE[] = __FILE__;
14 #endif
15 
16 extern CFont *bFont;
17 
18 /////////////////////////////////////////////////////////////////////////////
19 // glob dialog
20 
21 
22 Wglob::Wglob(CWnd* pParent /*=NULL*/)
23  : CDialog(Wglob::IDD, pParent)
24 {
25  //{{AFX_DATA_INIT(Wglob)
26  // NOTE: the ClassWizard will add member initialization here
27  //}}AFX_DATA_INIT
28 }
29 
30 
31 void Wglob::DoDataExchange(CDataExchange* pDX)
32 {
34  //{{AFX_DATA_MAP(Wglob)
35  DDX_Control(pDX, IDC_EDIT1, m_e1);
36  DDX_Control(pDX, IDC_EDIT2, m_e2);
37  DDX_Control(pDX, IDC_N1, m_n1);
38  DDX_Control(pDX, IDC_N2, m_n2);
39  DDX_Control(pDX, IDC_N3, m_n3);
40  DDX_Control(pDX, IDC_HEAD1, m_h1);
41  DDX_Control(pDX, IDC_HEAD2, m_h2);
42  DDX_Control(pDX, IDC_HEAD3, m_h3);
43  DDX_Control(pDX, IDC_F1, m_f1);
44  DDX_Control(pDX, IDC_F2, m_f2);
45  DDX_Control(pDX, IDC_F3, m_f3);
46  DDX_Control(pDX, IDC_A1, m_a1);
47  DDX_Control(pDX, IDC_A2, m_a2);
48  DDX_Control(pDX, IDC_A3, m_a3);
49  //}}AFX_DATA_MAP
50 }
51 
52 
53 BEGIN_MESSAGE_MAP(Wglob, CDialog)
54  //{{AFX_MSG_MAP(Wglob)
55  ON_WM_DESTROY()
56  ON_WM_CANCELMODE()
57  ON_BN_CLICKED(IDC_GH, OnGh)
58  ON_WM_HELPINFO()
59  //}}AFX_MSG_MAP
60 END_MESSAGE_MAP()
61 
62 /////////////////////////////////////////////////////////////////////////////
63 // Wglob message handlers
64 
65 int Wglob::DoModal(char *srt)
66 { // leider umstaendlich, aber sonst kommt srTerm nicht rueber!
67  strcpy(sr,srt);
68  return CDialog::DoModal();
69 }
70 
72 {
73 
74  return CDialog::DoModal();
75 }
76 
78 {
79 
81 }
82 
84 {
86 }
87 
88 
89 void Wglob::OnOK() // Eingaben herausholen in gra, grn, grf
90 {
91  char kn[10];
92  extern char gra[][400], grn[][400], grf[][10];
93  char u[410];
94 
95  m_f1.GetWindowText(kn,10);
96  if(*kn)
97  if(*kn=='#') strcpy(grf[0],kn); else sprintf(grf[0],"#%s",kn);
98  else *grf[0]=0;
99  m_a1.GetWindowText(gra[0],400);
100  m_n1.GetWindowText(grn[0],400);
101 // Einfuegen in leeres Feld nicht moeglich, grn aendern:
102  if(*grf[0] && !*gra[0])
103  { sprintf(u,"%s %s",grf[0],grn[0]); strcpy(grn[0],u); *grf[0]=0; }
104 
105  m_f2.GetWindowText(kn,10);
106  if(*kn)
107  if(*kn=='#') strcpy(grf[1],kn); else sprintf(grf[1],"#%s",kn);
108  else *grf[1]=0;
109  m_a2.GetWindowText(gra[1],400);
110  m_n2.GetWindowText(grn[1],400);
111  if(*grf[1] && !*gra[1])
112  { sprintf(u,"%s %s",grf[1],grn[1]); strcpy(grn[1],u); *grf[1]=0; }
113 
114  m_f3.GetWindowText(kn,10);
115  if(*kn)
116  if(*kn=='#') strcpy(grf[2],kn); else sprintf(grf[2],"#%s",kn);
117  else *grf[2]=0;
118  m_a3.GetWindowText(gra[2],400);
119  m_n3.GetWindowText(grn[2],400);
120  if(*grf[2] && !*gra[2])
121  { sprintf(u,"%s %s",grf[2],grn[2]); strcpy(grn[2],u); *grf[2]=0; }
122 
123  CDialog::OnOK();
124 }
125 
127 {
128 extern char grf[][10], gra[][400], grn[][400];
130 
131  if(*sr) m_e2.SetWindowText(sr); // result set
132  else m_e2.SetWindowText("Offline File");
133 
134  m_e1.SetWindowText(uif[340]);
135  m_h1.SetWindowText(uif[341]); // field
136  m_h2.SetWindowText(uif[342]); // find
137  m_h3.SetWindowText(uif[343]); // replace
138  m_a1.SetFont(bFont,TRUE);
139  m_a2.SetFont(bFont,TRUE);
140  m_a3.SetFont(bFont,TRUE);
141  m_n1.SetFont(bFont,TRUE);
142  m_n2.SetFont(bFont,TRUE);
143  m_n3.SetFont(bFont,TRUE);
144 
145  m_f1.SetWindowText(grf[0]); // search terms
146  m_a1.SetWindowText(gra[0]);
147  m_n1.SetWindowText(grn[0]);
148  m_f2.SetWindowText(grf[1]);
149  m_a2.SetWindowText(gra[1]);
150  m_n2.SetWindowText(grn[1]);
151  m_f3.SetWindowText(grf[2]);
152  m_a3.SetWindowText(gra[2]);
153  m_n3.SetWindowText(grn[2]);
154  SetWindowText(uif[354]); // a99 : Wglob Ch
155  return TRUE; // return TRUE unless you set the focus to a control
156  // EXCEPTION: OCX Property Pages should return FALSE
157 }
158 
160 {
161  extern char gra[][400];
162  *gra[0]=0; // to signal cancellation
163 
165 }
166 
167 void Wglob::OnGh()
168 {
169  extern a99 *dlg; // main dialog
170  dlg->helpinfo("_GR",uif[354]);
171  SetFocus();
172 }
173 
174 BOOL Wglob::OnHelpInfo(HELPINFO* pHelpInfo)
175 {
176  OnGh(); return 1;
177 
178 // return CDialog::OnHelpInfo(pHelpInfo);
179 }
180 
181 
182 /*
183  Copyright 2011 Universitätsbibliothek Braunschweig
184 
185  Licensed under the Apache License, Version 2.0 (the "License");
186  you may not use this file except in compliance with the License.
187  You may obtain a copy of the License at
188 
189  http://www.apache.org/licenses/LICENSE-2.0
190 
191  Unless required by applicable law or agreed to in writing, software
192  distributed under the License is distributed on an "AS IS" BASIS,
193  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
194  See the License for the specific language governing permissions and
195  limitations under the License.
196 */
197