2006-11-22 14:52:18 +03:00
|
|
|
/*
|
2009-07-03 16:09:16 +04:00
|
|
|
* Copyright 2001-2009, Haiku, Inc.
|
2006-11-22 14:52:18 +03:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Marc Flerackers (mflerackers@androme.be)
|
|
|
|
* Stefano Ceccherini (burton666@libero.it)
|
|
|
|
*/
|
2009-07-03 16:09:16 +04:00
|
|
|
#ifndef MENU_WINDOW_H
|
|
|
|
#define MENU_WINDOW_H
|
2004-12-27 12:05:16 +03:00
|
|
|
|
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 {
|
2009-07-03 16:09:16 +04:00
|
|
|
public:
|
|
|
|
BMenuWindow(const char* name);
|
|
|
|
virtual ~BMenuWindow();
|
|
|
|
|
|
|
|
virtual void DispatchMessage(BMessage* message,
|
|
|
|
BHandler* handler);
|
|
|
|
|
|
|
|
void AttachMenu(BMenu* menu);
|
|
|
|
void DetachMenu();
|
|
|
|
|
|
|
|
void AttachScrollers();
|
|
|
|
void DetachScrollers();
|
|
|
|
|
|
|
|
void SetSmallStep(float step);
|
2009-09-04 22:16:59 +04:00
|
|
|
void GetSteps(float* _smallStep, float* _largeStep) const;
|
2009-07-03 16:09:16 +04:00
|
|
|
bool HasScrollers() const;
|
|
|
|
bool CheckForScrolling(const BPoint& cursor);
|
|
|
|
bool TryScrollBy(const float& step);
|
2013-05-03 16:13:41 +04:00
|
|
|
bool TryScrollTo(const float& where);
|
2009-07-03 16:09:16 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
bool _Scroll(const BPoint& cursor);
|
|
|
|
void _ScrollBy(const float& step);
|
|
|
|
|
|
|
|
BMenu* fMenu;
|
|
|
|
BMenuFrame* fMenuFrame;
|
|
|
|
BMenuScroller* fUpperScroller;
|
|
|
|
BMenuScroller* fLowerScroller;
|
|
|
|
|
|
|
|
float fScrollStep;
|
|
|
|
float fValue;
|
|
|
|
float fLimit;
|
2004-12-27 12:05:16 +03:00
|
|
|
};
|
|
|
|
|
2006-11-22 14:52:18 +03:00
|
|
|
} // namespace BPrivate
|
|
|
|
|
2009-07-03 16:09:16 +04:00
|
|
|
#endif // MENU_WINDOW_H
|