2006-11-22 14:52:18 +03:00
|
|
|
/*
|
|
|
|
* Copyright 2001-2006, Haiku, Inc.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Marc Flerackers (mflerackers@androme.be)
|
|
|
|
* Stefano Ceccherini (burton666@libero.it)
|
|
|
|
*/
|
2004-12-27 12:05:16 +03:00
|
|
|
#ifndef __MENUWINDOW_H
|
|
|
|
#define __MENUWINDOW_H
|
|
|
|
|
2006-11-22 14:52:18 +03:00
|
|
|
|
2004-12-27 12:05:16 +03:00
|
|
|
#include <Window.h>
|
|
|
|
|
|
|
|
class BMenu;
|
2006-11-20 23:19:55 +03:00
|
|
|
|
|
|
|
|
2006-11-22 14:52:18 +03:00
|
|
|
namespace BPrivate {
|
2006-11-20 23:19:55 +03:00
|
|
|
|
2006-11-22 14:52:18 +03:00
|
|
|
class BMenuFrame;
|
|
|
|
class BMenuScroller;
|
2006-11-20 23:19:55 +03:00
|
|
|
|
2005-01-04 16:00:33 +03:00
|
|
|
|
2004-12-27 12:05:16 +03:00
|
|
|
class BMenuWindow : public BWindow {
|
2006-11-20 23:19:55 +03:00
|
|
|
public:
|
|
|
|
BMenuWindow(const char *name);
|
|
|
|
virtual ~BMenuWindow();
|
2008-01-03 10:30:05 +03:00
|
|
|
|
|
|
|
virtual void DispatchMessage(BMessage *message, BHandler *handler);
|
2005-01-04 16:00:33 +03:00
|
|
|
|
2006-11-20 23:19:55 +03:00
|
|
|
void AttachMenu(BMenu *menu);
|
|
|
|
void DetachMenu();
|
2006-03-28 17:06:47 +04:00
|
|
|
|
2006-11-20 23:19:55 +03:00
|
|
|
void AttachScrollers();
|
|
|
|
void DetachScrollers();
|
2004-12-27 12:05:16 +03:00
|
|
|
|
2008-10-03 10:03:27 +04:00
|
|
|
bool CheckForScrolling(const BPoint &cursor);
|
|
|
|
bool TryScrollBy(const float &step);
|
|
|
|
|
2006-11-20 23:19:55 +03:00
|
|
|
private:
|
2007-06-05 14:20:06 +04:00
|
|
|
BMenu *fMenu;
|
2006-11-20 23:19:55 +03:00
|
|
|
BMenuFrame *fMenuFrame;
|
2007-06-05 14:20:06 +04:00
|
|
|
BMenuScroller *fUpperScroller;
|
|
|
|
BMenuScroller *fLowerScroller;
|
|
|
|
|
|
|
|
float fValue;
|
|
|
|
float fLimit;
|
|
|
|
|
2008-10-03 10:03:27 +04:00
|
|
|
bool _Scroll(const BPoint &cursor);
|
|
|
|
void _ScrollBy(const float &step);
|
2004-12-27 12:05:16 +03:00
|
|
|
};
|
|
|
|
|
2006-11-22 14:52:18 +03:00
|
|
|
} // namespace BPrivate
|
|
|
|
|
|
|
|
#endif // __MENUWINDOW_H
|