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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user