1 /* 2 * Copyright 2014 Haiku, Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * John Scipione, jscipione@gmail.com 7 */ 8 #ifndef COLOR_MENU_ITEM_H 9 #define COLOR_MENU_ITEM_H 10 11 12 #include <InterfaceDefs.h> 13 #include <MenuItem.h> 14 15 16 class BColorMenuItem : public BMenuItem { 17 public: 18 BColorMenuItem(const char* label, 19 BMessage* message, rgb_color color, 20 char shortcut = 0, 21 uint32 modifiers = 0); 22 BColorMenuItem(BMenu* menu, rgb_color color, 23 BMessage* message = NULL); 24 BColorMenuItem(BMessage* data); 25 26 static BArchivable* Instantiate(BMessage* archive); 27 virtual status_t Archive(BMessage* archive, 28 bool deep = true) const; 29 30 virtual void DrawContent(); 31 virtual void GetContentSize(float* _width, float* _height); 32 33 virtual void SetMarked(bool mark); 34 35 rgb_color Color() const { return fColor; }; 36 virtual void SetColor(rgb_color color) { fColor = color; }; 37 38 private: 39 virtual void _ReservedColorMenuItem1(); 40 virtual void _ReservedColorMenuItem2(); 41 virtual void _ReservedColorMenuItem3(); 42 virtual void _ReservedColorMenuItem4(); 43 virtual void _ReservedColorMenuItem5(); 44 virtual void _ReservedColorMenuItem6(); 45 virtual void _ReservedColorMenuItem7(); 46 virtual void _ReservedColorMenuItem8(); 47 virtual void _ReservedColorMenuItem9(); 48 virtual void _ReservedColorMenuItem10(); 49 virtual void _ReservedColorMenuItem11(); 50 virtual void _ReservedColorMenuItem12(); 51 virtual void _ReservedColorMenuItem13(); 52 virtual void _ReservedColorMenuItem14(); 53 virtual void _ReservedColorMenuItem15(); 54 virtual void _ReservedColorMenuItem16(); 55 virtual void _ReservedColorMenuItem17(); 56 virtual void _ReservedColorMenuItem18(); 57 virtual void _ReservedColorMenuItem19(); 58 virtual void _ReservedColorMenuItem20(); 59 60 float _LeftMargin(); 61 float _Padding(); 62 float _ColorRectWidth(); 63 64 private: 65 rgb_color fColor; 66 67 uint32 _reserved[30]; 68 }; 69 70 71 #endif // COLOR_MENU_ITEM_H 72