a99  V32.6
allegro Windows Hauptprogramm
 Alle Klassen Dateien Funktionen Variablen Typdefinitionen Aufzählungen Aufzählungswerte Makrodefinitionen
acombo.cpp
gehe zur Dokumentation dieser Datei
1 // aCombo.cpp : ComboBox
2 // Ableitung von ComboBox, nur wg. Groessenaenderung
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 "aCombo.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 // CaCombo
21 
23 {
24  B=0;
25 }
26 
28 {
29 }
30 
31 // Klappt nicht: (keine Ahnung warum 18.11.00)
32 
33 BEGIN_MESSAGE_MAP(CaCombo, CComboBox)
34  //{{AFX_MSG_MAP(CaCombo)
35  ON_WM_CHAR()
36  ON_WM_KEYDOWN()
37  ON_WM_SYSKEYDOWN()
38  //}}AFX_MSG_MAP
39 END_MESSAGE_MAP()
40 
41 /////////////////////////////////////////////////////////////////////////////
42 // CaCombo message handlers
43 
44 void CaCombo::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
45 {
46  int i=nChar; int j=EOF; CHAR *p;
47  extern int Esc; // default: 92
48 
49 
50 
51  if(i<27) j=UtPfind(i);
52  if(i==Esc) { if(!osc) { osc=1; return; } else osc=0; }
53  if(i>27 && osc==1)
54  {
55  if(i=='0') { CHAR w[24]; SyTime(w); UtPinst(w,48); }
56  j=UtPfind(i);
57  }
58  osc=0;
59  if(j!=EOF)
60  {
61  p=pa[j];
62  while(*p) { if(i==127 && *p==Esc) osc=1; SendMessage(WM_CHAR, *p++); }
63  }
64  else CComboBox::OnChar(nChar, nRepCnt, nFlags);
65 
66 }
67 
68 
69 
70 
71 void CaCombo::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
72 {
73  if(nChar>112 && nChar<124)
74  GetParent()->PostMessage(WM_GOODBYE, 31, nChar);
75  // 118=F7, 116=F5
76  else CaCombo::OnChar(nChar, nRepCnt, nFlags);
77 }
78 
79 void CaCombo::OnSysKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) //Alt-Taste
80 {
81 // sprintf(Aerror,"%d,%d",nChar,nFlags);
82 // dlg->m_enter.SetWindowText(Aerror); *Aerror=0;
83 if(nChar==37) dlg->OnBack();
84 else if(nChar==39) dlg->OnForw();
85 else CaCombo::OnSysKeyDown(nChar,nRepCnt,nFlags);
86 }
87 
88 void CaCombo::movewin(int cx,int cy)
89 {
90 // Bei Groessenaenderung
91 extern int wihi, wiwi;
92 int wh=wihi,ww=wiwi;
93 if(!B)
94 {
95  WINDOWPLACEMENT pl;
96  GetWindowPlacement(&pl);
97  L=pl.rcNormalPosition.left;
98  R=pl.rcNormalPosition.right;
99  T=pl.rcNormalPosition.top;
100  B=pl.rcNormalPosition.bottom;
101 // sprintf(Aerror,"eL=%d,eR=%d,eT=%d,eB=%d",L,R,T,B); MessageBox(Aerror);
102 }
103  // ACHTUNG: Hoehe mit 4 multipliziert! Groesse des Ausklappbereichs ...
104 
105  MoveWindow(L*cx/ww,T*cy/wihi,((R-L)*cx)/ww,((B-T)*cy*4)/wihi);
106 
107 }
108 
109 /*
110  Copyright 2011 Universitätsbibliothek Braunschweig
111 
112  Licensed under the Apache License, Version 2.0 (the "License");
113  you may not use this file except in compliance with the License.
114  You may obtain a copy of the License at
115 
116  http://www.apache.org/licenses/LICENSE-2.0
117 
118  Unless required by applicable law or agreed to in writing, software
119  distributed under the License is distributed on an "AS IS" BASIS,
120  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
121  See the License for the specific language governing permissions and
122  limitations under the License.
123 */
124