I've wrote a "grid" gadget designed to replace the table control. The
gadget is flicker-free since it draws into an offscreen buffer first. It
supports multiple types of cell including a boolean type implemented using
a checkbox control. 

My problem is that I want to use CtlDrawControl() to draw the checkbox in
a way that will work between PalmOS 2.0 to 3.5. Currently, I have a
checkbox in my form that is set to "nonusable". And then when I need to
draw, I do (treat as pseudo-code): 

  winH = WinGetDrawWindow();
  WinSetDrawWindow(offscreen_win);

  CtlSetUsable(ctl, true);
  CtlSetEnable(ctl, true);
  FrmSetObjectBounds(form, ctlID, &offscreen_rect);
  CtlSetValue(ctl, value);

  CtlDrawControl(ctl);

  CtlSetUsable(ctl, false);
  CtlSetEnable(ctl, false);

  WinSetDrawWindow(winH);

The method seems to work on 2.0 and 3.1 debug ROMSs but I want to know if
any problems might arise on future versions of PalmOS? 

I didn't just allocate a ControlType structure since I assume these will
change in size between versions of PalmOS. Plus fiddling with structure
internals would be bad. (It would be nice to have a CtlAllocControl() that
would create a control w/o the need to insert it into a form.) 

I'm only on the digest of this list so please include me in reply headers. 

Source code is available but it is GPL'ed so I didn't attach it so no one
gets tainted unless they want to.

Tom


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to