You've already forked lazarus-ccr
jvcllaz: Improved layout for JvFullColorCircle demo
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6987 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -3,7 +3,6 @@ object JvFullColorCircleDlgMainFrm: TJvFullColorCircleDlgMainFrm
|
|||||||
Height = 315
|
Height = 315
|
||||||
Top = 214
|
Top = 214
|
||||||
Width = 274
|
Width = 274
|
||||||
BorderStyle = bsDialog
|
|
||||||
Caption = 'JvFullColorCircleDlgMainFrm'
|
Caption = 'JvFullColorCircleDlgMainFrm'
|
||||||
ClientHeight = 315
|
ClientHeight = 315
|
||||||
ClientWidth = 274
|
ClientWidth = 274
|
||||||
@ -15,16 +14,14 @@ object JvFullColorCircleDlgMainFrm: TJvFullColorCircleDlgMainFrm
|
|||||||
Position = poScreenCenter
|
Position = poScreenCenter
|
||||||
LCLVersion = '2.1.0.0'
|
LCLVersion = '2.1.0.0'
|
||||||
object Bevel: TBevel
|
object Bevel: TBevel
|
||||||
AnchorSideLeft.Control = Memo
|
AnchorSideTop.Control = cmbFileName
|
||||||
AnchorSideLeft.Side = asrCenter
|
|
||||||
AnchorSideTop.Control = ComboBoxFileName
|
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 33
|
Left = 32
|
||||||
Height = 86
|
Height = 86
|
||||||
Top = 35
|
Top = 41
|
||||||
Width = 86
|
Width = 86
|
||||||
BorderSpacing.Left = 6
|
BorderSpacing.Left = 9
|
||||||
BorderSpacing.Top = 6
|
BorderSpacing.Top = 12
|
||||||
Style = bsRaised
|
Style = bsRaised
|
||||||
end
|
end
|
||||||
object Image: TImage
|
object Image: TImage
|
||||||
@ -32,15 +29,15 @@ object JvFullColorCircleDlgMainFrm: TJvFullColorCircleDlgMainFrm
|
|||||||
AnchorSideLeft.Side = asrCenter
|
AnchorSideLeft.Side = asrCenter
|
||||||
AnchorSideTop.Control = Bevel
|
AnchorSideTop.Control = Bevel
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
Left = 36
|
Left = 35
|
||||||
Height = 80
|
Height = 80
|
||||||
Top = 38
|
Top = 44
|
||||||
Width = 80
|
Width = 80
|
||||||
Center = True
|
Center = True
|
||||||
end
|
end
|
||||||
object LabelImage: TLabel
|
object LabelImage: TLabel
|
||||||
AnchorSideLeft.Control = Owner
|
AnchorSideLeft.Control = Owner
|
||||||
AnchorSideTop.Control = ComboBoxFileName
|
AnchorSideTop.Control = cmbFileName
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
Left = 6
|
Left = 6
|
||||||
Height = 15
|
Height = 15
|
||||||
@ -53,31 +50,7 @@ object JvFullColorCircleDlgMainFrm: TJvFullColorCircleDlgMainFrm
|
|||||||
ParentColor = False
|
ParentColor = False
|
||||||
ParentFont = False
|
ParentFont = False
|
||||||
end
|
end
|
||||||
object Memo: TMemo
|
object cmbFileName: TComboBox
|
||||||
AnchorSideLeft.Control = Owner
|
|
||||||
AnchorSideTop.Control = Bevel
|
|
||||||
AnchorSideTop.Side = asrBottom
|
|
||||||
AnchorSideRight.Control = Bevel
|
|
||||||
AnchorSideRight.Side = asrBottom
|
|
||||||
Left = 6
|
|
||||||
Height = 70
|
|
||||||
Top = 127
|
|
||||||
Width = 141
|
|
||||||
Alignment = taCenter
|
|
||||||
BorderSpacing.Left = 6
|
|
||||||
BorderSpacing.Top = 6
|
|
||||||
BorderStyle = bsNone
|
|
||||||
Font.Color = clWindowText
|
|
||||||
Lines.Strings = (
|
|
||||||
'Original image'
|
|
||||||
)
|
|
||||||
OnKeyDown = MemoKeyDown
|
|
||||||
OnKeyPress = MemoKeyPress
|
|
||||||
ParentColor = True
|
|
||||||
ParentFont = False
|
|
||||||
TabOrder = 0
|
|
||||||
end
|
|
||||||
object ComboBoxFileName: TComboBox
|
|
||||||
AnchorSideLeft.Control = LabelImage
|
AnchorSideLeft.Control = LabelImage
|
||||||
AnchorSideLeft.Side = asrBottom
|
AnchorSideLeft.Side = asrBottom
|
||||||
AnchorSideTop.Control = Owner
|
AnchorSideTop.Control = Owner
|
||||||
@ -92,16 +65,30 @@ object JvFullColorCircleDlgMainFrm: TJvFullColorCircleDlgMainFrm
|
|||||||
DropDownCount = 24
|
DropDownCount = 24
|
||||||
Font.Color = clWindowText
|
Font.Color = clWindowText
|
||||||
ItemHeight = 15
|
ItemHeight = 15
|
||||||
OnClick = ComboBoxFileNameSelect
|
OnClick = cmbFileNameSelect
|
||||||
OnSelect = ComboBoxFileNameSelect
|
OnSelect = cmbFileNameSelect
|
||||||
ParentFont = False
|
ParentFont = False
|
||||||
Style = csDropDownList
|
Style = csDropDownList
|
||||||
TabOrder = 1
|
TabOrder = 0
|
||||||
|
end
|
||||||
|
object Label1: TLabel
|
||||||
|
AnchorSideTop.Control = Bevel
|
||||||
|
AnchorSideTop.Side = asrBottom
|
||||||
|
Left = 40
|
||||||
|
Height = 15
|
||||||
|
Top = 133
|
||||||
|
Width = 78
|
||||||
|
Alignment = taCenter
|
||||||
|
AutoSize = False
|
||||||
|
BorderSpacing.Top = 6
|
||||||
|
Caption = 'Original image'
|
||||||
|
ParentColor = False
|
||||||
|
WordWrap = True
|
||||||
end
|
end
|
||||||
object JvFullColorCircleDialog: TJvFullColorCircleDialog
|
object JvFullColorCircleDialog: TJvFullColorCircleDialog
|
||||||
HelpContext = 0
|
HelpContext = 0
|
||||||
OnApply = JvFullColorCircleDialogApply
|
OnApply = JvFullColorCircleDialogApply
|
||||||
Left = 184
|
left = 184
|
||||||
Top = 80
|
top = 80
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -31,7 +31,7 @@ unit JvFullColorCircleDialogMainForm;
|
|||||||
interface
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
SysUtils, Variants, Classes, Graphics, Controls, Types, Forms,
|
||||||
Dialogs, ExtCtrls, StdCtrls, JvFullColorSpaces, JvFullColorCircleForm,
|
Dialogs, ExtCtrls, StdCtrls, JvFullColorSpaces, JvFullColorCircleForm,
|
||||||
JvFullColorDialogs, JvFullColorRotate;
|
JvFullColorDialogs, JvFullColorRotate;
|
||||||
|
|
||||||
@ -42,23 +42,24 @@ type
|
|||||||
TJvFullColorCircleDlgMainFrm = class(TForm)
|
TJvFullColorCircleDlgMainFrm = class(TForm)
|
||||||
Image: TImage;
|
Image: TImage;
|
||||||
Bevel: TBevel;
|
Bevel: TBevel;
|
||||||
Memo: TMemo;
|
Label1: TLabel;
|
||||||
LabelImage: TLabel;
|
LabelImage: TLabel;
|
||||||
ComboBoxFileName: TComboBox;
|
cmbFileName: TComboBox;
|
||||||
JvFullColorCircleDialog: TJvFullColorCircleDialog;
|
JvFullColorCircleDialog: TJvFullColorCircleDialog;
|
||||||
procedure FormActivate(Sender: TObject);
|
procedure FormActivate(Sender: TObject);
|
||||||
procedure FormCreate(Sender: TObject);
|
procedure FormCreate(Sender: TObject);
|
||||||
procedure MemoKeyDown(Sender: TObject; var Key: Word;
|
procedure cmbFileNameSelect(Sender: TObject);
|
||||||
Shift: TShiftState);
|
|
||||||
procedure MemoKeyPress(Sender: TObject; var Key: Char);
|
|
||||||
procedure ComboBoxFileNameSelect(Sender: TObject);
|
|
||||||
procedure JvFullColorCircleDialogApply(Sender: TObject);
|
procedure JvFullColorCircleDialogApply(Sender: TObject);
|
||||||
|
private
|
||||||
|
procedure FormatLabel(ALabel: TLabel; const Delta: TJvColorDelta);
|
||||||
|
function MeasureLabels: TSize;
|
||||||
public
|
public
|
||||||
Images: array [0..6] of TImage;
|
Images: array [0..6] of TImage;
|
||||||
Memos: array [0..6] of TMemo;
|
Memos: array [0..6] of TMemo;
|
||||||
|
Labels: array[0..6] of TLabel;
|
||||||
procedure CustomizeDblClick(Sender: TObject);
|
procedure CustomizeDblClick(Sender: TObject);
|
||||||
procedure RotateCustomValues;
|
procedure RotateCustomValues;
|
||||||
procedure FormatMemo(AMemo: TMemo; const Delta: TJvColorDelta);
|
// procedure FormatMemo(AMemo: TMemo; const Delta: TJvColorDelta);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
@ -68,7 +69,8 @@ implementation
|
|||||||
|
|
||||||
{$R *.lfm}
|
{$R *.lfm}
|
||||||
|
|
||||||
uses Contnrs;
|
uses
|
||||||
|
LCLIntf, LCLType, Math, Contnrs;
|
||||||
|
|
||||||
resourcestring
|
resourcestring
|
||||||
RsCustomize = 'Dbl-click to customize';
|
RsCustomize = 'Dbl-click to customize';
|
||||||
@ -95,12 +97,112 @@ begin
|
|||||||
ImgDir := IncludeTrailingPathDelimiter(GetCurrentDir) + '../../design/JvCtrls/images/';
|
ImgDir := IncludeTrailingPathDelimiter(GetCurrentDir) + '../../design/JvCtrls/images/';
|
||||||
if FindFirst(ImgDir + '*.png', faAnyFile, LSearchRec) = 0 then
|
if FindFirst(ImgDir + '*.png', faAnyFile, LSearchRec) = 0 then
|
||||||
repeat
|
repeat
|
||||||
ComboBoxFileName.Items.Add(LSearchRec.Name);
|
cmbFileName.Items.Add(LSearchRec.Name);
|
||||||
until FindNext(LSearchRec) <> 0;
|
until FindNext(LSearchRec) <> 0;
|
||||||
FindClose(LSearchRec);
|
FindClose(LSearchRec);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TJvFullColorCircleDlgMainFrm.MeasureLabels: TSize;
|
||||||
|
var
|
||||||
|
i, j: Integer;
|
||||||
|
axIndex: TJvAxisIndex;
|
||||||
|
ColorSpc: TJvColorSpace;
|
||||||
|
L: TStrings;
|
||||||
|
s: String;
|
||||||
|
bmp: TBitmap;
|
||||||
|
R: TRect;
|
||||||
|
begin
|
||||||
|
Result := Size(0, 0);
|
||||||
|
ColorSpc := ColorSpaceManager.ColorSpace[csCMY];
|
||||||
|
L := TStringList.Create;
|
||||||
|
try
|
||||||
|
L.Add(Format('%s (%s)',[ColorSpc.Name, ColorSpc.ShortName]));
|
||||||
|
for axIndex := Low(TJvAxisIndex) to High(TJvAxisIndex) do
|
||||||
|
L.Add(Format('%s : %d, %d, %d',[ColorSpc.AxisName[axIndex], 255, 255, 255]));
|
||||||
|
s := L.Text;
|
||||||
|
finally
|
||||||
|
L.Free;
|
||||||
|
end;
|
||||||
|
|
||||||
|
bmp := TBitmap.Create;
|
||||||
|
try
|
||||||
|
bmp.SetSize(1, 1);
|
||||||
|
bmp.Canvas.Brush.Color := clWhite;
|
||||||
|
bmp.Canvas.FillRect(0, 0, 1, 1);
|
||||||
|
bmp.Canvas.Font.Assign(Label1.Font);
|
||||||
|
R := Rect(0, 0, MaxInt, MaxInt);
|
||||||
|
DrawText(bmp.Canvas.Handle, PChar(s), Length(s), R, DT_WORDBREAK or DT_CALCRECT or DT_NOCLIP);
|
||||||
|
Result.CX := Max(Result.CX, R.Right);
|
||||||
|
Result.CY := Max(Result.CY, R.Bottom);
|
||||||
|
finally
|
||||||
|
bmp.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TJvFullColorCircleDlgMainFrm.FormActivate(Sender: TObject);
|
procedure TJvFullColorCircleDlgMainFrm.FormActivate(Sender: TObject);
|
||||||
|
var
|
||||||
|
X, Y: Integer;
|
||||||
|
PitchX, PitchY: Integer;
|
||||||
|
LabelSize: TSize;
|
||||||
|
Index: Integer;
|
||||||
|
lBevel: TBevel;
|
||||||
|
lImage: TImage;
|
||||||
|
lLabel: TLabel;
|
||||||
|
h: Integer;
|
||||||
|
begin
|
||||||
|
LabelSize := MeasureLabels;
|
||||||
|
h := Label1.Canvas.Textheight('Tg');
|
||||||
|
PitchX := LabelSize.CX + 32;
|
||||||
|
PitchY := LabelSize.CY + Bevel.Height + 16;
|
||||||
|
|
||||||
|
Label1.Left := 8;
|
||||||
|
Label1.Width := LabelSize.CX;
|
||||||
|
Bevel.Left := Label1.Left + (Label1.Width - Bevel.Width) div 2;
|
||||||
|
|
||||||
|
Index := 0;
|
||||||
|
for Y := 0 to 1 do
|
||||||
|
for X := 0 to 3 do
|
||||||
|
if (X <> 0) or (Y <> 0) then
|
||||||
|
begin
|
||||||
|
lBevel := TBevel.Create(Self);
|
||||||
|
lBevel.Parent := Self;
|
||||||
|
lBevel.Style := bsRaised;
|
||||||
|
lBevel.SetBounds(Bevel.Left + X*PitchX, Bevel.Top + Y*PitchY, Bevel.Width, Bevel.Height);
|
||||||
|
|
||||||
|
lImage := TImage.Create(Self);
|
||||||
|
lImage.Parent := Self;
|
||||||
|
lImage.Stretch := false;
|
||||||
|
lImage.Center := true;
|
||||||
|
lImage.SetBounds(Image.Left + X*PitchX, Image.Top + Y*PitchY, Image.Width, Image.Height);
|
||||||
|
|
||||||
|
lLabel := TLabel.Create(Self);
|
||||||
|
lLabel.Parent := Self;
|
||||||
|
lLabel.AutoSize := false;
|
||||||
|
lLabel.WordWrap := true;
|
||||||
|
lLabel.Alignment := taCenter;
|
||||||
|
// lLabel.SetBounds(Label1.Left + X*PitchX, Label1.Top + Y*PitchY, LabelSize.CX, LabelSize.CY);
|
||||||
|
lLabel.Left := Label1.Left + X*PitchX;
|
||||||
|
lLabel.Top := Label1.Top + Y*PitchY;
|
||||||
|
lLabel.Width := LabelSize.CX;
|
||||||
|
lLabel.Height := LabelSize.CY + Y*h;
|
||||||
|
|
||||||
|
if (X = 3) and (Y = 1) then begin
|
||||||
|
lImage.OnDblClick := @CustomizeDblClick;
|
||||||
|
lLabel.OnDblClick := @CustomizeDblClick;
|
||||||
|
ClientWidth := lBevel.Left + lBevel.Width + Bevel.Left;
|
||||||
|
ClientHeight := lLabel.Top + lLabel.Height + cmbFileName.Top;
|
||||||
|
end;
|
||||||
|
|
||||||
|
Images[Index] := lImage;
|
||||||
|
Labels[Index] := lLabel;
|
||||||
|
Inc(Index);
|
||||||
|
end;
|
||||||
|
|
||||||
|
cmbFileName.ItemIndex := 0;
|
||||||
|
cmbFileNameSelect(cmbFileName);
|
||||||
|
end;
|
||||||
|
|
||||||
|
(*
|
||||||
var
|
var
|
||||||
X, Y: Integer;
|
X, Y: Integer;
|
||||||
PitchX, PitchY: Integer;
|
PitchX, PitchY: Integer;
|
||||||
@ -120,11 +222,13 @@ begin
|
|||||||
LBevel.Parent := Self;
|
LBevel.Parent := Self;
|
||||||
LBevel.Style := bsRaised;
|
LBevel.Style := bsRaised;
|
||||||
LBevel.SetBounds(Bevel.Left+X*PitchX, Bevel.Top+Y*PitchY, Bevel.Width, Bevel.Height);
|
LBevel.SetBounds(Bevel.Left+X*PitchX, Bevel.Top+Y*PitchY, Bevel.Width, Bevel.Height);
|
||||||
|
|
||||||
LImage := TImage.Create(Self);
|
LImage := TImage.Create(Self);
|
||||||
LImage.Parent := Self;
|
LImage.Parent := Self;
|
||||||
LImage.Stretch := False;
|
LImage.Stretch := False;
|
||||||
LImage.Center := true;
|
LImage.Center := true;
|
||||||
LImage.SetBounds(Image.Left+X*PitchX, Image.Top+Y*PitchY, Image.Width, Image.Height);
|
LImage.SetBounds(Image.Left+X*PitchX, Image.Top+Y*PitchY, Image.Width, Image.Height);
|
||||||
|
|
||||||
LMemo := TMemo.Create(Self);
|
LMemo := TMemo.Create(Self);
|
||||||
LMemo.Parent := Self;
|
LMemo.Parent := Self;
|
||||||
LMemo.BorderStyle := bsNone;
|
LMemo.BorderStyle := bsNone;
|
||||||
@ -133,20 +237,22 @@ begin
|
|||||||
LMemo.OnKeyPress := @MemoKeyPress;
|
LMemo.OnKeyPress := @MemoKeyPress;
|
||||||
LMemo.SetBounds(Memo.Left+X*PitchX, Memo.Top+Y*PitchY, Memo.Width, Memo.Height);
|
LMemo.SetBounds(Memo.Left+X*PitchX, Memo.Top+Y*PitchY, Memo.Width, Memo.Height);
|
||||||
LMemo.Alignment := taCenter;
|
LMemo.Alignment := taCenter;
|
||||||
|
|
||||||
if (X = 3) and (Y = 1) then
|
if (X = 3) and (Y = 1) then
|
||||||
begin
|
begin
|
||||||
LImage.OnDblClick := @CustomizeDblClick;
|
LImage.OnDblClick := @CustomizeDblClick;
|
||||||
LMemo.OnDblClick := @CustomizeDblClick;
|
LMemo.OnDblClick := @CustomizeDblClick;
|
||||||
ClientWidth := LMemo.Left+LMemo.Width-1+Memo.Left;
|
ClientWidth := LMemo.Left+LMemo.Width-1+Memo.Left;
|
||||||
ClientHeight := LMemo.Top+LMemo.Height-1+ComboboxFileName.Top;
|
ClientHeight := LMemo.Top+LMemo.Height-1+cmbFileName.Top;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Memos[Index] := LMemo;
|
Memos[Index] := LMemo;
|
||||||
Images[Index] := LImage;
|
Images[Index] := LImage;
|
||||||
Inc(Index);
|
Inc(Index);
|
||||||
end;
|
end;
|
||||||
ComboBoxFileName.ItemIndex := 0;
|
cmbFileName.ItemIndex := 0;
|
||||||
ComboBoxFileNameSelect(ComboBoxFileName);
|
ComboBoxFileNameSelect(cmbFileName);
|
||||||
end;
|
end; *)
|
||||||
|
|
||||||
procedure TJvFullColorCircleDlgMainFrm.CustomizeDblClick(Sender: TObject);
|
procedure TJvFullColorCircleDlgMainFrm.CustomizeDblClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
@ -154,27 +260,16 @@ begin
|
|||||||
RotateCustomValues;
|
RotateCustomValues;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TJvFullColorCircleDlgMainFrm.MemoKeyDown(Sender: TObject; var Key: Word;
|
procedure TJvFullColorCircleDlgMainFrm.cmbFileNameSelect(Sender: TObject);
|
||||||
Shift: TShiftState);
|
|
||||||
begin
|
|
||||||
Key := 0; // discard any key but Enabled=False affects the text rendering
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TJvFullColorCircleDlgMainFrm.MemoKeyPress(Sender: TObject; var Key: Char);
|
|
||||||
begin
|
|
||||||
Key := #0; // discard any key but Enabled=False affects the text rendering
|
|
||||||
end;
|
|
||||||
|
|
||||||
procedure TJvFullColorCircleDlgMainFrm.ComboBoxFileNameSelect(Sender: TObject);
|
|
||||||
var
|
var
|
||||||
Index: Integer;
|
Index: Integer;
|
||||||
fn: String;
|
fn: String;
|
||||||
begin
|
begin
|
||||||
if ComboboxFileName.ItemIndex = -1 then
|
if cmbFileName.ItemIndex = -1 then
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
if Image.Picture.Bitmap <> nil then begin
|
if Image.Picture.Bitmap <> nil then begin
|
||||||
fn := ImgDir + ComboboxFileName.Items[ComboboxFileName.ItemIndex];
|
fn := ImgDir + cmbFileName.Items[cmbFileName.ItemIndex];
|
||||||
if FileExists(fn) then
|
if FileExists(fn) then
|
||||||
Image.Picture.LoadFromFile(fn)
|
Image.Picture.LoadFromFile(fn)
|
||||||
else
|
else
|
||||||
@ -182,18 +277,24 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// Image.Picture.Bitmap := TBitmap.Create;
|
// Image.Picture.Bitmap := TBitmap.Create;
|
||||||
// Image.Picture.Bitmap.LoadFromFile(ComboBoxFileName.Items[ComboBoxFileName.ItemIndex]);
|
// Image.Picture.Bitmap.LoadFromFile(cmbFileName.Items[cmbFileName.ItemIndex]);
|
||||||
|
|
||||||
|
Labels[6].Caption := RsCustomize;
|
||||||
|
|
||||||
|
{
|
||||||
with Memos[6].Lines do
|
with Memos[6].Lines do
|
||||||
begin
|
begin
|
||||||
Clear;
|
Clear;
|
||||||
Add(RsCustomize);
|
Add(RsCustomize);
|
||||||
end;
|
end;
|
||||||
|
}
|
||||||
Images[6].Picture.Bitmap.FreeImage;
|
Images[6].Picture.Bitmap.FreeImage;
|
||||||
for Index := Low(Images) to High(Images)-1 do
|
for Index := Low(Images) to High(Images)-1 do
|
||||||
begin
|
begin
|
||||||
Images[Index].Picture.Bitmap.FreeImage;
|
Images[Index].Picture.Bitmap.FreeImage;
|
||||||
RotateBitmap(Image.Picture.Bitmap,Images[Index].Picture.Bitmap,ColorDeltas[Index]);
|
RotateBitmap(Image.Picture.Bitmap,Images[Index].Picture.Bitmap,ColorDeltas[Index]);
|
||||||
FormatMemo(Memos[Index],ColorDeltas[Index]);
|
FormatLabel(Labels[Index], ColorDeltas[Index]);
|
||||||
|
// FormatMemo(Memos[Index], ColorDeltas[Index]);
|
||||||
end;
|
end;
|
||||||
RotateCustomValues;
|
RotateCustomValues;
|
||||||
end;
|
end;
|
||||||
@ -201,9 +302,37 @@ end;
|
|||||||
procedure TJvFullColorCircleDlgMainFrm.RotateCustomValues;
|
procedure TJvFullColorCircleDlgMainFrm.RotateCustomValues;
|
||||||
begin
|
begin
|
||||||
RotateBitmap(Image.Picture.Bitmap,Images[6].Picture.Bitmap,JvFullColorCircleDialog.Delta);
|
RotateBitmap(Image.Picture.Bitmap,Images[6].Picture.Bitmap,JvFullColorCircleDialog.Delta);
|
||||||
FormatMemo(Memos[6],JvFullColorCircleDialog.Delta);
|
FormatLabel(Labels[6], JvFullColorCircleDialog.Delta);
|
||||||
|
// FormatMemo(Memos[6],JvFullColorCircleDialog.Delta);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TJvFullColorCircleDlgMainFrm.FormatLabel(ALabel: TLabel;
|
||||||
|
const Delta: TJvColorDelta);
|
||||||
|
var
|
||||||
|
Index: TJvAxisIndex;
|
||||||
|
L: TStringList;
|
||||||
|
begin
|
||||||
|
L := TStringList.Create;
|
||||||
|
try
|
||||||
|
with ColorSpaceManager, ColorSpace[Delta.ColorID] do begin
|
||||||
|
L.Add(Format('%s (%s)', [Name, ShortName]));
|
||||||
|
for Index := Low(TJvAxisIndex) to High(TJvAxisIndex) do
|
||||||
|
L.Add(Format('%s: %d, %d, %d', [
|
||||||
|
AxisName[Index],
|
||||||
|
Delta.AxisRed[Index].Value,
|
||||||
|
Delta.AxisGreen[Index].Value,
|
||||||
|
Delta.AxisBlue[Index].Value
|
||||||
|
]));
|
||||||
|
if ALabel = Labels[6] then
|
||||||
|
L.Add(RsCustomize);
|
||||||
|
end;
|
||||||
|
ALabel.Caption := L.Text;
|
||||||
|
finally
|
||||||
|
L.Free;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
|
(*
|
||||||
procedure TJvFullColorCircleDlgMainFrm.FormatMemo(AMemo: TMemo; const Delta: TJvColorDelta);
|
procedure TJvFullColorCircleDlgMainFrm.FormatMemo(AMemo: TMemo; const Delta: TJvColorDelta);
|
||||||
var
|
var
|
||||||
Index: TJvAxisIndex;
|
Index: TJvAxisIndex;
|
||||||
@ -218,7 +347,8 @@ begin
|
|||||||
if AMemo = Memos[6] then
|
if AMemo = Memos[6] then
|
||||||
Add(RsCustomize);
|
Add(RsCustomize);
|
||||||
end;
|
end;
|
||||||
end;
|
end; *)
|
||||||
|
|
||||||
|
|
||||||
{ TJvColorDeltaList }
|
{ TJvColorDeltaList }
|
||||||
|
|
||||||
|
@ -1,11 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<CONFIG>
|
<CONFIG>
|
||||||
<ProjectOptions>
|
<ProjectOptions>
|
||||||
<Version Value="11"/>
|
<Version Value="12"/>
|
||||||
<PathDelim Value="\"/>
|
<PathDelim Value="\"/>
|
||||||
<General>
|
<General>
|
||||||
|
<Flags>
|
||||||
|
<CompatibilityMode Value="True"/>
|
||||||
|
</Flags>
|
||||||
<SessionStorage Value="InProjectDir"/>
|
<SessionStorage Value="InProjectDir"/>
|
||||||
<MainUnit Value="0"/>
|
|
||||||
<Title Value="JvFullColorCircleDialogPrj"/>
|
<Title Value="JvFullColorCircleDialogPrj"/>
|
||||||
<Scaled Value="True"/>
|
<Scaled Value="True"/>
|
||||||
<ResourceType Value="res"/>
|
<ResourceType Value="res"/>
|
||||||
|
@ -2,12 +2,12 @@ object JvFullColorCircleFrm: TJvFullColorCircleFrm
|
|||||||
Left = 274
|
Left = 274
|
||||||
Height = 574
|
Height = 574
|
||||||
Top = 219
|
Top = 219
|
||||||
Width = 1010
|
Width = 1022
|
||||||
AutoSize = True
|
AutoSize = True
|
||||||
BorderStyle = bsDialog
|
BorderStyle = bsDialog
|
||||||
Caption = 'Color circle configurations'
|
Caption = 'Color circle configurations'
|
||||||
ClientHeight = 574
|
ClientHeight = 574
|
||||||
ClientWidth = 1010
|
ClientWidth = 1022
|
||||||
Color = clBtnFace
|
Color = clBtnFace
|
||||||
Font.Color = clWindowText
|
Font.Color = clWindowText
|
||||||
KeyPreview = True
|
KeyPreview = True
|
||||||
@ -64,21 +64,21 @@ object JvFullColorCircleFrm: TJvFullColorCircleFrm
|
|||||||
Left = 412
|
Left = 412
|
||||||
Height = 550
|
Height = 550
|
||||||
Top = 8
|
Top = 8
|
||||||
Width = 590
|
Width = 602
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
BorderSpacing.Right = 8
|
BorderSpacing.Right = 8
|
||||||
BevelInner = bvRaised
|
BevelInner = bvRaised
|
||||||
BevelOuter = bvLowered
|
BevelOuter = bvLowered
|
||||||
Caption = 'PanelGraphics'
|
Caption = 'PanelGraphics'
|
||||||
ClientHeight = 550
|
ClientHeight = 550
|
||||||
ClientWidth = 590
|
ClientWidth = 602
|
||||||
Font.Color = clWindowText
|
Font.Color = clWindowText
|
||||||
ParentFont = False
|
ParentFont = False
|
||||||
TabOrder = 5
|
TabOrder = 5
|
||||||
object LabelAxisSettings: TLabel
|
object LabelAxisSettings: TLabel
|
||||||
AnchorSideLeft.Control = JvColorAxisConfigCombo
|
AnchorSideLeft.Control = JvColorAxisConfigCombo
|
||||||
AnchorSideTop.Control = PanelGraphics
|
AnchorSideTop.Control = PanelGraphics
|
||||||
Left = 208
|
Left = 217
|
||||||
Height = 15
|
Height = 15
|
||||||
Top = 10
|
Top = 10
|
||||||
Width = 69
|
Width = 69
|
||||||
@ -98,10 +98,10 @@ object JvFullColorCircleFrm: TJvFullColorCircleFrm
|
|||||||
AnchorSideRight.Side = asrBottom
|
AnchorSideRight.Side = asrBottom
|
||||||
AnchorSideBottom.Control = PanelGraphics
|
AnchorSideBottom.Control = PanelGraphics
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 100
|
Left = 106
|
||||||
Height = 480
|
Height = 480
|
||||||
Top = 60
|
Top = 60
|
||||||
Width = 472
|
Width = 478
|
||||||
Anchors = [akTop, akLeft, akRight, akBottom]
|
Anchors = [akTop, akLeft, akRight, akBottom]
|
||||||
BorderSpacing.Left = 8
|
BorderSpacing.Left = 8
|
||||||
BorderSpacing.Top = 8
|
BorderSpacing.Top = 8
|
||||||
@ -125,12 +125,14 @@ object JvFullColorCircleFrm: TJvFullColorCircleFrm
|
|||||||
OnBlueColorChange = JvColorCircleBlueColorChange
|
OnBlueColorChange = JvColorCircleBlueColorChange
|
||||||
end
|
end
|
||||||
object JvFullColorTrackBarCommon: TJvFullColorTrackBar
|
object JvFullColorTrackBarCommon: TJvFullColorTrackBar
|
||||||
|
AnchorSideLeft.Control = Bevel10
|
||||||
|
AnchorSideLeft.Side = asrCenter
|
||||||
AnchorSideTop.Control = JvColorCircle
|
AnchorSideTop.Control = JvColorCircle
|
||||||
AnchorSideBottom.Control = Bevel10
|
AnchorSideBottom.Control = Bevel10
|
||||||
Left = 40
|
Left = 38
|
||||||
Height = 237
|
Height = 237
|
||||||
Top = 60
|
Top = 60
|
||||||
Width = 21
|
Width = 24
|
||||||
Anchors = [akTop, akLeft, akBottom]
|
Anchors = [akTop, akLeft, akBottom]
|
||||||
FullColor = 83886079
|
FullColor = 83886079
|
||||||
AxisConfig = acYZX
|
AxisConfig = acYZX
|
||||||
@ -146,10 +148,10 @@ object JvFullColorCircleFrm: TJvFullColorCircleFrm
|
|||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
AnchorSideBottom.Control = JvFullColorTrackBarRed
|
AnchorSideBottom.Control = JvFullColorTrackBarRed
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 68
|
Left = 74
|
||||||
Height = 237
|
Height = 237
|
||||||
Top = 303
|
Top = 303
|
||||||
Width = 21
|
Width = 24
|
||||||
Anchors = [akTop, akLeft, akBottom]
|
Anchors = [akTop, akLeft, akBottom]
|
||||||
BorderSpacing.Left = 8
|
BorderSpacing.Left = 8
|
||||||
FullColor = 83820544
|
FullColor = 83820544
|
||||||
@ -167,10 +169,10 @@ object JvFullColorCircleFrm: TJvFullColorCircleFrm
|
|||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
AnchorSideBottom.Control = JvFullColorTrackBarRed
|
AnchorSideBottom.Control = JvFullColorTrackBarRed
|
||||||
AnchorSideBottom.Side = asrBottom
|
AnchorSideBottom.Side = asrBottom
|
||||||
Left = 39
|
Left = 42
|
||||||
Height = 237
|
Height = 237
|
||||||
Top = 303
|
Top = 303
|
||||||
Width = 21
|
Width = 24
|
||||||
Anchors = [akTop, akLeft, akBottom]
|
Anchors = [akTop, akLeft, akBottom]
|
||||||
BorderSpacing.Left = 8
|
BorderSpacing.Left = 8
|
||||||
FullColor = 67174144
|
FullColor = 67174144
|
||||||
@ -190,7 +192,7 @@ object JvFullColorCircleFrm: TJvFullColorCircleFrm
|
|||||||
Left = 10
|
Left = 10
|
||||||
Height = 237
|
Height = 237
|
||||||
Top = 303
|
Top = 303
|
||||||
Width = 21
|
Width = 24
|
||||||
Anchors = [akTop, akLeft, akBottom]
|
Anchors = [akTop, akLeft, akBottom]
|
||||||
BorderSpacing.Left = 8
|
BorderSpacing.Left = 8
|
||||||
FullColor = 67109119
|
FullColor = 67109119
|
||||||
@ -206,7 +208,7 @@ object JvFullColorCircleFrm: TJvFullColorCircleFrm
|
|||||||
AnchorSideLeft.Side = asrCenter
|
AnchorSideLeft.Side = asrCenter
|
||||||
AnchorSideTop.Control = LabelAxisSettings
|
AnchorSideTop.Control = LabelAxisSettings
|
||||||
AnchorSideTop.Side = asrBottom
|
AnchorSideTop.Side = asrBottom
|
||||||
Left = 208
|
Left = 217
|
||||||
Height = 23
|
Height = 23
|
||||||
Top = 29
|
Top = 29
|
||||||
Width = 257
|
Width = 257
|
||||||
@ -222,10 +224,12 @@ object JvFullColorCircleFrm: TJvFullColorCircleFrm
|
|||||||
AnchorSideLeft.Control = PanelGraphics
|
AnchorSideLeft.Control = PanelGraphics
|
||||||
AnchorSideTop.Control = JvColorCircle
|
AnchorSideTop.Control = JvColorCircle
|
||||||
AnchorSideTop.Side = asrCenter
|
AnchorSideTop.Side = asrCenter
|
||||||
|
AnchorSideRight.Control = JvFullColorTrackBarBlue
|
||||||
|
AnchorSideRight.Side = asrBottom
|
||||||
Left = 2
|
Left = 2
|
||||||
Height = 6
|
Height = 6
|
||||||
Top = 297
|
Top = 297
|
||||||
Width = 90
|
Width = 96
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object PanelCommonSettings: TPanel
|
object PanelCommonSettings: TPanel
|
||||||
|
@ -714,12 +714,17 @@ begin
|
|||||||
w := 0;
|
w := 0;
|
||||||
for i := 0 to JvColorSpaceCombo.Items.Count-1 do
|
for i := 0 to JvColorSpaceCombo.Items.Count-1 do
|
||||||
w := Max(w, JvColorSpaceCombo.Canvas.TextWidth(JvColorSpaceCombo.Items[i]));
|
w := Max(w, JvColorSpaceCombo.Canvas.TextWidth(JvColorSpaceCombo.Items[i]));
|
||||||
JvColorSpaceCombo.Width := w + 32;
|
JvColorSpaceCombo.Width := w + Scale96ToFont(32);
|
||||||
|
|
||||||
Bevel1.Shape := bsSpacer;
|
Bevel1.Shape := bsSpacer;
|
||||||
Bevel10.Shape := bsSpacer;
|
Bevel10.Shape := bsSpacer;
|
||||||
JvColorCircle.Constraints.MinWidth := JvColorCircle.Height;
|
JvColorCircle.Constraints.MinWidth := JvColorCircle.Height;
|
||||||
|
|
||||||
|
JvFullColorTrackBarCommon.Width := Scale96ToFont(24);
|
||||||
|
JvFullColorTrackBarRed.Width := JvFullColorTrackBarCommon.Width;
|
||||||
|
JvFullColorTrackBarGreen.Width := JvFullColorTrackBarCommon.Width;
|
||||||
|
JvFullColorTrackBarBlue.Width := JvFullColorTrackBarCommon.Width;
|
||||||
|
|
||||||
Position := poScreenCenter;
|
Position := poScreenCenter;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user