xref: /haiku/headers/private/interface/BMCPrivate.h (revision 5d9e40fe9252c8f9c5e5e41594545bfa4419fcc7)
1 //------------------------------------------------------------------------------
2 //	Copyright (c) 2001-2002, OpenBeOS
3 //
4 //	Permission is hereby granted, free of charge, to any person obtaining a
5 //	copy of this software and associated documentation files (the "Software"),
6 //	to deal in the Software without restriction, including without limitation
7 //	the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 //	and/or sell copies of the Software, and to permit persons to whom the
9 //	Software is furnished to do so, subject to the following conditions:
10 //
11 //	The above copyright notice and this permission notice shall be included in
12 //	all copies or substantial portions of the Software.
13 //
14 //	THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 //	IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 //	FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 //	AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 //	LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 //	FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 //	DEALINGS IN THE SOFTWARE.
21 //
22 //	File Name:		BMCPrivate.h
23 //	Author:			Marc Flerackers (mflerackers@androme.be)
24 //	Description:	The BMCPrivate classes are used by BMenuField.
25 //------------------------------------------------------------------------------
26 
27 #ifndef _BMC_PRIVATE_H
28 #define _BMC_PRIVATE_H
29 
30 // Standard Includes -----------------------------------------------------------
31 
32 // System Includes -------------------------------------------------------------
33 #include <BeBuild.h>
34 #include <MenuBar.h>
35 #include <MenuItem.h>
36 
37 // Project Includes ------------------------------------------------------------
38 
39 // Local Includes --------------------------------------------------------------
40 
41 // Local Defines ---------------------------------------------------------------
42 
43 // Globals ---------------------------------------------------------------------
44 
45 //------------------------------------------------------------------------------
46 class _BMCItem_ : public BMenuItem {
47 
48 public:
49 					_BMCItem_(BMenu *menu);
50 					_BMCItem_(BMessage *message);
51 virtual				~_BMCItem_();
52 
53 static	BArchivable	*Instantiate(BMessage *data);
54 
55 		void		Draw();
56 		void		GetContentSize(float *width, float *height);
57 
58 private:
59 friend class BMenuField;
60 
61 			bool	fShowPopUpMarker;
62 };
63 //------------------------------------------------------------------------------
64 
65 /*//------------------------------------------------------------------------------
66 _BMCFilter_::_BMCFilter_(BMenuField *menuField, uint32)
67 {
68 }
69 //------------------------------------------------------------------------------
70 _BMCFilter_::~_BMCFilter_()
71 {
72 }
73 //------------------------------------------------------------------------------
74 filter_result _BMCFilter_::Filter(BMessage *message, BHandler **handler)
75 {
76 }
77 //------------------------------------------------------------------------------
78 _BMCFilter_ &_BMCFilter_::operator=(const _BMCFilter_ &)
79 {
80 	return *this;
81 }
82 //------------------------------------------------------------------------------*/
83 
84 //------------------------------------------------------------------------------
85 class _BMCMenuBar_ : public BMenuBar {
86 
87 public:
88 					_BMCMenuBar_(BRect frame, bool fixed_size,
89 						BMenuField *menuField);
90 					_BMCMenuBar_(BMessage *data);
91 virtual				~_BMCMenuBar_();
92 
93 static	BArchivable	*Instantiate(BMessage *data);
94 
95 virtual	void		AttachedToWindow();
96 virtual	void		FrameResized(float width, float height);
97 virtual	void		MessageReceived(BMessage* msg);
98 virtual	void		MakeFocus(bool focused = true);
99 
100 private:
101 		_BMCMenuBar_&operator=(const _BMCMenuBar_ &);
102 
103 		BMenuField		*fMenuField;
104 		bool			fFixedSize;
105 		BMessageRunner	*fRunner;
106 };
107 //------------------------------------------------------------------------------
108 
109 #endif // _BMC_PRIVATE_H
110