1:
I would have unterstood if they didn't write things about the protected methods. But they've left out the most public functions. And you can forget the documentation of ones which are documented.
Now the next funny thing:
Take a look into the cpmainframe.h, there you'll find this method:
// Loads a keypad window. This is automatically done and
// not required unless you create a custom keypad.
static void SetKeypad(CPKeyboardManager* kp);
Not realy funny is the comment: "create a custom keypad"
So my question: How to subclass a CPKeyboardManager? Even a "search in files" on all files in the sdk main directory finds some forward reverences to this class but nothing realy usable.
I'm in programming courses at my university. There we have to create documentations too...
SDK Creators: 0 points, sit down!
2: Set the warning level (Project menu...) higher and look
3: reading about to CLOSE AN APP i found an article in sdk forum which says send an HM_SYS_CLOSE message to itself. But this dont work. Sending an PM_EXIT does not work too. (See the comments in the header where the constants are defined - funny)
#include "Classpad.h" class MainWin1 : public CPWindow { public: MainWin1(const PegRect &r, WORD wStyle); void Draw(); SIGNED Message(const PegMessage &Mesg); }; MainWin1::MainWin1(const PegRect &r, WORD wStyle = FF_THIN) :CPWindow(r, wStyle) { } void MainWin1::Draw() { BeginDraw(); DrawFrame(); EndDraw(); } SIGNED MainWin1::Message(const PegMessage &Mesg) { if(Mesg.wType == PM_LBUTTONDOWN) { /* The close message */ PegMessage CloseMessage(HM_SYS_CLOSE); CloseMessage.pTarget = NULL; CloseMessage.pSource = NULL; CloseMessage.Next = NULL; CloseMessage.iData = 0; CloseMessage.lData = 0; CloseMessage.wType = HM_SYS_CLOSE; MessageQueue()->Push(CloseMessage); } return(CPWindow::Message(Mesg)); } void PegAppInitialize(PegPresentationManager *pPresentation) { PegRect r; r.Set(MAINFRAME_TOP, MAINFRAME_LEFT, MAINFRAME_RIGHT, MAINFRAME_BOTTOM - STATUS_HEIGHT); MainWin1 *mainwin = new MainWin1(r); pPresentation->Add(mainwin); } char *ExtensionGetLang(ID_MESSAGE Mesg) { return(""); }