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(BPoint cursor); 38 39 private: 40 BMenu *fMenu; 41 BMenuFrame *fMenuFrame; 42 BMenuScroller *fUpperScroller; 43 BMenuScroller *fLowerScroller; 44 45 float fValue; 46 float fLimit; 47 48 bool _Scroll(BPoint cursor); 49 }; 50 51 } // namespace BPrivate 52 53 #endif // __MENUWINDOW_H 54