00001
00002
00003
#ifndef _EVRYTHNG_H
00004
#define _EVRYTHNG_H
00005
00006
#ifndef RC_INVOKED
00007
#include "utils\u_utils.h"
00008
#endif
00009
00010
00011
00012
00013
00014 #define GermanVersion 1
00015
00016 #define MaxString 512
00017
00018 #define M_PI 3.14159265358979323846
00019
00020
00021 enum EScrollBarSide {
sbsLeft= 55,
sbsRight= 56};
00022
00023 #define LenAdditionalInfo 40
00024
00025
00026 #define R_Failure 202
00027 #define R_OK 999
00028
00029
00030 #define DetectorTimerIdStart 100
00031
00032
00033 #define TimerIdInformation 399
00034
00035
00036
00037
00038
#if defined(__FLAT__)
00039
typedef char*
HPSTR;
00040
typedef BYTE*
HPBYTE;
00041
typedef float*
HPFLOAT;
00042
typedef WORD*
HPWORD;
00043
#else
00044
00045 typedef char _huge *
HPSTR;
00046 typedef BYTE _huge *
HPBYTE;
00047 typedef float _huge *
HPFLOAT;
00048 typedef WORD _huge *
HPWORD;
00049
#endif
00050
00051 enum EUnitType
00052 {
00053
utGrad= 1,
utMinuten,
utSekunden,
utMillimeter,
utMikrometer,
utChannel,
utNone
00054 };
00055
00056
00057
EUnitType _CURVECLASS WINAPI
UnitEnum( LPSTR );
00058
00059
class TMDIWindow;
00060
00061
00062
00063
00064
00065 class IMainEvents {
00066
protected:
00067 IMainEvents() {};
00068 IMainEvents(
const IMainEvents& ) {};
00069 IMainEvents& operator= (
const IMainEvents& ) {};
00070
00071
00072
public:
00073
00074
virtual void OnLeave ()= 0;
00075 };
00076
00077
00078
00079
00080
00081 class TMain
00082 {
00083
public:
00084
TMain(
void );
00085
virtual ~TMain(
void );
00086
00087 BOOL
Init( HINSTANCE hInstance,
int cmdShow );
00088
void InitHardware();
00089
00090 BOOL
HasNewManJustage (
void )
00091 {
00092
return m_NewManJustage;
00093 };
00094
00095
00096
public:
00097 TMDIWindow*
ScanWindow;
00098 TMDIWindow*
AreaScanWindow;
00099
00100
00101
00102 HWND
hScanWindow;
00103 HWND
hAreaScanWindow;
00104
00105
00106
00107
00108
00109
public:
00110
bool AddToEventList(
IMainEvents *);
00111
bool RemoveFromEventList(
IMainEvents *);
00112
private:
00113
TIndList m_EventHandler;
00114
00115
00116
private:
00117
00118 HWND CreateMdiClient( HINSTANCE, HWND );
00119 HMENU CreateMenuBar(
void );
00120
00121
00122 LRESULT OnCommand(HWND hWindow, WPARAM wParam, LPARAM lParam);
00123
void OnSize(HWND);
00124
void OnPaint(HWND);
00125
void OnMenuInit(
void );
00126
void OnMenuSelect(HWND, WPARAM, LPARAM);
00127
00128
void SetWatchIndicator(
long );
00129
void SetParameters(
void );
00130
00131
00132
00133
void LoadPos(
void );
00134
void SavePos(
void );
00135
00136
00137
void CreateStatusBar( HINSTANCE, HWND );
00138
void BlastStatusLine( HWND,
int );
00139
void DrawStatus( HWND, ATOM,
int );
00140
00141
00142
00143
00144
private:
00145 BOOL m_NewManJustage;
00146
00147
00148 BOOL AreaScanExtention, ScanExtention, MacroExtention, TopographyExtention;
00149
00150 HMENU hTheMenu;
00151
static HACCEL hAccellerator;
00152 HWND hwndStatusBar;
00153 HBITMAP bmpStatusLine;
00154
00155
00156
00157
char StatusInfo[2*
MaxString];
00158
char AdditionalInfo[
LenAdditionalInfo];
00159
00160
00161
public:
00162
static LRESULT CALLBACK
EventHandler( HWND, UINT, WPARAM, LPARAM );
00163
static int MessageLoop(
void );
00164 };
00165
00166
00167
00168
00169
00170 enum EAskType {
atDefault,
atNewName,
atNoAsk};
00171 enum EWindowType {
wtUnknown= 0,
wtScan= 251,
wtAreaScan= 252,
wtCounter= 253,
wtEdit= 254};
00172 enum EPaintType {
ptEntire= 0,
ptPaintPoint,
ptFlush};
00173
00174 class TMDIWindow :
public TBasicMDIWindow
00175 {
00176
public:
00177
TMDIWindow ( HINSTANCE );
00178
virtual ~TMDIWindow (
void );
00179
00180 LRESULT
Show (
void );
00181
00182
00183
public:
00184 virtual BOOL
canNew()
00185 {
return FALSE; }
00186 virtual BOOL
canOpenFile()
00187 {
return FALSE; }
00188 virtual BOOL
canSave()
00189 {
return FALSE; }
00190 virtual BOOL
isScanning(BOOL &PsdContinious)
00191 { PsdContinious= FALSE;
return FALSE; }
00192 virtual BOOL
isInterrupted()
00193 {
return bInterrupted; }
00194
00195
00196
virtual void UpdateWnd( EPaintType= ptEntire );
00197 bool bUserPaint;
00198 BOOL
WholeWnd(
void );
00199
00200
00201 BOOL
SetFileName( LPSTR );
00202
00203 LPSTR
GetFileName(
void )
00204 {
00205
return FileName;
00206 };
00207
00208 void FileChange(
void )
00209 {
00210
bFileChanged= TRUE;
00211 };
00212
00213 BOOL
IsModified(
void )
00214 {
00215
return bFileChanged;
00216 };
00217
00218
virtual BOOL
CanOpen (
void );
00219
virtual BOOL
CanClose(
void );
00220
00221
00222
protected:
00223
virtual void OnMenuSelect ( WPARAM, LPARAM );
00224
00225
virtual HICON
GetIcon (
void ) const;
00226
00227 virtual HCURSOR GetCursor(
void )
00228 {
00229
return LoadCursor( NULL, IDC_ARROW );
00230 };
00231
00232 virtual LPCSTR
ClassName(
void )
00233 {
00234
return "Nutzerfenster";
00235 };
00236
00237 virtual LPCSTR
GetCharacteristic(
void )
00238 {
00239
return "Fenster";
00240 };
00241
00242
00243 virtual void TimerRequest( WPARAM )
00244 {};
00245
00246 virtual void DoCopy(
void )
00247 {};
00248
00249
virtual void Interrupt(
void );
00250
00251 virtual void SteeringReady( LPARAM )
00252 {};
00253 virtual void SteeringReset( LPARAM )
00254 {};
00255
00256 virtual void SetRanges(
void )
00257 {};
00258
00259 virtual void CounterSetRequest( LPARAM )
00260 {};
00261
00262 virtual void DistanceSetRequest( LPARAM )
00263 {};
00264
00265 virtual void PickUpData( LPARAM )
00266 {};
00267
00268
virtual BOOL
New(
void );
00269
virtual BOOL SaveFile( EAskType=atDefault );
00270
virtual BOOL
SaveFileAs(
void );
00271
00272 virtual BOOL
LoadOldData()
00273 {
00274
return FALSE;
00275 };
00276 virtual BOOL
UpdateFile(
void )
00277 {
00278
return FALSE;
00279 };
00280
00281
00282
00283 virtual void lButtonDown( WPARAM, LPARAM )
00284 {};
00285
00286 virtual void OnLButtonDown ( WPARAM wParam, LPARAM lParam )
00287 {
00288 lButtonDown(wParam, lParam);
00289 };
00290
00291 virtual void lButtonUp( WPARAM, LPARAM )
00292 {};
00293
00294 virtual void OnLButtonUp ( WPARAM wParam, LPARAM lParam )
00295 {
00296 lButtonUp(wParam, lParam);
00297 };
00298
00299
virtual void rButtonDown ( LPARAM );
00300
00301 virtual void OnRButtonDown ( WPARAM wParam, LPARAM lParam )
00302 {
00303 rButtonDown(lParam);
00304 };
00305
00306 virtual void MouseMove ( WPARAM, LPARAM )
00307 {};
00308
00309 virtual void OnMouseMove ( WPARAM wParam, LPARAM lParam )
00310 {
00311 MouseMove(wParam, lParam);
00312 };
00313
00314 virtual void Create ( HWND )
00315 {};
00316
00317 virtual void OnCreate (
void )
00318 {
00319 Create(
GetHandle());
00320 };
00321
00322 virtual void Paint ( HDC, PAINTSTRUCT* )
00323 {};
00324
00325 virtual void DoPaint ( HDC hdc, PAINTSTRUCT *ps )
00326 {
00327 Paint(hdc, ps);
00328 };
00329
00330 virtual void SetFocus (
void )
00331 {};
00332
00333 virtual void OnFocus (
void )
00334 {
00335
SetFocus();
00336 };
00337
00338 virtual void Size ( HWND, WPARAM, LPARAM )
00339 {};
00340
00341 virtual void OnSize ( WPARAM wParam, LPARAM lParam )
00342 {
00343 Size(
GetHandle(), wParam, lParam);
00344 };
00345
00346 virtual void RenderFormat ( WPARAM )
00347 {};
00348
00349 virtual void OnRenderFormat ( WPARAM wParam, LPARAM )
00350 {
00351 RenderFormat(wParam);
00352 };
00353
00354 virtual void RenderAllFormats ( WPARAM )
00355 {};
00356
00357 virtual void OnRenderAllFormats ( WPARAM wParam, LPARAM )
00358 {
00359 RenderAllFormats(wParam);
00360 };
00361
00362
00363
00364
virtual void OnKeyUp ( WPARAM, LPARAM );
00365
virtual void OnTimer ( WPARAM, LPARAM );
00366
virtual void OnNotCreated (
void );
00367
virtual LRESULT OnCommand ( WPARAM, LPARAM );
00368
00369
00370
public:
00371 char szDataPath[
MaxString];
00372
00373
protected:
00374 char FileName[2*
MaxString];
00375 char szFilter[
MaxString];
00376 char szExtension[4];
00377 BOOL
bOldDataLoaded;
00378 BOOL
bIsNewFile;
00379 BOOL
bFileChanged;
00380 char FontName[
MaxString];
00381 EWindowType WindowType;
00382 RECT
WndRect;
00383 RECT
ClientRect;
00384 BOOL
bMeasurementActive;
00385 BOOL
bInterrupted;
00386 HMENU
hHoleMenu,
00387
TheMenu;
00388
00389
protected:
00390 BOOL
bPaintPoint;
00391
static int s_WindowCount;
00392 };
00393
00394
#endif //ifndef _EVRYTHNG_H