xref: /trunk/main/cui/source/dialogs/colorpicker.src (revision 3f2293a34d640799d3a646809239d04f5e6f46e0)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22#include "colorpicker.hrc"
23
24#define DLG_WIDTH 295
25#define DLG_HEIGHT 216
26
27#define BUTTON_WIDTH 50
28#define BUTTON_HEIGHT 14
29
30#define METRIC_WIDTH 30
31#define METRIC_HEIGHT 12
32
33#define RADIO_WIDTH 8
34#define RADIO_HEIGHT 8
35
36#define LABEL_WIDTH 50
37#define LABEL_HEIGHT 10
38
39#define SLIDER_WIDTH 22
40#define PREVIEW_HEIGHT 16
41
42#define LINE_WIDTH (3 + RADIO_WIDTH + 2 + LABEL_WIDTH + 3 + METRIC_WIDTH + 3)
43#define LINE_HEIGHT 8
44
45#define CONTROL_AREA_X (DLG_WIDTH - LINE_WIDTH - 6)
46#define CONTROL_AREA_X_RADIO (CONTROL_AREA_X + 3)
47#define CONTROL_AREA_X_LABEL (CONTROL_AREA_X + 3 + RADIO_WIDTH + 2)
48#define CONTROL_AREA_X_METRIC (CONTROL_AREA_X + 3 + RADIO_WIDTH + 2 + LABEL_WIDTH + 3)
49
50#define CHOOSER_SIZE (CONTROL_AREA_X - 6 - SLIDER_WIDTH - 2 - 2 )
51
52#define BOTTOMLINE_Y (DLG_HEIGHT - 3 - 3 - 8 - 14)
53#define BUTTON_LINE_Y (BOTTOMLINE_Y + 8 + 3)
54
55#define RGB_Y1 (6 + LINE_HEIGHT + 1)
56#define RGB_Y2 (RGB_Y1 + METRIC_HEIGHT + 2)
57#define RGB_Y3 (RGB_Y2 + METRIC_HEIGHT + 2)
58#define RGB_Y4 (RGB_Y3 + METRIC_HEIGHT + 4)
59#define HSB_Y0 (RGB_Y4 + METRIC_HEIGHT + 1)
60#define HSB_Y1 (HSB_Y0 + LINE_HEIGHT + 2)
61#define HSB_Y2 (HSB_Y1 + METRIC_HEIGHT + 2)
62#define HSB_Y3 (HSB_Y2 + METRIC_HEIGHT + 2)
63#define CMYK_Y0 (HSB_Y3 + METRIC_HEIGHT + 1)
64#define CMYK_Y1 (CMYK_Y0 + LINE_HEIGHT + 1)
65#define CMYK_Y2 (CMYK_Y1 + METRIC_HEIGHT + 2)
66#define CMYK_Y3 (CMYK_Y2 + METRIC_HEIGHT + 2)
67#define CMYK_Y4 (CMYK_Y3 + METRIC_HEIGHT + 2)
68
69
70
71ModalDialog RID_CUI_DIALOG_COLORPICKER
72{
73    HelpID = "cui:ModalDialog:ColorPicker" ;
74
75    OutputSize = TRUE ;
76    SvLook = TRUE ;
77    Moveable = TRUE ;
78    Size = MAP_APPFONT ( DLG_WIDTH, DLG_HEIGHT ) ;
79
80    Text [ en-US ] = "Color Picker" ;
81
82    Control CT_COLORFIELD
83    {
84        HelpID = "cui:Control:ColorPicker:ColorField" ;
85        Pos = MAP_APPFONT ( 6, 6 ) ;
86        Size = MAP_APPFONT ( CHOOSER_SIZE, CHOOSER_SIZE ) ;
87        Border = TRUE ;
88        TabStop = TRUE ;
89    };
90
91    Control CT_COLORSLIDER
92    {
93        HelpID = "cui:Control:ColorPicker:ColorSlider" ;
94        Pos = MAP_APPFONT ( CONTROL_AREA_X - 2 - SLIDER_WIDTH + 4, 6 ) ;
95        Size = MAP_APPFONT ( SLIDER_WIDTH - 8, CHOOSER_SIZE ) ;
96        Border = TRUE ;
97        TabStop = TRUE ;
98    };
99
100    Control CT_PREVIEW
101    {
102        HelpID = "cui:Control:ColorPicker:ColorPreview" ;
103        Pos = MAP_APPFONT ( 6, 6 + CHOOSER_SIZE + 3 ) ;
104        Size = MAP_APPFONT ( CHOOSER_SIZE, PREVIEW_HEIGHT ) ;
105        Border = FALSE ;
106    };
107
108    Control CT_PREVIOUS
109    {
110        HelpID = "cui:Control:ColorPicker:ColorPrevious" ;
111        Pos = MAP_APPFONT ( 6 + (CHOOSER_SIZE/2), 6 + CHOOSER_SIZE + 3 ) ;
112        Size = MAP_APPFONT ( CHOOSER_SIZE/2, PREVIEW_HEIGHT ) ;
113        Border = FALSE ;
114        Hide = TRUE ;
115    };
116
117    FixedImage CT_LEFT_SLIDER
118    {
119    };
120
121    FixedImage CT_RIGHT_SLIDER
122    {
123    };
124
125    Image CT_SLIDERIMG
126    {
127        ImageBitmap = Bitmap { File = "colorslider.png" ; };
128    };
129
130#if 0
131    ImageButton PB_PICKER
132    {
133        HelpID = "cui:ImageButton:ColorPicker:Picker" ;
134        Pos = MAP_APPFONT ( CONTROL_AREA_X - 2 - SLIDER_WIDTH + 4, 6 + CHOOSER_SIZE + 3 ) ;
135        Size = MAP_APPFONT ( SLIDER_WIDTH - 8, PREVIEW_HEIGHT ) ;
136        TabStop = TRUE ;
137        QuickHelpText [ en-US ] = "Pick a color from the document" ;
138        ButtonImage = Image
139        {
140            ImageBitmap = Bitmap { File = "pipette.png" ; };
141        };
142    };
143#endif
144
145    FixedLine FL_RGB
146    {
147        Pos = MAP_APPFONT ( CONTROL_AREA_X, 6 ) ;
148        Size = MAP_APPFONT ( LINE_WIDTH, LINE_HEIGHT ) ;
149        Text [ en-US ] = "RGB" ;
150    };
151
152    RadioButton CT_RED
153    {
154        HelpID = "cui:RadioButton:ColorPicker:Red" ;
155        Pos = MAP_APPFONT ( CONTROL_AREA_X_RADIO, RGB_Y1+2 ) ;
156        Size = MAP_APPFONT ( RADIO_WIDTH, RADIO_HEIGHT ) ;
157        Group = TRUE ;
158    };
159
160    RadioButton CT_GREEN
161    {
162        HelpID = "cui:RadioButton:ColorPicker:Green" ;
163        Pos = MAP_APPFONT ( CONTROL_AREA_X_RADIO, RGB_Y2+2 ) ;
164        Size = MAP_APPFONT ( RADIO_WIDTH, RADIO_HEIGHT ) ;
165    };
166
167    RadioButton CT_BLUE
168    {
169        HelpID = "cui:RadioButton:ColorPicker:Blue" ;
170        Pos = MAP_APPFONT ( CONTROL_AREA_X_RADIO, RGB_Y3+2 ) ;
171        Size = MAP_APPFONT ( RADIO_WIDTH, RADIO_HEIGHT ) ;
172    };
173
174    RadioButton CT_HUE
175    {
176        HelpID = "cui:RadioButton:ColorPicker:Hue" ;
177        Pos = MAP_APPFONT ( CONTROL_AREA_X_RADIO, HSB_Y1+2 ) ;
178        Size = MAP_APPFONT ( RADIO_WIDTH, RADIO_HEIGHT ) ;
179        Check = TRUE ;
180    };
181
182    RadioButton CT_SATURATION
183    {
184        HelpID = "cui:RadioButton:ColorPicker:Saturation" ;
185        Pos = MAP_APPFONT ( CONTROL_AREA_X_RADIO, HSB_Y2+2 ) ;
186        Size = MAP_APPFONT ( RADIO_WIDTH, RADIO_HEIGHT ) ;
187    };
188
189    RadioButton CT_BRIGHTNESS
190    {
191        HelpID = "cui:RadioButton:ColorPicker:Brightness" ;
192        Pos = MAP_APPFONT ( CONTROL_AREA_X_RADIO, HSB_Y3+2 ) ;
193        Size = MAP_APPFONT ( RADIO_WIDTH, RADIO_HEIGHT ) ;
194    };
195
196    FixedText CT_RED
197    {
198        Pos = MAP_APPFONT ( CONTROL_AREA_X_LABEL, RGB_Y1+1 ) ;
199        Size = MAP_APPFONT ( LABEL_WIDTH, LABEL_HEIGHT ) ;
200        Text [ en-US ] = "~Red" ;
201    };
202
203    MetricField CT_RED
204    {
205        HelpID = "cui:MetricField:ColorPicker:Red" ;
206        Border = TRUE ;
207        Pos = MAP_APPFONT ( CONTROL_AREA_X_METRIC, RGB_Y1 ) ;
208        Size = MAP_APPFONT ( METRIC_WIDTH, METRIC_HEIGHT ) ;
209        TabStop = TRUE ;
210        Repeat = TRUE ;
211        Spin = TRUE ;
212        Maximum = 255 ;
213        Last = 255 ;
214    };
215
216    FixedText CT_GREEN
217    {
218        Pos = MAP_APPFONT ( CONTROL_AREA_X_LABEL, RGB_Y2+1 ) ;
219        Size = MAP_APPFONT ( LABEL_WIDTH, LABEL_HEIGHT ) ;
220        Text [ en-US ] = "~Green" ;
221    };
222
223    MetricField CT_GREEN
224    {
225        HelpID = "cui:MetricField:ColorPicker:Green" ;
226        Border = TRUE ;
227        Pos = MAP_APPFONT ( CONTROL_AREA_X_METRIC, RGB_Y2 ) ;
228        Size = MAP_APPFONT ( METRIC_WIDTH, METRIC_HEIGHT ) ;
229        TabStop = TRUE ;
230        Repeat = TRUE ;
231        Spin = TRUE ;
232        Maximum = 255 ;
233        Last = 255 ;
234    };
235
236    FixedText CT_BLUE
237    {
238        Pos = MAP_APPFONT ( CONTROL_AREA_X_LABEL, RGB_Y3+1 ) ;
239        Size = MAP_APPFONT ( LABEL_WIDTH, LABEL_HEIGHT ) ;
240        Text [ en-US ] = "~Blue" ;
241    };
242
243    MetricField CT_BLUE
244    {
245        HelpID = "cui:MetricField:ColorPicker:Blue" ;
246        Border = TRUE ;
247        Pos = MAP_APPFONT ( CONTROL_AREA_X_METRIC, RGB_Y3 ) ;
248        Size = MAP_APPFONT ( METRIC_WIDTH, METRIC_HEIGHT ) ;
249        TabStop = TRUE ;
250        Repeat = TRUE ;
251        Spin = TRUE ;
252        Maximum = 255 ;
253        Last = 255 ;
254    };
255
256    FixedText CT_HEX
257    {
258        Pos = MAP_APPFONT ( CONTROL_AREA_X_LABEL, RGB_Y4+1 ) ;
259        Size = MAP_APPFONT ( LABEL_WIDTH, LABEL_HEIGHT ) ;
260        Text [ en-US ] = "Hex ~#" ;
261    };
262
263    Edit CT_HEX
264    {
265        HelpID = "cui:MetricField:ColorPicker:Hex" ;
266        Border = TRUE ;
267        Left = TRUE ;
268        Pos = MAP_APPFONT ( CONTROL_AREA_X_METRIC, RGB_Y4 ) ;
269        Size = MAP_APPFONT ( METRIC_WIDTH, METRIC_HEIGHT ) ;
270        TabStop = TRUE ;
271    };
272
273// -------------------------------------------------------------------------
274// HSB
275// -------------------------------------------------------------------------
276
277    FixedLine FL_HSB
278    {
279        Pos = MAP_APPFONT ( CONTROL_AREA_X, HSB_Y0 ) ;
280        Size = MAP_APPFONT ( LINE_WIDTH, LINE_HEIGHT ) ;
281        Text [ en-US ] = "HSB" ;
282    };
283
284    FixedText CT_HUE
285    {
286        Pos = MAP_APPFONT ( CONTROL_AREA_X_LABEL, HSB_Y1+1 ) ;
287        Size = MAP_APPFONT ( LABEL_WIDTH, LABEL_HEIGHT ) ;
288        Text [ en-US ] = "H~ue" ;
289    };
290
291    MetricField CT_HUE
292    {
293        HelpID = "cui:MetricField:ColorPicker:Hue" ;
294        Border = TRUE ;
295        Pos = MAP_APPFONT ( CONTROL_AREA_X_METRIC, HSB_Y1 ) ;
296        Size = MAP_APPFONT ( METRIC_WIDTH, METRIC_HEIGHT ) ;
297        TabStop = TRUE ;
298        Repeat = TRUE ;
299        Spin = TRUE ;
300        Maximum = 360 ;
301        Last = 360 ;
302        Unit = FUNIT_CUSTOM ;
303    };
304
305    FixedText CT_SATURATION
306    {
307        Pos = MAP_APPFONT ( CONTROL_AREA_X_LABEL, HSB_Y2+1 ) ;
308        Size = MAP_APPFONT ( LABEL_WIDTH, LABEL_HEIGHT ) ;
309        Text [ en-US ] = "~Saturation" ;
310    };
311
312    MetricField CT_SATURATION
313    {
314        HelpID = "cui:MetricField:ColorPicker:Saturation" ;
315        Border = TRUE ;
316        Pos = MAP_APPFONT ( CONTROL_AREA_X_METRIC, HSB_Y2 ) ;
317        Size = MAP_APPFONT ( METRIC_WIDTH, METRIC_HEIGHT ) ;
318        TabStop = TRUE ;
319        Repeat = TRUE ;
320        Spin = TRUE ;
321        Maximum = 100 ;
322        Last = 100 ;
323        Unit = FUNIT_PERCENT ;
324    };
325
326    FixedText CT_BRIGHTNESS
327    {
328        Pos = MAP_APPFONT ( CONTROL_AREA_X_LABEL, HSB_Y3+1 ) ;
329        Size = MAP_APPFONT ( LABEL_WIDTH, LABEL_HEIGHT ) ;
330        Text [ en-US ] = "Bright~ness" ;
331    };
332
333    MetricField CT_BRIGHTNESS
334    {
335        HelpID = "cui:MetricField:ColorPicker:Brightness" ;
336        Border = TRUE ;
337        Pos = MAP_APPFONT ( CONTROL_AREA_X_METRIC, HSB_Y3 ) ;
338        Size = MAP_APPFONT ( METRIC_WIDTH, METRIC_HEIGHT ) ;
339        TabStop = TRUE ;
340        Repeat = TRUE ;
341        Spin = TRUE ;
342        Maximum = 100 ;
343        Last = 100 ;
344        Unit = FUNIT_PERCENT ;
345    };
346
347// -------------------------------------------------------------------------
348// CMYK
349// -------------------------------------------------------------------------
350
351    FixedLine FL_CMYK
352    {
353        Pos = MAP_APPFONT ( CONTROL_AREA_X, CMYK_Y0 ) ;
354        Size = MAP_APPFONT ( LINE_WIDTH, LINE_HEIGHT ) ;
355        Text [ en-US ] = "CMYK" ;
356    };
357
358    FixedText CT_CYAN
359    {
360        Pos = MAP_APPFONT ( CONTROL_AREA_X_LABEL, CMYK_Y1+1 ) ;
361        Size = MAP_APPFONT ( LABEL_WIDTH, LABEL_HEIGHT ) ;
362        Text [ en-US ] = "~Cyan" ;
363    };
364
365    MetricField CT_CYAN
366    {
367        HelpID = "cui:MetricField:ColorPicker:Cyan" ;
368        Border = TRUE ;
369        Pos = MAP_APPFONT ( CONTROL_AREA_X_METRIC, CMYK_Y1 ) ;
370        Size = MAP_APPFONT ( METRIC_WIDTH, METRIC_HEIGHT ) ;
371        TabStop = TRUE ;
372        Repeat = TRUE ;
373        Spin = TRUE ;
374        Maximum = 100 ;
375        Last = 100 ;
376        Unit = FUNIT_PERCENT ;
377    };
378
379    FixedText CT_MAGENTA
380    {
381        Pos = MAP_APPFONT ( CONTROL_AREA_X_LABEL, CMYK_Y2+1 ) ;
382        Size = MAP_APPFONT ( LABEL_WIDTH, LABEL_HEIGHT ) ;
383        Text [ en-US ] = "~Magenta" ;
384    };
385
386    MetricField CT_MAGENTA
387    {
388        HelpID = "cui:MetricField:ColorPicker:Magenta" ;
389        Border = TRUE ;
390        Pos = MAP_APPFONT ( CONTROL_AREA_X_METRIC, CMYK_Y2 ) ;
391        Size = MAP_APPFONT ( METRIC_WIDTH, METRIC_HEIGHT ) ;
392        TabStop = TRUE ;
393        Repeat = TRUE ;
394        Spin = TRUE ;
395        Maximum = 100 ;
396        Last = 100 ;
397        Unit = FUNIT_PERCENT ;
398    };
399
400    FixedText CT_YELLOW
401    {
402        Pos = MAP_APPFONT ( CONTROL_AREA_X_LABEL, CMYK_Y3+1 ) ;
403        Size = MAP_APPFONT ( LABEL_WIDTH, LABEL_HEIGHT ) ;
404        Text [ en-US ] = "~Yellow" ;
405    };
406
407    MetricField CT_YELLOW
408    {
409        HelpID = "cui:MetricField:ColorPicker:Yellow" ;
410        Border = TRUE ;
411        Pos = MAP_APPFONT ( CONTROL_AREA_X_METRIC, CMYK_Y3 ) ;
412        Size = MAP_APPFONT ( METRIC_WIDTH, METRIC_HEIGHT ) ;
413        TabStop = TRUE ;
414        Repeat = TRUE ;
415        Spin = TRUE ;
416        Maximum = 100 ;
417        Last = 100 ;
418        Unit = FUNIT_PERCENT ;
419    };
420
421    FixedText CT_KEY
422    {
423        Pos = MAP_APPFONT ( CONTROL_AREA_X_LABEL, CMYK_Y4+1 ) ;
424        Size = MAP_APPFONT ( LABEL_WIDTH, LABEL_HEIGHT ) ;
425        Text [ en-US ] = "~Key" ;
426    };
427
428    MetricField CT_KEY
429    {
430        HelpID = "cui:MetricField:ColorPicker:Key" ;
431        Border = TRUE ;
432        Pos = MAP_APPFONT ( CONTROL_AREA_X_METRIC, CMYK_Y4 ) ;
433        Size = MAP_APPFONT ( METRIC_WIDTH, METRIC_HEIGHT ) ;
434        TabStop = TRUE ;
435        Repeat = TRUE ;
436        Spin = TRUE ;
437        Maximum = 100 ;
438        Last = 100 ;
439        Unit = FUNIT_PERCENT ;
440    };
441
442    // ------------------------------------------------------
443    // bottom buttons
444    // ------------------------------------------------------
445
446    FixedLine FT_BOTTOMLINE
447    {
448        Pos = MAP_APPFONT ( 0, BOTTOMLINE_Y ) ;
449        Size = MAP_APPFONT ( DLG_WIDTH, 8 ) ;
450    };
451
452    HelpButton BTN_HELP
453    {
454        Pos = MAP_APPFONT ( 3, BUTTON_LINE_Y ) ;
455        Size = MAP_APPFONT ( BUTTON_WIDTH, BUTTON_HEIGHT ) ;
456        TabStop = TRUE ;
457    };
458
459    OKButton BTN_OK
460    {
461        Pos = MAP_APPFONT ( DLG_WIDTH - 3 - BUTTON_WIDTH - 3 - BUTTON_WIDTH, BUTTON_LINE_Y ) ;
462        Size = MAP_APPFONT ( BUTTON_WIDTH, BUTTON_HEIGHT ) ;
463        TabStop = TRUE ;
464        DefButton = TRUE ;
465    };
466    CancelButton BTN_CANCEL
467    {
468        Pos = MAP_APPFONT ( DLG_WIDTH - 3 - BUTTON_WIDTH, BUTTON_LINE_Y ) ;
469        Size = MAP_APPFONT ( BUTTON_WIDTH, BUTTON_HEIGHT ) ;
470        TabStop = TRUE ;
471    };
472};
473
474// ********************************************************************** EOF
475