Re: FormattedText.resize with parameter

  • From: Brendan Murphy <bmurphy@xxxxxxxxxxxxxxxxxxxxx>
  • To: ftcdev@xxxxxxxxxxxxx
  • Date: Mon, 9 Mar 2009 18:24:46 -0500

Peter Karlsson wrote:
> I was in normal mode, faking edit mode by setting true in
> setNormalViewMode, because I couldn't find a setter for edit mode,  
> just
> page and normal. I realize now this was what made the margins revert  
> to
> default, I just want to keep the left margin in all modes.


To set it for edit mode you call...

setNormalViewMode(0.06)

This sets the all the margins to 0.06 inches.

What you want is specialized in that you want one margin (the left
one) to be something different than 0.06 inches and still maintain
the edit mode behavior. To do that, you will need to override the
FormattedText.resize method and comment out the setLeftMargin
call.

...
if isEditViewMode then

   ' Get the normal view margin.
   margin = doc.getNormalViewMargin

   ' Set the margins.
   doc.setPageWidth(display.Width / doc.getResolution)
   doc.setTopMargin(margin)
   doc.setBottomMargin(margin)
   // doc.setLeftMargin(margin) <-- Comment this out.
   doc.setRightMargin(margin)

   ' Update the display.
   updateFull

else
...

In the next beta I will make this easier for you and you won't
have to override the method. I'll add a setEditViewMode method(s)
to allow you to accomplish what you want.

FTC Website: http://www.truenorthsoftware.com/formattedtextcontrol
Set List Options (digest and vacation modes): www.freelists.org/list/ftcdev
List Archive: www.freelists.org/archives/ftcdev
Unsubscribe: Send email to ftcdev-request@xxxxxxxxxxxxx with "unsubscribe" in 
the subject field.



Other related posts: