Loading ...
Sorry, an error occurred while loading the content.

426Re: [cc2-dev-l] programmatically toggling new/old text metrics

Expand Messages
  • Mike Riddle
    Mar 25, 2002
    • 0 Attachment
      I've mostly been working on the V7 core code, so I've been out of date
      with CC2's V6 core.

      Turns out that V6 does cache the header infoblock only, as it is used in so
      many places. Use the following to get the correct image to change:

      header = (HDR*) GetHeaderAdr();


      Christopher Golden wrote:
      Mike Riddle wrote:

      Use DLGetIBAdr,NULL,IB_HDR to get a pointer to the header record.
      Use the Header.cpy definition of the header structure, (or _HEADER.H)
      set the TSpec.Flags TS_METRIC bit. You may need to make some .h
      file changes, as the assembler .cpy definitions are complete, while the
      .h files are only partially complete.

      This looks very promising. Following your instructions, I
      am able to read the value of header's TSpec.Flags variable,
      and write out to it as well.

      However, setting or resetting it seems to have no effect
      upon the checkbox in the TSPEC dialog. That is, if I have
      the checkbox checked, and then I run my command and tell it
      to reset the flag, it apparently does, but the state of the
      checkbox shows that the flag is still set when I subsequent-
      ly open the TSPEC dialog.

      This wouldn't bother me too much, except that the value of
      the flag that I've indicated is also not paid attention to
      by CC2 when new text entities are created. :-/

      It appears that the checkbox in the TSPEC dialog is some-
      how connected to a different variable than the TSpec.Flags
      variable of the header block, and furthermore, that CC2 is
      reading the value of the relevant bit in that variable, not
      the one in the header that I 'm setting/resetting, when it
      creates text.

      The relevant code from my TSPECNEWMETRICS command is in-
      cluded here:

      header = (HDR*) DLGetIBAdr(NULL, IB_HDR);
      header->TSpec.Flags &= ~TS_METRICS;
      header->TSpec.Flags |= flag;

      (Before this code, "flag" holds the value of either 0 or
      -32768, depending upon whether the command has been told
      to set or reset the new metrics bit.)

      So to sum up, it looks like CC2 is tracking the "use new
      metrics" flag in two different places -- the header block
      as you've shown me, and somewhere else -- and that the
      second one is the one CC2 links with the state of the
      checkbox in the TSPEC dialog, as well as the state of any
      text entities created.

      Is CC2 perhaps caching this value somewhere?

      Thanks again,
      Christopher Golden

      ------------------------ Yahoo! Gro ups Sponsor ---------------------~-->
      Buy Stock for $4.
      No Minimums.
      FREE Money 2002.

      To Post a message, send it to: cc2-dev-l@...
      To Unsubscribe, send a blank message to: cc2-dev-l-unsubscribe@...

      Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

    • Show all 9 messages in this topic