Le 03/05/2021 à 13:55, James Richters via fpc-pascal a écrit :
>Defining it in public in TText_to_PDF is a good idea.
I tried putting it under the destructor in public… above the private
variables, but it wouldn’t compile thereI thought it would have to be
above all the functions and procedures… and there is no Var for
variables and there are two public and two private definitions, I
don’t really understand what’s going on…Can I just mix up variables
with functions and procedures since there is no Var declaration?Or is
there an order that must be followed?
Yes, the destructor is a special procedure, so it doesn't work. (it's
the same for constructor which is a special function).
You can put any number of public/private /protected sections.
Usually for each specific aspect of my class, I add:
- at first level a comment with the aspect.
- Then right below a "private" section for the internal stuff of the
aspect, not useful from outside the class
- eventually a "protected" section ( like private but can be accessed
from child classes)
- a "public" section for stuff useful from outside the class.
- you can have a "published" section, kind of "super public", mainly for
components in the ide palette , rtti, and when you need to discover
properties of an object at run time.
(this works for classes defined with "class end", for old style, kind
of record with methods defined with "object end", "published" doesn't work).
>(Sorry, I've renamed a lot of things)
Thanks, I’m still trying to pick up the naming conventions.For some
reason all my form changes got reset.I merged them back in and pushed
it.I made the background of the information boxes white, not invisible
that’s why I set them to ‘‘ at the beginning.. so the white boxes
would be visible.I also padded the text in the boxes with spaces so
the white background would make a border around the text.I also
re-arranged a lot of things, added horizontal scroll bars and shut off
word wrap on the results panel.. removed extra buttons we don’t need
now with the menu, etc..Let me know what you think of my form design.
It's nice. I keep my original design mainly because my "main"screen on
linux has a lower resolution.
Any idea how I change the format of M.Text=’[Date]’; in
uText_To_PDF.pas ?It shows up 2021-05-03(Which I actually like better
because it sorts properly)but here in the USA 05-03-2021 is
customary.I don’t see where [Date] gets filled in with the date or how
to define the format of it.I think I could make my own date format,
but I don’t want to over-complicate things.
'[Date]' is decoded in unit fpreport TFPReportCustomMemo.ParseText; and
expanded in TFPReportCustomMemo.ExpandExpressions; using method
TFPReportElement.ExpressionResultToString wich uses virtual function
TFPReportElement.GetDateTimeFormat for getting the datetime format.
You just need to declare a subclass of TFPReportMemo which overrides
GetDateTimeFormat. I 've adde a "TfprmText_to_PDF = class(
TFPReportMemo)" in uText_to_PDF for this.
In the unit test I've added a generation of a 10000 lines inifile for
testing. This lead me to change some things to improve the loading speed.
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal