1// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 2// 3// Copyright (c) 2004, Haiku 4// 5// This software is part of the Haiku distribution and is covered 6// by the Haiku license. 7// 8// 9// File: MethodMenuItem.h 10// Authors: Jérôme Duval, 11// 12// Description: Input Server 13// Created: October 19, 2004 14// 15// ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ 16 17#ifndef METHOD_MENUITEM_H_ 18#define METHOD_MENUITEM_H_ 19 20#include <Bitmap.h> 21#include <MenuItem.h> 22 23#define MENUITEM_ICON_SIZE 16 24 25class MethodMenuItem : public BMenuItem { 26 public: 27 MethodMenuItem(int32 cookie, const char *label, const uchar *icon, BMenu *subMenu, BMessenger &messenger); 28 MethodMenuItem(int32 cookie, const char *label, const uchar *icon); 29 30 virtual ~MethodMenuItem(); 31 32 virtual void DrawContent(); 33 virtual void GetContentSize(float *width, float *height); 34 35 void SetName(const char *name); 36 const char *Name() { return Label(); }; 37 38 void SetIcon(const uchar *icon); 39 const uchar *Icon() { return(uchar *)fIcon.Bits(); }; 40 41 int32 Cookie() { return fCookie; }; 42 private: 43 BBitmap fIcon; 44 int32 fCookie; 45 BMessenger fMessenger; 46}; 47 48#endif 49