Palm Game Sprite Problem
Hey guys! I am using Code Warrior 7. I am trying make a Palm Pong clone. I have my sprites running but when ever one moves, the place at which they were, you can see that still plus where they are now. Understand what I am saying? I need to figure out how to erase the stop it was just at so that there is only one picture of the ball at a time. I tried getting a rectangle to erase the last stop but that doesn't work, or atleast the way I did it. // The Ball Rectangle RctSetRectangle (BallRect,Ballx, Bally, Ball-width, Ball-height); do { if (hit==0){ if(Ballx148){Ballx++;Bally++;}} if (hit==1){ if(Ballx148){Ballx--;Bally--;}} if(Ballx=147){hit=1;} if(Ballx8){hit=0;} if(KeyCurrentState()==keyBitHard2){Checkit=true;} if(KeyCurrentState()0){ if(KeyCurrentState()==keyBitPageUp){delay++;if(delay5){y--;delay=0;}} if(KeyCurrentState()==keyBitPageDown){delay++;if(delay5){y++;delay=0;}} if(KeyCurrentState()==NULL){y=y;}} WinDrawBitmap(Bar1,1,y); WinDrawBitmap(Bar2,148,yy); // The Ball WinDrawBitmap(Ball,Ballx,Bally); WinCopyRectangle(oldDrawBall,offscreenBall,BallRect,Ballx,Bally,winErase); Thanks in Advance -- Brandon www.DreamCodersRealm.com -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Palm Sprite Question
Hey guys! I am having a slite sprite problem. I am using Code Warrior 7. I am trying make a Palm Pong clone. I have my sprites running but when ever one moves, the place at which they were, you can see that still plus where they are now. Understand what I am saying? I need to figure out how to erase the stop it was just at so that there is only one picture of the ball at a time. I tried getting a rectangle to erase the last stop but that doesn't work, or atleast the way I did it. // The Ball Rectangle RctSetRectangle (BallRect,Ballx, Bally, Ball-width, Ball-height); do { if (hit==0){ if(Ballx148){Ballx++;Bally++;}} if (hit==1){ if(Ballx148){Ballx--;Bally--;}} if(Ballx=147){hit=1;} if(Ballx8){hit=0;} if(KeyCurrentState()==keyBitHard2){Checkit=true;} if(KeyCurrentState()0){ if(KeyCurrentState()==keyBitPageUp){delay++;if(delay5){y--;delay=0;}} if(KeyCurrentState()==keyBitPageDown){delay++;if(delay5){y++;delay=0;}} if(KeyCurrentState()==NULL){y=y;}} WinDrawBitmap(Bar1,1,y); WinDrawBitmap(Bar2,148,yy); // The Ball WinDrawBitmap(Ball,Ballx,Bally); WinCopyRectangle(oldDrawBall,offscreenBall,BallRect,Ballx,Bally,winErase); Thanks in Advance! -- Brandon www.DreamCodersRealm.com -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Change the Color of the Background
How do you change the color of the Window's actual back ground? WinSetBackColor doesn't help me any. Thanks! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
C to C++ Conversion problem. PilRC
Ok, I asked earlier how do I use PilRC and Codewarrior 7.0 in C++ mode to use your own font. The anser I was given was to use FntSetFont(fntAppFontCustomBase); Which I used but am still back at step one. How do I use this? I tried throwing in my old C code FontPtr Text; Text=MemHandleLock(DmGetResource('NFNT', 1000)); FntDefineFont (fntAppFontCustomBase, Text); Which is no good because in C++ mode, it doesn't want to comple this. So how in C++ should I write my code to display User defined font? Thanks in Advance for all your help! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
C++ and PilRC question
How would I in C++, not C, write C++ code to allow me to change the font using PilRC? I am new to PilRC. Thank you in Advance for you help! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
PiLRC Font C problem
I am trying to use my own Font with my application. I am using Codewarrior R7 with the PilRc plug-in. I set up the compiler and file mappings correctly, and created a working rcp file. However, my c code is not compiling correctly, which I don't understand because all my syntax should be correct acorrding to the Palm Os Documents. Here is my code, FontPtr fonte; fonte=MemHandleLock(DmGetResource('NFNT', 1000)); FntDefineFont(255, fonte); I get two errors saying Error : illegal implicit conversion from 'void *' to 'FontType *' Starter.cpp line 336 fonte=MemHandleLock(DmGetResource('NFNT', 1000)); Error : illegal implicit conversion from 'int' to 'fontID' Starter.cpp line 337 FntDefineFont(255, fonte); Something is wrong with my Font pointer but I don't know what. What is wrong? Thanks! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
Unsigned char to a char *
How do you convert an unsigned char[40] to a char *? Thanks! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://wwwpalmoscom/dev/tech/support/forums/
SysRandom(UInt32); Problem!
Hey! I am trying to make a simple app for the palm and am trying to get the palm to return a number from 0 to 20 So I said Int16 choose; int wait; for(wait=0;wait10;wait++) choose=SysRandom(20); But it keeps returning 6926 which I am guessing is the highest number the palm can randomize What do I need to change to get the palm to return a random number consistantly between 0 and 20? Thanks! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://wwwpalmoscom/dev/tech/support/forums/
Where can I download a m505 Rom Image?
Hey! My pc 2 Palm connectiong isn't working Can anyone tell me where I can download a Palm m505 rom image on the internet or any palm rom image? Thanks! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://wwwpalmoscom/dev/tech/support/forums/
Re: Where can I download a m505 Rom Image?
Thank you my friend Thanks -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://wwwpalmoscom/dev/tech/support/forums/
Proccess in creating a Pdb.
Ok, I have read the documents and understand the functions for creating a database and I can creat a database but I don't understand exactly how to store data in a pdb I know that you use DbWrite and DbAttachRecord but can someone explain the proccess in saving data to a database for example a character variable? Or can someone explain an algorythm to be for saving data to a pdb? Thank you very much! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://wwwpalmoscom/dev/tech/support/forums/
Error in creating a Pdb.
Ok, I tried that example, Oh and THANKS SO MUCH for that website! ALOT of help! Thanks alot buddy! Anyways, I did get an error though DBRecordType r; Error : undefined identifier 'DBRecordType' Startercpp line 71 DBRecordType r; // this is our database record Wasn't DBRecordType a predefined commanded? Thanks! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://wwwpalmoscom/dev/tech/support/forums/
Clearing a WinDrawChars
Hey! I have a simple problem What I said was if(x=111) { StrIToA(xChar,x); WinDrawChars(xChar,StrLen(xChar),113,35); } But when x gets past 99, it leaves an extra un needed digit I tried a few things like WinEraseChars but those methods didn't work or atleast how I used them Any help would be appreciated! Thanks! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://wwwpalmoscom/dev/tech/support/forums/
Playing Sounds!
Can someone please show me an example source to playing a single note on the palm? I am fairly new and want to learn! Thanks! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://wwwpalmoscom/dev/tech/support/forums/
Re: Fonts
How do you make your own fonts if you are using Code Warrior? Thanks!! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Re: console mode in palm device
I do the / stroke + then + . + the 2 and get nothing. What am I doing wrong to get console mode? Thanks! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Re: console mode in palm device
Well I did that and I get a bunch of beeps but nothing other than that happens. Is there a special place I have to do it in? Thanks! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Problem Making a Calculator!
Hey! I am trying to make a calculator and I am getting a fatal error. My Calculator will add any numbers from 0 to 5. For example, If I say 5 + 4 it will say 9. However, If I say 5+ 6, I get a fatal exception. I am sure it is a pointer problem. Please show me what I did wrong! Thanks! case ctlSelectEvent: { case MainPlusButton: Int32 addn; Int32 addnn; Int32 newnum; char *NumSum; char *NumSumm; char Answer; fld=(FieldPtr) GetObjectPtr(MainNumField); fldd=(FieldPtr) GetObjectPtr(MainNummField); Answerfld=(FieldPtr) GetObjectPtr(MainAnswerField); NumSum=FldGetTextPtr (fld); NumSumm=FldGetTextPtr (fldd); addn = StrAToI (NumSum); addnn = StrAToI (NumSumm); newnum=addn+addnn; StrIToA (Answer, newnum); FldSetTextPtr (Answerfld,Answer); FldDrawField(Answerfld); handled=true; break; } break; -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Re: Problem Making a Calculator!
Heehee actually I already fixed it on my own but thanks! I figured that out. I have a question though. Now it only does addition. What is wrong?? case ctlSelectEvent: { case MainPlusButton: { Int32 addn; Int32 addnn; Int32 newnum; char *NumSum; char *NumSumm; char *Answer; fld=(FieldPtr) GetObjectPtr(MainNumField); fldd=(FieldPtr) GetObjectPtr(MainNummField); Answerfld=(FieldPtr) GetObjectPtr(MainAnswerField); NumSum=FldGetTextPtr (fld); NumSumm=FldGetTextPtr (fldd); addn = StrAToI (NumSum); addnn = StrAToI (NumSumm); newnum=addn+addnn; StrIToA (Answer, newnum); FldSetTextPtr (Answerfld,Answer); FldDrawField(Answerfld); handled=true; }break; case MainMinusButton: { Int32 Minusn; Int32 Minusnn; Int32 newnumm; char *NumSummm; char *NumSu; char *Answerm; fld=(FieldPtr) GetObjectPtr(MainNumField); fldd=(FieldPtr) GetObjectPtr(MainNummField); Answerfld=(FieldPtr) GetObjectPtr(MainAnswerField); NumSummm=FldGetTextPtr (fld); NumSu=FldGetTextPtr (fldd); Minusn = StrAToI (NumSummm); Minusnn = StrAToI (NumSu); newnumm=Minusn-Minusnn; StrIToA (Answerm, newnumm); FldSetTextPtr (Answerfld,Answerm); FldDrawField(Answerfld); handled=true; } break; } break; -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Modem Problem!
Hey! I am trying to get my Palm to dial a number on my 56k palm modem. My code compiles fine but I keep getting a fatal error on my palm. What am I doing wrong? ModemPtr modem; Char *number=7362812; Char *okDialP; Char *userInitP; MdmDial (modem,okDialP,userInitP, number); Thanks! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Custom Font on the Palm?
I notice one of the font id's allow you to use your own font. I am assuming this means a palm hack font. How do I access a certain palm hack font by saying FldSetFont (fld, fntAppFontCustomBase); Thanks! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Getting the Battery type!
Hey! I am having a little trouble with getting what kind of battery the user has. This is my code. UInt8 *percentP; SysBatteryKind *kindP; char *PercentStr; char *Percents; UInt16 Kind; Kind=SysBatteryInfoV20 (false,NULL,NULL,NULL,kindP,false); PercentStr=StrIToA (Percents, Kind-kindP); fld=(FieldPtr) GetObjectPtr(MainOutputField); FldSetTextPtr(fld,Kind.kindP); FldDrawField(fld); My error is here though PercentStr=StrIToA (Percents, Kind-kindP); It says Kind isn't an array. How do I access kindP and display it as a character string? Thanks! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Moving a Bitmap around!
Hey! I am a newbie and am trying to learn different api calls for the palm device. I have a from bitmap and want to know how to change it's x and y values promattically. I am using CodeWarrior 7.0. Please help! Thanks! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Screen Saver!
Ok, I am making a simple marquee program for the palm pilot. Everything works Perfectly except for when I want to exit. The effect I want is when the user presses the stlus against the screen, the app should exit and enter the app launch program. Instead it gives me a memory error. Here is my code. int num=0; Int16 penX, penY; BooleanpenDown; while(penDown==false){ num=num+1; if(num10) { scrollx=scrollx-1; num=0; } WinDrawChars(Brandon Rules!,14,scrollx,70); if (scrollx-100) { WinEraseWindow(); scrollx=177; } } EvtGetPen( penX, penY, penDown); if(penDown==true) SysAppLauncherDialog(); I know the main reason is probably because I have it in a While loop. Can anyone help me? Thanks! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Turn palm off code!
Ok, some people told me to search for this in some forums and I went everywhere they said. For those of you that are about to ask, yes I have read the documentation serveral times.The only reason I am even writing thi9s email is that about amonth ago someone asked the same question and someone knew and I thought they said it was SysTask(flase,false) but I don't remember what it was. Please tell me so that I can add it to my program. Thanks! GOD Bless!!! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Bitmap Families
I am trying to put some color pictures in my program and understand that I have to put them in a bitmap family in the constructor. How do I do that though, all it lets me do when I create a bitmap family is change the height and width. Please help me! Thanks! GOD Bless!!! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Turning the palm off.
I forgot the system command for turning the palm off. I thought it was SysTask(false,false); but that isn't it. Please tell me the command for turning the palm off. Thanks! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Getting text.
Hey! I am having a little trouble getting the text of a field. This is my code. frmP is a form pointer, fld is a FieldPtr Commandl is a char pointer. My goal is to make it so that when the user types in l and presses the execute button that the palm will sound off the alarm. Right now I don't get any errors but noting happens when I pres the command button and type in l in the text field. Please help! Thanks! GOD Bless!!! case MainExecuteButton: frmP=FrmGetActiveForm(); fld=( FieldPtr ) GetObjectPtr (MainCommandField); Commandl=FldGetTextPtr (fld); if(Commandl==l) SndPlaySystemSound(sndAlarm); break; -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
RE: Getting text.
It says StrCmp is defined. So hwo do I define it? -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Color programming.
I recently bought a Palm 505 and am making a small color demo. I put a colored bitmap on my form in the constructor and set it to 256 colors in constructor then when I load it on the palm is is all black. What do I need to do to make it show up in color? -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Bitmap Families?
How do I add a bitmap to a bitmap family? Please help! Thanks! GOD Bless!!! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Launching Programs
Is there a command that will Launch another program other than the palm default applications? If so can you send us the command and prototype? Thanks! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Sounds On the Palm
How do you play sounds on the Palm? We tried using sndplaysmf but we don't know what the pointer smfp is for. Any suggestions? Thanks! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Whoever thought up c++ should be shot!!!
How do you define the fields in a database? Do you use records? Please help. The only book we have on the subject doesn't show how to define fields in a database, it just assumes we already defined them. -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Lucky Charms and Database Fields Don't mix
We are trying to save the text in text fields that the user inputs into database fields. The code below compiles but it doesn't save the data. The variables like Serial are pointers to the text in the text fields. Any help would be apreciated. gDb=DmOpenDatabaseByTypeCreator(ourdbtype,yourapptype,dmModeReadWrite); if(! gDb) DmCreateDatabase(0,yourdbname,yourapptype,yourdbtype,false); DmOpenDatabaseInfo(gDb,theLocalID,NULL,NULL,theCardNum,NULL); DmDatabaseInfo(theCardNum,theLocalID,NULL,theAttributes, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); theAttributes |= dmHdrAttrBackup; theCardNum=0; DmSetDatabaseInfo(theCardNum,theLocalID,NULL,theAttributes, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); if (adding) { myRecordHandle=DmNewRecord(gDb, RecordIndex, sizeof(newRecord)); newRecordPtr=(OurStruct *)MemHandleLock(myRecordHandle); newRecord.cost=Coster; newRecord.serialnum=Serial; newRecord.datefield=Dater; newRecord.itemname=Namer; newRecord.lin=Lin; newRecord.nsn=Nsn; DmWrite(newRecordPtr,0,newRecord,sizeof(newRecord)); MemHandleUnlock(myRecordHandle); } -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
We have read the docs!
We have read the docs and we have a question on how o save the text in our field. This is our code. gDb=DmOpenDatabaseByTypeCreator(yourdbtype,yourapptype,dmModeReadWrite); if(! gDb) DmCreateDatabase(0,yourdbname,yourapptype,yourdbtype,false); DmOpenDatabaseInfo(gDb,theLocalID,NULL,NULL,theCardNum,NULL); DmDatabaseInfo(theCardNum,theLocalID,NULL,theAttributes, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); theAttributes |= dmHdrAttrBackup; theCardNum=0; DmSetDatabaseInfo(theCardNum,theLocalID,NULL,theAttributes, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL); if (adding) { myRecordHandle=DmNewRecord(gDb, RecordIndex, sizeof(newRecord)); newRecordPtr=(OurStruct *)MemHandleLock(myRecordHandle); newRecord.cost=Coster; newRecord.serialnum=Serial; newRecord.datefield=Dater; newRecord.itemname=Namer; newRecord.lin=Lin; newRecord.nsn=Nsn; DmWrite(newRecordPtr,0,newRecord,sizeof(newRecord)); DmWrite(newRecordPtr,0,(CharPtr) newRecord-serialnum,sizeof(newRecord)); MemHandleUnlock(myRecordHandle); } Our code works and actually saves records but in the records, our field's text is not in there. Please help us! Thanks! GOD Bless!!! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
We see no English in our Palm Database!
We are trying to save our field's text in a databse as different records and we are using a program called Insider to let us view the database's data and we know our data is being saved in the record because our data changes each time but how do we get english words to show up? Thanks! GOD Bless!!! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
How do you get a bloody pointer to a Database?
A lot of commands use a DmOpenRef to an open database in the command. What the hell is that and how do you declare or define one? -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Please answer my two error questions.
I keep getting to errors while trying to write a save algorythm for the database save button. This is what I did. DmOpenRef myDB; myRecordHandle=DmNewRecord(myDB, RecordIndex,RecordSize); newRecordPtr=MemHandleLock(myRecordHandle); newRecordPtr-itemnum=Serial; My errors are Error : illegal implicit conversion from 'unsigned long *' to 'unsigned short *' Starter.cpp line 444 myRecordHandle=DmNewRecord(myDB, RecordIndex,RecordSize); Error : illegal implicit conversion from 'void *' to 'OurStruct *' Starter.cpp line 445 newRecordPtr=MemHandleLock(myRecordHandle); and Error : illegal implicit conversion from 'unsigned long *' to 'unsigned short *' Starter.cpp line 444 myRecordHandle=DmNewRecord(myDB, RecordIndex,RecordSize); Error : illegal implicit conversion from 'void *' to 'OurStruct *' Starter.cpp line 445 newRecordPtr=MemHandleLock(myRecordHandle); Can anyone please help me? Thanks! GOD Bless!!! p.s. = Sorry about the other email. A co-worker was being a bit rude. He can't get a date. Thanks! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
One more error! Fatal Exception.
Ok, my code compiles fine but when I try it on the palm and save then it gives me a fatal error about saving the database so I tried going back and unlocking the memory handle and now when I try it it gives me a soft reset, before it gave me a hard reset. So what am I doing wrong here? Thanks! myRecordHandle=DmNewRecord(gDb, RecordIndex,RecordSize); //newRecordPtr=MemHandleLock(myRecordHandle); newRecordPtr=(OurStruct *) MemHandleLock(myRecordHandle); newRecordPtr-itemnum=Serial; MemHandleUnlock(myRecordHandle); FrmAlert(SaveAlert); FrmGotoForm(MainForm); WinEraseWindow(); GOD Bless!!! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Records not made by Britney Spears
If I have the following line of code it compiles but it gives us a NULL memory error when running. newRecordPtr=(OurStruct*)MemHandleLock(myRecordHandle); The book I am reading is called The Palm Programming -The Developer's Guide by: Neil Rhodes and Julie McKeehan and it says to use newRecordPtr=MemHandleLock(myRecordHandle); but it won't compile. Any suggestions? We are using this to try and make a new record in a database. -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Form Flashing bug.
For some odd reason after my timer in a form, the form will dissapear then reappear then disappear and I want it to disappear for good the first time. This is what I did. Please help me! static void MainFormInit(FormPtr /*frmP*/) { FormPtr pForm = FrmGetActiveForm(); pForm = FrmInitForm (SplashForm); FrmDrawForm (pForm); SysTaskDelay (100); WinEraseWindow(); pForm=FrmInitForm(MainForm); if( pForm ) { // Ini the Main Form // pForm = FrmInitForm (MainForm); // initialize the barcode type and barcode data fields SetFieldText( MainNumberField, No Barcode Data, 80, false ); FrmDrawForm( pForm ); } // WinEraseWindow(); } Then in my Main Form Event Handler I said, case frmOpenEvent: frmP=FrmInitForm(MainForm); frmP = FrmGetActiveForm(); MainFormInit( frmP); FrmDrawForm ( frmP); handled = true; break; Please help me! Thanks! GOD Bless!!! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Hey! How do you draw a circle with code?
How do you draw a circle with code? You know like the line commands like WinDrawLine(x,y,x,y)? Thanks! GOD Bless!!! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Re: How do you make a list id for a popup trigger? (Zzeta try this!)
Zzeta, this should work! case frmOpenEvent: frmP = FrmGetActiveForm(); AddNewFormInit( frmP); FrmDrawForm ( frmP); void *theList; void *theTrigger; // initialize the popup's selection, and set the popup trigger's text frmP = FrmGetActiveForm(); theList = FrmGetObjectPtr(frmP, FrmGetObjectIndex(frmP, AddNewNameLList)); // LstSetSelection(theList, defaultValue); theTrigger = FrmGetObjectPtr(frmP, FrmGetObjectIndex(frmP, AddNewNamePPopTrigger)); break; Hope this helps! Thanks! GOD Bless!!! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
RE: Why won't some of my buttons work?
No, I have a case in front of the MainUpdateOkButton. -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Re: Why won't some of my buttons work?
Ok, I got rid of the if statement and the case but my AddNewSaveButton still doesn't FrmAlert(SaveAlert); Instead, it takes the role of the MainAddNewButton and goes to a new form. -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
RE: Why won't some of my buttons work?
AddNewSaveButton is on another form that I am trying to handle in the Main Form cause I can't get it to work anywhere. -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
How do you make a list id for a popup trigger?
In the Code Warrior Constructor, how do you make a List Id for the pop up trigger. Thanks! GOD Bless!!! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Better algorythm for drawing?
For my drawing program I am saying case penMoveEvent: int x,y; Int16 penX, penY; BooleanpenDown; EvtGetPen( penX, penY, penDown); WinDrawLine(penX,penY,x=penX,y=penY); break; WinDrawLine(penX,penY,x=penX,y=penY); gives you little pixels, how do I make a longer thick line? Thanks! GOD Bless!!! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
I fixed most of my erros on my own but need some help.
I figured out most of the code myself and fix my problems but I thank all who helped me! I have one question though. I am working with a symbol palm and I wrote some code like this if (eventP-data.ctlEnter.controlID == UpdateScanButton) { ScanCmdStartDecode(); bHandled = true; } Now my code works BUT UpdateScanButton is not on the main form so when I try to scan I get an error and have to reset. The UpdateScanButton is on the UpdateForm. How do I say that in this code? I tried UpdateForm-UpdateScanButton) But that doesn't work. I tried some other things as well. Thanks! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Please Help!
I am working with a symbol palm and I wrote some code like this if (eventP-data.ctlEnter.controlID == UpdateScanButton) { ScanCmdStartDecode(); bHandled = true; } Now my code works BUT UpdateScanButton is not on the main form so when I try to scan I get an error and have to reset. The UpdateScanButton is on the UpdateForm. How do I say that in this code? I tried UpdateForm-UpdateScanButton) But that doesn't work. I tried some other things as well. Thanks! GOD Bless!!! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Pop-up triggers question.
How do you add more options to a pop - up trigger in the Code Warrior constructor 7.0? Thanks! GOD Bless!!! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
AHH! None of the cod works!
Eveytime I try to change a Field's text through code it gives me an error. Has anyone had this problem? I wrote out the protoypes and wrote out the definition and nothing works. I always get an error on SetTextField and all. Can someone please help? Thanks! GOD Bles!!! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Here is my source and what I am trying to do.
This is one of my errors I KEEP getting. Please explain it to me and how to solve it. Warning : function has no prototype Starter.cpp line 36 { Error : illegal implicit conversion from 'void *' to 'FieldType *' Starter.cpp line 40 FrmGetObjectIndex(FrmGetActiveForm(), UpdateNumberField)); Error : illegal implicit conversion from 'void *' to 'char *' Starter.cpp line 46 StrCopy( MemHandleLock( txtH ), String ); Error : ';' expected Starter.cpp line 481 SetField( UpdateNumberField,focusindexed); What I am trying to do. I am trying to make it so that when the user scans a barcode it will print the barcode number of the UpdateNumberField. This is for the Symbol Palm. I HAVE successfully Inied the palm scanning device and the scanner works. I need help on the conversion though and displaying the barcode number in the UpdateNumberField. Please help me! Thanks! /** * * Copyright (c) 1999 Palm Computing, Inc. or its subsidiaries. * All rights reserved. * * File: Starter.cpp * */ #include PalmOS.h #include StarterRsc.h #include HwrMiscFlags.h // gives HwrBatteryLevel #include ScanMgrDef.h // scan manager constants #include ScanMgrStruct.h // scan manager structures #include ScanMgr.h// scan manager API functions //Prototypes int ScanOpenDecoder(); int ScanCloseDecoder(); static Boolean OnDecoderData(); // GetSerialData(); static Boolean bOpenDecoderOK = false; static Boolean Auto_Scan = false; int ScanIsPalmSymbolUnit(); void SetFieldText( UInt16 nFieldID, const Char * pSrcText, Int16 nMaxSize, Boolean bRedraw ); static Boolean MainFormHandleEvent(EventPtr event); static Boolean ApplicationHandleEvent (EventPtr event); Boolean extendedData; int extendedDataLength; MemHandle hExtendedData; unsigned char *pExtendedData; int extendedDataType; void SetField( Word Field, CharPtr String ) { Handle txtH; FieldPtrfldP =0; fldP = FrmGetObjectPtr(FrmGetActiveForm(), FrmGetObjectIndex(FrmGetActiveForm(), UpdateNumberField)); if(FldGetTextLength(fldP)0) FldFreeMemory (fldP); txtH= MemHandleNew( StrLen( String ) + 1 ); StrCopy( MemHandleLock( txtH ), String ); MemHandleUnlock( txtH ); FldSetTextHandle( fldP, txtH ); } /*** * * Entry Points * ***/ /*** * * Internal Structures * ***/ typedef struct { UInt8 replaceme; } StarterPreferenceType; typedef struct { UInt8 replaceme; } StarterAppInfoType; typedef StarterAppInfoType* StarterAppInfoPtr; /*** * * Global variables * ***/ //static Boolean HideSecretRecords; /*** * * Internal Constants * ***/ #define appFileCreator 'STRT' #define appVersionNum 0x01 #define appPrefID 0x00 #define appPrefVersionNum 0x01 // Define the minimum OS version we support (2.0 for now). #define ourMinVersion sysMakeROMVersion(2,0,0,sysROMStageRelease,0) /*** * * Internal Functions * ***/ void SetFieldText( UInt16 nFieldID, const Char * pSrcText, Int16 nMaxSize, Boolean bRedraw ) { MemHandle hFieldText; Char * pFieldText; FieldPtr pField; // pField = (FieldPtr)GetObjectPtr( nFieldID ); // if( !pField ) return; hFieldText = FldGetTextHandle( pField ); if( !hFieldText ) hFieldText = MemHandleNew( nMaxSize ); // If already allocated, make sure it can handle nMaxSize already. // If not, realloc that buffer else { UInt32 curSize = MemHandleSize( hFieldText ); if( curSize nMaxSize ) MemHandleResize(hFieldText, nMaxSize ) ; } if( hFieldText ) { int len = StrLen(pSrcText); pFieldText = (Char * )MemHandleLock( hFieldText ); if (len nMaxSize) { StrNCopy( pFieldText, pSrcText, nMaxSize-1); pFieldText[nMaxSize-1] = '\0'; } else StrCopy( pFieldText, pSrcText ); MemHandleUnlock( hFieldText ); FldSetTextHandle( pField, (MemHandle)hFieldText );
Please fix my penX and penY code.
I am not really sure what I am doing wrong. Can someone please fix my code and tell me what they did so it will help my learning the palm OS programming platform? Thanks! GOD Bless!!! case penMoveEvent: int x,y; int penX,penY; Boolean penDown; EvtGetPen(penX, penY, penDown); penX=x; penY=y; WinDrawLine (penX,penY,x,y); break; -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
Re: Please fix my penX and penY code.
Oh, my error I keep getting says illegal implicit conversion from int to short* case penMoveEvent: int x,y; int penX,penY; Boolean penDown; /* Here is the error*/ EvtGetPen(penX, penY, penDown); penX=x; penY=y; WinDrawLine (penX,penY,x,y); break; -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
I need some help with some Ui bugs.
Hey! I am trying to make it so that one form will go to another and I got that to work but when I try to make the form return a white screen appears with nothing on it. Also, I tried writing an Exit option that I need to go back to the home screen The screen where you go to when you hit the home key. and I used FrmCloseAllForms(); and that gives me a blank white screen as well. Thanks! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
How do you change a field's text with code?
Hey! I am new to coding for the Palm Os platform. I have code warrior and I am writing a simple addition program to get use to coding for the palm os platform. I have figured out the button down event and things like that but am having trouble changing the text property of a label and a field through code. I have two fields for the user to type in a number in each. From there I have it so that when the user clicks the ADD button it performs an adding operation. My add function looks like this. static int Add(Int x, Int y) { return(x+y); } Then in the cltEnterEvent under my Add button code I said int c; Add(MainNum1Field,MainNum2Field); // This is now where the MainAnswerField text needs to display c. c is the integer and will be the sum of the MainNum1Field and MainNum2Field. MainAnswerField is where the value a c needs to be displayed. Can someone PLEASE tell me how to change the text of the MainAnswerField? Thanks! GOD Bless!!! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
How do you change a Field's text with code?
Ok, I know those are the two functions and that doesn't help cause everytime I do that I get an error so can you write me an example and make it output Hello World. Thanks! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
What is the x and y value of the pen?
I am making a small drawing program for the palmos and need to know for like on the penmove event what the x any commands for the pen's position is. Thanks! GOD Bless!!! -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/