Jump to content



Photo
- - - - -

Sdk Is Great


  • Please log in to reply
6 replies to this topic

#1 mkanter

mkanter

    Casio Addict

  • Members
  • PipPipPip
  • 74 posts

  • Calculators:
    CFX9850G, ClassPad 300

Posted 25 March 2005 - 10:05 AM

THE SDK IS GREAT AND IT'S WELL-DOCUMENTED!!! YEAH!!!
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("");
}


#2 Daruosh

Daruosh

    Casio Freak

  • Members
  • PipPipPipPip
  • 285 posts
  • Gender:Male
  • Location:Tehran - Iran
  • Interests:Computer Programming, Electronics, Image Processing, Neural Networks, AI, System Development, Calc, Guitar, Music,

  • Calculators:
    CP 300 OS 3.03, Algebra FX 2.0 Plus ROM 1.05, CG-20

Posted 25 March 2005 - 11:49 AM

I have same problems with CAS functions :(

#3 Nanard

Nanard

    Casio Fan

  • Members
  • PipPip
  • 43 posts
  • Location:France

  • Calculators:
    Classpad 300

Posted 25 March 2005 - 12:42 PM

I don't understand all but for the keyboard, I made a keyboard class (not yet finish ut usable) and if you want, I can share it with you.

#4 SoftCalc

SoftCalc

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 406 posts
  • Location:Portland, OR USA

  • Calculators:
    ClassPad 300 , AFX 2.0, HP-48/49/50, TI-89/92/Voyager, HP Expander, etc...

Posted 25 March 2005 - 11:23 PM

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.

<{POST_SNAPBACK}>


It isn't that the documentation is poor, it's just that you've found an undocumented feature. :)

Custom keyboards are not supported. Who knows, maybe sometime in the future they will be. This is why it isn't documented.

Now the header files are a different story. You might find things in the header files that are not mentioned in the documentation because they are not supported. They were left in the header files for two reasons...

1) C++ classes must have all data members and virtual functions defined in the header. Even if something isn't supported if it is a virtual function it has to be in the header.

2) Some functions are not supported, but might be in the future. The keyboard is a good example. There is only so many hours in the day and I'm sure people didn't want to wait another six months or year for the SDK.

3) Some functions are not supported or documented but might have been left in the header file so a determined programmer would have some information. ;) I'm a programmer and I'd rather have "here are some undocumented functions that might be useful" than "it can't be done or I can't tell you any function names".

It really is a difficult situation. If the functions never appeared in the header file nobody would complain. If the functions are listed in the header file (but not in any other documentation) so a determined programmer might have some hints, then some people will get frustrated and upset.

#5 Daruosh

Daruosh

    Casio Freak

  • Members
  • PipPipPipPip
  • 285 posts
  • Gender:Male
  • Location:Tehran - Iran
  • Interests:Computer Programming, Electronics, Image Processing, Neural Networks, AI, System Development, Calc, Guitar, Music,

  • Calculators:
    CP 300 OS 3.03, Algebra FX 2.0 Plus ROM 1.05, CG-20

Posted 26 March 2005 - 10:40 PM

It isn't that the documentation is poor, it's just that you've found an undocumented feature. :)

Custom keyboards are not supported. Who knows, maybe sometime in the future they will be. This is why it isn't documented.

Now the header files are a different story. You might find things in the header files that are not mentioned in the documentation because they are not supported. They were left in the header files for two reasons...

1) C++ classes must have all data members and virtual functions defined in the header. Even if something isn't supported if it is a virtual function it has to be in the header.

2) Some functions are not supported, but might be in the future. The keyboard is a good example. There is only so many hours in the day and I'm sure people didn't want to wait another six months or year for the SDK.

3) Some functions are not supported or documented but might have been left in the header file so a determined programmer would have some information. ;) I'm a programmer and I'd rather have "here are some undocumented functions that might be useful" than "it can't be done or I can't tell you any function names".

It really is a difficult situation. If the functions never appeared in the header file nobody would complain. If the functions are listed in the header file (but not in any other documentation) so a determined programmer might have some hints, then some people will get frustrated and upset.

<{POST_SNAPBACK}>


When the SDK will be complete?? (documention and features)
I tried to develop a CAS add-in, but it was very very diffcult task (no sample, no documents).

#6 SoftCalc

SoftCalc

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 406 posts
  • Location:Portland, OR USA

  • Calculators:
    ClassPad 300 , AFX 2.0, HP-48/49/50, TI-89/92/Voyager, HP Expander, etc...

Posted 27 March 2005 - 02:55 AM

When the SDK will be complete?? (documention and features)
I tried to develop a CAS add-in,  but it was very very diffcult task (no sample, no documents).

<{POST_SNAPBACK}>


Hopefully later this summer. :unsure:

One thing I can say, try using the CPExpression class. You can also try looking directly in the tags.h header file to see if there is more tags that aren't listed in the help file.

CPExpressions contain expression trees so there is normally no way to see exactly what is inside when debugging. I have a Visual Studio add-in that will let you view the actual value of expressions in the debugger as a string, for example "sin(x/y)" B) . It isn't polished enough and doesn't have an installer so I haven't released it just yet. Let me know if this is something you'd like to use and I can email it to you.

#7 SoftCalc

SoftCalc

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 406 posts
  • Location:Portland, OR USA

  • Calculators:
    ClassPad 300 , AFX 2.0, HP-48/49/50, TI-89/92/Voyager, HP Expander, etc...

Posted 27 March 2005 - 04:54 AM

CPExpressions contain expression trees so there is normally no way to see exactly what is inside when debugging. I have a Visual Studio add-in that will let you view the actual value of expressions in the debugger as a string, for example "sin(x/y)" B) .  It isn't polished enough and doesn't have an installer so I haven't released it just yet. Let me know if this is something you'd like to use and I can email it to you.

<{POST_SNAPBACK}>

OK, I've been using this Visual Studio add-in for debugging for the past few months and it appears to be solid enough, so here it is for everyone to enjoy. :)

http://www.cpsdk.com...topic.php?t=116


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users