1cd39deccSStefano Ceccherini /* 2d5c51ba6SJohn Scipione * Copyright 2001-2013 Haiku, Inc. All rights reserved. 3cd39deccSStefano Ceccherini * Distributed under the terms of the MIT License. 4cd39deccSStefano Ceccherini * 5cd39deccSStefano Ceccherini * Authors: 6d5c51ba6SJohn Scipione * Stephan Aßmus, superstippi@gmx.de 7d5c51ba6SJohn Scipione * Marc Flerackers, mflerackers@androme.be 8d5c51ba6SJohn Scipione * John Scipione, jscipione@gmail.com 9cd39deccSStefano Ceccherini */ 107ea7a892SMarc Flerackers #ifndef _BMC_PRIVATE_H 117ea7a892SMarc Flerackers #define _BMC_PRIVATE_H 127ea7a892SMarc Flerackers 13f6e4cbb9SAxel Dörfler 147ea7a892SMarc Flerackers #include <BeBuild.h> 157ea7a892SMarc Flerackers #include <MenuBar.h> 16cd39deccSStefano Ceccherini #include <MessageFilter.h> 177ea7a892SMarc Flerackers 18e28ba280SJohn Scipione 196031e624SJohn Scipione static const float kVMargin = 2.0f; 206031e624SJohn Scipione 216031e624SJohn Scipione 22cd39deccSStefano Ceccherini class _BMCFilter_ : public BMessageFilter { 23cd39deccSStefano Ceccherini public: 24cd39deccSStefano Ceccherini _BMCFilter_(BMenuField* menuField, uint32 what); 25f6e4cbb9SAxel Dörfler virtual ~_BMCFilter_(); 260699a883SStephan Aßmus 270699a883SStephan Aßmus virtual filter_result Filter(BMessage* message, BHandler** handler); 287ea7a892SMarc Flerackers 29cd39deccSStefano Ceccherini private: 30cd39deccSStefano Ceccherini _BMCFilter_& operator=(const _BMCFilter_&); 310699a883SStephan Aßmus 32cd39deccSStefano Ceccherini BMenuField* fMenuField; 33cd39deccSStefano Ceccherini }; 34cd39deccSStefano Ceccherini 357ea7a892SMarc Flerackers 367ea7a892SMarc Flerackers class _BMCMenuBar_ : public BMenuBar { 377ea7a892SMarc Flerackers public: 380699a883SStephan Aßmus _BMCMenuBar_(BRect frame, bool fixedSize, 390699a883SStephan Aßmus BMenuField* menuField); 402bf1592aSJohn Scipione _BMCMenuBar_(BMenuField* menuField); 417ea7a892SMarc Flerackers _BMCMenuBar_(BMessage* data); 427ea7a892SMarc Flerackers virtual ~_BMCMenuBar_(); 437ea7a892SMarc Flerackers 447ea7a892SMarc Flerackers static BArchivable* Instantiate(BMessage* data); 457ea7a892SMarc Flerackers 467ea7a892SMarc Flerackers virtual void AttachedToWindow(); 472e6a5805SStephan Aßmus virtual void Draw(BRect updateRect); 487ea7a892SMarc Flerackers virtual void FrameResized(float width, float height); 497ea7a892SMarc Flerackers virtual void MakeFocus(bool focused = true); 503dd9ff2bSJohn Scipione virtual void MessageReceived(BMessage* message); 51ca3a1c04SJohn Scipione virtual void SetMaxContentWidth(float width); 52408c0ee4SJohn Scipione virtual void SetEnabled(bool enabled); 53cd39deccSStefano Ceccherini TogglePopUpMarker(bool show)540699a883SStephan Aßmus void TogglePopUpMarker(bool show) 550699a883SStephan Aßmus { fShowPopUpMarker = show; } IsPopUpMarkerShown()560699a883SStephan Aßmus bool IsPopUpMarkerShown() const 570699a883SStephan Aßmus { return fShowPopUpMarker; } 587ea7a892SMarc Flerackers 59102a66c3SRene Gollent virtual BSize MinSize(); 60ec592aa9SIngo Weinhold virtual BSize MaxSize(); 61ec592aa9SIngo Weinhold 627ea7a892SMarc Flerackers private: 637ea7a892SMarc Flerackers _BMCMenuBar_&operator=(const _BMCMenuBar_&); 647ea7a892SMarc Flerackers 651c95f722SJohn Scipione void _Init(); 660699a883SStephan Aßmus 677ea7a892SMarc Flerackers BMenuField* fMenuField; 687ea7a892SMarc Flerackers bool fFixedSize; 69cd39deccSStefano Ceccherini bool fShowPopUpMarker; 703a38a485SStephan Aßmus float fPreviousWidth; 717ea7a892SMarc Flerackers }; 727ea7a892SMarc Flerackers 73*61dfdec4SJohn Scipione 747ea7a892SMarc Flerackers #endif // _BMC_PRIVATE_H 75