-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathColorContainer.h
46 lines (32 loc) · 1016 Bytes
/
ColorContainer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
* Copyright 2009-2013 Haiku, Inc. All Rights Reserved.
* Copyright 2001-2008 Werner Freytag.
* Distributed under the terms of the MIT License.
*/
#ifndef _COLOR_CONTAINER_H
#define _COLOR_CONTAINER_H
#include <View.h>
#define MSG_MESSAGERUNNER 'MsgR'
class BMessageRunner;
class ColorContainer : public BView {
public:
ColorContainer(BRect frame);
virtual ~ColorContainer();
virtual void Draw(BRect updateRect);
virtual void MessageReceived(BMessage *message);
virtual void MouseDown(BPoint where);
virtual void MouseMoved(BPoint where, uint32 code,
const BMessage* message);
virtual void MouseUp(BPoint where);
rgb_color GetColor() const;
void SetColor(rgb_color color);
void SetColor(long int color);
private:
void DragColor(BPoint where);
bool fMouseDown;
BPoint fMouseOffset;
rgb_color fColor;
BMessageRunner* fMessageRunner;
bool fGotFirstClick;
};
#endif // _COLOR_CONTAINER_H