1 /* 2 * Copyright 2001-2015, 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_TOP, 20 uint32 flags = B_WILL_DRAW); 21 BOptionPopUp(BRect frame, const char* name, 22 const char* label, BMessage* message, 23 bool fixed, uint32 resizeMask 24 = B_FOLLOW_LEFT_TOP, 25 uint32 flags = B_WILL_DRAW); 26 BOptionPopUp(const char* name, 27 const char* label, BMessage* message, 28 uint32 flags = B_WILL_DRAW); 29 30 virtual ~BOptionPopUp(); 31 32 BMenuField* MenuField(); 33 34 virtual bool GetOptionAt(int32 index, const char** _name, 35 int32* _value); 36 virtual void RemoveOptionAt(int32 index); 37 virtual int32 CountOptions() const; 38 virtual status_t AddOptionAt(const char* name, int32 value, 39 int32 index); 40 41 virtual void AllAttached(); 42 virtual void AttachedToWindow(); 43 virtual void MessageReceived(BMessage* message); 44 virtual void SetLabel(const char* text); 45 virtual void SetValue(int32 value); 46 virtual void SetEnabled(bool enabled); 47 virtual void GetPreferredSize(float* _width, 48 float* _height); 49 virtual void ResizeToPreferred(); 50 51 virtual int32 SelectedOption(const char** _name = 0, 52 int32* _value = 0) const; 53 private: 54 // Forbidden and FBC padding 55 BOptionPopUp(); 56 BOptionPopUp(const BOptionPopUp& other); 57 BOptionPopUp& operator=(const BOptionPopUp& other); 58 59 60 virtual status_t _Reserved_OptionControl_0(void*, ...); 61 virtual status_t _Reserved_OptionControl_1(void*, ...); 62 virtual status_t _Reserved_OptionControl_2(void*, ...); 63 virtual status_t _Reserved_OptionControl_3(void*, ...); 64 65 virtual status_t _Reserved_OptionPopUp_0(void*, ...); 66 virtual status_t _Reserved_OptionPopUp_1(void*, ...); 67 virtual status_t _Reserved_OptionPopUp_2(void*, ...); 68 virtual status_t _Reserved_OptionPopUp_3(void*, ...); 69 virtual status_t _Reserved_OptionPopUp_4(void*, ...); 70 virtual status_t _Reserved_OptionPopUp_5(void*, ...); 71 virtual status_t _Reserved_OptionPopUp_6(void*, ...); 72 virtual status_t _Reserved_OptionPopUp_7(void*, ...); 73 74 private: 75 BMenuField* fMenuField; 76 77 uint32 _reserved[8]; 78 }; 79 80 #endif // _OPTION_POP_UP_H 81