Skip to content

Commit a94a17f

Browse files
authored
Merge pull request #176 from bgrabitmap/dev-bgracontrols
Dev bgracontrols
2 parents 4d0cd5e + b7181f5 commit a94a17f

File tree

7 files changed

+523
-89
lines changed

7 files changed

+523
-89
lines changed

bccombobox.pas

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,14 @@ procedure TBCComboBox.ButtonClick(Sender: TObject);
163163
s: TSize;
164164
begin
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;
205206
end;
206207

@@ -324,6 +325,7 @@ procedure TBCComboBox.ListBoxKeyDown(Sender: TObject; var Key: Word;
324325
procedure TBCComboBox.ListBoxMouseUp(Sender: TObject; Button: TMouseButton;
325326
Shift: TShiftState; X, Y: Integer);
326327
begin
328+
FForm.Close;
327329
FQueryFormHide := true;
328330
end;
329331

@@ -418,15 +420,15 @@ procedure TBCComboBox.OnTimerCheckFormHide(Sender: TObject);
418420
{$endif}
419421

420422
begin
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;
430432
end;
431433

432434
procedure 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;
649652
end;
650653

bgracontrols.lpk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
</CompilerOptions>
3434
<Description Value="BGRA Controls is a set of graphical UI elements that you can use with Lazarus LCL applications."/>
3535
<License Value="Modified LGPL"/>
36-
<Version Major="9" Release="1" Build="3"/>
36+
<Version Major="9" Release="1" Build="4"/>
3737
<Files Count="70">
3838
<Item1>
3939
<Filename Value="atshapelinebgra.pas"/>

bgracontrolsinfo.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ interface
99
Classes, SysUtils;
1010

1111
const
12-
BGRAControlsVersion = 9000103;
12+
BGRAControlsVersion = 9000104;
1313

1414
function BGRAControlsVersionStr: string;
1515

0 commit comments

Comments
 (0)