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