home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Crawly Crypt Collection 1
/
crawlyvol1.bin
/
apps
/
spread
/
opusprg
/
opussrc
/
gctv.inc
< prev
next >
Wrap
Text File
|
1988-04-19
|
20KB
|
516 lines
{$P-}
CONST
max_winds = 2;
n_rows = 999;
n_cols = 255;
n_functions = 44;
float_len = 17; { for window_input call }
string_len = 60;
inp_mask = $13; { E_Message | E_Keyboard | E_Button }
e = 2.7182818285;
Ln2 = 0.69314718056;
Ln10 = 2.3025850930;
HalfPi = 1.5707963268;
Pi = 3.1415926536;
TwoPi = 6.2831853072;
DegPerRad = 57.295779513;
MaxSquare = 9E18;
MinSquare = 9E-18;
Desk = 3; { index of Desk menu item }
cell_size = 26;
str_size = 62;
dep_size = 8;
just_mask = $0030;
no_just_mask = $FFCF;
dollar_mask = $0080;
no_dollar_mask = $FF7F;
perc_mask = $0040;
no_perc_mask = $FFBF;
sci_mask = $0008;
no_sci_mask = $FFF7;
prec_mask = $0007;
no_prec_mask = $FFF8;
style_mask = $0700;
no_style_mask = $F8FF;
bold_mask = $0100;
italic_mask = $0200;
under_mask = $0400;
recalc_mask = $8000;
no_recalc_mask = $7FFF;
pending_mask = $4000;
not_pending_mask = $BFFF;
RS232 = 2;
Centronics = 3;
add = 1; { refers to action done on dependency lists }
remove = 2; { that reference a given cell }
adj_refs = 3; { distinguish from 2 above in proc adjust_expr }
RecalcMsg = $1000;
RecalcReply = $1080;
StringaCellMsg = $2000;
StringaCellReply = $2080;
TranslateMsg = $3000;
TranslateReply = $3080;
RealToStrMsg = $4000;
RealToStrReply = $4080;
StrToRealMsg = $5000;
StrToRealReply = $5080;
AssignedMsg = $6000;
AssignedReply = $6080;
PresentMsg = $7000;
PresentReply = $7080;
RedrawMsg = $8000;
RedrawReply = $8080;
MfdbAddrMsg = $9000;
MfdbAddrReply = $9080;
DataMsg = $A000;
DataReply = $A080;
DefRangeMsg = $B000;
DefRangeReply = $B080;
GetRangeMsg = $C000;
GetRangeReply = $C080;
LocateMsg = $D000;
LocateReply = $D080;
DeleteMsg = $E000;
DeleteReply = $E080;
NewMsg = $F000;
NewReply = $F080;
{ gemconst.pas - Personal Pascal GEM library constant definitions. }
No_Window = -1;
Root = 0 ; { Index of root w/in object tree }
Null_Index = -1 ; { Index of a non-existent item }
Max_Tree = 100 ;
Max_Depth = 8 ; { for dialogs }
White = 0;
Black = 1;
Red = 2;
LightBlue = 3;
{ Line styles: }
Solid = 1 ;
LongDash = 2 ;
Dotted = 3 ;
DashDot = 4 ;
Dashed = 5 ;
DashDotDot = 6 ;
{ Event values: }
E_Keyboard = $01 ;
E_Button = $02 ;
E_MRect_1 = $04 ;
E_MRect_2 = $08 ;
E_Message = $10 ;
E_Timer = $20 ;
E_All = $3F ;
No_Flags = 0;
Hide_Tree = $80;
{ Graphics command constants: }
{ Drawing modes: }
Replace_Mode = 1 ;
Trans_Mode = 2 ;
XOR_Mode = 3 ;
Rev_Trans_Mode = 4 ;
{ Text effects: }
Normal = 0 ;
Bold = 1 ;
Italics = 4 ;
Underlined = 8 ;
{ Font types: }
System_Font = 3 ;
Small_Font = 5 ;
{ Object states }
{ Use Normal for no special state }
Selected = $01 ;
Crossed = $02 ;
Checked = $04 ;
Disabled = $08 ;
{ Outlined and Shadowed are defined under text effects }
{ Window elements: }
G_All = $0FEF ; { All elements, excluding info line }
{ Predefined GEM messages: }
MN_Selected = 10 ;
WM_Redraw = 20 ;
WM_Topped = 21 ;
WM_Closed = 22 ;
WM_Fulled = 23 ;
WM_Arrowed = 24 ;
WM_HSlid = 25 ;
WM_VSlid = 26 ;
WM_Sized = 27 ;
WM_Moved = 28 ;
{ Wind_Get/Set field values: }
WF_PrevXYWH = 6 ;
WF_FullXYWH = 7 ;
WF_HSlide = 8 ;
WF_VSlide = 9 ;
WF_NewDesk = 14 ;
WF_HSlSize = 15 ;
WF_VSlSize = 16 ;
{ VDI graphics text justification }
VDI_Left = 0;
VDI_Center = 1;
VDI_Right = 2;
{ End of gemconst.pas }
TYPE
{ gemtype.pas - Common GEM type definitions for Personal Pascal library. }
Color_Reg = 0..15 ;
Draw_Modes = Replace_Mode..Rev_Trans_Mode ;
Line_Types = Solid..DashDotDot ;
Mouse_Type = ( M_Arrow, M_Text_Curs, M_Bee, M_Point_Hand, M_Flat_Hand,
M_Thin_Cross, M_Thick_Cross, M_Outln_Cross ) ;
Dialog_Ptr = ^char ;
Menu_Ptr = ^char ;
Generic_Ptr = ^CHAR; { can pass either of the above to this type var }
Word16 = ARRAY [ 0..15 ] OF integer ;
Mouse_Form = RECORD
hot_x : integer ;
hot_y : integer ;
res : integer ;
mask_color : integer ;
data_color : integer ;
mask : Word16 ;
data : Word16 ;
END ;
File_Name = STRING[12] ;
Path_Name = STRING;
Window_Title = STRING;
Message_Buffer = ARRAY [ 0..15 ] OF INTEGER;
STR255 = STRING [ 255 ] ;
C_STRING = PACKED ARRAY [ 1..81 ] OF CHAR;
C_STR255 = PACKED ARRAY [ 1..256 ] OF CHAR;
Palette_Buffer = ARRAY [ 0..15 ] OF INTEGER;
{ Editable text justification: }
TE_Just = ( TE_Left, TE_Right, TE_Center ) ;
{ Possible indices into a tree: }
Tree_Range = Root..Max_Tree ;
Tree_Index = Null_Index..Max_Tree ;
{ VDI graphic text justification }
VDI_Just = VDI_Left..VDI_Right;
{ AES and VDI parameter types; max definitions }
Control_Parms = ARRAY [ 0..11 ] OF INTEGER;
Int_In_Parms = ARRAY [ 0..127 ] OF INTEGER;
Int_Out_Parms = ARRAY [ 0..127 ] OF INTEGER;
Addr_In_Parms = ARRAY [ 0..1 ] OF LONG_INTEGER;
Addr_Out_Parms = ARRAY [ 0..0 ] OF LONG_INTEGER;
Pts_In_Parms = ARRAY [ 0..127 ] OF INTEGER;
Pts_Out_Parms = ARRAY [ 0..127 ] OF INTEGER;
{ End of gemtype.pas }
ClassType = ( Val,Labl,Expr );
AssignedStatus = ( Value,NonValue,Error,Desolate,Void );
StatusType = ( GenError,SyntaxErr,OutOfRange,BadRef,Overflow,
DivBy0,Undefined,BadReal,OK,Full,Empty );
InpType = ( FloatingPoint,AlphaNumeric,AnInteger );
ControlCodes =
( w_right_arrow,w_left_arrow,w_up_arrow,w_down_arrow,w_return,
w_page_right,w_page_left,w_page_up,w_page_down,w_cntl_a,w_cntl_z,
w_cntl_t,w_cntl_b,w_f1,w_f2,w_f3,w_f4,w_f5,w_f8,w_f9,w_f10,
w_sf2,w_sf3,w_sort,w_percent,w_style,alt_1,alt_2,alt_3,alt_4,
c_1,c_2,c_3,c_4,alt_x,alt_b,alt_m,alt_c,f6,f7,sf6,sf7,
c_f,c_l,alt_h,alt_i,alt_k,alt_f,alt_l,alt_t,
w_column,w_justify,w_precision,w_start_block,w_end_block,
w_deselect,w_replicate,w_goto,w_home,w_view,w_esc,
w_message,w_mouse,w_null,w_f,NoCode );
AllFunctions = (
LogOp,ExpOp,LnOp,SqrOp,SqrtOp,SinOp,CosOp,TanOp,
{ set names: } AsinOp,AcosOp,AtanOp,RadOp,DegOp,FacOp,
{ Single } AbsOp,PiOp,NotOp, { (<expr>) }
{ Double } DivOp,ModOp,RandOp,RoundOp,TruncOp,
{ (<expr>,<expr>) }
{ Multiple } AndOp,OrOp,
CountOp,SumOp,ProdOp,MeanOp,VarOp,SdevOp,SerrOp,
{ Aggregate } MaxOp,MinOp, { (<range>) }
LinrOp,CorrOp, { (<range>,<range>) }
PredvOp, { (<range>,<range>,<expr>) }
{ Financial } PvOp,FvOp,
PmtOp,NperOp, { (<expr>,<expr>,<expr>) }
{ LookUp } VlookupOp,HlookupOp, { (<range>,<expr>,<expr>) }
IndexOp,
{ None } IfOp { (<expr>,<expr>,<expr>) }
);
BoolOps = ( Equal,NotEqual,Greater,GreaterOrEqual,Lesser,
LesserOrEqual );
PosAttr = ( w_hdl,first_row,first_col,last_row,last_col,
hot_row,hot_col );
WidthFields = ( spaces,pixels );
SumSqrProd = ( Sum,SumSquares,Product );
ReqType = ( ACell,AString );
ExpandDirection = ( ExRight,ExLeft );
MapAction = ( ClearSelected,ReturnSelected );
CursorDirection = ( CursorDown,CursorRight );
HomeType = ( R,C,Both,Origin );
BlitDirection = ( None,Left,Right,Up,Down );
FormatCall = ( CWCall,DollarCall,JustCall,PrecCall,PercCall,
StyleCall,GlobalCall );
ExtentType = ( NoRowNames,NoColNames,WholeSheet,JustData );
DiskIoOps = ( LoadFile,SaveFile,LoadBlock,SaveBlock,
SaveText );
PrinterSpecial = ( Init,LineTerm,PageTerm,Draft,Final,Condensed,
BoldOn,BoldOff,ItalicOn,ItalicOff,
UnderOn,UnderOff );
PortType = RS232..Centronics;
PrinterLineOps = ( LfOp,FFOp,RowColOp,Title1Op,Title2Op,HeaderOp,
DataOp,FooterOp );
STR1 = STRING[1];
STR2 = STRING[2];
STR5 = STRING[5];
STR10 = STRING[10];
STR30 = STRING[30];
STR40 = STRING[40];
STR60 = STRING[60];
LorFstr = STR60;
Len61 = PACKED ARRAY [1..61] OF CHAR;
P_EdText = LorFstr; { buffer type for text fields in forms }
C_EdText = Len61;
PtrToReal = ^REAL;
PtrToString = ^STRING;
BlitArray = PACKED ARRAY [1..32000] OF BYTE;
ESquares = ARRAY [1..7] OF REAL;
Letters = SET OF CHAR;
FunctionDef = RECORD
func_name : STR10;
func_type : AllFunctions;
END;
CellCoordinates = RECORD
row,
col : INTEGER;
END;
Mfdb = RECORD
address : LONG_INTEGER;
wid_pix : INTEGER; { define all these }
ht_pix : INTEGER; { separately else }
wid_wds : INTEGER; { the compiler will }
format : INTEGER; { store them in the }
planes : INTEGER; { REVERSE order, and }
res1 : INTEGER; { GEM will misunder- }
res2 : INTEGER; { stand... }
res3 : INTEGER
END;
ThreeHundredBytes = PACKED ARRAY [1..300] OF BYTE;
PrinterCodes = ARRAY [Init..UnderOff] OF STR10;
TypeWidth = ARRAY [1..n_cols,WidthFields] OF BYTE;
ColDividerPos = ARRAY [1..20] OF INTEGER; { 20 case expanded rez }
HundredInts = ARRAY [1..100] OF INTEGER; { ever available, 8 is }
TypeName = ARRAY [1..n_cols] OF STR2; { max needed at present}
ErrorStrings = ARRAY [GenError..BadReal] OF STR10;
LineOpArray = ARRAY [1..66] OF PrinterLineOps;
FunctionArray = ARRAY [1..n_functions] OF FunctionDef;
MarkArray = ARRAY [1..6] OF CellCoordinates;
MonthArray = ARRAY [1..12] OF STR10;
DayArray = ARRAY [1..7] OF STR10;
Switcheroo = RECORD
CASE BYTE OF
1 : ( c : INTEGER );
2 : ( format : INTEGER );
3 : ( class : ClassType );
4 : ( status : StatusType );
5 : ( number : REAL );
6 : ( str : STRING );
7 : ( switched : ThreeHundredBytes );
END;
DepPtr = ^DependentCells;
DependentCells = PACKED RECORD
r,
c : INTEGER;
next : DepPtr;
END;
CellPtr = ^CellType;
CellType = PACKED RECORD
c : INTEGER;
format : INTEGER;
class : ClassType;
status : StatusType;
num : REAL;
str : ^LorFstr;
sub : DepPtr;
next : CellPtr;
END;
DataTable = ARRAY [0..n_rows] OF CellPtr; { the zero'th row }
{ is for a scratch}
VAR ap_id,x_1,y_1,w_1,h_1,hdl,hdl_1,hdl_2, { list }
act_hdl,n_hdls,i,j,h_entry,v_entry,o_x,
o_y,max_w,max_h,start_row,start_col,
finish_row,finish_col,o_s_col,o_f_col,
o_s_row,o_f_row,o_scr_row,o_scr_col,
data_row,data_col,kbd_state,
scr_row,scr_col,o_data_row,
o_data_col,x_pos,y_pos,mx,my,
two_cell_h,three_cell_h,event,b_cnt,
key,fo_x,fo_y,fo_w,fo_h,
rez,total,alert,n_ops,
screen_height,b_s_row,b_s_col,
b_e_row,b_e_col,cell_height,
redraw_x,redraw_y,redraw_w,redraw_h,
clip_x,clip_y,clip_w,clip_h,
w_idx,drive,screen_width,default_format,
max_screen_cols,half_scr_width,
half_scr_height,
column,char_count,x_pix,btn_state,
blit_x,blit_y,blit_w,blit_h,
pos_in_str,nl_chr_line,con_chr_line,
v_slider_pos,h_slider_pos,message_type,
x_margin,y_margin,freeze_row,freeze_col,
logical_row_1,logical_col_1,
virtual_f_row,virtual_f_col,
virtual_h_entry,virtual_v_entry,
edit_x,edit_y,
con_x,con_y,con_w,con_h,area_x,area_y,
area_w,area_h : INTEGER;
long_key,original_memory,working_memory,
data_addr : LONG_INTEGER;
v_slide_inc,h_slide_inc : REAL;
temp_char,char1,char2 : CHAR;
null_str : STR1;
col_row : STR10;
temp_1 : STR30;
directory : C_STRING;
full_path,current_file : STRING;
temp,too_long,old_form,float_over : STR255;
p_title_1,p_title_2,header,footer : P_EdText;
p_row_col,print_formulas,draft_final,
condensed_print,
null_input,full_redraw,
global_extent,block_set,block_st_set,
block_end_set,
need_to_redraw,
redraw_flag,grid_flag,auto_cursor,
form_flag,user_quit,auto_recalc,
did_recalc,m1s,m2s,m3s,m4s,
small_text,bad_str,natural : BOOLEAN;
extent : ExtentType;
default_path : ARRAY [1..2] OF STRING;
w_pos : ARRAY [1..max_winds,PosAttr]
OF INTEGER;
w_vert_grid : ARRAY [1..2] OF ColDividerPos;
Single,Double,Multiple,
Aggregate,Financial,LookUp : SET OF AllFunctions;
blit_buffer : BlitArray;
days : DayArray;
months : MonthArray;
e_table : ESquares;
cursor_direction : CursorDirection;
up_case,low_case,float,digits : Letters;
port : PortType;
printer_codes : PrinterCodes;
inp_code : ControlCodes;
error_msg : ErrorStrings;
screen_mfdb,mem_mfdb : Mfdb;
marks : MarkArray;
num_str : LorFstr;
s0,s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,
s12,s13 : C_EdText;
old_vert_grid,vert_grid : ColDividerPos;
col_width : TypeWidth;
col_name : TypeName;
functions : FunctionArray;
ptr : CellPtr;
data : DataTable;
{ GEM-related stuff }
control : Control_Parms;
int_in : Int_In_Parms;
int_out : Int_Out_Parms;
addr_in : Addr_In_Parms;
addr_out : Addr_Out_Parms;
pts_in : Pts_In_Parms;
pts_out : Pts_Out_Parms;
palette : Palette_Buffer;
main_menu : Menu_Ptr;
info_ptr,goto_ptr,fmat_ptr,
rep_ptr,vfrm_ptr,sort_ptr,
print_ptr,key_ptr,form_ptr,
rang_ptr,err_ptr,stat_ptr,prhelp_ptr,
mhelp_ptr,crefhelp_ptr,rechelp_ptr,
page_ptr,data_fill_ptr,freeze_ptr,
action_ptr,new_desk_ptr : Dialog_Ptr;
indx : Tree_Index;
t_1,t_2,dummy_title : Window_Title;
msg_area,msg : Message_Buffer;
{ declarations for string_to_real and real_to_string }
exp_val,
sign_exp,
sign_num,
lfactor,
places,
str_pos,
str_len,
dec_pos,
comma_pos,
n_digits : INTEGER;
real_num,
mag_num,
lpower : REAL;
lquit,
loverflow,
found : BOOLEAN;
last : PACKED ARRAY [1..15] OF CHAR;