xref: /haiku/headers/os/interface/OptionPopUp.h (revision d5cd5d63ff0ad395989db6cf4841a64d5b545d1d)
1 /*******************************************************************************
2 /
3 /	File:			OptionPopUp.h
4 /
5 /   Description:  A BOptionPopUp is a BControl that has a popup menu.
6 /
7 /	Copyright 1997-99, Be Incorporated, All Rights Reserved
8 /
9 *******************************************************************************/
10 
11 
12 #if !defined(_OPTION_POP_UP_H)
13 #define _OPTION_POP_UP_H
14 
15 #include <OptionControl.h>
16 
17 
18 class BMenuField;
19 
20 
21 
22 class BOptionPopUp :
23 	public BOptionControl
24 {
25 public:
26 							BOptionPopUp(
27 									BRect frame,
28 									const char * name,
29 									const char * label,
30 									BMessage * message,
31 									uint32 resize = B_FOLLOW_LEFT | B_FOLLOW_TOP,
32 									uint32 flags = B_WILL_DRAW);
33 							BOptionPopUp(
34 									BRect frame,
35 									const char * name,
36 									const char * label,
37 									BMessage * message,
38 									bool fixed,
39 									uint32 resize = B_FOLLOW_LEFT | B_FOLLOW_TOP,
40 									uint32 flags = B_WILL_DRAW);
41 							~BOptionPopUp();
42 
43 		BMenuField *		MenuField();
44 
45 virtual	bool				GetOptionAt(
46 									int32 index,
47 									const char ** out_name,
48 									int32 * out_value);
49 virtual	void				RemoveOptionAt(
50 									int32 index);
51 virtual	int32				CountOptions() const;
52 virtual	status_t			AddOptionAt(
53 									const char * name,
54 									int32 value,
55 									int32 index);
56 
57 virtual	void				AllAttached();
58 virtual	void				MessageReceived(
59 									BMessage * message);
60 virtual	void				SetLabel(
61 									const char *text);
62 virtual	void				SetValue(
63 									int32 value);
64 virtual	void				SetEnabled(
65 									bool on);
66 virtual	void				GetPreferredSize(
67 									float *width,
68 									float *height);
69 virtual	void				ResizeToPreferred();
70 virtual	int32				SelectedOption(
71 									const char ** outName = 0,
72 									int32 * outValue = 0) const;
73 private:
74 
75 		BOptionPopUp();	/* private unimplemented */
76 		BOptionPopUp(
77 				const BOptionPopUp & clone);
78 		BOptionPopUp & operator=(
79 				const BOptionPopUp & clone);
80 
81 		/* Mmmh, stuffing! */
82 virtual		status_t _Reserved_OptionControl_0(void *, ...);
83 virtual		status_t _Reserved_OptionControl_1(void *, ...);
84 virtual		status_t _Reserved_OptionControl_2(void *, ...);
85 virtual		status_t _Reserved_OptionControl_3(void *, ...);
86 		/* Mmmh, stuffing! */
87 virtual		status_t _Reserved_OptionPopUp_0(void *, ...);
88 virtual		status_t _Reserved_OptionPopUp_1(void *, ...);
89 virtual		status_t _Reserved_OptionPopUp_2(void *, ...);
90 virtual		status_t _Reserved_OptionPopUp_3(void *, ...);
91 virtual		status_t _Reserved_OptionPopUp_4(void *, ...);
92 virtual		status_t _Reserved_OptionPopUp_5(void *, ...);
93 virtual		status_t _Reserved_OptionPopUp_6(void *, ...);
94 virtual		status_t _Reserved_OptionPopUp_7(void *, ...);
95 
96 
97 		BMenuField * _mField;
98 		uint32 _reserved_menu_control_[8];
99 
100 };
101 
102 
103 
104 
105 #endif /* _OPTION_POP_UP_H */
106