diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-07-14 16:46:46 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2008-07-14 16:46:46 +0000 |
commit | 9432daf804c88f04f20f89773fd0efdcbe89e360 (patch) | |
tree | 59039315145732b1dd965994a5b8f29ba7a07db3 /src/gui/gui_editcombo.pas | |
parent | ccbce7ba60305b5438c3ac6311d39374ee2a0e55 (diff) | |
download | fpGUI-9432daf804c88f04f20f89773fd0efdcbe89e360.tar.xz |
* Applied some of the various patch from Jean-Marc.
Diffstat (limited to 'src/gui/gui_editcombo.pas')
-rw-r--r-- | src/gui/gui_editcombo.pas | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/gui/gui_editcombo.pas b/src/gui/gui_editcombo.pas index 96d2188f..36c87633 100644 --- a/src/gui/gui_editcombo.pas +++ b/src/gui/gui_editcombo.pas @@ -129,8 +129,8 @@ type end; -function CreateEditCombo(AOwner: TComponent; x, y, w: TfpgCoord; AList:TStringList; - h: TfpgCoord = 0): TfpgEditCombo; +function CreateEditCombo(AOwner: TComponent; x, y, w: TfpgCoord; AList:TStringList; ACompletion: boolean = False; + ANew: TAllowNew = anNo; h: TfpgCoord = 0): TfpgEditCombo; implementation @@ -225,14 +225,16 @@ begin ListBox.PopupFrame := True; end; -function CreateEditCombo(AOwner: TComponent; x, y, w: TfpgCoord; AList: TStringList; - h: TfpgCoord = 0): TfpgEditCombo; +function CreateEditCombo(AOwner: TComponent; x, y, w: TfpgCoord; AList:TStringList; ACompletion: boolean = False; + ANew: TAllowNew = anNo; h: TfpgCoord = 0): TfpgEditCombo; begin Result := TfpgEditCombo.Create(AOwner); Result.Left := x; Result.Top := y; Result.Width := w; Result.Focusable := True; + Result.AutoCompletion := ACompletion; + Result.AllowNew := ANew; if h < TfpgEditCombo(Result).Font.Height + 6 then Result.Height:= TfpgEditCombo(Result).Font.Height + 6 else @@ -528,7 +530,10 @@ begin FItems.Add(FText); anAsk: if TfpgMessageDialog.Question(rsNewItemDetected, Format(rsAddNewItem, [FText])) = mbYes then - FItems.Add(FText) + begin + FItems.Add(FText); + FocusItem := Pred(FItems.Count); + end else begin FNewItem:= False; |