* BMenu now scrolls when you press page up/down, if possible.
* BMenuWindow no longer uses a fixed scroll step - instead, the menu sets it to the height of its first item. * Cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31389 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
/*
|
||||
* Copyright 2001-2006, Haiku, Inc.
|
||||
* Copyright 2001-2009, Haiku, Inc.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Marc Flerackers ([email protected])
|
||||
* Stefano Ceccherini ([email protected])
|
||||
*/
|
||||
#ifndef __MENUWINDOW_H
|
||||
#define __MENUWINDOW_H
|
||||
#ifndef MENU_WINDOW_H
|
||||
#define MENU_WINDOW_H
|
||||
|
||||
|
||||
#include <Window.h>
|
||||
@@ -22,34 +22,39 @@ class BMenuScroller;
|
||||
|
||||
|
||||
class BMenuWindow : public BWindow {
|
||||
public:
|
||||
BMenuWindow(const char *name);
|
||||
virtual ~BMenuWindow();
|
||||
public:
|
||||
BMenuWindow(const char* name);
|
||||
virtual ~BMenuWindow();
|
||||
|
||||
virtual void DispatchMessage(BMessage *message, BHandler *handler);
|
||||
|
||||
void AttachMenu(BMenu *menu);
|
||||
void DetachMenu();
|
||||
|
||||
void AttachScrollers();
|
||||
void DetachScrollers();
|
||||
virtual void DispatchMessage(BMessage* message,
|
||||
BHandler* handler);
|
||||
|
||||
bool CheckForScrolling(const BPoint &cursor);
|
||||
bool TryScrollBy(const float &step);
|
||||
|
||||
private:
|
||||
BMenu *fMenu;
|
||||
BMenuFrame *fMenuFrame;
|
||||
BMenuScroller *fUpperScroller;
|
||||
BMenuScroller *fLowerScroller;
|
||||
|
||||
float fValue;
|
||||
float fLimit;
|
||||
|
||||
bool _Scroll(const BPoint &cursor);
|
||||
void _ScrollBy(const float &step);
|
||||
void AttachMenu(BMenu* menu);
|
||||
void DetachMenu();
|
||||
|
||||
void AttachScrollers();
|
||||
void DetachScrollers();
|
||||
|
||||
void SetSmallStep(float step);
|
||||
void GetSteps(float* _smallStep, float* _largeStep);
|
||||
bool HasScrollers() const;
|
||||
bool CheckForScrolling(const BPoint& cursor);
|
||||
bool TryScrollBy(const float& step);
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
} // namespace BPrivate
|
||||
|
||||
#endif // __MENUWINDOW_H
|
||||
#endif // MENU_WINDOW_H
|
||||
|
||||
Reference in New Issue
Block a user