a99  V32.6
allegro Windows Hauptprogramm
 Alle Klassen Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Makrodefinitionen
aedit.cpp
gehe zur Dokumentation dieser Datei
1 // aEdit.cpp : mehrzeiliges Eingabefeld mit Groessenaenderung
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 "winx.h"
9 #include "aEdit.h"
10 
11 #ifdef _DEBUG
12 #define new DEBUG_NEW
13 #undef THIS_FILE
14 static char THIS_FILE[] = __FILE__;
15 #endif
16 
17 extern a99 *dlg;
18 
19 /////////////////////////////////////////////////////////////////////////////
20 // CaEdit
21 
22 extern CFont *bFont;
23 
25 {
26  SetFont(bFont,TRUE);
27  esc=0;
28  B=0;
29 }
30 
32 {
33 }
34 
35 
36 BEGIN_MESSAGE_MAP(CaEdit, CEdit)
37  //{{AFX_MSG_MAP(CaEdit)
38  ON_WM_CHAR()
39  ON_WM_KEYDOWN()
40  ON_WM_SYSKEYDOWN()
41  ON_WM_SETFOCUS()
42  //}}AFX_MSG_MAP
43 END_MESSAGE_MAP()
44 
45 /////////////////////////////////////////////////////////////////////////////
46 // CaEdit message handlers
47 
48 void CaEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
49 {
50  int i=nChar; int j=EOF; CHAR *p;
51  extern int Esc; // default: 92
52 
53 // sprintf(Aerror,"%d = %d",nChar,nFlags); dlg->m_enter.SetWindowText(Aerror); //test
54 
55  if(i<27) j=UtPfind(i);
56  if(i==Esc) { if(!esc) { esc=1; return; } else esc=0; }
57  if(i>27 && esc==1)
58  {
59  if(i=='0') { CHAR w[24]; SyTime(w); UtPinst(w,48); }
60  j=UtPfind(i);
61  }
62  esc=0;
63  if(j!=EOF)
64  {
65  p=pa[j];
66  if(tolower((char)*p)=='x' && p[1]==' ') dlg->FLEXecute((char *)p);
67  else while(*p) { if(i==127 && *p==Esc) esc=1; SendMessage(WM_CHAR, *p++); }
68  }
69  else CEdit::OnChar(nChar, nRepCnt, nFlags); // Fehler bei Sonderzeichen!
70  // SendMessage(WM_CHAR,nChar); // fuehrt zum Absturz!!! warum???
71 }
72 
73 void CaEdit::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
74 {
75  if(nChar>112 && nChar<124)
76  GetParent()->PostMessage(WM_GOODBYE, 31, nChar);
77  // 118=F7, 116=F5
78  else CEdit::OnChar(nChar, nRepCnt, nFlags);
79 }
80 
81 void CaEdit::OnSysKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) //Alt-Taste
82 {
83 if(nChar==37) dlg->OnBack();
84 else if(nChar==39) dlg->OnForw();
85 else CEdit::OnSysKeyDown(nChar,nRepCnt,nFlags);
86 }
87 
88 void CaEdit::OnSetFocus(CWnd *pOld)
89 {
90  extern bool fomod;
91  CEdit::OnSetFocus(pOld);
92  if(this->m_hWnd != dlg->m_enter)
93  if(fomod) this->SetSel(-1,0,FALSE);
94 }
95 
96 void CaEdit::movewin(int cx,int cy)
97 {
98 extern int wihi, wiwi;
99 int wh=wihi,ww=wiwi;
100 if(!B)
101 {
102  WINDOWPLACEMENT pl;
103  GetWindowPlacement(&pl);
104  L=pl.rcNormalPosition.left;
105  R=pl.rcNormalPosition.right;
106  T=pl.rcNormalPosition.top;
107  B=pl.rcNormalPosition.bottom;
108 // sprintf(Aerror,"eL=%d,eR=%d,eT=%d,eB=%d",L,R,T,B); MessageBox(Aerror);
109 }
110  MoveWindow(L*cx/ww,T*cy/wihi,((R-L)*cx)/ww,((B-T)*cy)/wihi);
111 
112 }
113 
114 /*
115  Copyright 2011 Universitätsbibliothek Braunschweig
116 
117  Licensed under the Apache License, Version 2.0 (the "License");
118  you may not use this file except in compliance with the License.
119  You may obtain a copy of the License at
120 
121  http://www.apache.org/licenses/LICENSE-2.0
122 
123  Unless required by applicable law or agreed to in writing, software
124  distributed under the License is distributed on an "AS IS" BASIS,
125  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
126  See the License for the specific language governing permissions and
127  limitations under the License.
128 */
129