kooloveme / thtmlviewer

Automatically exported from code.google.com/p/thtmlviewer
Other
0 stars 0 forks source link

IDDisplay type confusion #191

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It's a little frustrating to see the Help file say one thing, only to discover 
that what it says is no longer relevant.  Someone needs to get the 
documentation updated for these components.  Example: the IDDisplay property is 
described in the help file thusly:

Declaration
property IDDisplay[const ID: string]: boolean;

And yet attempting to use the property as described will fail.  Why? Because 
the IDDisplay property is no longer a Boolean procedure.  Instead, it turns out 
IDDisplay is supposed to be assigned something called TPropDisplay, a type that 
is nowhere mentioned in the help file!  In searching all the source units, I 
came across the following:

type
  TPropDisplay = (
    pdUnassigned,
    pdBlock,
    pdInline,
    pdInlineBlock,
    pdListItem,
    pdRunIn,
    pdNone);
const
  CPropDisplay: array [TPropDisplay] of ThtString = (
    '',
    'block',
    'inline',
    'inline-block',
    'list-item',
    'run-in',
    'none');

But this code is cryptic, compared to the simple Boolean value that once was 
used.  I cannot make sense of the above type values, and there are no comments 
explaining what all these values represent.

So essentially we went from a documented, easy to understand procedure to one 
that is undocumented and uncommented.

Can someone explain what the IDDisplay now does compared to what it used to do, 
back when PBear was supporting the code?

Original issue reported on code.google.com by xyz.123....@gmail.com on 10 Sep 2012 at 4:11

GoogleCodeExporter commented 9 years ago
Hi xyz,

the former false corresponds to pdNone. 
The former true any value other than pdNone.

The enumeration reflects the CSS property Display more precisely.

OrphanCat

Original comment by OrphanCat on 12 Sep 2012 at 9:42