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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
|
{
(Still unused) skeleton for Colorsel replacement, based on mostly the
use by the fpmopts.inc file, to be added on as details emerge.
Copyright 2008 by Marco van de Voort and Andreas Jakobsche
See the file COPYING.FPC, included in this distribution,
for details about the copyright.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
****************************************************************************}
}
unit ColorSel;
interface
uses Objects, Dialogs, Views;
type
PColorItem = ^TColorItem;
TColorItem = record
Name: PString;
Index: Byte;
Next: PColorItem;
end;
PColorGroup = ^TColorGroup;
TColorGroup = record
Name: PString;
Index: Byte;
Items: PColorItem;
Next: PColorGroup;
end;
PColorGroupList = ^TColorGroupList;
TColorGroupList = object(TListViewer)
Groups: PColorGroup;
constructor Init(var Bounds: TRect; AScrollBar: PScrollBar; AGroups: PColorGroup);
end;
PColorDialog = ^TColorDialog;
TColorDialog = object(TDialog)
Groups: PColorGroupList;
Pal: TPalette;
constructor Init(APalette: TPalette; AGroups: PColorGroup);
constructor Load(var S: TStream);
procedure Store(var S: TStream);
end;
function ColorGroup(Name: string; Items: PColorItem; Next: PColorGroup): PColorGroup;
function ColorItem(Name: string; Index: Byte; Next: PColorItem): PColorItem;
implementation
uses App;
const
RColorDialog: TStreamRec = (
ObjType: idColorDialog;
VmtLink: Ofs(TypeOf(TColorDialog)^);
Load: @TColorDialog.Load;
Store: @TColorDialog.Store
);
procedure RegisterColorsel;
begin
// according to help should register TColorSelector, TMonoSelector, TColorDisplay, TColorGroupList, TColorItemList, TColorDialog
// probably don't bother with the mono variants. Except for (P/T)colordialog, these don't grep in FV/IDE src.
// TColorSelector -> the square colorselection widget (instantiated twice once for front, once for back?)
// TColorGrouplist-> the selection of the color group (left list) (TListbox or whatever the TV eq is?)
// TColorItemList -> the selection of the color identifier (right list) (TListbox or whatever the TV eq is?)
RegisterType(RColorDialog);
end ;
function ColorGroup(Name: string; Items: PColorItem; Next: PColorGroup): PColorGroup;
var
R: PColorGroup;
begin
New(R);
R^.Name := NewStr(Name);
R^.Items := Items;
R^.Next := Next;
ColorGroup := R;
end;
function ColorItem(Name: string; Index: Byte; Next: PColorItem): PColorItem;
var R: PColorItem;
begin
New(R);
R^.Name := NewStr(Name);
R^.Index := Index;
R^.Next := Next;
ColorItem := R
end;
constructor TColorGroupList.Init(var Bounds: TRect; AScrollBar: PScrollBar; AGroups: PColorGroup);
var
x: PColorGroup;
begin
inherited Init(Bounds, 1, nil, AScrollBar);
Range := 0;
Groups := AGroups;
x := AGroups;
while Assigned(x) do begin
x^.Index := Range;
Inc(Range);
x := x^.Next
end;
end;
constructor TColorDialog.Init(APalette: TPalette; AGroups: PColorGroup);
var
Bounds: TRect;
begin
Bounds.Assign(0, 0, 62, 19);
inherited Init(Bounds, 'Colors');
Options := Options or ofCentered;
Pal := APalette;
Bounds.Grow(-1, -1);
Groups := New(PColorGroupList, Init(Bounds, nil, AGroups));
end;
constructor TColorDialog.Load(var S: TStream);
begin
end;
procedure TColorDialog.Store(var S: TStream);
begin
end;
end.
{
ColorGroup(label_colors_grp_menus, MenuColorItems(nil),
ColorGroup(label_colors_grp_desktop, DesktopColorItems(nil),
ColorGroup(label_colors_grp_dialogs, DialogColorItems(dpGrayDialog,nil),
from fpmopts.inc
procedure TIDEApp.Colors;
var D: PColorDialog;
begin
New(D, Init(AppPalette,
ColorGroup(label_colors_grp_browser,
ColorItem(label_colors_framepassive , 215,
ColorItem(label_colors_frameactive , 216,
ColorItem(label_colors_frameicon , 217,
ColorItem(label_colors_scrollbarpage , 218,
ColorItem(label_colors_scrollbaricons , 219,
ColorItem(label_colors_normaltext , 220,
ColorItem(label_colors_selectedtext , 221,
ColorItem(label_colors_activeitem , 222,
ColorItem(label_colors_inactiveitem , 223,
ColorItem(label_colors_focuseditem , 224,
ColorItem(label_colors_selecteditem , 225,
ColorItem(label_colors_divider , 226,
nil)))))))))))),
ColorGroup(label_colors_grp_clock,
ColorItem(label_colors_clockview , 227,
nil),
ColorGroup(label_colors_grp_menus, MenuColorItems(nil),
ColorGroup(label_colors_grp_desktop, DesktopColorItems(nil),
ColorGroup(label_colors_grp_dialogs, DialogColorItems(dpGrayDialog,nil),
ColorGroup(label_colors_grp_editor,
ColorItem(label_colors_framepassive , 167,
ColorItem(label_colors_frameactive , 168,
ColorItem(label_colors_frameicon , 169,
ColorItem(label_colors_scrollbarpage , 170,
ColorItem(label_colors_scrollbaricons , 171,
ColorItem(label_colors_normaltext , 199,
ColorItem(label_colors_selectedtext , 208,
ColorItem(label_colors_highlighcolumn , 209,
ColorItem(label_colors_highlightrow , 210,
ColorItem(label_colors_errormessages , 214,
nil)))))))))),
ColorGroup(label_colors_grp_help,
ColorItem(label_colors_framepassive , 128,
ColorItem(label_colors_frameactive , 129,
ColorItem(label_colors_frameicon , 130,
ColorItem(label_colors_scrollbarpage , 131,
ColorItem(label_colors_scrollbaricons , 132,
ColorItem(label_colors_helptext , 160,
ColorItem(label_colors_helplinks , 161,
ColorItem(label_colors_selectedlink , 162,
ColorItem(label_colors_selectedtext , 163,
ColorItem(label_colors_html_heading1 , 229,
ColorItem(label_colors_html_heading2 , 230,
ColorItem(label_colors_html_heading3 , 231,
ColorItem(label_colors_html_heading4 , 232,
ColorItem(label_colors_html_heading5 , 233,
ColorItem(label_colors_html_heading6 , 234,
nil))))))))))))))),
ColorGroup(label_colors_grp_menus, MenuColorItems(nil),
ColorGroup(label_colors_grp_syntax,
ColorItem(label_colors_whitespace , 200,
ColorItem(label_colors_comments , 201,
ColorItem(label_colors_reservedwords , 202,
ColorItem(label_colors_identifiers , 203,
ColorItem(label_colors_strings , 204,
ColorItem(label_colors_numbers , 205,
ColorItem(label_colors_hexnumbers , 212,
ColorItem(label_colors_assembler , 206,
ColorItem(label_colors_symbols , 207,
ColorItem(label_colors_directives , 211,
ColorItem(label_colors_tabs , 213,
nil))))))))))),
nil))))))))));
end;
fvconsts.pas: idColorSelector = 92;
fvconsts.pas: idMonoSelector = 93;
}
|