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 MaskColor = Color { Red = 0xFFFF; Green = 0x0000; Blue = 0xFFFF; }; 129 }; 130 131#if 0 132 ImageButton PB_PICKER 133 { 134 HelpID = "cui:ImageButton:ColorPicker:Picker"; 135 Pos = MAP_APPFONT ( CONTROL_AREA_X - 2 - SLIDER_WIDTH + 4, 6 + CHOOSER_SIZE + 3 ) ; 136 Size = MAP_APPFONT( SLIDER_WIDTH - 8, PREVIEW_HEIGHT ); 137 TabStop = TRUE ; 138 QuickHelpText [ en-US ] = "Pick a color from the document" ; 139 ButtonImage = Image 140 { 141 ImageBitmap = Bitmap { File = "pipette.png" ; }; 142 MaskColor = Color { Red = 0xFFFF; Green = 0x0000; Blue = 0xFFFF; } ; 143 }; 144 }; 145#endif 146 147 FixedLine FL_RGB 148 { 149 Pos = MAP_APPFONT ( CONTROL_AREA_X , 6 ) ; 150 Size = MAP_APPFONT ( LINE_WIDTH , LINE_HEIGHT ) ; 151 Text [ en-US ] = "RGB" ; 152 }; 153 154 RadioButton CT_RED 155 { 156 HelpID = "cui:RadioButton:ColorPicker:Red"; 157 Pos = MAP_APPFONT ( CONTROL_AREA_X_RADIO , RGB_Y1+2 ) ; 158 Size = MAP_APPFONT ( RADIO_WIDTH , RADIO_HEIGHT ) ; 159 Group = TRUE; 160 }; 161 162 RadioButton CT_GREEN 163 { 164 HelpID = "cui:RadioButton:ColorPicker:Green"; 165 Pos = MAP_APPFONT ( CONTROL_AREA_X_RADIO , RGB_Y2+2 ) ; 166 Size = MAP_APPFONT ( RADIO_WIDTH , RADIO_HEIGHT ) ; 167 }; 168 169 RadioButton CT_BLUE 170 { 171 HelpID = "cui:RadioButton:ColorPicker:Blue"; 172 Pos = MAP_APPFONT ( CONTROL_AREA_X_RADIO , RGB_Y3+2 ) ; 173 Size = MAP_APPFONT ( RADIO_WIDTH , RADIO_HEIGHT ) ; 174 }; 175 176 RadioButton CT_HUE 177 { 178 HelpID = "cui:RadioButton:ColorPicker:Hue"; 179 Pos = MAP_APPFONT ( CONTROL_AREA_X_RADIO , HSB_Y1+2 ) ; 180 Size = MAP_APPFONT ( RADIO_WIDTH , RADIO_HEIGHT ) ; 181 Check = TRUE ; 182 }; 183 184 RadioButton CT_SATURATION 185 { 186 HelpID = "cui:RadioButton:ColorPicker:Saturation"; 187 Pos = MAP_APPFONT ( CONTROL_AREA_X_RADIO , HSB_Y2+2 ) ; 188 Size = MAP_APPFONT ( RADIO_WIDTH , RADIO_HEIGHT ) ; 189 }; 190 191 RadioButton CT_BRIGHTNESS 192 { 193 HelpID = "cui:RadioButton:ColorPicker:Brightness"; 194 Pos = MAP_APPFONT ( CONTROL_AREA_X_RADIO , HSB_Y3+2 ) ; 195 Size = MAP_APPFONT ( RADIO_WIDTH , RADIO_HEIGHT ) ; 196 }; 197 198 FixedText CT_RED 199 { 200 Pos = MAP_APPFONT ( CONTROL_AREA_X_LABEL , RGB_Y1+1 ) ; 201 Size = MAP_APPFONT ( LABEL_WIDTH , LABEL_HEIGHT ) ; 202 Text [ en-US ] = "~Red" ; 203 }; 204 205 MetricField CT_RED 206 { 207 HelpID = "cui:MetricField:ColorPicker:Red"; 208 Border = TRUE ; 209 Pos = MAP_APPFONT ( CONTROL_AREA_X_METRIC , RGB_Y1 ) ; 210 Size = MAP_APPFONT ( METRIC_WIDTH , METRIC_HEIGHT ) ; 211 TabStop = TRUE ; 212 Repeat = TRUE ; 213 Spin = TRUE ; 214 Maximum = 255 ; 215 Last = 255 ; 216 }; 217 218 FixedText CT_GREEN 219 { 220 Pos = MAP_APPFONT ( CONTROL_AREA_X_LABEL , RGB_Y2+1 ) ; 221 Size = MAP_APPFONT ( LABEL_WIDTH , LABEL_HEIGHT ) ; 222 Text [ en-US ] = "~Green" ; 223 }; 224 225 MetricField CT_GREEN 226 { 227 HelpID = "cui:MetricField:ColorPicker:Green"; 228 Border = TRUE ; 229 Pos = MAP_APPFONT ( CONTROL_AREA_X_METRIC , RGB_Y2 ) ; 230 Size = MAP_APPFONT ( METRIC_WIDTH , METRIC_HEIGHT ) ; 231 TabStop = TRUE ; 232 Repeat = TRUE ; 233 Spin = TRUE ; 234 Maximum = 255 ; 235 Last = 255 ; 236 }; 237 238 FixedText CT_BLUE 239 { 240 Pos = MAP_APPFONT ( CONTROL_AREA_X_LABEL , RGB_Y3+1 ) ; 241 Size = MAP_APPFONT ( LABEL_WIDTH , LABEL_HEIGHT ) ; 242 Text [ en-US ] = "~Blue" ; 243 }; 244 245 MetricField CT_BLUE 246 { 247 HelpID = "cui:MetricField:ColorPicker:Blue"; 248 Border = TRUE ; 249 Pos = MAP_APPFONT ( CONTROL_AREA_X_METRIC , RGB_Y3 ) ; 250 Size = MAP_APPFONT ( METRIC_WIDTH , METRIC_HEIGHT ) ; 251 TabStop = TRUE ; 252 Repeat = TRUE ; 253 Spin = TRUE ; 254 Maximum = 255 ; 255 Last = 255 ; 256 }; 257 258 FixedText CT_HEX 259 { 260 Pos = MAP_APPFONT ( CONTROL_AREA_X_LABEL , RGB_Y4+1 ) ; 261 Size = MAP_APPFONT ( LABEL_WIDTH , LABEL_HEIGHT ) ; 262 Text [ en-US ] = "Hex ~#" ; 263 }; 264 265 Edit CT_HEX 266 { 267 HelpID = "cui:MetricField:ColorPicker:Hex"; 268 Border = TRUE ; 269 Left = TRUE ; 270 Pos = MAP_APPFONT ( CONTROL_AREA_X_METRIC , RGB_Y4 ) ; 271 Size = MAP_APPFONT ( METRIC_WIDTH , METRIC_HEIGHT ) ; 272 TabStop = TRUE ; 273 }; 274 275// ------------------------------------------------------------------------- 276// HSB 277// ------------------------------------------------------------------------- 278 279 FixedLine FL_HSB 280 { 281 Pos = MAP_APPFONT ( CONTROL_AREA_X , HSB_Y0 ) ; 282 Size = MAP_APPFONT ( LINE_WIDTH , LINE_HEIGHT ) ; 283 Text [ en-US ] = "HSB" ; 284 }; 285 286 FixedText CT_HUE 287 { 288 Pos = MAP_APPFONT ( CONTROL_AREA_X_LABEL , HSB_Y1+1 ) ; 289 Size = MAP_APPFONT ( LABEL_WIDTH , LABEL_HEIGHT ) ; 290 Text [ en-US ] = "H~ue" ; 291 }; 292 293 MetricField CT_HUE 294 { 295 HelpID = "cui:MetricField:ColorPicker:Hue"; 296 Border = TRUE ; 297 Pos = MAP_APPFONT ( CONTROL_AREA_X_METRIC , HSB_Y1 ) ; 298 Size = MAP_APPFONT ( METRIC_WIDTH , METRIC_HEIGHT ) ; 299 TabStop = TRUE ; 300 Repeat = TRUE ; 301 Spin = TRUE ; 302 Maximum = 360 ; 303 Last = 360 ; 304 Unit = FUNIT_CUSTOM ; 305 }; 306 307 FixedText CT_SATURATION 308 { 309 Pos = MAP_APPFONT ( CONTROL_AREA_X_LABEL , HSB_Y2+1 ) ; 310 Size = MAP_APPFONT ( LABEL_WIDTH , LABEL_HEIGHT ) ; 311 Text [ en-US ] = "~Saturation" ; 312 }; 313 314 MetricField CT_SATURATION 315 { 316 HelpID = "cui:MetricField:ColorPicker:Saturation"; 317 Border = TRUE ; 318 Pos = MAP_APPFONT ( CONTROL_AREA_X_METRIC , HSB_Y2 ) ; 319 Size = MAP_APPFONT ( METRIC_WIDTH , METRIC_HEIGHT ) ; 320 TabStop = TRUE ; 321 Repeat = TRUE ; 322 Spin = TRUE ; 323 Maximum = 100 ; 324 Last = 100 ; 325 Unit = FUNIT_CUSTOM ; 326 CustomUnitText = " %" ; 327 }; 328 329 FixedText CT_BRIGHTNESS 330 { 331 Pos = MAP_APPFONT ( CONTROL_AREA_X_LABEL , HSB_Y3+1 ) ; 332 Size = MAP_APPFONT ( LABEL_WIDTH , LABEL_HEIGHT ) ; 333 Text [ en-US ] = "Bright~ness" ; 334 }; 335 336 MetricField CT_BRIGHTNESS 337 { 338 HelpID = "cui:MetricField:ColorPicker:Brightness"; 339 Border = TRUE ; 340 Pos = MAP_APPFONT ( CONTROL_AREA_X_METRIC , HSB_Y3 ) ; 341 Size = MAP_APPFONT ( METRIC_WIDTH , METRIC_HEIGHT ) ; 342 TabStop = TRUE ; 343 Repeat = TRUE ; 344 Spin = TRUE ; 345 Maximum = 100 ; 346 Last = 100 ; 347 Unit = FUNIT_CUSTOM ; 348 CustomUnitText = " %" ; 349 }; 350 351// ------------------------------------------------------------------------- 352// CMYK 353// ------------------------------------------------------------------------- 354 355 FixedLine FL_CMYK 356 { 357 Pos = MAP_APPFONT ( CONTROL_AREA_X , CMYK_Y0 ) ; 358 Size = MAP_APPFONT ( LINE_WIDTH , LINE_HEIGHT ) ; 359 Text [ en-US ] = "CMYK" ; 360 }; 361 362 FixedText CT_CYAN 363 { 364 Pos = MAP_APPFONT ( CONTROL_AREA_X_LABEL , CMYK_Y1+1 ) ; 365 Size = MAP_APPFONT ( LABEL_WIDTH , LABEL_HEIGHT ) ; 366 Text [ en-US ] = "~Cyan" ; 367 }; 368 369 MetricField CT_CYAN 370 { 371 HelpID = "cui:MetricField:ColorPicker:Cyan"; 372 Border = TRUE ; 373 Pos = MAP_APPFONT ( CONTROL_AREA_X_METRIC , CMYK_Y1 ) ; 374 Size = MAP_APPFONT ( METRIC_WIDTH , METRIC_HEIGHT ) ; 375 TabStop = TRUE ; 376 Repeat = TRUE ; 377 Spin = TRUE ; 378 Maximum = 100 ; 379 Last = 100 ; 380 Unit = FUNIT_CUSTOM ; 381 CustomUnitText = " %" ; 382 }; 383 384 FixedText CT_MAGENTA 385 { 386 Pos = MAP_APPFONT ( CONTROL_AREA_X_LABEL , CMYK_Y2+1 ) ; 387 Size = MAP_APPFONT ( LABEL_WIDTH , LABEL_HEIGHT ) ; 388 Text [ en-US ] = "~Magenta" ; 389 }; 390 391 MetricField CT_MAGENTA 392 { 393 HelpID = "cui:MetricField:ColorPicker:Magenta"; 394 Border = TRUE ; 395 Pos = MAP_APPFONT ( CONTROL_AREA_X_METRIC , CMYK_Y2 ) ; 396 Size = MAP_APPFONT ( METRIC_WIDTH , METRIC_HEIGHT ) ; 397 TabStop = TRUE ; 398 Repeat = TRUE ; 399 Spin = TRUE ; 400 Maximum = 100 ; 401 Last = 100 ; 402 Unit = FUNIT_CUSTOM ; 403 CustomUnitText = " %" ; 404 }; 405 406 FixedText CT_YELLOW 407 { 408 Pos = MAP_APPFONT ( CONTROL_AREA_X_LABEL , CMYK_Y3+1 ) ; 409 Size = MAP_APPFONT ( LABEL_WIDTH , LABEL_HEIGHT ) ; 410 Text [ en-US ] = "~Yellow" ; 411 }; 412 413 MetricField CT_YELLOW 414 { 415 HelpID = "cui:MetricField:ColorPicker:Yellow"; 416 Border = TRUE ; 417 Pos = MAP_APPFONT ( CONTROL_AREA_X_METRIC , CMYK_Y3 ) ; 418 Size = MAP_APPFONT ( METRIC_WIDTH , METRIC_HEIGHT ) ; 419 TabStop = TRUE ; 420 Repeat = TRUE ; 421 Spin = TRUE ; 422 Maximum = 100 ; 423 Last = 100 ; 424 Unit = FUNIT_CUSTOM ; 425 CustomUnitText = " %" ; 426 }; 427 428 FixedText CT_KEY 429 { 430 Pos = MAP_APPFONT ( CONTROL_AREA_X_LABEL , CMYK_Y4+1 ) ; 431 Size = MAP_APPFONT ( LABEL_WIDTH , LABEL_HEIGHT ) ; 432 Text [ en-US ] = "~Key" ; 433 }; 434 435 MetricField CT_KEY 436 { 437 HelpID = "cui:MetricField:ColorPicker:Key"; 438 Border = TRUE ; 439 Pos = MAP_APPFONT ( CONTROL_AREA_X_METRIC , CMYK_Y4 ) ; 440 Size = MAP_APPFONT ( METRIC_WIDTH , METRIC_HEIGHT ) ; 441 TabStop = TRUE ; 442 Repeat = TRUE ; 443 Spin = TRUE ; 444 Maximum = 100 ; 445 Last = 100 ; 446 Unit = FUNIT_CUSTOM ; 447 CustomUnitText = " %" ; 448 }; 449 450 // ------------------------------------------------------ 451 // bottom buttons 452 // ------------------------------------------------------ 453 454 FixedLine FT_BOTTOMLINE 455 { 456 Pos = MAP_APPFONT ( 0 , BOTTOMLINE_Y ) ; 457 Size = MAP_APPFONT ( DLG_WIDTH , 8 ) ; 458 }; 459 460 HelpButton BTN_HELP 461 { 462 Pos = MAP_APPFONT ( 3 , BUTTON_LINE_Y ) ; 463 Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ; 464 TabStop = TRUE ; 465 }; 466 467 OKButton BTN_OK 468 { 469 Pos = MAP_APPFONT ( DLG_WIDTH - 3 - BUTTON_WIDTH - 3 - BUTTON_WIDTH, BUTTON_LINE_Y ) ; 470 Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ; 471 TabStop = TRUE ; 472 DefButton = TRUE ; 473 }; 474 CancelButton BTN_CANCEL 475 { 476 Pos = MAP_APPFONT ( DLG_WIDTH - 3 - BUTTON_WIDTH, BUTTON_LINE_Y ) ; 477 Size = MAP_APPFONT ( BUTTON_WIDTH , BUTTON_HEIGHT ) ; 478 TabStop = TRUE ; 479 }; 480}; 481 482// eof 483