Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/01/01 07:00
Read: times


 
#8883 - RE: Menu
Hi, aka j, Erik, All!

aka j, you had a lot of interesting things to be remembered. I regret
very much that Z80 core looks like not so popular in these days.

>The variable lengths were supported because the menu structure for
>drill-down information was not specified precisely. The order on
>subscreens and the count of items could change upon the customer's
>request so the structure made it easy.

The menu structure I was going to implemet was something like this:

struct m_item {
unsigned char num; /* serial number of node */
unsigned char * const s_ptr; /* ptr to menu item string */
struct m_item * const up_sptr; /* Ptr to an upper node */
struct m_item * const down_sptr; /* Ptr to a down node */
struct m_item * const left_sptr; /* Ptr to a left node */
struct m_item * const right_sptr; /* Ptr to a right node */
unsigned char const (* f_ptr)(void); /* a function to be performed */
};

I hope just number of such blocks would be variable.

In case of bi-lingual menu second line could be replaced with

unsigned char * * const s_pptr;
or unsigned char * const s_ptrs[NO_OF_LANGS];

so that access to a menu string would be like this:

sprintf(lcd_buf_ptr, "%-16s", *(s_pptr+lang));
or sprintf(lcd_buf_ptr, "%-16s", s_ptrs[lang]);

if I am not mistaken.
Just it might be needed to play with modifier "const", to get
a varieble pptr inside of totally constant structures.

I have attempted it with a not bi-lingual menu. It works, but
I still cannot evaluate how is it better or not. A more simple
code to move via items, but filling the structure with required
values sems to me not so easy yet. Our unit must be ready for
showing to customers every day. And my experiments are interrupted
all the time.

Thank you!
Best regards,
Oleg

List of 14 messages in thread
TopicAuthorDate
Menu            01/01/70 00:00      
RE: Menu            01/01/70 00:00      
RE: Menu            01/01/70 00:00      
RE: Menu            01/01/70 00:00      
RE: Menu            01/01/70 00:00      
RE: Menu            01/01/70 00:00      
RE: Menu            01/01/70 00:00      
RE: Menu            01/01/70 00:00      
RE: Menu            01/01/70 00:00      
RE: Menu            01/01/70 00:00      
RE: Menu            01/01/70 00:00      
RE: Menu            01/01/70 00:00      
RE: Menu            01/01/70 00:00      
RE: Menu            01/01/70 00:00      

Back to Subject List