#ifndef CODE_MENUP_H
#define CODE_MENUP_H

/*-----------------------------------------------------------------------
 * Xclasses header file
 * ($Id: menu_p.h,v 1.2 1998/07/29 23:02:30 schmitzj Exp $)
 * 
 * Copyright (C) 1998 Jürgen Schmitz
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA  02111-1307, USA.
 *-----------------------------------------------------------------------
 */

#include <Xclasses/popup.h>
#include <Xclasses/gadget.h>
#include <Xclasses/gfx_text.h>
#include <Xclasses/menu.h>
#include <Xclasses/callable.h>
#include <Xclasses/dlist.h>

#define LEFT	5
#define SPACE	15
#define TOP		7
#define BOTTOM	7
#define MTOP	1
#define MBOTTOM	2
#define UPPOP	2

struct menupunkt
{
	struct node base;

	int			right:1,
				free:1;
	gfx_text	text;
	int 		x,h,w;

	popup		pops;
};

class pmenu : public callable
{
	friend class menu;

public:
	class menu *o;
	
	dlist 		punkte;

	int 		sel;
	menupunkt 	*addto;
	menupunkt	*offen;
	int			hashelp;
	int			nohelp:1,
				reason_inother:1,
				reason_inhelp:1,
				reason_subwin:1,
				new_style:1,
				free:1;

    pmenu();
    ~pmenu();
    
    void setpos(void);
    void setwidth(void);
    void draw(void);
    void helpmenu(void);
    int  handleHelp(void);
	int  keyhook(popup *,int userdata);
};

#endif
