Fri, 06 Aug 2004
Displaying an alert window

resource - .h file:

#define CustomAlert 1000

resource - .rcp file:

ALERT ID CustomAlert
BEGIN
  TITLE "custom alert"
  MESSAGE "^1\n^2\n^3"
  BUTTONS "OK"
END

code:

    Char alertMsg[64];
    StrPrintF(alertMsg, "Your value is %d", yourValue);
    FrmCustomAlert(CustomAlert, alertMsg, "", "");

do NOT pass NULL value as param in FrmCustomAlert - always use "".


(posted at 12:10 | filed under programming/palmbits | link)    (comments | add new)
Wed, 04 Aug 2004
Changing graphics mode
Boolean SetScreenColorDepth(int depth)
{
    UInt16 reqDepth=depth;
    Err err = WinScreenMode(winScreenModeSet,NULL,NULL,&reqDepth,NULL);
    return !err;
}

Boolean RestoreScreenColorDepth(void)
{
    Err err = WinScreenMode(winScreenModeSetToDefaults,NULL,NULL,NULL,NULL);
    return !err;
}

You must set color depth before any window is created. Check error codes for unsupported modes.


(posted at 15:35 | filed under programming/palmbits | link)    (comments | add new)
Tue, 03 Aug 2004
Double buffering

This is an example, how to do and use double buffering (offscreen window) to create smooth animations

WinHandle displayWindow;
WinHandle offscreenWindow;

void CreateOffScreen() {
    Err err;
    offscreenWindow = WinCreateOffscreenWindow(160,160, screenFormat, &err);
}

void PaintOffScreen() {
    WinSetDrawWindow(offscreenWindow);
    // draw there
}

void Show() {
    RectangleType bounds;

    WinSetDrawWindow(displayWindow);
    WinGetBounds(displayWindow, &bounds);
    WinCopyRectangle (offscreenWindow, 0, &bounds, 0, 0, 0);
}

(posted at 15:22 | filed under programming/palmbits | link)    (comments | add new)
Mon, 02 Aug 2004
My new Thinkpad...

I've bought brand new IBM. It's marvellous and I'm trying to install my favourite OS now.

IBM R51

Updated: all my wishes succeeeeeeded :) It's GREAT


(posted at 15:30 | filed under | link)    (comments | add new)