home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QBasic & Borland Pascal & C
/
Delphi5.iso
/
C
/
Samples
/
CSAPE32.ARJ
/
INCLUDE
/
SLED.H
< prev
next >
Wrap
C/C++ Source or Header
|
1990-12-11
|
4KB
|
135 lines
/*
sled.h
% The sled window class header
C-scape 3.2
Copyright (c) 1988, by Oakland Group, Inc.
ALL RIGHTS RESERVED.
Revision History:
-----------------
12/12/88 jdc new! from the bobsled_Class
12/13/88 jdc added: #define sled_funcs bob_funcs
3/29/89 jmd converted seds to 'pure' objects, moved sleddata to sled_xd
4/28/89 jdc added sled_GetFieldRow()
7/15/89 ted Converted '_func' prototypes from typedef to macro.
8/04/89 gam renamed this file to sled.h. Used to be sledwin.h
8/05/89 gam added protection/marking for rows and columns
8/21/89 jdc broke out close code into sledwin_Close (LNF)
8/25/89 gam removed obsolete sld_rpnt() and sled_fkey() prototypes
10/17/89 jdc added sled_GetCol macro
11/27/89 ted removed obsolete sed_GetSled() macro.
11/27/89 gam changed sled_Repaint to sed_Repaint
2/24/90 jdc removed sled_GetHeight
3/14/90 jmd made sled_SetColVar a boolean
3/28/90 jmd ansi-fied
4/11/90 jmd removed height element from sled struct
4/23/90 jmd changed class to winclass
06/11/90 jsm Added right paren to sled_GetCol
6/13/90 jdc fixed scrolling with protection
6/25/90 jdc added sled_GetHeight macro
12/11/90 jdc added paging macros
*/
#define SLEDWM_LASTMSG (SEDWM_LASTMSG + 0)
typedef struct _sledxd {
sed_xd wd; /* sed superclass xdata */
unsigned int offset;
unsigned int size;
xarray xa;
iarray cflags; /* Column special flags */
unsigned int flagsize; /* size of the mark/protect flag sarray */
byte regattr;
byte selattr;
unsigned int width;
VOID *blank;
} sled_xd;
#define sled_getxd(sled) ((sled_xd *) sed_getxd(sled))
#define SLED_BSIZE 50
#define SLED_ASIZE 10
/* function prototypes */
/* SLDDROWS.C */
extern void sled_DeleteRows(sed_type sed, int row, int count);
/* SLDIROWS.C */
extern boolean sled_InsertRows(sed_type sed, int row, int count);
/* SLEDOPEN.C */
extern sed_type sled_ReallyOpen(menu_type menu, int hgt, spc_fptr spec_func, class_fptr winclass);
extern boolean sled_Init(sed_type sed, int hgt, spc_fptr spec_func);
extern boolean sled_remapper(sed_type sed, int offset);
/* SLEDWIN.C */
extern class_func (sledwin_Class);
extern void sledwin_Close(sed_type sed);
extern int sled_Remap(sed_type sed, int offset);
extern VOID *sled_GetColVar(sed_type sed, int col, int row);
extern boolean sled_SetColVar(sed_type sed, int col, int row, VOID *data);
/* SPCSLED.C */
extern spc_func (spc_Sled);
/* the sled remapping code is now contained completely in spc_Sled */
#define sled_funcs bob_funcs
/* macros */
#define sled_Open(m, h, s) sled_ReallyOpen(m, h, s, sledwin_Class)
#define sled_Repaint(sed) sed_Repaint(sed)
#define sled_GetOffset(sed) ((sled_getxd(sed))->offset)
#define sled_GetColSize(sed) ((sled_getxd(sed))->size)
#define sled_GetWidth(sed) ((sled_getxd(sed))->width)
#define sled_GetXa(sed) ((sled_getxd(sed))->xa)
#define sled_GetBlank(sed) ((sled_getxd(sed))->blank)
#define sled_GetHeight(sed) sed_GetHeight(sed)
#define sled_SetOffset(sed, o) ((sled_getxd(sed))->offset = (o))
#define sled_SetColSize(sed, c) ((sled_getxd(sed))->size = (c))
#define sled_SetWidth(sed, w) ((sled_getxd(sed))->width = (w))
#define sled_SetXa(sed, x) ((sled_getxd(sed))->xa = (x))
#define sled_SetBlank(sed, b) ((sled_getxd(sed))->blank = (b))
#define sled_GetTextHeight(sed) \
(menu_GetFieldRow(sed_GetMenu(sed), sed_GetGridField(sed, 0, 0)) + 1)
#define sled_PageUp(sed) \
sled_Remap(sed, - sed_GetHeight(sed) + sled_GetTextHeight(sed))
#define sled_PageDown(sed) \
sled_Remap(sed, sed_GetHeight(sed) - sled_GetTextHeight(sed));
#define sled_flagsize(sed) ((sled_getxd(sed))->flagsize)
/* Get the "current" row in the column array */
#define sled_GetRow(sed) \
(sed_GetGridRow(sed, sed_GetFieldNo(sed)) + sled_GetOffset(sed))
/* Get the "current" col in the sled */
#define sled_GetCol(sed) \
(sed_GetGridCol(sed, sed_GetFieldNo(sed)))
/* Get the row in the column array that a particular field displays */
#define sled_GetFieldRow(sed, fldno) \
(sed_GetGridRow(sed, fldno) + sled_GetOffset(sed))
#define sled_IsLastRow(sed) \
((sled_GetRow(sed) >= sled_GetColSize(sed) - 1 ) ? TRUE : FALSE)