Forum > Packages and Libraries

New component - properties are integer instead of single

<< < (2/3) > >>

alpine:
TBLCDDisplay.Paint() --> Prepare() --> ApplyTheme() --> Invalidate (-->Paint)

Also in ApplyTheme you don't have begin/end block according to the indentation.

bobby100:
alpine, you are my hero - thank you very, very much!

That incomplete begin/end block is from trying to get this working - added code, didn't help - delete code etc. Somehow deleted more than needed there.
I wonder why the compiler didn't throw an error there...

alpine:
No problem.

What about the original problem with the properties. Is it resolved now?

bobby100:
Yes, it is.
I don't know what exactly helped. The biggest change was to move all the internal variables into a TPersistent class (the variables containing theme settings).
At some step, I saw that the variables are losing the values mid into applying the theme (a couple of values are applied OK, the rest was causing problems like division by zero). The debugger was complaining about not finding the values in memory (or something like that, I didn't take a note of the message). It seems like the variables are de-reffered somehow (pointers being null-ed?). That could be the exact problem of the properties in object inspector too - if the variables are not found in memory, the object inspector couldn't render it right. I came to thoughts that somehow my class instance gets exchanged by the raw class structure (no instance created).
It should not be the case. I am using TBComponentTheme as a palette component in Lazarus. After dropping such component on the form - the Create should be called by the form.
At the point with TBComponentTheme component dropped onto the form - the Object Inspector was already showing wrong values.
After assigning the TBComponentTheme to a LCDDisplay component - the IDE would not render completely, my form would not render completely etc.

So, the single significant change was moving the variables (theme-related) inside the TBComponentTheme into a separate TPersistent class (TThemeSet), create an instance of it in TBComponentTheme.Create, and work with the instance.

alpine:
I'm just speculating, but - is it possible that the total mess created by the paint loop to give you the impression that persistency is broken while it isn't? After all installing it into the IDE will broke it's loop too.
 Edit: Just loading the project, placing a breakpoint and pressing F9 a few times was enough to catch the loop by examining the stack window. I'm on Linux and there wasn't any big troubles (hang-ups or something) with the IDE. I suspect on Win it will behave differently because of the toolkit.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version