diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-03-25 07:38:05 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-03-25 07:38:05 +0000 |
commit | 7a052fef4639d92b9ee24ffa78ab3da834d61b5c (patch) | |
tree | 58d605ae6d3f3a40059ecba9863ad316a2ea1b52 /src/gui/gui_editcombo.pas | |
parent | 4e42945f27265f30981594c2daa182ca8cd82856 (diff) | |
download | fpGUI-7a052fef4639d92b9ee24ffa78ab3da834d61b5c.tar.xz |
Applied patch from Jean-Marc to allow setting the editbox to be cleared, and
the dropdown to close when return key has been pressed
Diffstat (limited to 'src/gui/gui_editcombo.pas')
-rw-r--r-- | src/gui/gui_editcombo.pas | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/gui_editcombo.pas b/src/gui/gui_editcombo.pas index 7198a1ef..ccd2ec27 100644 --- a/src/gui/gui_editcombo.pas +++ b/src/gui/gui_editcombo.pas @@ -400,7 +400,10 @@ var i: integer; begin if AValue = '' then - FocusItem := 0 // nothing selected + begin + FocusItem := 0; // nothing selected + FText:= ''; + end else begin for i := 0 to Items.Count - 1 do @@ -512,6 +515,8 @@ begin FSelectedItem:= -4; // detects return has been pressed (must be 4 due to number of repaints) if FNewItem and (FAllowNew = anYes) then FItems.Add(FText); + if Assigned(FDropDown) then + FDropDown.Close; end; else |