Skip to content

Commit

Permalink
Merge pull request #176 from bgrabitmap/dev-bgracontrols
Browse files Browse the repository at this point in the history
Dev bgracontrols
  • Loading branch information
lainz authored May 27, 2024
2 parents 4d0cd5e + b7181f5 commit a94a17f
Show file tree
Hide file tree
Showing 7 changed files with 523 additions and 89 deletions.
33 changes: 18 additions & 15 deletions bccombobox.pas
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,14 @@ procedure TBCComboBox.ButtonClick(Sender: TObject);
s: TSize;
begin
{$IFDEF DARWIN}
if Assigned(FForm) and not FForm.Visible then FreeForm;
//if Assigned(FForm) and not FForm.Visible then FreeForm;
{$ENDIF}

CreateForm;

if FForm.Visible then
FForm.Visible := false
else
//if FForm.Visible then
// FForm.Visible := false
//else
if Now > FFormHideDate+MinDelayReopen then
begin
p := ControlToScreen(Point(FButton.Left, FButton.Top + FButton.Height));
Expand All @@ -196,11 +196,12 @@ procedure TBCComboBox.ButtonClick(Sender: TObject);
if FForm.Top + FForm.Height > Screen.WorkAreaTop + Screen.WorkAreaHeight then
FForm.Top := FForm.Top - FForm.Height - Self.Height;
if Assigned(FOnDropDown) then FOnDropDown(self);
FForm.Visible := True;
//FForm.Visible := True;
if FListBox.CanSetFocus then
FListBox.SetFocus;
FTimerCheckFormHide.Enabled:= true;
FQueryFormHide := false;
FForm.ShowModal;
end;
end;

Expand Down Expand Up @@ -324,6 +325,7 @@ procedure TBCComboBox.ListBoxKeyDown(Sender: TObject; var Key: Word;
procedure TBCComboBox.ListBoxMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
FForm.Close;
FQueryFormHide := true;
end;

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

begin
if Assigned(FForm) and FForm.Visible and
({$IFDEF DARWIN}not FForm.Active or {$ENDIF}
{$IFDEF WINDOWS}not IsDropDownOnTop or{$ENDIF}
FQueryFormHide) then
begin
FForm.Visible := false;
FQueryFormHide := false;
FTimerCheckFormHide.Enabled := false;
end;
//if Assigned(FForm) and FForm.Visible and
//({$IFDEF DARWIN}not FForm.Active or {$ENDIF}
//{$IFDEF WINDOWS}not IsDropDownOnTop or{$ENDIF}
//FQueryFormHide) then
//begin
//FForm.Visible := false;
//FQueryFormHide := false;
//FTimerCheckFormHide.Enabled := false;
//end;
end;

procedure TBCComboBox.SetArrowFlip(AValue: boolean);
Expand Down Expand Up @@ -630,7 +632,7 @@ procedure TBCComboBox.CreateForm;
FListBox := TListBox.Create(self);
FListBox.Parent := FForm;
FListBox.BorderStyle := bsNone;
FListBox.OnSelectionChange := ListBoxSelectionChange;

FListBox.OnMouseLeave:=ListBoxMouseLeave;
FListBox.OnMouseMove:=ListBoxMouseMove;
FListBox.OnMouseUp:= ListBoxMouseUp;
Expand All @@ -645,6 +647,7 @@ procedure TBCComboBox.CreateForm;
end;
FListBox.ItemIndex := FItemIndex;
FListBox.Color := FDropDownColor;
FListBox.OnSelectionChange := ListBoxSelectionChange;
end;
end;

Expand Down
2 changes: 1 addition & 1 deletion bgracontrols.lpk
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</CompilerOptions>
<Description Value="BGRA Controls is a set of graphical UI elements that you can use with Lazarus LCL applications."/>
<License Value="Modified LGPL"/>
<Version Major="9" Release="1" Build="3"/>
<Version Major="9" Release="1" Build="4"/>
<Files Count="70">
<Item1>
<Filename Value="atshapelinebgra.pas"/>
Expand Down
2 changes: 1 addition & 1 deletion bgracontrolsinfo.pas
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ interface
Classes, SysUtils;

const
BGRAControlsVersion = 9000103;
BGRAControlsVersion = 9000104;

function BGRAControlsVersionStr: string;

Expand Down
Loading

0 comments on commit a94a17f

Please sign in to comment.