Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

menurt.h File Reference

This is ncurses based menu definition module. More...

#include "basetypes.h"

Data Structures

struct  ITEM
 This is structure for individual item of structure MENU. More...

struct  MENU
 This is structure for menu routines. More...


Defines

#define NOTSELECTED   FALSE
#define SELECTED   TRUE
#define SEPARATOR   FALSE
#define REGULARITEM   TRUE
#define OPTIONSTRLEN_MAX   50
 Definitons for maximal len for ``option'' in struct ``ITEM''. More...

#define DESCSTRLEN_MAX   81
 Definitons for maximal len for ``desc'' in struct ``ITEM''. More...

#define SHORTCUTSTRLEN_MAX   25
 Definitons for maximal len for ``shortcuts'' in struct ``MENU''. More...


Functions

void initmenu (struct MENU *menu, int lines, int cols, int y, int x, int use_shadow)
 initmenu. More...

void additem (struct MENU *menu, char *item, char *desc)
 additem. More...

void showitem (struct MENU *menu, struct ITEM *itemptr, int selected)
 showitem. More...

void showmenu (struct MENU *menu)
 showmenu. More...

void menumoveto (struct MENU *menu, struct ITEM **itemptr, unsigned int row)
void operatemenu (struct MENU *menu, int *row, int *aborted)
 operatemenu. More...

void hidemenu (struct MENU *menu)
 hidemenu. More...

void unhidemenu (struct MENU *menu)
 unhidemenu. More...

void destroymenu (struct MENU *menu)
 destroymenu. More...

char * menu_option_to_char (struct MENU *menu, int row)
 menu_option_to_char. More...


Detailed Description

This is ncurses based menu definition module.

Author:
Igor Bujna
Date:
Pá čec 26 09:59:28 CEST 2002
Version:
1.01

Define Documentation

#define DESCSTRLEN_MAX   81
 

Definitons for maximal len for ``desc'' in struct ``ITEM''.

#define NOTSELECTED   FALSE
 

#define OPTIONSTRLEN_MAX   50
 

Definitons for maximal len for ``option'' in struct ``ITEM''.

#define REGULARITEM   TRUE
 

#define SELECTED   TRUE
 

#define SEPARATOR   FALSE
 

#define SHORTCUTSTRLEN_MAX   25
 

Definitons for maximal len for ``shortcuts'' in struct ``MENU''.


Function Documentation

void additem struct MENU   menu,
char *    item,
char *    desc
 

additem.

Parameters:
menu  Pointer to given menu
item  Given name for item
desc  Given description for item
Returns:
void
Routines for putting given ``item'' with description ``desc'' to menu.
  1. If some word from ``item'' is among with string ``^''. This word is shortcut for this place in menu. This word has other color resolution (blue).

void destroymenu struct MENU   menu
 

destroymenu.

Parameters:
menu  Pointer to given menu
Returns:
void
Destroy every routines for menu and freeing memory.

void hidemenu struct MENU   menu
 

hidemenu.

Parameters:
menu  Pointer to given menu
Returns:
void
Hide given menu.

void initmenu struct MENU   menu,
int    lines,
int    cols,
int    y,
int    x,
int    use_shadow
 

initmenu.

Parameters:
menu  Pointer to given menu
lines  Number of lines in given menu on the screen
cols  Number of cols in given menu on the screen
y  Position in ``y'' in start menu on the screen
x  Position in ``x'' in start menu on the screen
use_shadow  TRUE or FALSE for using shadow for given menu
Returns:
void
Initialize menu system. it's pointer to ``struct MENU''.
  1. The menu start in ``x'' and ``y'' on the screen and have number of ``lines'' and ``cols''.
  2. If ``use_shadow'' is TRUE, menu have shadow above menu screen (like 3 dimension).

char* menu_option_to_char struct MENU   menu,
int    row
 

menu_option_to_char.

Parameters:
menu  Pointer to given menu
row  It's given item in menu
Returns:
char
This routines return name for given item.
  1. from return name will be delete this char '^'

void menumoveto struct MENU   menu,
struct ITEM **    itemptr,
unsigned int    row
 

void operatemenu struct MENU   menu,
int *    row,
int *    aborted
 

operatemenu.

Parameters:
menu  Pointer to given menu
row  Pointer to actaly position in menu
aborted  It's last key pressed
Returns:
void
Routines for actually do the menu operation after all the initialization(``showitem'' or ``showmenu'').

void showitem struct MENU   menu,
struct ITEM   itemptr,
int    selected
 

showitem.

Parameters:
menu  Pointer to given menu
itemptr 
selected 
Returns:
void
Routines for showing indiviadual item from menu.

void showmenu struct MENU   menu
 

showmenu.

Parameters:
menu  Pointer to given menu
Returns:
void
Routines for repeatedly calls showitem to display individual items. You call for redrawin menu.

void unhidemenu struct MENU   menu
 

unhidemenu.

Parameters:
menu  Pointer to given menu @retrun void
Unhide given menu.


Generated on Wed Apr 2 06:51:16 2003 for TFCC by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001