- Added Drag&Drop for random hue list (refs #66)
This commit is contained in:
parent
ae720d1931
commit
fd4155a45b
|
@ -48,6 +48,7 @@ inherited frmHueSettings: TfrmHueSettings
|
||||||
Width = 209
|
Width = 209
|
||||||
Anchors = [akTop, akLeft, akRight]
|
Anchors = [akTop, akLeft, akRight]
|
||||||
BorderSpacing.Around = 8
|
BorderSpacing.Around = 8
|
||||||
|
DragMode = dmAutomatic
|
||||||
Font.Height = 14
|
Font.Height = 14
|
||||||
ItemHeight = 16
|
ItemHeight = 16
|
||||||
OnDrawItem = lbHueDrawItem
|
OnDrawItem = lbHueDrawItem
|
||||||
|
@ -365,6 +366,8 @@ inherited frmHueSettings: TfrmHueSettings
|
||||||
BorderSpacing.Around = 4
|
BorderSpacing.Around = 4
|
||||||
ItemHeight = 0
|
ItemHeight = 0
|
||||||
MultiSelect = True
|
MultiSelect = True
|
||||||
|
OnDragDrop = lbRandomDragDrop
|
||||||
|
OnDragOver = lbRandomDragOver
|
||||||
OnDrawItem = lbHueDrawItem
|
OnDrawItem = lbHueDrawItem
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
end
|
end
|
||||||
|
|
|
@ -59,6 +59,9 @@ type
|
||||||
procedure lbHueDrawItem(Control: TWinControl; Index: Integer; ARect: TRect;
|
procedure lbHueDrawItem(Control: TWinControl; Index: Integer; ARect: TRect;
|
||||||
State: TOwnerDrawState);
|
State: TOwnerDrawState);
|
||||||
procedure lbHueSelectionChange(Sender: TObject; User: boolean);
|
procedure lbHueSelectionChange(Sender: TObject; User: boolean);
|
||||||
|
procedure lbRandomDragDrop(Sender, Source: TObject; X, Y: Integer);
|
||||||
|
procedure lbRandomDragOver(Sender, Source: TObject; X, Y: Integer;
|
||||||
|
State: TDragState; var Accept: Boolean);
|
||||||
public
|
public
|
||||||
function GetHue: Word;
|
function GetHue: Word;
|
||||||
public
|
public
|
||||||
|
@ -153,6 +156,19 @@ begin
|
||||||
edHue.Text := Format('$%x', [lbHue.ItemIndex]);
|
edHue.Text := Format('$%x', [lbHue.ItemIndex]);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TfrmHueSettings.lbRandomDragDrop(Sender, Source: TObject; X,
|
||||||
|
Y: Integer);
|
||||||
|
begin
|
||||||
|
if Source = lbHue then
|
||||||
|
btnAddRandomClick(Sender);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TfrmHueSettings.lbRandomDragOver(Sender, Source: TObject; X,
|
||||||
|
Y: Integer; State: TDragState; var Accept: Boolean);
|
||||||
|
begin
|
||||||
|
if Source = lbHue then Accept := True;
|
||||||
|
end;
|
||||||
|
|
||||||
function TfrmHueSettings.GetHue: Word;
|
function TfrmHueSettings.GetHue: Word;
|
||||||
begin
|
begin
|
||||||
if cbRandom.Checked and (lbRandom.Items.Count > 0) then
|
if cbRandom.Checked and (lbRandom.Items.Count > 0) then
|
||||||
|
|
Loading…
Reference in New Issue