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 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
|
/*
This file is part of Advanced Strategic Command; http://www.asc-hq.de
Copyright (C) 1994-1999 Martin Bickel and Alexander Schfer
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
*/
#ifndef krkr_h
#define krkr_h
#include "stdlib.h"
#include "i86.h"
#include "stdio.h"
#include "conio.h"
#include "ctype.h"
#include "graph.h"
#include "string.h"
#include "stdlib.h"
#include "dos.h"
#include "..\tpascal.inc"
#include "..\typen.h"
//typedef char* pchar;
#define YES 1
#define NO 0
#define clearscreen() (_clearscreen (_GCLEARSCREEN))
#define path(x) (_fullpath (x, "", 255))
typedef struct {
char x,y;
} tcurpos ;
typedef struct {
char name[13];
unsigned short date;
unsigned short time;
long size;
FILE *fp;
} tfile;
void _wait (void);
void charcat (char s[], char c);
void num_ed (long &old, long min, long max);
void num_ed (unsigned short &old, long min, long max);
void num_ed (char &old, long min, long max);
void num_ed ( int &sel, long min, long max);
void unpack_date (unsigned short packed, int &day, int &month, int &year);
void unpack_time (unsigned short packed, int &sec, int &min, int &hour);
void stredit (pchar &string, char maxlength, char xpos, char ypos); // fr dynamische-strings
void stredit2 (char *string, char maxlength, char xpos, char ypos); // fr statische Strings
void bitselect (long &bits, const char *selection[], char bitnum);
void bitselect (unsigned short &bits, const char *selection[], char bitnum);
void bitselect (char &bits, const char *selection[], char bitnum);
void bitselect (int &bits, const char *selection[], char bitnum);
void bitselect ( tterrainbits &bits, const char *selection[], char bitnum);
void yn_switch (char *s1, char *s2, char v1, char v2, char &oldvalue);
void fileselect (char *searchstr, unsigned attributes, tfile &file);
class cstredit {
protected :
char *string, maxlength; // string und seine max. Lnge
tcurpos textpos; // Anfangspos von string
char pos; // Position des Cursors
char status; // Text einfuegen=1 / berschreiben=-1
char **oldstring; // speichert den alten string ab
void addchar (char c);
void delchar (char leftright);
void overwrite (char c);
void changecursor (void);
void setoldstr (void);
public :
void init (char **_string, char _maxlength, char x, char y);
void edit (void);
void done ();
} ;
class cbitselect {
protected :
tterrainbits bits, *oldbits; // Speichervariable fr bits
char quantity; // Anzahl der mglichen Auswahlen
tcurpos position; // position der 1. reihe
char sel; // position des Auswahlcursors
void setpos (char updown);
void changebit (void);
void cbitselect :: setoldbits (void);
public :
void init (tterrainbits &_bits, char *selection[], char bitnum);
void select (void);
void done ();
} ;
class cyn_switch {
protected :
tcurpos position; // Position der Knpfe
char sel; // angewhlter knopf
char *oldvalue; // Zeiger auf die zu verndernde Variable
struct {
char value; // wert des knopfes
char string[15]; // label des knopfes
} button [1];
void paintbutton (char button);
public :
void init (char *s1, char *s2, char v1, char v2, char &_oldvalue);
void select (void);
void done (void);
} ;
class cfileselect {
protected :
tfile *file; // Dateien (Name, Datum, Grsse)
long quantity; // Anzahl der gefundenen Dateien
char sel, maxsel; // Position der Markierung (0-19)
long position, maxposition; // nummer der obersten datei
char sortstatus; // speichert oob nach name oder datum sortiert ist
void search_files (char *searchstr, unsigned attributes);
void displayallfiles (void);
void getinfostr (char *displaystr, long filenum);
void bar (char onoff);
void sort (char option);
public :
void init (char *searchstr, unsigned attributes);
void select (void);
void done (tfile &selected_file);
} ;
extern void settxt50mode ( void );
extern void terrainaccess_ed ( TerrainAccess* ft, char* name );
#endif
|