new constants for compatibility

git-svn-id: trunk@3694 -
This commit is contained in:
mattias 2002-12-12 17:47:46 +00:00
parent c62603e8e6
commit 735191d158
10 changed files with 242 additions and 70 deletions

View File

@ -2498,7 +2498,7 @@ begin
// read all constants
repeat
ReadNextAtom; // identifier or number
if not AtomIsIdentifier(false) or AtomIsNumber then begin
if (not AtomIsIdentifier(false)) and (not AtomIsNumber) then begin
RaiseStringExpectedButAtomFound(ctsIdentifier);
end;
CreateChildNode;

View File

@ -70,6 +70,9 @@ function CleanAndExpandDirectory(const Filename: string): string;
function SearchFileInPath(const Filename, BasePath, SearchPath,
Delimiter: string; SearchLoUpCase: boolean): string;
// file read
function ReadFileToString(const Filename: string): string;
implementation
{$IFNDEF win32}
@ -101,6 +104,9 @@ end.
{
$Log$
Revision 1.6 2002/12/12 17:47:44 mattias
new constants for compatibility
Revision 1.5 2002/12/09 16:48:36 mattias
added basic file handling functions to filectrl

View File

@ -85,12 +85,29 @@ begin
Result := FImage.FHandle;
end;
function TBitmap.GetHandleType: TBitmapHandleType;
begin
// ToDo:
Result:=bmDIB;
end;
function TBitmap.GetMaskHandle: HBITMAP;
begin
MaskHandleNeeded;
Result := FImage.FMaskHandle;
end;
function TBitmap.GetScanline(Row: Integer): Pointer;
begin
// ToDo:
Result:=nil;
end;
procedure TBitmap.SetHandleType(Value: TBitmapHandleType);
begin
end;
procedure TBitMap.HandleNeeded;
var
n : integer;
@ -415,6 +432,12 @@ Begin
FImage.FHandle := 0;
end;
function TBitmap.ReleasePalette: HPALETTE;
begin
// ToDo
Result := 0;
end;
function TBitmap.GetEmpty: boolean;
begin
with FImage do
@ -427,6 +450,11 @@ begin
Result := FDIB.dsbm.bmHeight;
end;
function TBitmap.GetPalette: HPALETTE;
begin
Result:=inherited GetPalette;
end;
function TBitmap.GetWidth: Integer;
begin
with FImage do
@ -474,12 +502,25 @@ begin
end;
end;
procedure TBitmap.SetPalette(Value: HPALETTE);
begin
inherited SetPalette(Value);
end;
procedure TBitmap.SetTransparentMode(Value: TTransparentMode);
begin
end;
// included by graphics.pp
{ =============================================================================
$Log$
Revision 1.24 2002/12/12 17:47:46 mattias
new constants for compatibility
Revision 1.23 2002/11/12 10:16:16 lazarus
MG: fixed TMainMenu creation

View File

@ -172,13 +172,14 @@ End;
------------------------------------------------------------------------------}
Procedure TCustomEdit.SetCharCase(Value : TEditCharCase);
Begin
if FCharCase <> value then
Begin
if FCharCase <> value then
Begin
FCharCase := Value;
if FCharCase = ecUpperCase then Text := Uppercase(Text)
else
if FCharCase = ecLowerCase then Text := Lowercase(Text);
end;
if FCharCase = ecUpperCase then
Text := Uppercase(Text)
else if FCharCase = ecLowerCase then
Text := Lowercase(Text);
end;
End;
{------------------------------------------------------------------------------
@ -188,8 +189,10 @@ End;
------------------------------------------------------------------------------}
procedure TCustomEdit.SetMaxLength(Value : Integer);
begin
if Value=MaxLength then exit;
FMaxLength := Value;
CNSendMessage(LM_SETPROPERTIES, Self, nil);
if HandleAllocated then
CNSendMessage(LM_SETPROPERTIES, Self, nil);
end;
{------------------------------------------------------------------------------
@ -202,6 +205,14 @@ begin
FModified := Value;
end;
procedure TCustomEdit.SetPasswordChar(const AValue: Char);
begin
if FPasswordChar=AValue then exit;
FPasswordChar:=AValue;
if HandleAllocated then
CNSendMessage(LM_SETPROPERTIES, Self, nil);
end;
{------------------------------------------------------------------------------
Method: TCustomEdit.SetEchoMode
Params: Value to set FModified to
@ -211,7 +222,8 @@ procedure TCustomEdit.SetEchoMode(Val : TEchoMode);
begin
if (Val <> FEchoMode) then begin
FEchoMode:= Val;
CNSendMessage(LM_SETPROPERTIES, Self, nil);
if HandleAllocated then
CNSendMessage(LM_SETPROPERTIES, Self, nil);
end;
end;
@ -224,7 +236,8 @@ procedure TCustomEdit.SetReadOnly(Value : Boolean);
begin
if FreadOnly <> Value then begin
FReadOnly := Value;
CNSendMessage(LM_SETPROPERTIES, Self, nil);
if HandleAllocated then
CNSendMessage(LM_SETPROPERTIES, Self, nil);
end;
end;
@ -290,6 +303,9 @@ end;
{ =============================================================================
$Log$
Revision 1.14 2002/12/12 17:47:46 mattias
new constants for compatibility
Revision 1.13 2002/11/16 11:22:57 mbukovjan
Fixes to MaxLength. TCustomMemo now has MaxLength, too.

View File

@ -571,9 +571,34 @@ begin
Result:='';
end;
{------------------------------------------------------------------------------
function ReadFileToString(const Filename: string): string;
------------------------------------------------------------------------------}
function ReadFileToString(const Filename: string): string;
var
fs: TFileStream;
begin
Result:='';
try
fs:=TFileStream.Create(Filename,fmOpenRead);
try
Setlength(Result,fs.Size);
if Result<>'' then
fs.Read(Result,length(Result));
finally
fs.Free;
end;
except
Result:='';
end;
end;
{
$Log$
Revision 1.5 2002/12/12 17:47:46 mattias
new constants for compatibility
Revision 1.4 2002/12/09 16:48:36 mattias
added basic file handling functions to filectrl

View File

@ -17,28 +17,6 @@
*****************************************************************************
}
const
FontCharsets: array[0..18] of TIdentMapEntry = (
(Value: ANSI_CHARSET; Name: 'ANSI_CHARSET'),
(Value: DEFAULT_CHARSET; Name: 'DEFAULT_CHARSET'),
(Value: SYMBOL_CHARSET; Name: 'SYMBOL_CHARSET'),
(Value: MAC_CHARSET; Name: 'MAC_CHARSET'),
(Value: SHIFTJIS_CHARSET; Name: 'SHIFTJIS_CHARSET'),
(Value: HANGEUL_CHARSET; Name: 'HANGEUL_CHARSET'),
(Value: JOHAB_CHARSET; Name: 'JOHAB_CHARSET'),
(Value: GB2312_CHARSET; Name: 'GB2312_CHARSET'),
(Value: CHINESEBIG5_CHARSET; Name: 'CHINESEBIG5_CHARSET'),
(Value: GREEK_CHARSET; Name: 'GREEK_CHARSET'),
(Value: TURKISH_CHARSET; Name: 'TURKISH_CHARSET'),
(Value: VIETNAMESE_CHARSET; Name: 'VIETNAMESE_CHARSET'),
(Value: HEBREW_CHARSET; Name: 'HEBREW_CHARSET'),
(Value: ARABIC_CHARSET; Name: 'ARABIC_CHARSET'),
(Value: BALTIC_CHARSET; Name: 'BALTIC_CHARSET'),
(Value: RUSSIAN_CHARSET; Name: 'RUSSIAN_CHARSET'),
(Value: THAI_CHARSET; Name: 'THAI_CHARSET'),
(Value: EASTEUROPE_CHARSET; Name: 'EASTEUROPE_CHARSET'),
(Value: OEM_CHARSET; Name: 'OEM_CHARSET'));
procedure GetCharsetValues(Proc: TGetStrProc);
var
I: Integer;
@ -855,6 +833,9 @@ end;
{ =============================================================================
$Log$
Revision 1.11 2002/12/12 17:47:46 mattias
new constants for compatibility
Revision 1.10 2002/12/07 08:42:08 mattias
improved ExtTxtOut: support for char dist array

View File

@ -38,6 +38,11 @@ begin
Filer.DefineBinaryProperty('Data', @ReadData, @WriteData, DoWrite);
end;
function TGraphic.GetPalette: HPALETTE;
begin
Result:=0;
end;
procedure TGraphic.Changed(Sender: TObject);
begin
FModified := True;
@ -83,6 +88,11 @@ begin
LoadFromStream(Stream);
end;
procedure TGraphic.SetPalette(Value: HPALETTE);
begin
end;
procedure TGraphic.SaveToFile(const Filename: string);
var
Stream: TStream;

View File

@ -60,10 +60,20 @@ function PredefinedClipboardFormat(
function CharLower(c: char): char;
function CharUpper(c: char): char;
{$IFDEF win32}
function GetTickCount: DWord; cdecl; external;
{$ELSE}
function GetTickCount: DWord;
{$ENDIF}
implementation
uses
Strings, Math;
Strings, Math
{$IFNDEF Win32}
, {$IFDEF Ver1_0}Linux{$ELSE}Unix{$ENDIF}
{$ENDIF}
;
var
FPredefinedClipboardFormats:
@ -71,6 +81,15 @@ var
LowerCaseChars: array[char] of char;
UpperCaseChars: array[char] of char;
{$IFNDEF Win32}
function GetTickCount: DWord;
var
hour, minutes, secs, msecs, usecs: word;
begin
GetTime(hour, minutes, secs, msecs, usecs);
Result:=(((hour*60)+minutes)*60+secs)*1000+msecs;
end;
{$ENDIF}
function MakeLong(A,B : Word) : LongInt;
begin
@ -124,6 +143,9 @@ end.
{
$Log$
Revision 1.24 2002/12/12 17:47:45 mattias
new constants for compatibility
Revision 1.23 2002/11/23 09:34:12 mattias
fixed compiling errors for synregexpr.pas

View File

@ -48,7 +48,7 @@ uses VCLGlobals, Classes;
type
//TODO: check this against vclglobals
PLongInt = ^LongInt;
PInteger = ^Integer;
PSmallInt = ^SmallInt;
@ -750,6 +750,7 @@ type
peBlue: Byte;
peFlags: Byte;
end;
TPaletteEntry = tagPALETTEENTRY;
PALETTEENTRY = tagPALETTEENTRY;
PLogPalette = ^tagLogPalette;
@ -788,7 +789,14 @@ type
end;
GRADIENTRECT = tagGRADIENTRECT;
{ Bitmap Header Definition }
{ ********************************** }
{ B I T M A P S T U F F }
{ TBitmap is an encapsulation of a matrix of pixels. It has a Canvas to allow
modifications to the image. Creating copies of a TBitmap is very fast
since the handle is copied not the image. If the image is modified, and
the handle is shared by more than one TBitmap object, the image is copied
before the modification is performed (i.e. copy on write). }
PBitmap = ^TagBitmap;
tagBITMAP = packed record
bmType: Longint;
@ -801,7 +809,20 @@ type
end;
BITMAP = tagBITMAP;
PBitmapInfoHeader = ^TagBitmapInfoHeader;
PBitmapCoreHeader = ^TBitmapCoreHeader;
tagBITMAPCOREHEADER = packed record
bcSize: DWORD;
bcWidth: Word;
bcHeight: Word;
bcPlanes: Word;
bcBitCount: Word;
end;
TBitmapCoreHeader = tagBITMAPCOREHEADER;
BITMAPCOREHEADER = tagBITMAPCOREHEADER;
PBitmapInfoHeader = ^TBitmapInfoHeader;
tagBITMAPINFOHEADER = packed record
biSize : DWORD;
biWidth : Longint;
@ -815,14 +836,48 @@ type
biClrUsed : DWORD;
biClrImportant : DWORD;
end;
TBitmapInfoHeader = tagBITMAPINFOHEADER;
BITMAPINFOHEADER = tagBITMAPINFOHEADER;
{ ********************************** }
{ B I T M A P S T U F F }
PRGBTriple = ^TRGBTriple;
tagRGBTRIPLE = packed record
rgbtBlue: Byte;
rgbtGreen: Byte;
rgbtRed: Byte;
end;
TRGBTriple = tagRGBTRIPLE;
RGBTRIPLE = tagRGBTRIPLE;
PRGBQUAD = ^TRGBQUAD;
tagRGBQUAD = packed record
rgbBlue : BYTE;
rgbGreen : BYTE;
rgbRed : BYTE;
rgbReserved : BYTE;
end;
TRGBQuad = tagRGBQUAD;
RGBQUAD = tagRGBQUAD;
PBitmapInfo = ^TBitmapInfo;
tagBITMAPINFO = packed record
bmiHeader: TBitmapInfoHeader;
bmiColors: array[0..0] of TRGBQuad;
end;
TBitmapInfo = tagBITMAPINFO;
BITMAPINFO = tagBITMAPINFO;
PBitmapCoreInfo = ^TBitmapCoreInfo;
tagBITMAPCOREINFO = record
bmciHeader: TBitmapCoreHeader;
bmciColors: array[0..0] of TRGBTriple;
Reserved: array[0..0] of Char;
end;
TBitmapCoreInfo = tagBITMAPCOREINFO;
BITMAPCOREINFO = tagBITMAPCOREINFO;
PBitmapFileHeader = ^TBitmapFileHeader;
tagBITMAPFILEHEADER = packed record
bfType: Word;
bfSize: DWORD;
@ -833,8 +888,8 @@ type
TBitmapFileHeader = tagBITMAPFILEHEADER;
BITMAPFILEHEADER = tagBITMAPFILEHEADER;
PDIBSection = ^TDIBSection;
PDIBSection = ^TDIBSection;
tagDIBSECTION = packed record
dsBm: TagBitmap;
dsBmih: tagBITMAPINFOHEADER;
@ -845,30 +900,6 @@ type
TDIBSection = tagDIBSECTION;
DIBSECTION = tagDIBSECTION;
PRGBQUAD = ^tagRGBQUAD;
tagRGBQUAD = packed record
rgbBlue : BYTE;
rgbGreen : BYTE;
rgbRed : BYTE;
rgbReserved : BYTE;
end;
RGBQUAD = tagRGBQUAD;
PRGBTRIPLE = ^tagRGBTRIPLE;
tagRGBTRIPLE = packed record
rgbtBlue : BYTE;
rgbtGreen : BYTE;
rgbtRed : BYTE;
end;
RGBTRIPLE = tagRGBTRIPLE;
PBITMAPINFO = ^tagBITMAPINFO;
tagBITMAPINFO = packed record
bmiHeader : tagBITMAPINFOHEADER;
bmiColors : array[0..0] of tagRGBQUAD;
end;
BITMAPINFO = tagBITMAPINFO;
const
TRUETYPE_FONTTYPE = 4;
@ -1254,22 +1285,28 @@ const
//==============================================
// GetDeviceCaps constants
//==============================================
BI_RGB = 0;
BI_BITFIELDS = 3;
HORZSIZE = 4;
VERTSIZE = 6;
HORZRES = 8;
VERTRES = 10;
BITSPIXEL = 12;
PLANES = 14;
LOGPIXELSX = 88;
LOGPIXELSY = 90;
type
TFarProc = Pointer;
TFNWndProc = TFarProc;
MakeIntResourceA = PAnsiChar;
MakeIntResource = MakeIntResourceA;
PLogFontA = ^TLogFontA;
PLogFontW = ^TLogFontW;
@ -1333,6 +1370,13 @@ type
LOGBRUSH = tagLOGBRUSH;
PMaxLogPalette = ^TMaxLogPalette; // not in Windows Headers
TMaxLogPalette = packed record
palVersion: Word;
palNumEntries: Word;
palPalEntry: array [Byte] of TPaletteEntry;
end;
type
PEnumLogFontA = ^TEnumLogFontA;
PEnumLogFontW = ^TEnumLogFontW;
@ -1462,7 +1506,7 @@ type
PWndClassExA = ^TWndClassExA;
PWndClassExA = ^TWndClassExA;
PWndClassExW = ^TWndClassExW;
PWndClassEx = PWndClassExA;
@ -1542,9 +1586,7 @@ type
WNDCLASSW = tagWNDCLASSW;
WNDCLASS = WNDCLASSA;
type
PMsg = ^TMsg;
tagMSG = packed record
hwnd: HWND;
@ -1638,12 +1680,26 @@ const
type
TShortCut = Low(Word)..High(Word); {should be moved to classes}
function hiword(i: integer): word;
function loword(i: integer): word;
Function Char2VK(C : Char) : Word;
function MapIrregularVirtualKey(vk: word): word;
function MulDiv(nNumber, nNumerator, nDenominator: Integer): Integer;
implementation
function hiword(i: integer): word;
begin
Result:=Hi(i);
end;
function loword(i: integer): word;
begin
Result:=Lo(i);
end;
Function Char2VK(C : Char) : Word;
begin
Case C of
@ -1675,11 +1731,19 @@ begin
end;
end;
function MulDiv(nNumber, nNumerator, nDenominator: Integer): Integer;
begin
Result:=(int64(nNumber)*int64(nNumerator)) div nDenominator;
end;
end.
{
$Log$
Revision 1.28 2002/12/12 17:47:45 mattias
new constants for compatibility
Revision 1.27 2002/12/05 22:16:28 mattias
double byte char font started

View File

@ -424,6 +424,7 @@ type
FEchoMode : TEchoMode;
FMaxLength : Integer;
FModified : Boolean;
FPasswordChar: Char;
FReadOnly : Boolean;
FOnChange : TNotifyEvent;
FSelLength : integer;
@ -432,6 +433,7 @@ type
procedure SetCharCase(Value : TEditCharCase);
procedure SetMaxLength(Value : Integer);
procedure SetModified(Value : Boolean);
procedure SetPasswordChar(const AValue: Char);
procedure SetReadOnly(Value : Boolean);
Protected
Procedure DoAutoSize; Override;
@ -460,6 +462,7 @@ type
property SelStart: integer read GetSelStart write SetSelStart;
property SelText: String read GetSelText write SetSelText;
property Modified : Boolean read GetModified write SetModified;
property PasswordChar: Char read FPasswordChar write SetPasswordChar default #0;
property Text;
published
property PopupMenu;
@ -514,6 +517,7 @@ type
property OnKeyPress;
Property OnKeyDown;
Property OnKeyUp;
property PasswordChar;
end;
@ -1382,6 +1386,9 @@ end.
{ =============================================================================
$Log$
Revision 1.69 2002/12/12 17:47:45 mattias
new constants for compatibility
Revision 1.68 2002/11/27 14:37:37 mattias
added form editor options for rubberband and colors