-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathColorContainersView.h
59 lines (43 loc) · 1.29 KB
/
ColorContainersView.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
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
* Copyright 2009-2013 Haiku, Inc. All Rights Reserved.
* Copyright 2001-2008 Werner Freytag.
* Distributed under the terms of the MIT License.
*/
#ifndef _COLOR_CONTAINERS_VIEW_H
#define _COLOR_CONTAINERS_VIEW_H
#include <File.h>
#include <View.h>
enum color_control_layout {
B_CELLS_NONE = 0,
B_CELLS_2x20 = 2,
B_CELLS_4x10 = 4,
B_CELLS_5x8 = 5,
B_CELLS_8x5 = 8,
B_CELLS_10x4 = 10,
B_CELLS_20x2 = 20,
};
static const int32 kColorContainerCount = 40;
class ColorContainer;
class ColorContainersView : public BView {
public:
ColorContainersView(color_control_layout
layout = B_CELLS_NONE);
virtual ~ColorContainersView();
virtual void AttachedToWindow();
virtual void Draw(BRect updateRect);
virtual void MouseDown(BPoint where);
virtual void MouseMoved(BPoint where, uint32 code,
const BMessage *message);
virtual void MouseUp(BPoint where);
void SaveSettings();
BMessage* Settings() { return &fSettings; }
private:
void _LoadSettings();
void _SaveSettings();
status_t _InitSettingsFile(BFile* file, bool write);
BMessage fSettings;
bool fMouseDown;
BPoint fMouseOffset;
ColorContainer* fColorContainer[kColorContainerCount];
};
#endif // _COLOR_CONTAINERS_VIEW_H