View Full Version : Menus and Menubars
bianchirider
06-14-2004, 08:37 AM
Hello devs,
I just started programming my Clie SJ-22 with Code Warrior, and the CLIEpose. I went through the tutorial chapter on menus. Basically you create an about form(modal), and then use a menu to link to it. Well, I got the form working, and got the menu text "About Errand" to show up under the main form lable, but when you click it it goes to another form that was created earlier, not the 'About' form.
The quick and dirty question:
Is there a quick way to link a specific form with a Menu option?
any other tips and tricks for menus will be used.
Thanks, I'll be around in the future.
plaksyuk
06-14-2004, 09:25 AM
Hello devs,
I just started programming my Clie SJ-22 with Code Warrior, and the CLIEpose. I went through the tutorial chapter on menus. Basically you create an about form(modal), and then use a menu to link to it. Well, I got the form working, and got the menu text "About Errand" to show up under the main form lable, but when you click it it goes to another form that was created earlier, not the 'About' form.
The quick and dirty question:
Is there a quick way to link a specific form with a Menu option?
any other tips and tricks for menus will be used.
Thanks, I'll be around in the future.
You need to handle menu item selection event in your main form. There is an appropriate event - menuEvent, which holds item ID.
bianchirider
06-14-2004, 09:32 AM
So I'll need to fill in a function stub in the main form with som C++, right.
Do you know off hand how to call another from that is modal and named "About". If not, I can probably figure it out in a few, thanks for the help thus far.
plaksyuk
06-14-2004, 09:47 AM
So I'll need to fill in a function stub in the main form with som C++, right.
Right.
Do you know off hand how to call another from that is modal and named "About". If not, I can probably figure it out in a few, thanks for the help thus far.
First, most simple may to show about dialog is to use alerts. In this case you need only to call FrmAlert() with your alert id. If you need to use more customized About dialog, use the following code:
FrmType *frmP = FrmInitForm(aboutDialogResID);
FrmDoDialog(frmP);
FrmDeleteForm(frmP);
bianchirider
06-14-2004, 10:47 AM
Hey, thanks plaksyuk for the help, I'll try it when I get home.
To any other beginners reading this here is a great tutorial link:
http://mobile.eric-poncet.com/palm/tutorial/index.html
and a complete palm programming book('98) by O'rielly:
http://cerem.ufp.pt/~nribeiro/aulas/lfor/palmprog.pdf
drvman02
06-15-2004, 09:35 AM
any other tips and tricks for menus will be used.
Another tip that I had learned late is that the edit menu items can be handled mostly by the OS.
As long as you define your edit menu Ids as the following:
undo 10000
cut 10001
copy 10002
paste 10003
select 10004
bianchirider
06-15-2004, 01:49 PM
yea, I read that yesterday on the cliedev forum. Havent tried it yet though. The problem that I was having, was I didn't have the right Main.cpp file in my project when in the tutorial. I went back and started over and it worked fine. The CW Tutorials really are a pretty good starting point. The MyErrand app is similar to a program that I want to code anyway, so I'll probably just morph it over after I finish the last chapter.
vBulletin v3.0.3, Copyright ©2000-2012, Jelsoft Enterprises Ltd.