First try at menu scrolling, courthesy of Łukasz Zemczak. Works more or less, although a bit buggy

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19343 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini
2006-11-20 20:19:55 +00:00
parent 1941200400
commit 27cc25083e
3 changed files with 237 additions and 33 deletions
+48 -10
View File
@@ -30,21 +30,59 @@
#include <Window.h>
class BMenu;
class BMenuScroller;
class BMenuScroller : public BView {
public:
BMenuScroller(BRect frame, BMenu *menu);
virtual ~BMenuScroller();
virtual void Pulse();
virtual void Draw(BRect updateRect);
private:
BMenu *fMenu;
BRect fUpperButton;
BRect fLowerButton;
float fValue;
float fLimit;
bool fUpperEnabled;
bool fLowerEnabled;
uint32 fButton;
BPoint fPosition;
};
class BMenuFrame : public BView {
public:
BMenuFrame(BMenu *menu);
virtual void AttachedToWindow();
virtual void DetachedFromWindow();
virtual void Draw(BRect updateRect);
private:
friend class BMenuWindow;
BMenu *fMenu;
};
class BMenuWindow : public BWindow {
public:
BMenuWindow(const char *name);
virtual ~BMenuWindow();
public:
BMenuWindow(const char *name);
virtual ~BMenuWindow();
void AttachMenu(BMenu *menu);
void DetachMenu();
void AttachMenu(BMenu *menu);
void DetachMenu();
void UpdateScrollers();
void AttachScrollers();
void DetachScrollers();
private:
BMenuScroller *fUpperScroller;
BMenuScroller *fLowerScroller;
private:
BMenuScroller *fScroller;
BMenuFrame *fMenuFrame;
};
#endif