How to control TfrMemoView.Font.Style in script

Hello all,
I've got some problems when I try to control Font.Style in TfrMemoView component form script code (Pascal) in FR 2. I'll try to explain:
1. I have a doublepass report with nested dataset containing few data fields, one of them is integer field which I treat as a status field.
2. When the status field has been set to value of 0, some of the TfrMemoView components (linked to other data fields at the same nesting level - the same row) have to be rendered as in design state.
3. When the status field has been set to value of 1, they have to be rendered as in design state, but with striked out font style.
4. I have OnBeforePrint event handler for the band containing the controls I want to set up. The code looks like:
begin
  // mem1, mem2, mem3, mem4 are TfrMemoView controls
  if ([CDS___MyTable."Status"] > 0) then
  begin
    mem1.Font.Style := mem1.Font.Style + [fsStrikeout];
    mem2.Font.Style := mem2.Font.Style + [fsStrikeout];
    mem3.Font.Style := mem3.Font.Style + [fsStrikeout];
    mem4.Font.Style := mem4.Font.Style + [fsStrikeout];
  end
  else
  begin
    mem1.Font.Style := mem1.Font.Style - [fsStrikeout];
    mem2.Font.Style := mem2.Font.Style - [fsStrikeout];
    mem3.Font.Style := mem3.Font.Style - [fsStrikeout];
    mem4.Font.Style := mem4.Font.Style - [fsStrikeout];
  end
end

5. The result is every second row is striked out (and believe me - the data rows aren't filled with value of 1 in every second row ;) ).

In Pascal - when I exclude some value from a set - if the set includes this value, it is excluded, when the set does not contain excluded value - the set remains unchanged. What do I miss? Do the set operators behave in different way than in pure Pascal? I suppose they behave in different way, because it is not possible to assign an empty set (" [] ") to Font.Style property. There are no set operators also, so I think the sets are simulated in a way I don't understand.

Or maybe my approach is a total mistake?

I will appreciate any hints.
Thanks in advance,
mikk

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 11:53PM
    the style property is not actually a set but is the sum of integer constant values.
    fsnormal = 0
    to figure out what they are click on the fonts in object inspector then look at the styles dropdown their valu is that of their position in the box, with the first being 0,
    and IIRC inside we have to use syntax like mem1.font.fonstyle.

    ;)
  • edited 11:53PM
    wrote:
    ... the style property is not actually a set but is the sum of integer constant values ...
    Ok, I understand.
    wrote:
    ... and IIRC inside we have to use syntax like mem1.font.fonstyle ...
    Nope, it has to be just like above. There is no FontStyle property (I suppose "fonstyle" is a typo).

    Thank you anyway, I'll try to do some workarounds.
    Kind regards
    mikk
  • gordkgordk St.Catherines On. Canada.
    edited 11:53PM
    here is the values
    frConsts := 2;
    frConsts := 1;
    frConsts := 4;
    frConsts := 8;

    you can use this syntax

    if [Line#]>2 then memo9.font.style := 15 else memo9.font.style:= 0;
    0 = regular, 15 = all
    any other number is the resultant sum of the styles

    ;)

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.