2006-05-28 11:48:53 +04:00
|
|
|
/*
|
2009-03-25 17:53:10 +03:00
|
|
|
* Copyright 2001-2009 Haiku, Inc. All rights reserved.
|
2006-05-28 11:48:53 +04:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Marc Flerackers (mflerackers@androme.be)
|
|
|
|
* Stephan Aßmus <superstippi@gmx.de>
|
|
|
|
*/
|
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>
|
|
|
|
#include <MenuItem.h>
|
2006-05-28 11:48:53 +04:00
|
|
|
#include <MessageFilter.h>
|
2003-06-16 12:32:55 +04:00
|
|
|
|
2007-10-16 00:13:55 +04:00
|
|
|
class BMessageRunner;
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
_BMCMenuBar_(bool fixedSize,
|
|
|
|
BMenuField* menuField);
|
|
|
|
_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 MessageReceived(BMessage* msg);
|
|
|
|
virtual void MakeFocus(bool focused = true);
|
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
|
|
|
|
2009-08-07 03:24:48 +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_&);
|
|
|
|
|
|
|
|
void _Init(bool setMaxContentWidth);
|
2007-10-16 00:13:55 +04:00
|
|
|
|
2009-03-25 17:53:10 +03:00
|
|
|
BMenuField* fMenuField;
|
|
|
|
bool fFixedSize;
|
|
|
|
BMessageRunner* fRunner;
|
|
|
|
bool fShowPopUpMarker;
|
|
|
|
float fPreviousWidth;
|
2003-06-16 12:32:55 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // _BMC_PRIVATE_H
|