diff --git a/Client/Tools/UfrmHueSettings.lfm b/Client/Tools/UfrmHueSettings.lfm index 6d0d8d2..638b663 100644 --- a/Client/Tools/UfrmHueSettings.lfm +++ b/Client/Tools/UfrmHueSettings.lfm @@ -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 diff --git a/Client/Tools/UfrmHueSettings.pas b/Client/Tools/UfrmHueSettings.pas index 1b9b943..bece3da 100644 --- a/Client/Tools/UfrmHueSettings.pas +++ b/Client/Tools/UfrmHueSettings.pas @@ -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