ec592aa9e5
the maximum width. The latter supports unlimited maximum width. The _BMCMenuBar_ draws fine when resized wider than its min/preferred width, but not the complete "button" area will cause the menu to open when being pressed. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21465 a95241bf-73f2-0310-859d-f6bbb57e9c96
64 lines
1.5 KiB
C++
64 lines
1.5 KiB
C++
/*
|
|
* Copyright 2001-2006, Haiku, Inc.
|
|
* Distributed under the terms of the MIT License.
|
|
*
|
|
* Authors:
|
|
* Marc Flerackers (mflerackers@androme.be)
|
|
* Stephan Aßmus <superstippi@gmx.de>
|
|
*/
|
|
|
|
|
|
#ifndef _BMC_PRIVATE_H
|
|
#define _BMC_PRIVATE_H
|
|
|
|
#include <BeBuild.h>
|
|
#include <MenuBar.h>
|
|
#include <MenuItem.h>
|
|
#include <MessageFilter.h>
|
|
|
|
class _BMCFilter_ : public BMessageFilter {
|
|
public:
|
|
_BMCFilter_(BMenuField *menuField, uint32 what);
|
|
~_BMCFilter_();
|
|
filter_result Filter(BMessage *message, BHandler **handler);
|
|
|
|
private:
|
|
_BMCFilter_ &operator=(const _BMCFilter_ &);
|
|
BMenuField *fMenuField;
|
|
};
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
class _BMCMenuBar_ : public BMenuBar {
|
|
|
|
public:
|
|
_BMCMenuBar_(BRect frame, bool fixed_size,
|
|
BMenuField *menuField);
|
|
_BMCMenuBar_(BMessage *data);
|
|
virtual ~_BMCMenuBar_();
|
|
|
|
static BArchivable *Instantiate(BMessage *data);
|
|
|
|
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);
|
|
|
|
void TogglePopUpMarker(bool show) { fShowPopUpMarker = show; }
|
|
bool IsPopUpMarkerShown() const { return fShowPopUpMarker; }
|
|
|
|
virtual BSize MaxSize();
|
|
|
|
private:
|
|
_BMCMenuBar_&operator=(const _BMCMenuBar_ &);
|
|
|
|
BMenuField *fMenuField;
|
|
bool fFixedSize;
|
|
BMessageRunner *fRunner;
|
|
bool fShowPopUpMarker;
|
|
};
|
|
//------------------------------------------------------------------------------
|
|
|
|
#endif // _BMC_PRIVATE_H
|