#ifndef PIMENUX_H_SEEN
#define PIMENUX_H_SEEN

#include "pimenugen.h"


class PIMenuX ;

struct _pimxit_ 
{
SysDWdg itb;
PIMenuX *pmen;
PIMessage msg;
int toggpdm;      // 0= Normal Item, 1, Toggle Item,  2= PDMenu
bool togstate;    // true , false pour toggle items  
};



class PIMenuX : public PIMenuGen {
public:
	          PIMenuX(PIWdg* par, char* nom, PIMenuType pdpu=k_UTMenu);
	          ~PIMenuX();
				   
  virtual void	  AppendItem(char* nom, PIMessage msg, char* sc=NULL);
  virtual void	  AppendCheckItem(char* nom, PIMessage msg, char* sc=NULL);
  virtual void	  AppendPDMenu(PIMenuGen *pdm, char* sc=NULL);

  virtual void    DeleteItem(char *nom);
  virtual void    DeleteItemMsg(PIMessage msg);
  virtual void    DeleteItemNum(int n);

  virtual void    SetSensitivity(char *nom, bool sens=true); 
  virtual void    SetSensitivityMsg(PIMessage msg, bool sens=true); 
  virtual void    SetSensitivityNum(int n, bool sens=true);

  virtual bool    IsSensitive(char *nom);
  virtual bool    IsSensitiveMsg(PIMessage msg);
  virtual bool    IsSensitiveNum(int n);

  virtual void    SetState(char *nom, bool st=false); 
  virtual void    SetStateMsg(PIMessage msg, bool st=false); 
  virtual void    SetStateNum(int n, bool st=false);
 
  virtual bool    GetState(char *nom); 
  virtual bool    GetStateMsg(PIMessage msg); 
  virtual bool    GetStateNum(int n); 

  virtual void    Show();
  virtual void    Show(PIWdg *w, int px, int py);


// Pour usage prive et par OptionMenu, ...
  PIMessage       ItemMsg(int n);
  int             GetNumItem(char *nom);
  int             GetNumItemMsg(PIMessage msg);
  SysDWdg         GetItemWdg(int n);
  char*           ItemName(int n);
  char*           ItemNameWdg(SysDWdg itw);

protected:
        void      AddItem(const char* nom, PIMessage msg, int tog, char* sc, PIMenuX *pdm);

int mNItem, mNItemMax;
_pimxit_  * mBut;
char mSItem[96];
};


typedef PIMenuX        PIMenu;


#endif
