SysBattery...() then?

Maybe... You could always take a look at LJP, there's some code there to draw a nice battery indicator using OS drawing calls. Should be hard to find though, maybe I'll post it here later.

PS: could you not quote whole posts replying?

Sorry. It's just that I'm used to GMail hiding them automatically at my disposure :)

I'll try not to do it anymore, thanks for bringing it to my attention.

PS: here's the code for the bettery indicator... it's presumed to be called in low-density mode, although if called in high-density it will simply be smaller :P


RGBColorType fg;
UInt32 pluggedIn,percent,voltage; //get these values from SysBatteryInfo
RectangleType rect;   
int basex, basey; //set these to be the position where you want it to be drawn...

fg.r=240;fg.g=230;fg.b=190;

WinSetForeColorRGB(&fg,NULL);
WinSetDrawMode(winPaint);

rect.topLeft.x=basex+1;
rect.topLeft.y=basey+1;
rect.extent.x=15;
rect.extent.y=8;
WinPaintRectangle(&rect,0);

rect.topLeft.x=basex+16;
rect.topLeft.y=basey+3;
rect.extent.x=2;
rect.extent.y=4;
WinPaintRectangle(&rect,0);

fg.r=0;fg.g=0;fg.b=0;
WinSetForeColorRGB(&fg,NULL);

rect.topLeft.x=basex+2;
rect.topLeft.y=basey+2;
rect.extent.x=13;
rect.extent.y=6;
WinPaintRectangle(&rect,0);

fg.r=255;fg.g=255;fg.b=200;
WinSetForeColorRGB(&fg,NULL);

rect.topLeft.y=basey+3;
rect.extent.x=percent/10 + 1;
rect.extent.y=4;
rect.topLeft.x=basex+3;
WinPaintRectangle(&rect,0);
-- For information on using the PalmSource Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/

Reply via email to