#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, const char* nom, PIMenuType pdpu=k_UTMenu);
	          ~PIMenuX();
				   
  virtual void	  AppendItem(const char* nom, PIMessage msg, char* sc=NULL);
  virtual void	  AppendCheckItem(const char* nom, PIMessage msg, char* sc=NULL);
  virtual void	  AppendPDMenu(PIMenuGen *pdm, char* sc=NULL);
  virtual void	  AppendSeparator();

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

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

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

  virtual void    SetState(const char *nom, bool st=false); 
  virtual void    SetStateMsg(PIMessage msg, bool st=false); 
  virtual void    SetStateNum(int n, bool st=false);
 
  virtual bool    GetState(const 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(const 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;
int mNSep;
_pimxit_  * mBut;
char mSItem[96];
};


typedef PIMenuX        PIMenu;


#endif
