cocoa: fix compilation for fpc320rc1 headers. bug #36864

git-svn-id: trunk@62885 -
This commit is contained in:
dmitry 2020-04-05 03:47:06 +00:00
parent a43056f291
commit e1d1474d82
8 changed files with 21 additions and 11 deletions

View File

@ -74,7 +74,7 @@ type
procedure setEnabled_(aenabled: ObjCBool); message 'setEnabled:';
end;
{$if FPC_FULLVERSION < 30301}
{$if FPC_FULLVERSION < 30200}
NSAppearance = objcclass external(NSObject)
function name: NSString; message 'name';
class function currentAppearance: NSAppearance; message 'currentAppearance';
@ -299,6 +299,14 @@ const
NSTableViewAnimationSlideLeft = $30; // Animates a row in by sliding from the left. Animates a row out by sliding towards the left.
NSTableViewAnimationSlideRight = $40; // Animates a row in by sliding from the right. Animates a row out by sliding towards the right.
{$if FPC_FULLVERSION >= 30200}
// all of the sudden those are gone! in FPC 3.2.0rc
const
NSVariableStatusItemLength = -1;
NSSquareStatusItemLength = -2;
{$endif}
implementation
function NSNormalWindowLevel: NSInteger;

View File

@ -285,7 +285,7 @@ begin
Continue;
end;
aButton := anAlert.addButtonWithTitle(NSLocalizedString(NSSTR(ButtonCaption[Buttons[I]])));
aButton := anAlert.addButtonWithTitle(NSSTR(ButtonCaption[Buttons[I]]));
aButton.setKeyEquivalentModifierMask(0);
if I = DefaultIndex then

View File

@ -1549,7 +1549,7 @@ begin
mn := GetManTicks(self);
if mn.AddTick(atick) then
begin
if mn.draw then self.setNeedsDisplay;
if mn.draw then self.setNeedsDisplay_(true);
end;
end;
@ -1560,7 +1560,7 @@ begin
mn := GetManTicks(self);
if mn.draw=adraw then Exit;
mn.draw:=adraw;
self.setNeedsDisplay;
self.setNeedsDisplay_(true);
end;
procedure TCocoaSlider.lclExpectedKeys(var wantTabs, wantArrows, wantReturn,

View File

@ -50,7 +50,9 @@ type
procedure resetCursorRects; override;
function lclClientFrame: TRect; override;
function lclContentView: NSView; override;
procedure setDocumentView(aView: NSView); override;
procedure setDocumentView(aView:
{$if FPC_FULLVERSION < 30200}NSView{$else}id{$endif}
); override;
procedure scrollContentViewBoundsChanged(notify: NSNotification); message 'scrollContentViewBoundsChanged:';
procedure resetScrollRect; message 'resetScrollRect';
@ -646,7 +648,7 @@ begin
Result:=documentView;
end;
procedure TCocoaScrollView.setDocumentView(aView: NSView);
procedure TCocoaScrollView.setDocumentView(aView: {$if FPC_FULLVERSION < 30200}NSView{$else}id{$endif});
begin
inherited setDocumentView(aView);
resetScrollRect;

View File

@ -233,8 +233,8 @@ type
procedure setCheckAction(aSelector: SEL); message 'setCheckAction:';
procedure setTextAction(aSelector: SEL); message 'setTextAction:';
procedure resizeSubviewsWithOldSize(oldSize: NSSize); override;
procedure setIdentifier(identifier_: NSString); message 'setIdentifier:'; {$if FPC_FULLVERSION >= 30300}override;{$endif}
function identifier: NSString; message 'identifier'; {$if FPC_FULLVERSION >= 30300}override;{$endif}
procedure setIdentifier(identifier_: NSString); message 'setIdentifier:'; {$if FPC_FULLVERSION >= 30200}override;{$endif}
function identifier: NSString; message 'identifier'; {$if FPC_FULLVERSION >= 30200}override;{$endif}
function textFrame: NSRect; message 'textFrame';
procedure lclSetEnabled(AEnabled: Boolean); override;
end;

View File

@ -1041,7 +1041,7 @@ end;
procedure TCocoaWindowContentDocument.setNeedsDisplay_(aflag: LCLObjCBoolean);
begin
inherited setNeedsDisplay;
inherited setNeedsDisplay_(aflag);
if Assigned(overlay) then overlay.setNeedsDisplay_(aflag);
end;

View File

@ -2091,7 +2091,7 @@ begin
lSlider.setTickMarkPosition(NSTickMarkAbove)
else
lSlider.setTickMarkPosition(NSTickMarkBelow);
lSlider.setNeedsDisplay;
lSlider.setNeedsDisplay_(true);
end;
{------------------------------------------------------------------------------

View File

@ -2270,7 +2270,7 @@ var
begin
view := GetListBox(ACustomListBox);
ListBoxSetStyle(view, TCustomListBox(ACustomListBox).Style);
view.setNeedsDisplay;
view.setNeedsDisplay_(true);
end;
class procedure TCocoaWSCustomListBox.SetTopIndex(const ACustomListBox: TCustomListBox; const NewTopIndex: integer);