- 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
|
||||
Anchors = [akTop, akLeft, akRight]
|
||||
BorderSpacing.Around = 8
|
||||
DragMode = dmAutomatic
|
||||
Font.Height = 14
|
||||
ItemHeight = 16
|
||||
OnDrawItem = lbHueDrawItem
|
||||
|
@ -365,6 +366,8 @@ inherited frmHueSettings: TfrmHueSettings
|
|||
BorderSpacing.Around = 4
|
||||
ItemHeight = 0
|
||||
MultiSelect = True
|
||||
OnDragDrop = lbRandomDragDrop
|
||||
OnDragOver = lbRandomDragOver
|
||||
OnDrawItem = lbHueDrawItem
|
||||
TabOrder = 1
|
||||
end
|
||||
|
|
|
@ -59,6 +59,9 @@ type
|
|||
procedure lbHueDrawItem(Control: TWinControl; Index: Integer; ARect: TRect;
|
||||
State: TOwnerDrawState);
|
||||
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
|
||||
function GetHue: Word;
|
||||
public
|
||||
|
@ -153,6 +156,19 @@ begin
|
|||
edHue.Text := Format('$%x', [lbHue.ItemIndex]);
|
||||
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;
|
||||
begin
|
||||
if cbRandom.Checked and (lbRandom.Items.Count > 0) then
|
||||
|
|
Loading…
Reference in New Issue