How can i write a program for CP in my PC, and then copy that program to my CP ?
Thanks
Programming With Classpad
Started by
fiberoptik
, Oct 29 2004 04:18 PM
4 replies to this topic
#1
Posted 29 October 2004 - 04:18 PM
#2
Posted 29 October 2004 - 04:30 PM
use the classpad manager which came with your CP, you can write the program in there then save and transfer it to the CP.
#3
Posted 29 October 2004 - 04:55 PM
Thanks for your help
#4 Guest_GehennanArchmage_*
Posted 22 May 2005 - 09:30 PM
Thanks for your help
Hello I am trying to write a program and get it to display a number. The manual says to cast the CP_CHAR to a PegChar but how is that done? I can find nothing, and am unsure were to look? Heres want I have ....
CP_CHAR buffer[15];
Cal_Random(1,&low,&hi,&number);
CP_Norm_OBC(&number, buffer, IM_MODE_NORM1);
temp = (PEGCHAR)&buffer;
PegPoint pp = { 10, 10 };
PegColor pegColor = BLACK;
DrawText( pp, buffer, pegColor, PegTextThing::GetBasicFont());
Any help?
#5
Posted 24 May 2005 - 03:03 PM
You are programming in C++ using the SDK. If you want to be sure to get a reply you should post this type of question on theHello I am trying to write a program and get it to display a number. The manual says to cast the CP_CHAR to a PegChar but how is that done?
...<snip>...
Any help?
SDK Forum.
An easier way to do this is...
Cal_Random(1,&low,&hi,&number); // I use a CPString. It does all the work for me :) CPString num_string(number); PegPoint pp = { 10, 10 }; PegColor pegColor = BLACK; PegFont *font = PegTextThing::GetBasicFont(); // NOTE: The rectangle that you are about to draw info also // needs to be invalidated first. You might have alreadt done // this so you don't have to worry about it here. For example, // you can call Invalidate() without and arguments to invalidate // the entire screen before drawing. If you haven't invalidated // the screen and you want an optimized draw you can invalidate // just the area you are about to draw as follows... // // int w = TextWidth(num_string,font); // int h = TextHeight(num_string,font); // CPRect rect(pp.x, pp.y, pp.x+w, pp.y+h); // Invalidate(rect); DrawText( pp, num_string, pegColor, font);Something else you need to be aware of. Your draw operations need to be nested between BeginDraw() and EndDraw() calls.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users