1 /* 2 * Copyright 2001-2009, Haiku, Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _OPTION_POP_UP_H 6 #define _OPTION_POP_UP_H 7 8 9 #include <OptionControl.h> 10 11 12 class BMenuField; 13 14 15 class BOptionPopUp : public BOptionControl { 16 public: 17 BOptionPopUp(BRect frame, const char* name, 18 const char* label, BMessage* message, 19 uint32 resizeMask = B_FOLLOW_LEFT 20 | B_FOLLOW_TOP, 21 uint32 flags = B_WILL_DRAW); 22 BOptionPopUp(BRect frame, const char* name, 23 const char* label, BMessage* message, 24 bool fixed, uint32 resizeMask 25 = B_FOLLOW_LEFT | B_FOLLOW_TOP, 26 uint32 flags = B_WILL_DRAW); 27 BOptionPopUp(const char* name, 28 const char* label, BMessage* message, 29 uint32 flags = B_WILL_DRAW); 30 31 virtual ~BOptionPopUp(); 32 33 BMenuField* MenuField(); 34 35 virtual bool GetOptionAt(int32 index, const char** _name, 36 int32* _value); 37 virtual void RemoveOptionAt(int32 index); 38 virtual int32 CountOptions() const; 39 virtual status_t AddOptionAt(const char* name, int32 value, 40 int32 index); 41 42 virtual void AllAttached(); 43 virtual void AttachedToWindow(); 44 virtual void MessageReceived(BMessage* message); 45 virtual void SetLabel(const char* text); 46 virtual void SetValue(int32 value); 47 virtual void SetEnabled(bool enabled); 48 virtual void GetPreferredSize(float* _width, 49 float* _height); 50 virtual void ResizeToPreferred(); 51 52 virtual int32 SelectedOption(const char** _name = 0, 53 int32* _value = 0) const; 54 private: 55 // Forbidden and FBC padding 56 BOptionPopUp(); 57 BOptionPopUp(const BOptionPopUp& other); 58 BOptionPopUp& operator=(const BOptionPopUp& other); 59 60 61 virtual status_t _Reserved_OptionControl_0(void*, ...); 62 virtual status_t _Reserved_OptionControl_1(void*, ...); 63 virtual status_t _Reserved_OptionControl_2(void*, ...); 64 virtual status_t _Reserved_OptionControl_3(void*, ...); 65 66 virtual status_t _Reserved_OptionPopUp_0(void*, ...); 67 virtual status_t _Reserved_OptionPopUp_1(void*, ...); 68 virtual status_t _Reserved_OptionPopUp_2(void*, ...); 69 virtual status_t _Reserved_OptionPopUp_3(void*, ...); 70 virtual status_t _Reserved_OptionPopUp_4(void*, ...); 71 virtual status_t _Reserved_OptionPopUp_5(void*, ...); 72 virtual status_t _Reserved_OptionPopUp_6(void*, ...); 73 virtual status_t _Reserved_OptionPopUp_7(void*, ...); 74 75 private: 76 BMenuField* fMenuField; 77 78 uint32 _reserved[8]; 79 }; 80 81 #endif // _OPTION_POP_UP_H 82