Forum > LCL

TControl and TGraphic Control creation issue

(1/7) > >>

jcdammeyer:
I ported a Delphi component over to Lazarus.  Ran fine on Windows.  But has issues on both the Pi and the Beaglebone.  That was many months ago and it's only this weekend that I've had a chance to try and chase down the issue.
I've added some screen shots to demonstrate what Lazarus is seeing.
The creation of the component and assignment with the value of 40 to the width which part of the TControl object.
Hovering with the cursor over the Width shows how/where it's been declared on the PC.
Notice the property is the same on the Beagle.
But run the program with a break point and suddenly the Width component is gone.   Since I'm limited to 4 JPGs I can add the one showing the PC does not have this problem on a follow up posting.

jcdammeyer:
So the question is why on the Beagle and the Pi is the Width parameter not initialized (random value) and marked as unknown while on the PC it has the value assigned in the create constructor.

The end result is that on the Pi or the Beagle the display the first digit is incorrect and in the wrong position and the other 3 are blank.  The calculation
  W := Width / 20;
  H := Height / 38;

sets W and H effectively to 0.  (a very small float number).

Don't know where to look next since the edit shows the correct linkage while the run time debug does not but only on the Beagle or Pi.  Not a PC.


jamie:
You have different screen resolutions,  you need a scaler divider that is calculated via your screen X,Y resolution and not use fixed values..

jcdammeyer:

--- Quote from: jamie on April 25, 2021, 02:21:27 pm ---You have different screen resolutions,  you need a scaler divider that is calculated via your screen X,Y resolution and not use fixed values..

--- End quote ---

If the components were oddly shaped I could see that but the PC with 1080 and the Pi with 1080 have the same resolution.  The Beagle is stretched so circles aren't round but in either case the value of Width passed to TdsSevenSegmentDisplay.DrawSegment(s:Byte) should not be 0 since the value 40 was assigned to it inside the create constructor.

When I put a break point inside that constructor TdsSevenSegmentDisplay.Create(AOwner : TComponent) and look at Width it does indeed have 40 in it.

So why later when DrawSegment is called does it no longer have a value?  Lazarus under Windows does not have that issue so there's something different in the ARM family.  But what?

jamie:
maybe bad compiler..

 There has been recent corrections made with the compiler for arm but I think you need to get the most recent truck for that and of course you will need to rebuild all of the LCL code etc with that compiler..

Navigation

[0] Message Index

[#] Next page

Go to full version