@@ -163,14 +163,14 @@ procedure TBCComboBox.ButtonClick(Sender: TObject);
163163 s: TSize;
164164begin
165165 { $IFDEF DARWIN}
166- if Assigned(FForm) and not FForm.Visible then FreeForm;
166+ // if Assigned(FForm) and not FForm.Visible then FreeForm;
167167 { $ENDIF}
168168
169169 CreateForm;
170170
171- if FForm.Visible then
172- FForm.Visible := false
173- else
171+ // if FForm.Visible then
172+ // FForm.Visible := false
173+ // else
174174 if Now > FFormHideDate+MinDelayReopen then
175175 begin
176176 p := ControlToScreen(Point(FButton.Left, FButton.Top + FButton.Height));
@@ -196,11 +196,12 @@ procedure TBCComboBox.ButtonClick(Sender: TObject);
196196 if FForm.Top + FForm.Height > Screen.WorkAreaTop + Screen.WorkAreaHeight then
197197 FForm.Top := FForm.Top - FForm.Height - Self.Height;
198198 if Assigned(FOnDropDown) then FOnDropDown(self);
199- FForm.Visible := True;
199+ // FForm.Visible := True;
200200 if FListBox.CanSetFocus then
201201 FListBox.SetFocus;
202202 FTimerCheckFormHide.Enabled:= true;
203203 FQueryFormHide := false;
204+ FForm.ShowModal;
204205 end ;
205206end ;
206207
@@ -324,6 +325,7 @@ procedure TBCComboBox.ListBoxKeyDown(Sender: TObject; var Key: Word;
324325procedure TBCComboBox.ListBoxMouseUp (Sender: TObject; Button: TMouseButton;
325326 Shift: TShiftState; X, Y: Integer);
326327begin
328+ FForm.Close;
327329 FQueryFormHide := true;
328330end ;
329331
@@ -418,15 +420,15 @@ procedure TBCComboBox.OnTimerCheckFormHide(Sender: TObject);
418420 { $endif}
419421
420422begin
421- if Assigned(FForm) and FForm.Visible and
422- ({ $IFDEF DARWIN} not FForm.Active or { $ENDIF}
423- { $IFDEF WINDOWS} not IsDropDownOnTop or { $ENDIF}
424- FQueryFormHide) then
425- begin
426- FForm.Visible := false;
427- FQueryFormHide := false;
428- FTimerCheckFormHide.Enabled := false;
429- end ;
423+ // if Assigned(FForm) and FForm.Visible and
424+ // ({$IFDEF DARWIN}not FForm.Active or {$ENDIF}
425+ // {$IFDEF WINDOWS}not IsDropDownOnTop or{$ENDIF}
426+ // FQueryFormHide) then
427+ // begin
428+ // FForm.Visible := false;
429+ // FQueryFormHide := false;
430+ // FTimerCheckFormHide.Enabled := false;
431+ // end;
430432end ;
431433
432434procedure TBCComboBox.SetArrowFlip (AValue: boolean);
@@ -630,7 +632,7 @@ procedure TBCComboBox.CreateForm;
630632 FListBox := TListBox.Create(self);
631633 FListBox.Parent := FForm;
632634 FListBox.BorderStyle := bsNone;
633- FListBox.OnSelectionChange := ListBoxSelectionChange;
635+
634636 FListBox.OnMouseLeave:=ListBoxMouseLeave;
635637 FListBox.OnMouseMove:=ListBoxMouseMove;
636638 FListBox.OnMouseUp:= ListBoxMouseUp;
@@ -645,6 +647,7 @@ procedure TBCComboBox.CreateForm;
645647 end ;
646648 FListBox.ItemIndex := FItemIndex;
647649 FListBox.Color := FDropDownColor;
650+ FListBox.OnSelectionChange := ListBoxSelectionChange;
648651 end ;
649652end ;
650653
0 commit comments