You've already forked lazarus-ccr
colorpalette: Activate LCL scaling of Laz 1.8. Replace .lrs resource by .res. Add highDPI component palette icons (see image_sources). Set version no 0.2.3.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5940 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -1,14 +0,0 @@
|
|||||||
LazarusResources.Add('tcolorpalette','XPM',[
|
|
||||||
'/* XPM */'#10'static char *graphic[] = {'#10'"20 21 13 1",'#10'". c #848484"'
|
|
||||||
+','#10'", c None",'#10'"- c #FFFFFF",'#10'"* c #C6C6C6",'#10'"a c #000000",'
|
|
||||||
+#10'"b c #840000",'#10'"c c #848400",'#10'"d c #808000",'#10'"e c #FF0000",'
|
|
||||||
+#10'"f c #FFFF00",'#10'"g c #008400",'#10'"h c #008484",'#10'"i c #000084",'
|
|
||||||
+#10'"...................,",'#10'".-----------------*-",'#10'".-aaaaaaaaaaaaa'
|
|
||||||
+'aaa.-",'#10'".-aaaaaabbbbacccca.-",'#10'".-aaaaaabbbbacccca.-",'#10'".-aaaa'
|
|
||||||
+'aabbbbacccca.-",'#10'".-aaaaaabbbbaddcca.-",'#10'".-aaaaaaaaaaaaaaaa.-",'#10
|
|
||||||
+'".-a----aeeeeaffffa.-",'#10'".-a----aeeeeaffffa.-",'#10'".-a----aeeeeaffffa'
|
|
||||||
+'.-",'#10'".-a----aeeeeaffffa.-",'#10'".-aaaaaaaaaaaaaaaa.-",'#10'".-aggggah'
|
|
||||||
+'hhhaiiiia.-",'#10'".-aggggahhhhaiiiia.-",'#10'".-aggggahhhhaiiiia.-",'#10'"'
|
|
||||||
+'.-aggggahhhhaiiiia.-",'#10'".-aaaaaaaaaaaaaaaa.-",'#10'".*.................'
|
|
||||||
+'-",'#10'",-------------------",'#10'",,,,,,,,,,,,,,,,,,,,"}'#10
|
|
||||||
]);
|
|
@ -48,7 +48,7 @@ unit ColorPalette;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, SysUtils, LResources, Controls, Forms, Graphics, Math,
|
Classes, SysUtils, LResources, LCLVersion, Controls, Forms, Graphics, Math,
|
||||||
LCLType;
|
LCLType;
|
||||||
|
|
||||||
type
|
type
|
||||||
@ -138,6 +138,10 @@ type
|
|||||||
procedure ColorPick(AIndex: Integer; Shift: TShiftState); virtual;
|
procedure ColorPick(AIndex: Integer; Shift: TShiftState); virtual;
|
||||||
procedure ColorMouseMove(AColor: TColor; Shift: TShiftState); virtual;
|
procedure ColorMouseMove(AColor: TColor; Shift: TShiftState); virtual;
|
||||||
procedure DoAddColor(AColor: TColor; AColorName: String = ''); virtual;
|
procedure DoAddColor(AColor: TColor; AColorName: String = ''); virtual;
|
||||||
|
{$IF LCL_FULLVERSION >= 1080000}
|
||||||
|
procedure DoAutoAdjustLayout(const AMode: TLayoutAdjustmentPolicy;
|
||||||
|
const AXProportion, AYProportion: Double); override;
|
||||||
|
{$ENDIF}
|
||||||
procedure DoColorPick(AColor: TColor; AShift: TShiftState); virtual;
|
procedure DoColorPick(AColor: TColor; AShift: TShiftState); virtual;
|
||||||
procedure DoDeleteColor(AIndex: Integer); virtual;
|
procedure DoDeleteColor(AIndex: Integer); virtual;
|
||||||
procedure DoInsertColor(AIndex: Integer; AColor: TColor; AColorName: String = ''); virtual;
|
procedure DoInsertColor(AIndex: Integer; AColor: TColor; AColorName: String = ''); virtual;
|
||||||
@ -251,8 +255,10 @@ type
|
|||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
|
{$R colorpalette.res}
|
||||||
|
|
||||||
uses
|
uses
|
||||||
LCLIntf, StrUtils;
|
LCLIntf;
|
||||||
|
|
||||||
const
|
const
|
||||||
SELKIND_NAMES: Array[TPaletteSelectionKind] of String = (
|
SELKIND_NAMES: Array[TPaletteSelectionKind] of String = (
|
||||||
@ -363,6 +369,23 @@ begin
|
|||||||
FColors.AddObject(AColorName, TObject(PtrInt(AColor)));
|
FColors.AddObject(AColorName, TObject(PtrInt(AColor)));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{$IF LCL_FULLVERSION >= 1080000}
|
||||||
|
procedure TCustomColorPalette.DoAutoAdjustLayout(
|
||||||
|
const AMode: TLayoutAdjustmentPolicy; const AXProportion, AYProportion: Double);
|
||||||
|
begin
|
||||||
|
inherited DoAutoAdjustLayout(AMode, AXProportion, AYProportion);
|
||||||
|
|
||||||
|
if AMode = lapAutoAdjustForDPI then
|
||||||
|
begin
|
||||||
|
FButtonWidth := Round(FButtonWidth * AXProportion);
|
||||||
|
FButtonHeight := Round(FButtonHeight * AYProportion);
|
||||||
|
FButtonDistance := Round(FButtonDistance * AXProportion);
|
||||||
|
UpdateSize;
|
||||||
|
Invalidate;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{$ENDIF}
|
||||||
|
|
||||||
procedure TCustomColorPalette.DoColorPick(AColor: TColor; AShift: TShiftState);
|
procedure TCustomColorPalette.DoColorPick(AColor: TColor; AShift: TShiftState);
|
||||||
begin
|
begin
|
||||||
if Assigned(FOnColorPick) then
|
if Assigned(FOnColorPick) then
|
||||||
@ -1318,8 +1341,5 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
initialization
|
|
||||||
{$I colorpalette.lrs}
|
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
BIN
components/colorpalette/colorpalette.res
Normal file
BIN
components/colorpalette/colorpalette.res
Normal file
Binary file not shown.
@ -7,8 +7,12 @@
|
|||||||
<SessionStorage Value="InProjectDir"/>
|
<SessionStorage Value="InProjectDir"/>
|
||||||
<MainUnit Value="0"/>
|
<MainUnit Value="0"/>
|
||||||
<Title Value="project1"/>
|
<Title Value="project1"/>
|
||||||
|
<Scaled Value="True"/>
|
||||||
<ResourceType Value="res"/>
|
<ResourceType Value="res"/>
|
||||||
<UseXPManifest Value="True"/>
|
<UseXPManifest Value="True"/>
|
||||||
|
<XPManifest>
|
||||||
|
<DpiAware Value="True"/>
|
||||||
|
</XPManifest>
|
||||||
<Icon Value="0"/>
|
<Icon Value="0"/>
|
||||||
</General>
|
</General>
|
||||||
<i18n>
|
<i18n>
|
||||||
|
@ -13,6 +13,7 @@ uses
|
|||||||
{$R *.res}
|
{$R *.res}
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
Application.Scaled := True;
|
||||||
RequireDerivedFormResource:=True;
|
RequireDerivedFormResource:=True;
|
||||||
Application.Initialize;
|
Application.Initialize;
|
||||||
Application.CreateForm(TMainForm, MainForm);
|
Application.CreateForm(TMainForm, MainForm);
|
||||||
|
@ -7,8 +7,9 @@ object MainForm: TMainForm
|
|||||||
ClientHeight = 586
|
ClientHeight = 586
|
||||||
ClientWidth = 625
|
ClientWidth = 625
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
|
Position = poScreenCenter
|
||||||
ShowHint = True
|
ShowHint = True
|
||||||
LCLVersion = '1.5'
|
LCLVersion = '1.9.0.0'
|
||||||
object LeftPanel: TPanel
|
object LeftPanel: TPanel
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 586
|
Height = 586
|
||||||
@ -439,11 +440,11 @@ object MainForm: TMainForm
|
|||||||
Top = 8
|
Top = 8
|
||||||
Width = 287
|
Width = 287
|
||||||
HorzScrollBar.Increment = 15
|
HorzScrollBar.Increment = 15
|
||||||
HorzScrollBar.Page = 155
|
HorzScrollBar.Page = 154
|
||||||
HorzScrollBar.Smooth = True
|
HorzScrollBar.Smooth = True
|
||||||
HorzScrollBar.Tracking = True
|
HorzScrollBar.Tracking = True
|
||||||
VertScrollBar.Increment = 4
|
VertScrollBar.Increment = 4
|
||||||
VertScrollBar.Page = 42
|
VertScrollBar.Page = 41
|
||||||
VertScrollBar.Smooth = True
|
VertScrollBar.Smooth = True
|
||||||
VertScrollBar.Tracking = True
|
VertScrollBar.Tracking = True
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
@ -453,10 +454,10 @@ object MainForm: TMainForm
|
|||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
object ColorPalette: TColorPalette
|
object ColorPalette: TColorPalette
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 41
|
Height = 40
|
||||||
Hint = 'Click to select a color'
|
Hint = 'Click to select a color'
|
||||||
Top = 1
|
Top = 1
|
||||||
Width = 155
|
Width = 154
|
||||||
ButtonHeight = 20
|
ButtonHeight = 20
|
||||||
ButtonWidth = 20
|
ButtonWidth = 20
|
||||||
ColumnCount = 8
|
ColumnCount = 8
|
||||||
|
@ -7,8 +7,12 @@
|
|||||||
<SessionStorage Value="InProjectDir"/>
|
<SessionStorage Value="InProjectDir"/>
|
||||||
<MainUnit Value="0"/>
|
<MainUnit Value="0"/>
|
||||||
<Title Value="project1"/>
|
<Title Value="project1"/>
|
||||||
|
<Scaled Value="True"/>
|
||||||
<ResourceType Value="res"/>
|
<ResourceType Value="res"/>
|
||||||
<UseXPManifest Value="True"/>
|
<UseXPManifest Value="True"/>
|
||||||
|
<XPManifest>
|
||||||
|
<DpiAware Value="True"/>
|
||||||
|
</XPManifest>
|
||||||
<Icon Value="0"/>
|
<Icon Value="0"/>
|
||||||
</General>
|
</General>
|
||||||
<i18n>
|
<i18n>
|
||||||
|
@ -13,6 +13,7 @@ uses
|
|||||||
{$R *.res}
|
{$R *.res}
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
Application.Scaled := True;
|
||||||
RequireDerivedFormResource:=True;
|
RequireDerivedFormResource:=True;
|
||||||
Application.Initialize;
|
Application.Initialize;
|
||||||
Application.CreateForm(TMainForm, MainForm);
|
Application.CreateForm(TMainForm, MainForm);
|
||||||
|
@ -8,7 +8,7 @@ object MainForm: TMainForm
|
|||||||
ClientWidth = 633
|
ClientWidth = 633
|
||||||
OnCreate = FormCreate
|
OnCreate = FormCreate
|
||||||
ShowHint = True
|
ShowHint = True
|
||||||
LCLVersion = '1.5'
|
LCLVersion = '1.9.0.0'
|
||||||
object MainPanel: TPanel
|
object MainPanel: TPanel
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 432
|
Height = 432
|
||||||
@ -110,10 +110,11 @@ object MainForm: TMainForm
|
|||||||
AnchorSideLeft.Control = CoolBar
|
AnchorSideLeft.Control = CoolBar
|
||||||
AnchorSideTop.Control = CoolBar
|
AnchorSideTop.Control = CoolBar
|
||||||
Left = 13
|
Left = 13
|
||||||
Height = 49
|
Height = 45
|
||||||
Top = 5
|
Top = 5
|
||||||
Width = 50
|
Width = 46
|
||||||
Align = alNone
|
Align = alNone
|
||||||
|
AutoSize = True
|
||||||
BorderSpacing.Left = 11
|
BorderSpacing.Left = 11
|
||||||
BorderSpacing.Top = 3
|
BorderSpacing.Top = 3
|
||||||
ButtonHeight = 45
|
ButtonHeight = 45
|
||||||
@ -141,7 +142,7 @@ object MainForm: TMainForm
|
|||||||
AnchorSideLeft.Control = CoolBar
|
AnchorSideLeft.Control = CoolBar
|
||||||
AnchorSideTop.Control = CoolBar
|
AnchorSideTop.Control = CoolBar
|
||||||
Left = 78
|
Left = 78
|
||||||
Height = 45
|
Height = 44
|
||||||
Top = 7
|
Top = 7
|
||||||
Width = 385
|
Width = 385
|
||||||
ButtonHeight = 15
|
ButtonHeight = 15
|
||||||
|
@ -20,16 +20,16 @@
|
|||||||
</CompilerOptions>
|
</CompilerOptions>
|
||||||
<Description Value="This package contains a color palette component."/>
|
<Description Value="This package contains a color palette component."/>
|
||||||
<License Value="Modified LGPL"/>
|
<License Value="Modified LGPL"/>
|
||||||
<Version Minor="2" Release="2"/>
|
<Version Minor="2" Release="3"/>
|
||||||
<Files Count="2">
|
<Files Count="2">
|
||||||
<Item1>
|
<Item1>
|
||||||
<Filename Value="colorpalette.lrs"/>
|
|
||||||
<Type Value="LRS"/>
|
|
||||||
</Item1>
|
|
||||||
<Item2>
|
|
||||||
<Filename Value="colorpalette.pas"/>
|
<Filename Value="colorpalette.pas"/>
|
||||||
<HasRegisterProc Value="True"/>
|
<HasRegisterProc Value="True"/>
|
||||||
<UnitName Value="ColorPalette"/>
|
<UnitName Value="ColorPalette"/>
|
||||||
|
</Item1>
|
||||||
|
<Item2>
|
||||||
|
<Filename Value="colorpalette.res"/>
|
||||||
|
<Type Value="Binary"/>
|
||||||
</Item2>
|
</Item2>
|
||||||
</Files>
|
</Files>
|
||||||
<RequiredPkgs Count="2">
|
<RequiredPkgs Count="2">
|
||||||
@ -48,5 +48,8 @@
|
|||||||
<Version Value="2"/>
|
<Version Value="2"/>
|
||||||
<IgnoreBinaries Value="False"/>
|
<IgnoreBinaries Value="False"/>
|
||||||
</PublishOptions>
|
</PublishOptions>
|
||||||
|
<CustomOptions Items="ExternHelp" Version="2">
|
||||||
|
<_ExternHelp Items="Count"/>
|
||||||
|
</CustomOptions>
|
||||||
</Package>
|
</Package>
|
||||||
</CONFIG>
|
</CONFIG>
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
unit LazColorPalette;
|
unit LazColorPalette;
|
||||||
|
|
||||||
{$warn 5023 off : no warning about unused units}
|
|
||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 199 B |
Reference in New Issue
Block a user