-
-
Notifications
You must be signed in to change notification settings - Fork 336
/
AppearPrefView.h
91 lines (68 loc) · 2.56 KB
/
AppearPrefView.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/*
* Copyright 2001-2010, Haiku, Inc.
* Copyright 2003-2004 Kian Duffy, myob@users.sourceforge.net
* Parts Copyright 1998-1999 Kazuho Okui and Takashi Murai.
* All rights reserved. Distributed under the terms of the MIT license.
*/
#ifndef APPEARANCE_PREF_VIEW_H
#define APPEARANCE_PREF_VIEW_H
#include <GroupView.h>
#include <Messenger.h>
#include <String.h>
static const uint32 MSG_HALF_FONT_CHANGED = 'mchf';
static const uint32 MSG_HALF_SIZE_CHANGED = 'mchs';
static const uint32 MSG_FULL_FONT_CHANGED = 'mcff';
static const uint32 MSG_FULL_SIZE_CHANGED = 'mcfs';
static const uint32 MSG_COLOR_FIELD_CHANGED = 'mccf';
static const uint32 MSG_COLOR_CHANGED = 'mcbc';
static const uint32 MSG_COLOR_SCHEME_CHANGED = 'mccs';
static const uint32 MSG_TAB_TITLE_SETTING_CHANGED = 'mtts';
static const uint32 MSG_WINDOW_TITLE_SETTING_CHANGED = 'mwts';
static const uint32 MSG_BLINK_CURSOR_CHANGED = 'mbcc';
static const uint32 MSG_WARN_ON_EXIT_CHANGED = 'mwec';
static const uint32 MSG_COLS_CHANGED = 'mccl';
static const uint32 MSG_ROWS_CHANGED = 'mcrw';
static const uint32 MSG_HISTORY_CHANGED = 'mhst';
static const uint32 MSG_PREF_MODIFIED = 'mpmo';
struct color_scheme;
class BCheckBox;
class BColorControl;
class BMenu;
class BMenuField;
class BPopUpMenu;
class BTextControl;
class AppearancePrefView : public BGroupView {
public:
AppearancePrefView(const char* name,
const BMessenger &messenger);
virtual void Revert();
virtual void MessageReceived(BMessage* message);
virtual void AttachedToWindow();
virtual void GetPreferredSize(float* _width,
float* _height);
private:
void _EnableCustomColors(bool enable);
void _ChangeColorScheme(color_scheme* scheme);
void _SetCurrentColorScheme(BMenuField* field);
static BMenu* _MakeFontMenu(uint32 command,
const char* defaultFamily,
const char* defaultStyle);
static BMenu* _MakeSizeMenu(uint32 command,
uint8 defaultSize);
static BPopUpMenu* _MakeMenu(uint32 msg, const char** items,
const char* defaultItem);
static BPopUpMenu* _MakeColorSchemeMenu(uint32 msg,
const color_scheme** schemes,
const color_scheme* defaultItemName);
BCheckBox* fBlinkCursor;
BCheckBox* fWarnOnExit;
BMenuField* fFont;
BMenuField* fFontSize;
BMenuField* fColorSchemeField;
BMenuField* fColorField;
BColorControl* fColorControl;
BTextControl* fTabTitle;
BTextControl* fWindowTitle;
BMessenger fTerminalMessenger;
};
#endif // APPEARANCE_PREF_VIEW_H