/****************************************************************************
	Knihovna obsahuje definici tridy TMainMenuObject, ktera je zakladnim staveb-
	nim kamenem pro praci s polozkami v menu. 

*****************************************************************************/

#ifndef GR_MENU_ITEM_H
#define GR_MENU_ITEM_H
#include "OS_types.h"
#include "GR_object.h"

typedef union TMainMenuOutState
{
	RESULT result;
	void * subMenus;
}TMainMenuOutState;

/****************************************************************************
	Trida je zakladnim stavebnim kamenem menu

*****************************************************************************/
class TMainMenuObject
{
public:
	TScreenObject * subObjects;								//Graficke objekty nalezejici menu
	TMainMenuObject * subMenus;								//Polozky menu
	char subCount;											//Pocet podpolozek
	ANSWER isExecutable;									//Flag jestli polozka obsahuje aplikaci nebo podmenu
	TASK_NAME Application;									//ID aplikace v OS
	void InitSub(TScreenObject* subitems, TMainMenuObject * submenus, char count);		//Inicializace jako podmenu
	void InitApp(TASK_NAME App);														//Inicializace jako odkaz
	TMainMenuObject(){};																//Konstruktor
	TMainMenuOutState * Click(OBJECT_MESSAGE msg);										//Callback polozky
};



#endif