Changeset 522 for GraphicTest/Packages/Graphics32/GR32_Dsgn_Color.pas
- Timestamp:
- Apr 17, 2019, 10:42:18 AM (5 years ago)
- Location:
- GraphicTest/Packages/Graphics32
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GraphicTest/Packages/Graphics32
-
Property svn:ignore
set to
lib
-
Property svn:ignore
set to
-
GraphicTest/Packages/Graphics32/GR32_Dsgn_Color.pas
r450 r522 47 47 Consts, 48 48 DesignIntf, DesignEditors, VCLEditors, 49 Windows, Registry, Graphics, Dialogs, Forms, 49 Windows, Registry, Graphics, Dialogs, Forms, Controls, 50 50 {$ENDIF} 51 51 GR32, GR32_Image; … … 70 70 procedure RemoveColor(const AName: string); 71 71 end; 72 73 {$IFDEF COMPILER2010_UP} 74 TColor32Dialog = class(TCommonDialog) 75 private 76 FColor: TColor32; 77 FCustomColors: TStrings; 78 procedure SetCustomColors(Value: TStrings); 79 public 80 function Execute(ParentWnd: HWND): Boolean; override; 81 published 82 property Color: TColor32 read FColor write FColor default clBlack32; 83 property CustomColors: TStrings read FCustomColors write SetCustomColors; 84 property Ctl3D default True; 85 end; 86 {$ENDIF} 72 87 73 88 { TColor32Property } … … 106 121 107 122 implementation 123 124 {$IFDEF COMPILER2010_UP} 125 uses 126 GR32_Dsgn_ColorPicker; 127 {$ENDIF} 108 128 109 129 { TColorManager } … … 387 407 388 408 409 { TColor32Dialog } 410 411 {$IFDEF COMPILER2010_UP} 412 procedure TColor32Dialog.SetCustomColors(Value: TStrings); 413 begin 414 FCustomColors.Assign(Value); 415 end; 416 417 function TColor32Dialog.Execute(ParentWnd: HWND): Boolean; 418 var 419 ColorPicker: TFormColorPicker; 420 begin 421 ColorPicker := TFormColorPicker.Create(nil); 422 try 423 ColorPicker.Color := FColor; 424 Result := ColorPicker.ShowModal = mrOK; 425 if Result then 426 FColor := ColorPicker.Color; 427 finally 428 ColorPicker.Free; 429 end; 430 end; 431 {$ENDIF} 432 433 389 434 { TColor32Property } 390 435 … … 392 437 procedure TColor32Property.Edit; 393 438 var 439 {$IFDEF COMPILER2010_UP} 440 ColorDialog: TColor32Dialog; 441 {$ELSE} 394 442 ColorDialog: TColorDialog; 443 {$ENDIF} 395 444 IniFile: TRegIniFile; 396 445 … … 427 476 begin 428 477 IniFile := nil; 478 {$IFDEF COMPILER2010_UP} 479 ColorDialog := TColor32Dialog.Create(Application); 480 {$ELSE} 429 481 ColorDialog := TColorDialog.Create(Application); 482 {$ENDIF} 430 483 try 431 484 GetCustomColors; 432 ColorDialog.Color := WinColor(GetOrdValue);485 ColorDialog.Color := GetOrdValue; 433 486 ColorDialog.HelpContext := 25010; 487 {$IFNDEF COMPILER2010_UP} 434 488 ColorDialog.Options := [cdShowHelp]; 489 {$ENDIF} 435 490 if ColorDialog.Execute then 436 SetOrdValue(Cardinal(Color 32(ColorDialog.Color)));491 SetOrdValue(Cardinal(ColorDialog.Color)); 437 492 SaveCustomColors; 438 493 finally … … 446 501 begin 447 502 Result := [paMultiSelect, {$IFDEF EXT_PROP_EDIT}paDialog,{$ENDIF} paValueList, 448 paRevertable];503 paRevertable]; 449 504 end; 450 505
Note:
See TracChangeset
for help on using the changeset viewer.