1 /* 2 * Copyright 2001-2006, Haiku, Inc. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Marc Flerackers (mflerackers@androme.be) 7 * Stefano Ceccherini (burton666@libero.it) 8 */ 9 #ifndef __MENUWINDOW_H 10 #define __MENUWINDOW_H 11 12 13 #include <Window.h> 14 15 class BMenu; 16 17 18 namespace BPrivate { 19 20 class BMenuFrame; 21 class BMenuScroller; 22 23 24 class BMenuWindow : public BWindow { 25 public: 26 BMenuWindow(const char *name); 27 virtual ~BMenuWindow(); 28 29 virtual void DispatchMessage(BMessage *message, BHandler *handler); 30 31 void AttachMenu(BMenu *menu); 32 void DetachMenu(); 33 34 void AttachScrollers(); 35 void DetachScrollers(); 36 37 bool CheckForScrolling(const BPoint &cursor); 38 bool TryScrollBy(const float &step); 39 40 private: 41 BMenu *fMenu; 42 BMenuFrame *fMenuFrame; 43 BMenuScroller *fUpperScroller; 44 BMenuScroller *fLowerScroller; 45 46 float fValue; 47 float fLimit; 48 49 bool _Scroll(const BPoint &cursor); 50 void _ScrollBy(const float &step); 51 }; 52 53 } // namespace BPrivate 54 55 #endif // __MENUWINDOW_H 56