#1 2011-09-26 10:24:08

Leander007
Member
From: Slovenia
Registered: 2011-04-29
Posts: 113

Proposition: Avoding "hardcoded" behavior for TGDIPages...

Hello Arnaud.

In my application I'm using TGDIPages for report generation and I noticed that some procedures have fixed behavior (they are not "obeying" custom settings; the work via SaveLayout -> RestoreSavedLayout).
I know that I can easily derive my own class from it and provide different behavior. But it would be more proper if this is done already at TGDIPages.

E.g. DrawTitle and DrawTextAcrossCols have fixed behavior.
DrawTitle has fixed rule for Font size and alignment (forcing left align) via TitleFlags.
DrawTextAcrossCols is (recently) forcing via PrintColumnHeaders no word wrapping (WordWrapLeftCols := false).

I think that these procedures should by default be customizable via global settings using save\restore layout and the fixed one (with fixed layout) should be renamed if really needed . If this is not an option, because of existing code, then at least there should be provided custom alternatives (e.g. TitleFlags should be writable property or procedures with custom suffix should be introduced -> DrawTitleCustom).

This is just proposition smile.


"Uncertainty in science: There no doubt exist natural laws, but once this fine reason of ours was corrupted, it corrupted everything.", Blaise Pascal

Offline

#2 2011-09-26 15:43:46

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,203
Website

Re: Proposition: Avoding "hardcoded" behavior for TGDIPages...

Nice proposal, indeed.

In fact, TGdiPages was a wrapper used for mainly one application.
I need a reporting feature at hand, creating reports from code, in a simple way.

We may had some "style" feature.
But keeping it KISS.

I'll think about that.
If you have some proposal of methods, don't hesitate to post them here!

Offline

Board footer

Powered by FluxBB