home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 May
/
Pcwk0597.iso
/
borland
/
cb
/
setup
/
cbuilder
/
data.z
/
RICHEDIT.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1997-02-28
|
11KB
|
401 lines
{*******************************************************}
{ }
{ Delphi Runtime Library }
{ Windows 32bit API Interface Unit }
{ }
{ Copyright (c) 1996 Borland International }
{ }
{*******************************************************}
unit RichEdit;
interface
uses Messages, Windows;
type
TCHAR = Char;
{$nonamespace TCHAR}
const
cchTextLimitDefault = 32767;
const
WM_CONTEXTMENU = $007B;
WM_PRINTCLIENT = $0318;
const
EM_GETLIMITTEXT = 213;
EM_POSFROMCHAR = 214;
EM_CHARFROMPOS = 215;
EM_SCROLLCARET = $00B7;
EM_CANPASTE = WM_USER + 50;
EM_DISPLAYBAND = WM_USER + 51;
EM_EXGETSEL = WM_USER + 52;
EM_EXLIMITTEXT = WM_USER + 53;
EM_EXLINEFROMCHAR = WM_USER + 54;
EM_EXSETSEL = WM_USER + 55;
EM_FINDTEXT = WM_USER + 56;
EM_FORMATRANGE = WM_USER + 57;
EM_GETCHARFORMAT = WM_USER + 58;
EM_GETEVENTMASK = WM_USER + 59;
EM_GETOLEINTERFACE = WM_USER + 60;
EM_GETPARAFORMAT = WM_USER + 61;
EM_GETSELTEXT = WM_USER + 62;
EM_HIDESELECTION = WM_USER + 63;
EM_PASTESPECIAL = WM_USER + 64;
EM_REQUESTRESIZE = WM_USER + 65;
EM_SELECTIONTYPE = WM_USER + 66;
EM_SETBKGNDCOLOR = WM_USER + 67;
EM_SETCHARFORMAT = WM_USER + 68;
EM_SETEVENTMASK = WM_USER + 69;
EM_SETOLECALLBACK = WM_USER + 70;
EM_SETPARAFORMAT = WM_USER + 71;
EM_SETTARGETDEVICE = WM_USER + 72;
EM_STREAMIN = WM_USER + 73;
EM_STREAMOUT = WM_USER + 74;
EM_GETTEXTRANGE = WM_USER + 75;
EM_FINDWORDBREAK = WM_USER + 76;
EM_SETOPTIONS = WM_USER + 77;
EM_GETOPTIONS = WM_USER + 78;
EM_FINDTEXTEX = WM_USER + 79;
EM_SETPUNCTUATION = WM_USER + 100;
EM_GETPUNCTUATION = WM_USER + 101;
EM_SETWORDWRAPMODE = WM_USER + 102;
EM_GETWORDWRAPMODE = WM_USER + 103;
EM_SETIMECOLOR = WM_USER + 104;
EM_GETIMECOLOR = WM_USER + 105;
const
EN_MSGFILTER = $0700;
EN_REQUESTRESIZE = $0701;
EN_SELCHANGE = $0702;
EN_DROPFILES = $0703;
EN_PROTECTED = $0704;
EN_CORRECTTEXT = $0705;
EN_STOPNOUNDO = $0706;
EN_IMECHANGE = $0707;
EN_SAVECLIPBOARD = $0708;
const
ENM_NONE = $00000000;
ENM_CHANGE = $00000001;
ENM_UPDATE = $00000002;
ENM_SCROLL = $00000004;
ENM_KEYEVENTS = $00010000;
ENM_MOUSEEVENTS = $00020000;
ENM_REQUESTRESIZE = $00040000;
ENM_SELCHANGE = $00080000;
ENM_DROPFILES = $00100000;
ENM_PROTECTED = $00200000;
ENM_CORRECTTEXT = $00400000;
ENM_IMECHANGE = $00800000;
const
ES_SAVESEL = $00008000;
ES_SUNKEN = $00004000;
ES_DISABLENOSCROLL = $00002000;
ES_SELECTIONBAR = $01000000;
ES_VERTICAL = $00400000;
ES_NOIME = $00080000;
ES_SELFIME = $00040000;
const
ECO_AUTOWORDSELECTION = $00000001;
ECO_AUTOVSCROLL = $00000040;
ECO_AUTOHSCROLL = $00000080;
ECO_NOHIDESEL = $00000100;
ECO_READONLY = $00000800;
ECO_WANTRETURN = $00001000;
ECO_SAVESEL = $00008000;
ECO_SELECTIONBAR = $01000000;
ECO_VERTICAL = $00400000;
ECOOP_SET = $0001;
ECOOP_OR = $0002;
ECOOP_AND = $0003;
ECOOP_XOR = $0004;
const
WB_CLASSIFY = 3;
WB_MOVEWORDLEFT = 4;
WB_MOVEWORDRIGHT = 5;
WB_LEFTBREAK = 6;
WB_RIGHTBREAK = 7;
WB_MOVEWORDPREV = 4;
WB_MOVEWORDNEXT = 5;
WB_PREVBREAK = 6;
WB_NEXTBREAK = 7;
const
PC_FOLLOWING = 1;
PC_LEADING = 2;
PC_OVERFLOW = 3;
PC_DELIMITER = 4;
WBF_WORDWRAP = $010;
WBF_WORDBREAK = $020;
WBF_OVERFLOW = $040;
WBF_LEVEL1 = $080;
WBF_LEVEL2 = $100;
WBF_CUSTOM = $200;
WBF_CLASS = $0F;
WBF_ISWHITE = $10;
WBF_BREAKLINE = $20;
WBF_BREAKAFTER = $40;
const
FT_MATCHCASE = 4;
FT_WHOLEWORD = 2;
type
_charformat = record
cbSize: UINT;
dwMask: Longint;
dwEffects: Longint;
yHeight: Longint;
yOffset: Longint;
crTextColor: TColorRef;
bCharSet: Byte;
bPitchAndFamily: Byte;
szFaceName: array[0..LF_FACESIZE - 1] of TCHAR;
end;
{$nonamespace _charformat}
TCharFormat = _charformat;
const
CFM_BOLD = $00000001;
CFM_ITALIC = $00000002;
CFM_UNDERLINE = $00000004;
CFM_STRIKEOUT = $00000008;
CFM_PROTECTED = $00000010;
CFM_SIZE = $80000000;
CFM_COLOR = $40000000;
CFM_FACE = $20000000;
CFM_OFFSET = $10000000;
CFM_CHARSET = $08000000;
const
CFE_BOLD = $0001;
CFE_ITALIC = $0002;
CFE_UNDERLINE = $0004;
CFE_STRIKEOUT = $0008;
CFE_PROTECTED = $0010;
CFE_AUTOCOLOR = $40000000;
const
yHeightCharPtsMost = 1638;
const
SCF_SELECTION = $0001;
SCF_WORD = $0002;
SCF_DEFAULT = $0000; { set the default charformat or paraformat }
SCF_ALL = $0004; { not valid with SCF_SELECTION or SCF_WORD }
SCF_USEUIRULES = $0008; { modifier for SCF_SELECTION; says that }
{ the format came from a toolbar, etc. and }
{ therefore UI formatting rules should be }
{ used instead of strictly formatting the }
{ selection. }
type
_charrange = record
cpMin: Longint;
cpMax: LongInt;
end;
{$nonamespace _charrange}
TCharRange = _charrange;
type
TEditStreamCallBack = function (dwCookie: Longint; pbBuff: PByte; cb: Longint; var pcb: Longint): Longint;
type
_textrange = record
chrg: TCharRange;
lpstrText: PChar;
end;
{$nonamespace _textrange}
TTextRange = _textrange;
type
_editstream = record
dwCookie: Longint;
dwError: Longint;
pfnCallback: TEditStreamCallBack;
end;
{$nonamespace _editstream}
TEditStream = _editstream;
const
SF_TEXT = $0001;
SF_RTF = $0002;
SF_RTFNOOBJS = $0003;
SF_TEXTIZED = $0004;
const
SFF_SELECTION = $8000;
SFF_PLAINRTF = $4000;
type
_findtext = record
chrg: TCharRange;
lpstrText: PChar;
end;
{$nonamespace _findtext}
TFindText = _findtext;
_findtextexa = record
chrg: TCharRange;
lpstrText: PChar;
chrgText: TCharRange;
end;
{$nonamespace _findtextexa}
TFindTextEx = _findtextexa;
type
_formatrange = record
hdc: HDC;
hdcTarget: HDC;
rc: TRect;
rcPage: TRect;
chrg: TCharRange;
end;
{$nonamespace _formatrange}
TFormatRange = _formatrange;
const
MAX_TAB_STOPS = 32;
lDefaultTab = 720;
type
_paraformat = record
cbSize: UINT;
dwMask: Longint;
wNumbering: Word;
wReserved: Word;
dxStartIndent: Longint;
dxRightIndent: Longint;
dxOffset: Longint;
wAlignment: Word;
cTabCount: Smallint;
rgxTabs: array [0..MAX_TAB_STOPS - 1] of Longint;
end;
{$nonamespace _paraformat}
TParaFormat = _paraformat;
const
PFM_STARTINDENT = $00000001;
PFM_RIGHTINDENT = $00000002;
PFM_OFFSET = $00000004;
PFM_ALIGNMENT = $00000008;
PFM_TABSTOPS = $00000010;
PFM_NUMBERING = $00000020;
PFM_OFFSETINDENT = $80000000;
const
PFN_BULLET = $0001;
const
PFA_LEFT = $0001;
PFA_RIGHT = $0002;
PFA_CENTER = $0003;
type
PMsgFilter = ^TMsgFilter;
_msgfilter = record
nmhdr: TNMHdr;
msg: UINT;
wParam: WPARAM;
lParam: LPARAM;
end;
{$nonamespace _msgfilter}
TMsgFilter = _msgfilter;
PReqSize = ^TReqSize;
TReqSize = record
nmhdr: TNMHdr;
rc: TRect;
end;
PSelChange = ^TSelChange;
_selchange = record
nmhdr: TNMHdr;
chrg: TCharRange;
seltyp: Word;
end;
{$nonamespace _selchange}
TSelChange = _selchange;
const
SEL_EMPTY = $0000;
SEL_TEXT = $0001;
SEL_OBJECT = $0002;
SEL_MULTICHAR = $0004;
SEL_MULTIOBJECT = $0008;
type
TEndDropFiles = record
nmhdr: TNMHdr;
hDrop: THandle;
cp: Longint;
fProtected: Bool;
end;
PENProtected = ^TENProtected;
_enprotected = record
nmhdr: TNMHdr;
msg: UINT;
wParam: WPARAM;
lParam: LPARAM;
chrg: TCharRange;
end;
{$nonamespace _enprotected}
TENProtected = _enprotected;
PENSaveClipboard = ^TENSaveClipboard;
_ensaveclipboard = record
nmhdr: TNMHdr;
cObjectCount: Longint;
cch: Longint;
end;
{$nonamespace _ensaveclipboard}
TENSaveClipboard = _ensaveclipboard;
_encorrecttext = record
nmhdr: TNMHdr;
chrg: TCharRange;
seltyp: Word;
end;
{$nonamespace _encorrecttext}
TENCorrectText = _encorrecttext;
_punctuation = record
iSize: UINT;
szPunctuation: PChar;
end;
{$nonamespace _punctuation}
TPunctuation = _punctuation;
_compcolor = record
crText: TColorRef;
crBackground: TColorRef;
dwEffects: Longint;
end;
{$nonamespace _compcolor}
TCompColor = _compcolor;
const
CF_RTF = 'Rich Text Format';
CF_RETEXTOBJ = 'RichEdit Text and Objects';
type
_repastespecial = record
dwAspect: Longint;
dwParam: Longint;
end;
{$nonamespace _repastespecial}
TRepasteSpecial = _repastespecial;
implementation
end.