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 22f6e4cbb9SAxel Dörfler class BMessageRunner; 23f6e4cbb9SAxel Dörfler 24f6e4cbb9SAxel Dörfler 25cd39deccSStefano Ceccherini class _BMCFilter_ : public BMessageFilter { 26cd39deccSStefano Ceccherini public: 27cd39deccSStefano Ceccherini _BMCFilter_(BMenuField* menuField, uint32 what); 28f6e4cbb9SAxel Dörfler virtual ~_BMCFilter_(); 290699a883SStephan Aßmus 300699a883SStephan Aßmus virtual filter_result Filter(BMessage* message, BHandler** handler); 317ea7a892SMarc Flerackers 32cd39deccSStefano Ceccherini private: 33cd39deccSStefano Ceccherini _BMCFilter_& operator=(const _BMCFilter_&); 340699a883SStephan Aßmus 35cd39deccSStefano Ceccherini BMenuField* fMenuField; 36cd39deccSStefano Ceccherini }; 37cd39deccSStefano Ceccherini 387ea7a892SMarc Flerackers 397ea7a892SMarc Flerackers class _BMCMenuBar_ : public BMenuBar { 407ea7a892SMarc Flerackers public: 410699a883SStephan Aßmus _BMCMenuBar_(BRect frame, bool fixedSize, 420699a883SStephan Aßmus BMenuField* menuField); 432bf1592aSJohn Scipione _BMCMenuBar_(BMenuField* menuField); 447ea7a892SMarc Flerackers _BMCMenuBar_(BMessage* data); 457ea7a892SMarc Flerackers virtual ~_BMCMenuBar_(); 467ea7a892SMarc Flerackers 477ea7a892SMarc Flerackers static BArchivable* Instantiate(BMessage* data); 487ea7a892SMarc Flerackers 497ea7a892SMarc Flerackers virtual void AttachedToWindow(); 502e6a5805SStephan Aßmus virtual void Draw(BRect updateRect); 517ea7a892SMarc Flerackers virtual void FrameResized(float width, float height); 527ea7a892SMarc Flerackers virtual void MessageReceived(BMessage* msg); 537ea7a892SMarc Flerackers virtual void MakeFocus(bool focused = true); 54ca3a1c04SJohn Scipione virtual void SetMaxContentWidth(float width); 55*408c0ee4SJohn Scipione virtual void SetEnabled(bool enabled); 56cd39deccSStefano Ceccherini 570699a883SStephan Aßmus void TogglePopUpMarker(bool show) 580699a883SStephan Aßmus { fShowPopUpMarker = show; } 590699a883SStephan Aßmus bool IsPopUpMarkerShown() const 600699a883SStephan Aßmus { return fShowPopUpMarker; } 617ea7a892SMarc Flerackers 62102a66c3SRene Gollent virtual BSize MinSize(); 63ec592aa9SIngo Weinhold virtual BSize MaxSize(); 64ec592aa9SIngo Weinhold 657ea7a892SMarc Flerackers private: 667ea7a892SMarc Flerackers _BMCMenuBar_&operator=(const _BMCMenuBar_&); 677ea7a892SMarc Flerackers 681c95f722SJohn Scipione void _Init(); 690699a883SStephan Aßmus 707ea7a892SMarc Flerackers BMenuField* fMenuField; 717ea7a892SMarc Flerackers bool fFixedSize; 727ea7a892SMarc Flerackers BMessageRunner* fRunner; 73cd39deccSStefano Ceccherini bool fShowPopUpMarker; 743a38a485SStephan Aßmus float fPreviousWidth; 757ea7a892SMarc Flerackers }; 767ea7a892SMarc Flerackers 777ea7a892SMarc Flerackers #endif // _BMC_PRIVATE_H 78