Issue 75 in extpascal: FormsToExtPascal component mapping and z-order

42 views
Skip to first unread message

extp...@googlecode.com

unread,
Feb 24, 2014, 3:53:40 PM2/24/14
to extp...@googlegroups.com
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

extp...@googlecode.com

unread,
Feb 24, 2014, 4:03:36 PM2/24/14
to extp...@googlegroups.com

Comment #1 on issue 75 by jean.suz...@gmail.com: FormsToExtPascal component
Ooops, sorry I've forgotten to attach my test case.
Unit1 is the ancestor, and you get the problem in unit2

Attachments:
Project1.dpr 263 bytes
Unit1.dfm 1.2 KB
Unit1.pas 589 bytes
Unit2.dfm 269 bytes
Unit2.pas 337 bytes
Project1.cfg 434 bytes
Project1.dof 2.0 KB
Project1.res 876 bytes
Reply all
Reply to author
Forward
0 new messages