Yes I had the exact same thing happen to me and asked the same question in 
the list, but never got a reply.

My guess is that the field structure changes form OS to OS and it is not 
safe to directly modify it. The only thing that is safe to do is to use the 
API calls or to modify the field attribute structure via the 
FldGetAttributes and FldSetAttributes.

So you should do:


> > static void SetFieldEditable( Word wID, Boolean bEditable)
> > {
> >       FieldPtr        pField;
> >       FormPtr pForm = FrmGetActiveForm();
> >       Word            wIndex;
> >       FieldAttrType   attr;



> >       wIndex = FrmGetObjectIndex( pForm, wID);
> >       pField = FrmGetObjectPtr( pForm, wIndex);

         FldGetAttributes(pField , &attr);


> >       attr.editable = bEditable;
> >       if( bEditable)  attr.underlined = grayUnderline;
> >       else attr.underlined = noUnderline;

         FldSetAttributes(pField , &attr);


> > }

Chris

At 09:55 AM 12/6/1999 -0700, you wrote:
> > Sorry if this has been discussed already: the digests haven't been
> > delivered in awhile.
> >
> > I was tracing through my code and discovered something unusual.
> > Codewarrior was reporting that my FieldPtr attributes were changing in an
> > unexpected manner.
> >
> > static void SetFieldEditable( Word wID, Boolean bEditable)
> > {
> >       FieldPtr        pField;
> >       FormPtr pForm = FrmGetActiveForm();
> >       Word            wIndex;
> >
> >       wIndex = FrmGetObjectIndex( pForm, wID);
> >       pField = FrmGetObjectPtr( pForm, wIndex);
> >       pField->attr.editable = bEditable;
> >       if( bEditable)  pField->attr.underlined = grayUnderline;
> >       else pField->attr.underlined = noUnderline;
> > }
> >
> > This function should change the Editable and Underlined attributes of the
> > field.  Codewarrior was reporting that the assignment of a value to
> > Editable actually changed the value for HasScrollBar, and that the
> > assignment of a value to Underlined acually changed the value for
> > InsPtVisible.
> >
> > _Environment_
> > Codewarrior:  R6
> > PalmOS:       3.0
> > POSE:         3.0a3
> > HostOS:       NT4
> >

---
Christian Vandendorpe ([EMAIL PROTECTED])
http://www.zorglub.com

Reply via email to