I didn't get any answers to my previous question
("corrupted labels"), so I replaced the labels with
WinDrawChars/WinEraseChars as needed.  However, I
still have a problem showing/hiding other objects.

My form contains:
1. a form bitmap
2. a Gadget (bounds determine where to draw chars)
3. another Gadget (ditto)
4. a Button

I am using the code below to show or hide the bitmap
and the button.  On OS versions < 3.2 (I tested on
2.0, 3.0, 3.1 , 3.3, 3.5, and 4.0), the button gets
corrupted (a sloppy rectangle is displayed at the
wrong location and it doesn't respond to taps).  On OS
versions >= 3.3 it works as expected.

Does anyone have any suggestions?

---- code ----
#define kSysVersion32
sysMakeROMVersion(3,2,0,sysROMStageRelease,0)

static void SafeShowObject( FormPtr frmP, UInt16
objectIndex )
{
  static UInt32 romVer = 0;
  ControlType * cp;

  if ( !romVer )
    FtrGet( sysFtrCreator, sysFtrNumROMVersion,
&romVer );

  if ( romVer < kSysVersion32 )
  {
    cp = (ControlType *) FrmGetObjectPtr( frmP,
objectIndex );
    if ( cp )
      CtlSetUsable(cp, true);
  }
  FrmShowObject( frmP, objectIndex );
}

static void SafeHideObject( FormPtr frmP, UInt16
objectIndex )
{
  static UInt32 romVer = 0;
  ControlType * cp;

  if ( !romVer )
    FtrGet( sysFtrCreator, sysFtrNumROMVersion,
&romVer );

  if ( romVer < kSysVersion32 )
  {
    cp = (ControlType *) FrmGetObjectPtr( frmP,
objectIndex );
    if ( cp )
      CtlSetUsable(cp, false);
  }
  FrmHideObject(frmP, objectIndex);
}


__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to