Fixes #19671 Change-Id: I2ef001666ac4fa88364c7c5d5c95b0d96d5a090a Reviewed-on: https://review.haiku-os.org/c/haiku/+/9605 Reviewed-by: Stefano Ceccherini <[email protected]> Reviewed-by: waddlesplash <[email protected]> Tested-by: Commit checker robot <[email protected]>
77 lines
1.8 KiB
C++
77 lines
1.8 KiB
C++
/*
|
|
* Copyright 2001-2013 Haiku, Inc. All rights reserved.
|
|
* Distributed under the terms of the MIT License.
|
|
*
|
|
* Authors:
|
|
* Stephan Aßmus, [email protected]
|
|
* Marc Flerackers, [email protected]
|
|
* John Scipione, [email protected]
|
|
*/
|
|
#ifndef _BMC_PRIVATE_H
|
|
#define _BMC_PRIVATE_H
|
|
|
|
|
|
#include <BeBuild.h>
|
|
#include <MenuBar.h>
|
|
#include <MessageFilter.h>
|
|
|
|
|
|
static const float kVMargin = 2.0f;
|
|
|
|
|
|
class _BMCFilter_ : public BMessageFilter {
|
|
public:
|
|
_BMCFilter_(BMenuField* menuField, uint32 what);
|
|
virtual ~_BMCFilter_();
|
|
|
|
virtual filter_result Filter(BMessage* message, BHandler** handler);
|
|
|
|
private:
|
|
_BMCFilter_& operator=(const _BMCFilter_&);
|
|
|
|
BMenuField* fMenuField;
|
|
};
|
|
|
|
|
|
class _BMCMenuBar_ : public BMenuBar {
|
|
public:
|
|
_BMCMenuBar_(BRect frame, bool fixedSize,
|
|
BMenuField* menuField);
|
|
_BMCMenuBar_(BMenuField* menuField);
|
|
_BMCMenuBar_(BMessage* data);
|
|
virtual ~_BMCMenuBar_();
|
|
|
|
static BArchivable* Instantiate(BMessage* data);
|
|
|
|
virtual void AttachedToWindow();
|
|
virtual void Draw(BRect updateRect);
|
|
virtual void MouseMoved(BPoint where, uint32 code, const BMessage* dragMessage);
|
|
virtual void FrameResized(float width, float height);
|
|
virtual void MakeFocus(bool focused = true);
|
|
virtual void MessageReceived(BMessage* message);
|
|
virtual void SetMaxContentWidth(float width);
|
|
virtual void SetEnabled(bool enabled);
|
|
|
|
void TogglePopUpMarker(bool show)
|
|
{ fShowPopUpMarker = show; }
|
|
bool IsPopUpMarkerShown() const
|
|
{ return fShowPopUpMarker; }
|
|
|
|
virtual BSize MinSize();
|
|
virtual BSize MaxSize();
|
|
|
|
private:
|
|
_BMCMenuBar_&operator=(const _BMCMenuBar_&);
|
|
|
|
void _Init();
|
|
|
|
BMenuField* fMenuField;
|
|
bool fFixedSize;
|
|
bool fShowPopUpMarker;
|
|
bool fIsInside;
|
|
float fPreviousWidth;
|
|
};
|
|
|
|
|
|
#endif // _BMC_PRIVATE_H
|