Version 0.1.4: Workaround for recent Lazarus LCL changes that broke Orpheus compilation.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@152 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
macpgmr
2007-04-26 12:59:21 +00:00
parent 0709a41813
commit 74c0b234d6
5 changed files with 18 additions and 140 deletions

View File

@ -33,6 +33,11 @@
<A name="Whats_New"></A><H3>What's New</H3>
<UL>
<LI>20070425 release (0.1.4):
<UL>
<LI>Recent changes to Lazarus LCL broke compilation of Orpheus. This
release can now be compiled with the latest LCL.<P>
</UL>
<LI>20070401 release (0.1.3):
<UL>
<LI>Improvements to TO32FlexEdit on Windows.<P>
@ -633,7 +638,7 @@ OS X tips for Lazarus:<P>
<P>
<HR>
Last updated: April 7, 2007
Last updated: April 25, 2007
<P>
</BODY>

View File

@ -45,7 +45,7 @@ uses
{$IFNDEF LCL} Windows, Messages, {$ELSE} LclIntf, LMessages, Types, LclType, MyMisc, {$ENDIF}
Classes, Controls, Forms, SysUtils, StdCtrls, Buttons,
OvcData, O32Editf, OvcEF, Graphics, O32SR, O32bordr, O32Vldtr,
O32VlOp1, o32ovldr, o32pvldr, o32rxvld, Dialogs;
O32VlOp1, o32ovldr, {$IFNDEF LCL} o32pvldr, {$ENDIF} o32rxvld, Dialogs;
type
{Forward Declaration}

View File

@ -87,142 +87,15 @@ uses
{$IFNDEF LCL} Mask, {$IFDEF VERSION6} MaskUtils, {$ENDIF} {$ELSE} MaskEdit, {$ENDIF}
SysUtils, O32VlReg;
// Note commented out IFNDEF in order to use these functions with LCL.
// This means this unit can't be compiled by Delphi 5 and earlier.
//{$IFNDEF VERSION6}
{ These are declared in the implementation section of the VCL unit Mask.pas, }
{ so I had to copy them here so that I could use it. Delphi 6 has made them }
{ available by moving them to MaskUtils.pas and making them globally }
{ available }
function MaskGetCharType(const EditMask: string;
MaskOffset: Integer): TMaskCharType;
var
MaskChar: Char;
begin
Result := mcLiteral;
MaskChar := #0;
if MaskOffset <= Length(EditMask) then
MaskChar := EditMask[MaskOffset];
if MaskOffset > Length(EditMask) then
Result := mcNone
else if ByteType(EditMask, MaskOffset) <> mbSingleByte then
Result := mcLiteral
else if (MaskOffset > 1) and (EditMask[MaskOffset - 1] = mDirLiteral) and
(ByteType(EditMask, MaskOffset - 1) = mbSingleByte) and
not ((MaskOffset > 2) and (EditMask[MaskOffset - 2] = mDirLiteral) and
(ByteType(EditMask, MaskOffset - 2) = mbSingleByte)) then
Result := mcLiteral
else if (MaskChar = MaskFieldSeparator) and
(Length(EditMask) >= 4) and
(MaskOffset > Length(EditMask) - 4) then
Result := mcFieldSeparator
else if (Length(EditMask) >= 4) and
(MaskOffset > (Length(EditMask) - 4)) and
(EditMask[MaskOffset - 1] = MaskFieldSeparator) and
not ((MaskOffset > 2) and (EditMask[MaskOffset - 2] = mDirLiteral) and
(ByteType(EditMask, MaskOffset - 2) <> mbTrailByte)) then
Result := mcField
else if MaskChar in [mMskTimeSeparator, mMskDateSeparator] then
Result := mcIntlLiteral
else if MaskChar in [mDirReverse, mDirUpperCase, mDirLowerCase,
mDirLiteral] then
Result := mcDirective
else if MaskChar in [mMskAlphaOpt, mMskAlphaNumOpt, mMskAsciiOpt,
mMskNumSymOpt, mMskNumericOpt] then
Result := mcMaskOpt
else if MaskChar in [mMskAlpha, mMskAlphaNum, mMskAscii, mMskNumeric] then
Result := mcMask;
end;
{=====}
function MaskOffsetToOffset(const EditMask: String; MaskOffset: Integer): Integer;
var
I: Integer;
CType: TMaskCharType;
begin
Result := 0;
for I := 1 to MaskOffset do
begin
CType := MaskGetCharType(EditMask, I);
if not (CType in [mcDirective, mcField, mcFieldSeparator]) then
Inc(Result);
end;
end;
{=====}
function OffsetToMaskOffset(const EditMask: string; Offset: Integer): Integer;
var
I: Integer;
Count: Integer;
MaxChars: Integer;
begin
MaxChars := MaskOffsetToOffset(EditMask, Length(EditMask));
if Offset > MaxChars then
begin
Result := -1;
Exit;
end;
Result := 0;
Count := Offset;
for I := 1 to Length(EditMask) do
begin
if not (mcDirective = MaskGetCharType(EditMask, I)) then begin
Dec(Count);
if Count < 0 then
Exit;
end;
Inc(Result);
end;
end;
{=====}
function MaskIntlLiteralToChar(IChar: Char): Char;
begin
Result := IChar;
case IChar of
mMskTimeSeparator: Result := TimeSeparator;
mMskDateSeparator: Result := DateSeparator;
end;
end;
{=====}
function MaskGetCurrentDirectives(const EditMask: string;
MaskOffset: Integer): TMaskDirectives;
var
I: Integer;
MaskChar: Char;
begin
Result := [];
for I := 1 to Length(EditMask) do
begin
MaskChar := EditMask[I];
if (MaskChar = mDirReverse) then
Include(Result, mdReverseDir)
else if (MaskChar = mDirUpperCase) and (I < MaskOffset) then
begin
Exclude(Result, mdLowerCase);
if not ((I > 1) and (EditMask[I-1] = mDirLowerCase)) then
Include(Result, mdUpperCase);
end
else if (MaskChar = mDirLowerCase) and (I < MaskOffset) then
begin
Exclude(Result, mdUpperCase);
Include(Result, mdLowerCase);
end;
end;
if MaskGetCharType(EditMask, MaskOffset) = mcLiteral then
Include(Result, mdLiteralChar);
end;
//{$ENDIF}
// In the original Orpheus, TurboPower had just copied the following
// functions from the VCL Mask unit in order to use them with Delphi 5
// and earlier: MaskGetCharType, MaskOffsetToOffset, OffsetToMaskOffset,
// MaskIntlLiteralToChar, and MaskGetCurrentDirectives.
// With Delphi 6, these functions are now in MaskUtils unit and in the
// interfaces section. However, these functions and the constants they
// reference are not currently available with the LCL, so for now the
// Paradox validator is not available for LCL.
{===== TO32ParadoxValidator ==========================================}

View File

@ -41,7 +41,7 @@ unit o32vpool;
interface
uses
OvcBase, Classes, Graphics, stdctrls, O32Vldtr, o32ovldr, o32pvldr, o32rxvld;
OvcBase, Classes, Graphics, stdctrls, O32Vldtr, o32ovldr, {$IFNDEF LCL} o32pvldr, {$ENDIF} o32rxvld;
type
TO32ValidatorPool = class;

View File

@ -31,7 +31,7 @@
"/>
<License Value="MPL 1.1
"/>
<Version Minor="1" Release="3"/>
<Version Minor="1" Release="4"/>
<Files Count="1">
<Item1>
<Filename Value="myovcreg.pas"/>