From ad71ccb493e7842ab5ae0764837fc2f9e9ac71c9 Mon Sep 17 00:00:00 2001 From: alexs75 Date: Thu, 14 Jan 2010 18:51:51 +0000 Subject: [PATCH] fix compile rxMemDataset for 86-x64 git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1126 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/rx/rxdbgrid.pas | 12 +++++++++--- components/rx/rxdbtimeedit.pas | 7 +++++-- components/rx/rxfileutils.pas | 4 ++-- components/rx/rxmemds.pas | 2 +- components/rx/vclutils.pas | 14 ++++++++++---- 5 files changed, 27 insertions(+), 12 deletions(-) diff --git a/components/rx/rxdbgrid.pas b/components/rx/rxdbgrid.pas index 39dbbd0ba..92b06ea99 100644 --- a/components/rx/rxdbgrid.pas +++ b/components/rx/rxdbgrid.pas @@ -1168,16 +1168,22 @@ end; procedure TRxDBGrid.OutCaptionCellText90(aCol,aRow: Integer;const aRect: TRect; aState: TGridDrawState;const ACaption:string; const TextOrient:TTextOrientation); var - dW:integer; + dW, dY:integer; begin Canvas.FillRect(aRect); DrawCellGrid(aCol,aRow,aRect,aState); if TextOrient in [toVertical90, toVertical270] then - dW:=((aRect.Bottom - aRect.Top) - Canvas.TextWidth(ACaption)) div 2 + begin + dW:=((aRect.Bottom - aRect.Top) - Canvas.TextWidth(ACaption)) div 2; + dY:=((aRect.Right - aRect.Left) - Canvas.TextHeight(ACaption)) div 2; + end else + begin dW:=0; - OutTextXY90(Canvas, aRect.Left, aRect.Top+dw, ACaption, TextOrient); + dY:=0; + end; + OutTextXY90(Canvas, aRect.Left + dY, aRect.Top+dw, ACaption, TextOrient); end; procedure TRxDBGrid.OutCaptionSortMarker(const aRect: TRect; diff --git a/components/rx/rxdbtimeedit.pas b/components/rx/rxdbtimeedit.pas index b6a5dcfa4..0e8eb0bf6 100644 --- a/components/rx/rxdbtimeedit.pas +++ b/components/rx/rxdbtimeedit.pas @@ -240,8 +240,11 @@ end; procedure TCustomRxDBTimeEdit.Change; begin - FDatalink.Edit; - FDataLink.Modified; + if Assigned(FDatalink) then + begin + FDatalink.Edit; + FDataLink.Modified; + end; inherited Change; end; diff --git a/components/rx/rxfileutils.pas b/components/rx/rxfileutils.pas index aea54e12a..fb09b865d 100644 --- a/components/rx/rxfileutils.pas +++ b/components/rx/rxfileutils.pas @@ -107,7 +107,7 @@ var S:string; begin {$IFDEF WINDOWS} - GetFileNameOwner(SearchDomain, FileName, Result, S); + GetFileNameOwner(UTF8ToSys(SearchDomain), UTF8ToSys(FileName), Result, S); Result:=UTF8Encode(Result); {$ELSE} Result:=''; @@ -118,7 +118,7 @@ procedure GetFileOwnerData(const SearchDomain, FileName: String; out UserName, DomainName: string); begin {$IFDEF WINDOWS} - GetFileNameOwner(SearchDomain, FileName, UserName, DomainName); + GetFileNameOwner(UTF8ToSys(SearchDomain), UTF8ToSys(FileName), UserName, DomainName); UserName:=UTF8Encode(UserName); DomainName:=UTF8Encode(DomainName); {$ELSE} diff --git a/components/rx/rxmemds.pas b/components/rx/rxmemds.pas index d9b9ddbc0..6ec20e7dc 100644 --- a/components/rx/rxmemds.pas +++ b/components/rx/rxmemds.pas @@ -558,7 +558,7 @@ begin {.$ELSE} (FieldDefs[Index].DataType in ftSupported - ftBlobTypes) then {.$ENDIF} - Result := Pointer(Integer(PChar(Buffer)) + FOffsets^[Index]) + Result := Pointer(PtrInt(PChar(Buffer)) + FOffsets^[Index]) else Result := nil; end; diff --git a/components/rx/vclutils.pas b/components/rx/vclutils.pas index e07f83c94..a36331c0d 100644 --- a/components/rx/vclutils.pas +++ b/components/rx/vclutils.pas @@ -186,11 +186,12 @@ end; procedure RotateLabel(Canvas: TCanvas; x, y: Integer; const St: String; RotDegree: Integer); var - OldFont, NewFont: HFONT; +{ OldFont, NewFont: HFONT; LogRec: TLOGFONT; - DC: HDC; + DC: HDC;} + L:integer; begin - with Canvas do +{ with Canvas do begin Brush.Style := bsClear; GetObject(Font.Handle, SizeOf(LogRec), @LogRec); @@ -202,7 +203,12 @@ begin end; OldFont := SelectObject(DC, NewFont); TextOut(DC, X, Y, @St[1], Length(St)); - DeleteObject(SelectObject(DC, OldFont)); + DeleteObject(SelectObject(DC, OldFont));} + + L:=Canvas.Font.Orientation; + Canvas.Font.Orientation:=RotDegree * 10; + Canvas.TextOut(X, Y, St); + Canvas.Font.Orientation:=L; end;