fixed a few fpc 2.1.1 incompatibilities

git-svn-id: trunk@9716 -
This commit is contained in:
mattias 2006-08-11 12:38:00 +00:00
parent 08e038ba3c
commit 7bb113cec8
21 changed files with 74 additions and 45 deletions

View File

@ -144,15 +144,6 @@ type
LastErrorBehindIgnorePosition: boolean;
LastErrorCheckedForIgnored: boolean;
CurrentPhase: integer;
procedure RaiseExceptionInstance(TheException: ECodeToolError); virtual;
procedure RaiseExceptionClass(const AMessage: string;
ExceptionClass: ECodeToolErrors); virtual;
procedure RaiseException(const AMessage: string); virtual;
procedure RaiseExceptionFmt(const AMessage: string;
const args : array of const);
procedure SaveRaiseException(const AMessage: string); virtual;
procedure SaveRaiseExceptionFmt(const AMessage: string;
const args : array of const);
procedure ClearLastError;
procedure RaiseLastError;
procedure DoProgress;
@ -288,6 +279,15 @@ type
read FOnSetGlobalWriteLock write FOnSetGlobalWriteLock;
// error handling
procedure RaiseExceptionInstance(TheException: ECodeToolError); virtual;
procedure RaiseExceptionClass(const AMessage: string;
ExceptionClass: ECodeToolErrors); virtual;
procedure RaiseException(const AMessage: string); virtual;
procedure RaiseExceptionFmt(const AMessage: string;
const args : array of const);
procedure SaveRaiseException(const AMessage: string); virtual;
procedure SaveRaiseExceptionFmt(const AMessage: string;
const args : array of const);
property IgnoreErrorAfter: TCodePosition
read FIgnoreErrorAfter write SetIgnoreErrorAfter;
procedure ClearIgnoreErrorAfter;

View File

@ -591,7 +591,6 @@ type
BinaryOperator: TAtomPosition;
Params: TFindDeclarationParams): TExpressionType;
function GetParameterNode(Node: TCodeTreeNode): TCodeTreeNode;
function GetFirstParameterNode(Node: TCodeTreeNode): TCodeTreeNode;
function GetExpressionTypeOfTypeIdentifier(
Params: TFindDeclarationParams): TExpressionType;
function FindTermTypeAsString(TermAtom: TAtomPosition;
@ -605,11 +604,8 @@ type
ContextNode: TCodeTreeNode; Params: TFindDeclarationParams): boolean;
function FindContextNodeAtCursor(
Params: TFindDeclarationParams): TFindContext;
function FindIdentifierInContext(Params: TFindDeclarationParams): boolean;
function FindClassOfMethod(ProcNode: TCodeTreeNode;
Params: TFindDeclarationParams; FindClassContext: boolean): boolean;
function FindAncestorOfClass(ClassNode: TCodeTreeNode;
Params: TFindDeclarationParams; FindClassContext: boolean): boolean;
function FindForwardIdentifier(Params: TFindDeclarationParams;
var IsForward: boolean): boolean;
function FindExpressionResultType(Params: TFindDeclarationParams;
@ -631,11 +627,6 @@ type
SourceExprParamList: TExprTypeList; IgnoreMissingParameters: boolean;
Params: TFindDeclarationParams;
CompatibilityList: TTypeCompatibilityList): TTypeCompatibility;
function IsParamNodeListCompatibleToExprList(
TargetExprParamList: TExprTypeList;
FirstSourceParameterNode: TCodeTreeNode;
Params: TFindDeclarationParams;
CompatibilityList: TTypeCompatibilityList): TTypeCompatibility;
function IsParamNodeListCompatibleToParamNodeList(FirstTargetParameterNode,
FirstSourceParameterNode: TCodeTreeNode;
Params: TFindDeclarationParams;
@ -657,8 +648,6 @@ type
function CheckParameterSyntax(CursorNode: TCodeTreeNode;
CleanCursorPos: integer; out ParameterAtom, ProcNameAtom: TAtomPosition;
out ParameterIndex: integer): boolean;
function FindNthParameterNode(Node: TCodeTreeNode;
ParameterIndex: integer): TCodeTreeNode;
protected
function OpenCodeToolForUnit(UnitNameAtom, UnitInFileAtom: TAtomPosition;
ExceptionOnNotFound: boolean): TFindDeclarationTool;
@ -714,6 +703,18 @@ type
function CleanPosIsDeclarationIdentifier(CleanPos: integer;
Node: TCodeTreeNode): boolean;
function FindIdentifierInContext(Params: TFindDeclarationParams): boolean;
function FindAncestorOfClass(ClassNode: TCodeTreeNode;
Params: TFindDeclarationParams; FindClassContext: boolean): boolean;
function FindNthParameterNode(Node: TCodeTreeNode;
ParameterIndex: integer): TCodeTreeNode;
function GetFirstParameterNode(Node: TCodeTreeNode): TCodeTreeNode;
function IsParamNodeListCompatibleToExprList(
TargetExprParamList: TExprTypeList;
FirstSourceParameterNode: TCodeTreeNode;
Params: TFindDeclarationParams;
CompatibilityList: TTypeCompatibilityList): TTypeCompatibility;
function JumpToNode(ANode: TCodeTreeNode;
var NewPos: TCodeXYPosition; var NewTopLine: integer;
IgnoreJumpCentered: boolean): boolean;

View File

@ -673,12 +673,12 @@ type
function CheckCount: Boolean; virtual;
procedure Clear;
function CreateStackEntry(const AIndex: Integer): TCallStackEntry; virtual;
function GetStackEntry(const AIndex: Integer): TCallStackEntry; virtual;
procedure SetCount(const ACount: Integer); virtual;
public
function Count: Integer;
constructor Create;
destructor Destroy; override;
function GetStackEntry(const AIndex: Integer): TCallStackEntry; virtual;
property Entries[const AIndex: Integer]: TCallStackEntry read GetEntry;
end;

View File

@ -503,7 +503,7 @@ begin
end;
end;
MenuItem^.CaptionLabel.Text:=MenuItem^.Caption;
MenuItem^.CaptionLabel.Caption:=MenuItem^.Caption;
if (MenuItem^.NextItem <> nil) then Draw(MenuItem^.NextItem, FormPanel, SubMenuPanel);
with MenuItem^.SelfPanel do

View File

@ -68,20 +68,23 @@ begin
TSetDesigningComponent.SetDesigningOfComponent(AComponent,true);
end;
{$IFOPT R+}{$DEFINE RangeCheckOn}{$ENDIF}
class procedure TSetDesigningComponent.SetDesigningOfComponent(
AComponent: TComponent; Value: Boolean);
begin
AComponent.SetDesigning(Value);
TSetDesigningComponent(AComponent).SetDesigning(Value);
end;
{ TPersistentWithTemplates }
{$IFOPT S+}{$DEFINE StackCheckOn}{$ENDIF}
{$R-}
{$S-}
procedure TPersistentWithTemplates.DoNothing;
// this is the template procedure for all events of the designed components
begin
// !!! do not write any code in here !!!
end;
{$IFDEF RangeCheckOn}{$R+}{$ENDIF}
{$IFDEF StackCheckOn}{$S+}{$ENDIF}
end.

View File

@ -2035,7 +2035,10 @@ end;
procedure TDefinePropertiesPersistent.PublicDefineProperties(Filer: TFiler);
begin
debugln('TDefinePropertiesPersistent.PublicDefineProperties START ',ClassName,' ',dbgsName(FTarget));
Target.DefineProperties(Filer);
{$IFOPT R+}{$DEFINE RangeCheckOn}{$ENDIF}
{$R-}
TDefinePropertiesPersistent(Target).DefineProperties(Filer);
{$IFDEF RangeCheckOn}{$R+}{$ENDIF}
debugln('TDefinePropertiesPersistent.PublicDefineProperties END ',ClassName,' ',dbgsName(FTarget));
end;

View File

@ -415,14 +415,14 @@ function TManagedLocals.GetName(const AnIndex: Integer): String;
begin
if Master = nil
then Result := inherited GetName(AnIndex)
else Result := Master.GetName(AnIndex);
else Result := Master.Names[AnIndex];
end;
function TManagedLocals.GetValue(const AnIndex: Integer): String;
begin
if Master = nil
then Result := inherited GetValue(AnIndex)
else Result := Master.GetValue(AnIndex);
else Result := Master.Values[AnIndex];
end;
function TManagedLocals.Count: Integer;
@ -449,14 +449,14 @@ function TManagedWatch.GetValid: TValidState;
begin
if FMaster = nil
then Result := inherited GetValid
else Result := FMaster.GetValid;
else Result := FMaster.Valid;
end;
function TManagedWatch.GetValue: String;
begin
if FMaster = nil
then Result := inherited GetValue
else Result := FMaster.GetValue;
else Result := FMaster.Value;
end;
procedure TManagedWatch.SetEnabled(const AValue: Boolean);

View File

@ -467,7 +467,7 @@ begin
// split description into lines
LabelsAsText.Text:=FFileDescs[ListIndex];
for i:=0 to LabelListCount(ListIndex)-1 do begin
GetLabel(ListIndex,i).Text:=LabelsAsText[i];
GetLabel(ListIndex,i).Caption:=LabelsAsText[i];
end;
end;
LabelsAsText.Free;

View File

@ -758,7 +758,7 @@ begin
CheckAndWriteNode('short', ShortEdit.Text, SHORT);
CheckAndWriteNode('descr', DescrMemo.Text, DESCR);
CheckAndWriteNode('errors', ErrorsMemo.Text, ERRORS);
CheckAndWriteNode('seealso', LinkListBox.Text, SEEALSO);
CheckAndWriteNode('seealso', LinkListBox.Caption, SEEALSO);
CheckAndWriteExampleNode(ExampleEdit.Text);
end;
Node := Node.NextSibling;
@ -776,7 +776,7 @@ begin
ERRORS:
InsertNodeElement('errors', ErrorsMemo.Text);
SEEALSO:
InsertNodeElement('seealso', LinkListBox.Text);
InsertNodeElement('seealso', LinkListBox.Caption);
EXAMPLE:
InsertNodeElement('example', ExampleEdit.Text);
end;

View File

@ -66,9 +66,9 @@ begin
for I := 0 to Memo.Lines.Count - 1 do Inc(NumChars, Length(Memo.Lines[I]));
if Memo.Lines.Count = 1 then
StatusLabel.Text := Format(ois1LineDChars, [NumChars])
StatusLabel.Caption := Format(ois1LineDChars, [NumChars])
else
StatusLabel.Text := Format(oisDLinesDChars, [Memo.Lines.Count, NumChars]);
StatusLabel.Caption := Format(oisDLinesDChars, [Memo.Lines.Count, NumChars]);
end;
procedure TStringsPropEditorFrm.SortButtonClick(Sender: TObject);

View File

@ -65,6 +65,7 @@ Type
property ShadowType: TShadowType read fShadowType write SetShadowType default stEtchedIn;
property Visible;
property OnClick;
property OnDblClick;
property OnMouseMove;
property OnMouseDown;
property OnMouseUp;

View File

@ -197,7 +197,6 @@ type
function GetCaptionOfKind(aKind: TBitBtnKind): String;
protected
procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); override;
procedure Click; override;
procedure GlyphChanged(Sender: TObject);
procedure InitializeWnd; override;
procedure TextChanged; override;
@ -205,6 +204,7 @@ type
public
constructor Create(TheOwner: TComponent); override;
destructor Destroy; Override;
procedure Click; override;
public
property Glyph: TBitmap read GetGlyph write SetGlyph stored IsGlyphStored;
property NumGlyphs: Integer read GetNumGlyphs write SetNumGlyphs default 1;
@ -330,6 +330,7 @@ type
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
function FindDownButton: TCustomSpeedButton;
procedure Click; override; // make Click public
public
property AllowAllUp: Boolean read FAllowAllUp write SetAllowAllUp default false;
property Down: Boolean read FDown write SetDown default false;

View File

@ -1273,6 +1273,7 @@ type
public
constructor Create(TheOwner: TComponent); override;
function CheckMenuDropdown: Boolean; dynamic;
procedure Click; override;
procedure GetCurrentIcon(var ImageList: TCustomImageList;
var TheIndex: integer); virtual;
property Index: Integer read GetIndex;

View File

@ -1519,7 +1519,6 @@ type
procedure CMDrag(var Message: TCMDrag); message CM_DRAG;
procedure CMShowingChanged(var Message: TLMessage); message CM_SHOWINGCHANGED;
procedure CMVisibleChanged(var TheMessage: TLMessage); message CM_VISIBLECHANGED;
function ContainsControl(Control: TControl): Boolean;
procedure ControlsAligned; virtual;
procedure DoSendBoundsToInterface; virtual;
procedure RealizeBounds; virtual;
@ -1598,11 +1597,9 @@ type
function DialogChar(var Message: TLMKey): boolean; override;
procedure ControlKeyDown(var Key: Word; Shift: TShiftState); dynamic;
procedure ControlKeyUp(var Key: Word; Shift: TShiftState); dynamic;
procedure KeyDown(var Key: Word; Shift: TShiftState); dynamic;
procedure KeyDownBeforeInterface(var Key: Word; Shift: TShiftState); dynamic;
procedure KeyDownAfterInterface(var Key: Word; Shift: TShiftState); dynamic;
procedure KeyPress(var Key: char); dynamic;
procedure KeyUp(var Key: Word; Shift: TShiftState); dynamic;
procedure KeyUpBeforeInterface(var Key: Word; Shift: TShiftState); dynamic;
procedure KeyUpAfterInterface(var Key: Word; Shift: TShiftState); dynamic;
procedure UTF8KeyPress(var UTF8Key: TUTF8Char); dynamic;
@ -1697,6 +1694,7 @@ type
AllowDisabled, AllowWinControls: Boolean): TControl;
Function ControlAtPos(const Pos: TPoint;
AllowDisabled, AllowWinControls, OnlyClientAreas: Boolean): TControl; virtual;
function ContainsControl(Control: TControl): Boolean;
procedure DoAdjustClientRectChange;
procedure InvalidateClientRectCache(WithChildControls: boolean);
function ClientRectNeedsInterfaceUpdate: boolean;
@ -1736,6 +1734,8 @@ type
procedure HandleNeeded;
function BrushCreated: Boolean;
procedure EraseBackground(DC: HDC); virtual;
procedure KeyDown(var Key: Word; Shift: TShiftState); dynamic;
procedure KeyUp(var Key: Word; Shift: TShiftState); dynamic;
function IntfUTF8KeyPress(var UTF8Key: TUTF8Char;
RepeatCount: integer; SystemKey: boolean): boolean; dynamic;
end;

View File

@ -426,7 +426,6 @@ type
protected
FFormBorderStyle: TFormBorderStyle;
FActionLists: TList;
function CloseQuery: boolean; virtual;
function FormUpdating: boolean;
procedure Activate; dynamic;
procedure ActiveChanged; dynamic;
@ -473,6 +472,7 @@ type
function GetIconHandle: HICON;
destructor Destroy; override;
procedure Close;
function CloseQuery: boolean; virtual;
procedure Release;
procedure Hide;
procedure Show;

View File

@ -518,6 +518,11 @@ begin
dec(FLockSelectionChange);
end;
procedure TCustomListBox.Click;
begin
inherited Click;
end;
{------------------------------------------------------------------------------
procedure TCustomListBox.MeasureItem(Index: Integer; var TheHeight: Integer);

View File

@ -241,8 +241,8 @@ begin
if (not (csDesigning in ComponentState)) and (FAssociate <> nil)
then begin
if Thousands
then FAssociate.Text := FloatToStrF(FPosition, ffNumber, 0, 0)
else FAssociate.Text := IntToStr(FPosition);
then FAssociate.Caption := FloatToStrF(FPosition, ffNumber, 0, 0)
else FAssociate.Caption := IntToStr(FPosition);
end;
end;
@ -409,7 +409,7 @@ var
InvalidNumber : Boolean;
begin
If Associate <> nil then begin
str := Trim(Associate.Text);
str := Trim(Associate.Caption);
InvalidNumber := str = '';
For I := Length(str) downto 1 do
if str[I] = ThousandSeparator then

View File

@ -101,6 +101,11 @@ begin
Result:=FindDown(GetFirstParentForm(Self));
end;
procedure TCustomSpeedButton.Click;
begin
inherited Click;
end;
{------------------------------------------------------------------------------
Method: TCustomSpeedButton.SetAllowAllUp
Params: Value:

View File

@ -177,18 +177,18 @@ end;
function TTabControlNoteBookStrings.GetObject(Index: Integer): TObject;
begin
Result:=FNoteBook.Pages.GetObject(Index);
Result:=FNoteBook.Pages.Objects[Index];
end;
procedure TTabControlNoteBookStrings.Put(Index: Integer; const S: string);
begin
FNoteBook.Pages.Put(Index, S);
FNoteBook.Pages[Index]:=S;
end;
procedure TTabControlNoteBookStrings.PutObject(Index: Integer; AObject: TObject
);
begin
FNoteBook.Pages.PutObject(Index, AObject);
FNoteBook.Pages.Objects[Index]:=AObject;
end;
procedure TTabControlNoteBookStrings.SetImages(const AValue: TCustomImageList);
@ -201,7 +201,10 @@ end;
procedure TTabControlNoteBookStrings.SetUpdateState(Updating: Boolean);
begin
FNoteBook.Pages.SetUpdateState(Updating);
if Updating then
FNoteBook.Pages.BeginUpdate
else
FNoteBook.Pages.EndUpdate;
end;
procedure TTabControlNoteBookStrings.SetTabHeight(const AValue: Smallint);

View File

@ -584,6 +584,11 @@ begin
Result:=FToolBar.CheckMenuDropdown(Self);
end;
procedure TToolButton.Click;
begin
inherited Click;
end;
procedure TToolButton.GetCurrentIcon(var ImageList: TCustomImageList;
var TheIndex: integer);
begin

View File

@ -483,6 +483,7 @@ type
procedure Clear; virtual;
procedure LockSelectionChange;
procedure UnlockSelectionChange;
procedure Click; override; // make it public
public
property Align;
property Anchors;