Commit b0b4d078 authored by Martin Schreiber's avatar Martin Schreiber

* Dephi compatibility.

parent 067633b1
......@@ -213,7 +213,7 @@ type
public
constructor create(const agrid: tcustomgrid;
const aowner: tgridarrayprop;
const acontroller: tcustomdropdownlistcontroller); virtual; reintroduce;
const acontroller: tcustomdropdownlistcontroller); reintroduce; virtual;
end;
dropdownfixcolclassty = class of tdropdownfixcol;
......
......@@ -1309,7 +1309,7 @@ begin
tdatalist1(fdata).readdata(reader);
end
else begin
reader.{$ifdef FPC}driver.{$endif}skipvalue;
reader.driver.skipvalue;
end;
reader.readlistend;
end;
......@@ -2110,7 +2110,8 @@ begin
end;
end;
end;
filer.defineproperty('colorder',@readorder,@writeorder,bo1);
filer.defineproperty('colorder',{$ifdef FPC}@{$endif}readorder,
{$ifdef FPC}@{$endif}writeorder,bo1);
inherited;
end;
......
......@@ -1216,20 +1216,25 @@ end;
{$endif}
procedure movealignment(const source: alignmentsty; var dest: alignmentsty);
(*
{$ifndef FPC}
const
mask1: alignmentsty = [al_intpol,al_or,al_and];
mask2: alignmentsty = [al_left,al_xcentered,al_right];
mask3: alignmentsty = [al_top,al_ycentered,al_bottom];
var
value1,value2,value3: alignmentsty;
*)
mask4: alignmentsty = [al_fit,al_tiled];
{$endif}
begin
dest:= alignmentsty(setsinglebit(longword(source),longword(dest),
[longword([al_intpol,al_or,al_and]),
longword([al_left,al_xcentered,al_right]),
longword([al_top,al_ycentered,al_bottom]),
longword([al_fit,al_tiled])]));
{$ifdef FPC}
dest:= alignmentsty(setsinglebit(
longword(source),longword(dest),
[longword([al_intpol,al_or,al_and]),
longword([al_left,al_xcentered,al_right]),
longword([al_top,al_ycentered,al_bottom]),
longword([al_fit,al_tiled])]));
{$else}
dest:= alignmentsty(setsinglebitar16(word(source),word(dest),
[word(mask1),word(mask2),word(mask3),word(mask4)]));
{$endif}
(*
value1:= alignmentsty(setsinglebit(
{$ifdef FPC}longword{$else}word{$endif}(source),
......@@ -3311,7 +3316,7 @@ end;
// painting
//
function ispaintcolor(acolor: colorty): boolean; inline;
function ispaintcolor(acolor: colorty): boolean; {$ifdef FPC}inline;{$endif}
begin
result:= (acolor <> cl_transparent) and (acolor <> cl_none);
end;
......
......@@ -107,10 +107,12 @@ function setsinglebit(const new,old: word;
function setsinglebit(const new,old: longword;
const mask: array of longword): longword; overload;
{$ifndef FPC}
function setsinglebitar8(const new,old: byte;
const mask: array of byte): byte;
function setsinglebitar16(const new,old: word;
const mask: array of word): word; overload;
const mask: array of word): word;
function setsinglebitar32(const new,old: longword;
const mask: array of longword): longword; overload;
const mask: array of longword): longword;
{$endif}
function checkbit(const value: byte; const bitnum: integer): boolean; overload;
......@@ -483,6 +485,16 @@ begin
end;
end;
{$ifndef FPC}
function setsinglebitar8(const new,old: byte;
const mask: array of byte): byte;
var
int1: integer;
begin
result:= new;
for int1:= 0 to high(mask) do begin
result:= setsinglebit(result,old,mask[int1]);
end;
end;
function setsinglebitar16(const new,old: word;
const mask: array of word): word;
var
......
......@@ -3716,7 +3716,7 @@ begin
ch1:= #$2400; //unicode null glyph
end;
if not stripcontrolchars or (ord(ch1) >= ord(' ')) or (ch1 = c_tab) then begin
(pmsechar(pointer(str1)+int3))^:= ch1;
(pmsechar(pointer(str1))+int3)^:= ch1;
inc(int3);
end;
end;
......
......@@ -853,7 +853,7 @@ end;
procedure tcustomrealdisp.valuechanged;
begin
if canevent(tmethod(fondatachange)) then begin
fondatachange(self,fvalue);
fondatachange(self,real(fvalue));
end;
inherited;
end;
......
......@@ -670,11 +670,7 @@ end;
procedure tformscrollbox.readdummy(reader: treader);
begin
{$ifdef FPC}
reader.driver.skipvalue;
{$else}
reader.skipvalue;
{$endif}
end;
procedure tformscrollbox.writedummy(writer: twriter);
......
......@@ -3894,8 +3894,8 @@ begin
// avalue:= avalue - deprecatedcoloptions1;
optionsbefore:= foptions1;
foptions1:= avalue;
opt1:= coloptions1ty({$ifdef FPC}longword{$else}byte{$endif}(optionsbefore) xor
{$ifdef FPC}longword{$else}byte{$endif}(foptions1));
opt1:= coloptions1ty({$ifdef FPC}longword{$else}word{$endif}(optionsbefore) xor
{$ifdef FPC}longword{$else}word{$endif}(foptions1));
if co1_autorowheight in opt1 then begin
if co1_autorowheight in foptions1 then begin
include(fstate,gps_needsrowheight);
......@@ -6981,14 +6981,14 @@ var
begin
foptionsfix:= avalue;
opt1:= coloptions1ty(
{$ifndef FPC}byte({$endif}
{$ifndef FPC}word({$endif}
replacebits(
longword(
{$ifndef FPC}byte({$endif}avalue{$ifndef FPC}){$endif})
shr longword(fixcoloptionsshift1),
longword(foptions),
longword(
{$ifndef FPC}byte({$endif}
{$ifndef FPC}word({$endif}
fixcoloptionsmask
{$ifndef FPC}){$endif}
)
......@@ -7351,15 +7351,15 @@ var
mask: {$ifdef FPC}longword{$else}byte{$endif};
begin
if foptions1 <> value then begin
mask:= {$ifdef FPC}longword{$else}byte{$endif}(value) xor
{$ifdef FPC}longword{$else}byte{$endif}(foptions1);
mask:= {$ifdef FPC}longword{$else}word{$endif}(value) xor
{$ifdef FPC}longword{$else}word{$endif}(foptions1);
foptions1:= Value;
if not (csloading in fgrid.componentstate) then begin
for int1:= 0 to count - 1 do begin
tcol(items[int1]).options1:= coloptions1ty(
replacebits(
{$ifdef FPC}longword{$else}byte{$endif}(value),
{$ifdef FPC}longword{$else}byte{$endif}(tcol(items[int1]).options1),
{$ifdef FPC}longword{$else}word{$endif}(value),
{$ifdef FPC}longword{$else}word{$endif}(tcol(items[int1]).options1),
mask));
end;
end;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment