Step 9The program, part 1
Disclaimer: Before this project I had zero experience with the C language, my programming experience had been limited to Visual Basic and (mostly) Java. Because of this I'm not sure where the similarity between C programming for the Palm OS and for the Computer begin and end. And since this is quite literally my first C program ('cept for the obligatory "Hello World" app) my adherence to C standards and good codeing practice is probably pretty bad as well.
The first part of this program is the .rcp file. This file contains information PilRC uses to build the GUI; we'll call it "robot.rcp". We'll also need another file called "robot.h" where we will define some constants that will be used when referencing the GUI elements. Each element is assigned an ID number, and we will assign each number a name. When the compiler goes trough the source code it will replace the names with the numbers that they represent. For example "FormMain" is defined as 9000, that means every time we use "FormMain" in the program we really are using the number 9000.
Here is my robot.h file:
//--------------------- Fourms ----------------------- #define FormMain 9000 #define FormSelect 9001 #define FormMacro 9002 #define MainMenu 9100 #define AboutAlert 9101 //--------------------- Form Main -------------------- #define PicRobot 1000 #define PicWall_ 1001 #define PicCliff 1010 #define PicWhealR 1011 #define PicWhealL 1012 #define PicBumpR 1013 #define PicBumpL 1014 #define PicWall 1015 #define FldVoltage 1100 #define FldProg 1101 #define BtnDisconnect 1200 //--------------------- Form Select ------------------ #define SelScript 2000 #define FldDescription 2001 //--------------------- Form Macro ------------------- #define BtnSend 3000 #define BtnClear 3001 #define BtnDel 3002 #define BtnUp 3100 #define BtnDown 3101 #define BtnLeft 3102 #define BtnRight 3103 #define BtnCClock 3104 #define BtnClock 3105 #define BtnPause 3106 #define BtnP1 3201 #define BtnP2 3202 #define BtnP4 3204 #define BtnP8 3208 #define BtnP16 3216 #define PicBar 3300 #define PicUp 3400 #define PicDown 3401 #define PicLeft 3402 #define PicRight 3403 #define PicClock 3404 #define PicCClock 3405 #define PicPause 3406 #define FldScript 3500 #define SclScript 3501 //--------------------- Main Menu -------------------- #define MnuStatus 8000 #define MnuScript 8001 #define MnuMacro 8002 #define MnuConnect 8100 #define MnuDisconnect 8101 #define MnuRun 8102 #define MnuStop 8103 #define MnuAbout 8200
| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|












































