2006-05-28 07:48:53 +00:00
|
|
|
/*
|
2013-05-06 16:53:21 -04:00
|
|
|
* Copyright 2001-2013 Haiku, Inc. All rights reserved.
|
2006-05-28 07:48:53 +00:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Authors:
|
2013-05-06 16:53:21 -04:00
|
|
|
* Stephan Aßmus, superstippi@gmx.de
|
|
|
|
* Marc Flerackers, mflerackers@androme.be
|
|
|
|
* John Scipione, jscipione@gmail.com
|
2006-05-28 07:48:53 +00:00
|
|
|
*/
|
2003-06-16 08:32:55 +00:00
|
|
|
#ifndef _BMC_PRIVATE_H
|
|
|
|
#define _BMC_PRIVATE_H
|
|
|
|
|
2007-10-15 20:13:55 +00:00
|
|
|
|
2003-06-16 08:32:55 +00:00
|
|
|
#include <BeBuild.h>
|
|
|
|
#include <MenuBar.h>
|
2006-05-28 07:48:53 +00:00
|
|
|
#include <MessageFilter.h>
|
2003-06-16 08:32:55 +00:00
|
|
|
|
2013-05-06 18:29:34 -04:00
|
|
|
|
2013-05-26 01:52:23 -04:00
|
|
|
static const float kVMargin = 2.0f;
|
|
|
|
|
|
|
|
|
2007-10-15 20:13:55 +00:00
|
|
|
class BMessageRunner;
|
|
|
|
|
|
|
|
|
2006-05-28 07:48:53 +00:00
|
|
|
class _BMCFilter_ : public BMessageFilter {
|
|
|
|
public:
|
2009-03-25 14:53:10 +00:00
|
|
|
_BMCFilter_(BMenuField* menuField, uint32 what);
|
|
|
|
virtual ~_BMCFilter_();
|
|
|
|
|
|
|
|
virtual filter_result Filter(BMessage* message, BHandler** handler);
|
2006-05-28 07:48:53 +00:00
|
|
|
|
|
|
|
private:
|
2009-03-25 14:53:10 +00:00
|
|
|
_BMCFilter_& operator=(const _BMCFilter_&);
|
|
|
|
|
|
|
|
BMenuField* fMenuField;
|
2006-05-28 07:48:53 +00:00
|
|
|
};
|
2003-06-16 08:32:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
class _BMCMenuBar_ : public BMenuBar {
|
|
|
|
public:
|
2009-03-25 14:53:10 +00:00
|
|
|
_BMCMenuBar_(BRect frame, bool fixedSize,
|
|
|
|
BMenuField* menuField);
|
2013-05-06 17:00:42 -04:00
|
|
|
_BMCMenuBar_(BMenuField* menuField);
|
2009-03-25 14:53:10 +00:00
|
|
|
_BMCMenuBar_(BMessage* data);
|
|
|
|
virtual ~_BMCMenuBar_();
|
2003-06-16 08:32:55 +00:00
|
|
|
|
2009-03-25 14:53:10 +00:00
|
|
|
static BArchivable* Instantiate(BMessage* data);
|
2003-06-16 08:32:55 +00:00
|
|
|
|
2009-03-25 14:53:10 +00:00
|
|
|
virtual void AttachedToWindow();
|
|
|
|
virtual void Draw(BRect updateRect);
|
|
|
|
virtual void FrameResized(float width, float height);
|
|
|
|
virtual void MessageReceived(BMessage* msg);
|
|
|
|
virtual void MakeFocus(bool focused = true);
|
2013-05-29 23:56:08 -04:00
|
|
|
virtual void SetMaxContentWidth(float width);
|
2013-08-20 18:15:13 -04:00
|
|
|
virtual void SetEnabled(bool enabled);
|
2003-06-16 08:32:55 +00:00
|
|
|
|
2009-03-25 14:53:10 +00:00
|
|
|
void TogglePopUpMarker(bool show)
|
|
|
|
{ fShowPopUpMarker = show; }
|
|
|
|
bool IsPopUpMarkerShown() const
|
|
|
|
{ return fShowPopUpMarker; }
|
2007-06-19 23:09:01 +00:00
|
|
|
|
2013-05-06 18:29:34 -04:00
|
|
|
virtual BSize MinSize();
|
2009-03-25 14:53:10 +00:00
|
|
|
virtual BSize MaxSize();
|
2007-06-19 23:09:01 +00:00
|
|
|
|
2003-06-16 08:32:55 +00:00
|
|
|
private:
|
2009-03-25 14:53:10 +00:00
|
|
|
_BMCMenuBar_&operator=(const _BMCMenuBar_&);
|
|
|
|
|
2013-06-07 03:25:36 -04:00
|
|
|
void _Init();
|
2007-10-15 20:13:55 +00:00
|
|
|
|
2009-03-25 14:53:10 +00:00
|
|
|
BMenuField* fMenuField;
|
|
|
|
bool fFixedSize;
|
|
|
|
BMessageRunner* fRunner;
|
|
|
|
bool fShowPopUpMarker;
|
|
|
|
float fPreviousWidth;
|
2003-06-16 08:32:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _BMC_PRIVATE_H
|