CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

menu, sub.menu structure with lcd

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Calamar



Joined: 07 Sep 2003
Posts: 60
Location: Buenos Aires (Argentina)

View user's profile Send private message Send e-mail MSN Messenger

menu, sub.menu structure with lcd
PostPosted: Mon Jul 04, 2005 4:43 pm     Reply with quote

I would like a exmaple in C, how to create
a menu, sub-menu I'll display it in
standar LCD.
_________________
Best Regards
Daniel H. Sagarra
La Plata (Argentina)
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Mon Jul 04, 2005 11:27 pm     Reply with quote

Search the forum and you should find some stuff. Here is a post showing show to use pointers to functions to do a menuing system. Its up to you to decide what to do with the menus though

http://www.ccsinfo.com/forum/viewtopic.php?t=20416&postdays=0&postorder=asc&highlight=menu&start=15
valemike
Guest







PostPosted: Tue Jul 05, 2005 12:00 am     Reply with quote

I've implemented a menu using a switch-case state machine. Scrolling up and down will bring you to the next or previous state.

Then if you want a submenu, then you'll have to save your current state and initialize a new menu state machine.
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Tue Jul 05, 2005 6:42 am     Reply with quote

I create a const data struct that contains many things about a menu entry. What to do if you press a certain button (function pointers), menu text, ...., and the "parent menu" id. With this, there is no need to save the current state since you will know where to go when the user hits the back or up button.
Guest








PostPosted: Thu Jul 07, 2005 12:01 pm     Reply with quote

I also I'm designing a user interface and would like to use function pointers. I'm a little confussed after reading the posts. Does the compiler fully support pointers to functions? What are the limitations? Can they be used inside of a structure?

Any input that you guys have would be great.

Thanks,

Joel
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Thu Jul 07, 2005 12:04 pm     Reply with quote

The compiler doesn't like const pointers to functions. The post I made was a work around for that. If you read the post, you will see that I did use them in a struct.
Guest








PostPosted: Thu Jul 07, 2005 12:14 pm     Reply with quote

I wanted something more portable. Does CCS no about this limitation? I think that there offical statement is that they completely support pointers to functions.
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Thu Jul 07, 2005 12:15 pm     Reply with quote

Then you will need to use a different compiler.
Guest








PostPosted: Thu Jul 07, 2005 12:20 pm     Reply with quote

Thanks for you input Mark,

Hopefully in time they will fix some parts of the compiler......
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Thu Jul 07, 2005 12:21 pm     Reply with quote

They will have to make the decision to allow pointers to consts.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group