Status: New
Owner: ----
Labels: Type-Defect Priority-Medium OpSys-All
New issue 75 by
jean.suz...@gmail.com: FormsToExtPascal component mapping
and z-order
http://code.google.com/p/extpascal/issues/detail?id=75
Hello,
We are testing ExtPascal for use with our Delphi code.
There is a small problem when a form inherits from another form and the
original z-order between components has been changed, using the bring to
front/send to back functionnalities of the form popup menu in delpĥi.
Delphi 7 stores the z-order between square brackets after the classname,
and it breaks the mapping in FormsToExtPascal.
If you have the folowing in a DFM :
inherited Label1: TLabel [0]
end
inherited Label2: TLabel [1]
end
inherited Label3: TLabel [2]
end
you get the folowing lines in the .inc file :
{TLabel [0] not mapped}
{TLabel [1] not mapped}
{TLabel [2] not mapped}
I have modified a few lines in Fm2Base.TFormConverterBase to fix this,
removing the z-order. I join the diff file for this.
Yours sincerely,
Jean SUZINEAU
================================================================
Index:
/home/jean/install/ExtPascal_svn/extpascal-read-only/ExtP_Toolkit/fmtoextp/fm2base.pas
===================================================================
---
/home/jean/install/ExtPascal_svn/extpascal-read-only/ExtP_Toolkit/fmtoextp/fm2base.pas
(révision 819)
+++
/home/jean/install/ExtPascal_svn/extpascal-read-only/ExtP_Toolkit/fmtoextp/fm2base.pas
(copie de travail)
@@ -272,10 +272,29 @@
end;
+function StrToK( Key: String; var S: String): String;
+var
+ I: Integer;
+begin
+ I:= Pos( Key, S);
+ if I = 0
+ then
+ begin
+ Result:= S;
+ S:= '';
+ end
+ else
+ begin
+ Result:= Copy( S, 1, I-1);
+ Delete( S, 1, (I-1)+Length( Key));
+ end;
+end;
+
function TFormConverterBase.GetClassName(const InStr : string) : string;
{Return class name from object declaration.}
begin
Result := Trim(Copy(InStr, Pos(':', InStr)+1, MaxInt));
+ Result:= Trim(StrToK( '[', Result));
end;
@@ -605,4 +624,4 @@
end;
-end.
+end.
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings