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